Revert "Allow setting custom server and key with env variables"

This commit is contained in:
RustDesk 2023-01-18 11:48:10 +08:00 committed by GitHub
parent a46c373081
commit 7aced73393
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 8 additions and 42 deletions

View File

@ -15,11 +15,6 @@ env:
# for multiarch gcc compatibility
VCPKG_COMMIT_ID: "14e7bb4ae24616ec54ff6b2f6ef4e8659434ea44"
VERSION: "1.2.0"
# To make a custom build with your own servers set the below secret values
RS_PUB_KEY_VAL: '${{ secrets.RS_PUB_KEY_VAL }}'
RENDEZVOUS_SERVER1: '${{ secrets.RENDEZVOUS_SERVER1 }}'
RENDEZVOUS_SERVER2: '${{ secrets.RENDEZVOUS_SERVER2 }}'
RENDEZVOUS_SERVER3: '${{ secrets.RENDEZVOUS_SERVER3 }}'
jobs:
build-for-windows:
@ -155,7 +150,6 @@ jobs:
uses: actions/checkout@v3
- name: Import the codesign cert
if: ${{ env.MACOS_P12_BASE64== 'true' }}
uses: apple-actions/import-codesign-certs@v1
with:
p12-file-base64: ${{ secrets.MACOS_P12_BASE64 }}
@ -163,13 +157,11 @@ jobs:
keychain: rustdesk
- name: Check sign and import sign key
if: ${{ env.MACOS_P12_BASE64== 'true' }}
run: |
security default-keychain -s rustdesk.keychain
security find-identity -v
- name: Import notarize key
if: ${{ env.MACOS_P12_BASE64== 'true' }}
uses: timheuer/base64-to-file@v1.2
with:
# https://gregoryszorc.com/docs/apple-codesign/stable/apple_codesign_rcodesign.html#notarizing-and-stapling
@ -178,7 +170,6 @@ jobs:
encodedString: ${{ secrets.MACOS_NOTARIZE_JSON }}
- name: Install rcodesign tool
if: ${{ env.MACOS_P12_BASE64== 'true' }}
shell: bash
run: |
pushd /tmp
@ -249,7 +240,6 @@ jobs:
./build.py --flutter ${{ matrix.job.extra-build-args }}
- name: Codesign app and create signed dmg
if: ${{ env.MACOS_P12_BASE64== 'true' }}
run: |
security default-keychain -s rustdesk.keychain
security unlock-keychain -p ${{ secrets.MACOS_P12_PASSWORD }} rustdesk.keychain
@ -562,7 +552,6 @@ jobs:
- uses: r0adkll/sign-android-release@v1
name: Sign app APK
if: ${{ env.ANDROID_SIGNING_KEY== 'true' }}
id: sign-rustdesk
with:
releaseDirectory: ./signed-apk
@ -575,14 +564,12 @@ jobs:
BUILD_TOOLS_VERSION: "30.0.2"
- name: Upload Artifacts
if: ${{ env.ANDROID_SIGNING_KEY== 'true' }}
uses: actions/upload-artifact@master
with:
name: rustdesk-${{ env.VERSION }}-${{ matrix.job.target }}-release-signed.apk
path: ${{steps.sign-rustdesk.outputs.signedReleaseFile}}
- name: Publish signed apk package
if: ${{ env.ANDROID_SIGNING_KEY== 'true' }}
- name: Publish apk package
uses: softprops/action-gh-release@v1
with:
prerelease: true
@ -590,15 +577,6 @@ jobs:
files: |
${{steps.sign-rustdesk.outputs.signedReleaseFile}}
- name: Publish unsigned apk package
if: ${{ env.ANDROID_SIGNING_KEY!= 'true' }}
uses: softprops/action-gh-release@v1
with:
prerelease: true
tag_name: ${{ env.TAG_NAME }}
files: |
../rustdesk-${{ env.VERSION }}-${{ matrix.job.target }}-release.apk
build-rustdesk-lib-linux-amd64:
needs: [generate-bridge-linux, build-vcpkg-deps-linux]
name: build-rust-lib ${{ matrix.job.target }} (${{ matrix.job.os }}) [${{ matrix.job.extra-build-features }}]

View File

@ -77,20 +77,12 @@ const CHARS: &'static [char] = &[
'm', 'n', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z',
];
//check for env variable RENDEZVOUS_SERVER if not use the default
pub const RENDEZVOUS_SERVERS: [&'static str;3] =
match option_env!("RENDEZVOUS_SERVER") {
Some(key) => [key, key, key],
None => ["rs-ny.rustdesk.com","rs-sg.rustdesk.com","rs-cn.rustdesk.com"],
};
pub const RS_DEF_PUB_KEY: &'static str = "OeVuKk5nlHiXp+APNn0Y3pC1Iwpwn44JGqrQCsWqmBw=";
//check for env variable RS_PUB_KEY if not use default
pub const RS_PUB_KEY: &'static str = match option_env!("RS_PUB_KEY_VAL") {
Some(key) => key,
None => RS_DEF_PUB_KEY,
};
pub const RENDEZVOUS_SERVERS: &'static [&'static str] = &[
"rs-ny.rustdesk.com",
"rs-sg.rustdesk.com",
"rs-cn.rustdesk.com",
];
pub const RS_PUB_KEY: &'static str = "OeVuKk5nlHiXp+APNn0Y3pC1Iwpwn44JGqrQCsWqmBw=";
pub const RENDEZVOUS_PORT: i32 = 21116;
pub const RELAY_PORT: i32 = 21117;

View File

@ -243,11 +243,7 @@ pub fn set_peer_option(id: String, name: String, value: String) {
#[inline]
pub fn using_public_server() -> bool {
if hbb_common::config::RS_PUB_KEY == hbb_common::config::RS_DEF_PUB_KEY {
return true
} else {
return false
}
crate::get_custom_rendezvous_server(get_option_("custom-rendezvous-server")).is_empty()
}
#[inline]