Merge pull request #2810 from botanicvelious/master
Allow setting custom server and key with env variables
This commit is contained in:
commit
a46c373081
24
.github/workflows/flutter-nightly.yml
vendored
24
.github/workflows/flutter-nightly.yml
vendored
@ -15,6 +15,11 @@ env:
|
|||||||
# for multiarch gcc compatibility
|
# for multiarch gcc compatibility
|
||||||
VCPKG_COMMIT_ID: "14e7bb4ae24616ec54ff6b2f6ef4e8659434ea44"
|
VCPKG_COMMIT_ID: "14e7bb4ae24616ec54ff6b2f6ef4e8659434ea44"
|
||||||
VERSION: "1.2.0"
|
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:
|
jobs:
|
||||||
build-for-windows:
|
build-for-windows:
|
||||||
@ -150,6 +155,7 @@ jobs:
|
|||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v3
|
||||||
|
|
||||||
- name: Import the codesign cert
|
- name: Import the codesign cert
|
||||||
|
if: ${{ env.MACOS_P12_BASE64== 'true' }}
|
||||||
uses: apple-actions/import-codesign-certs@v1
|
uses: apple-actions/import-codesign-certs@v1
|
||||||
with:
|
with:
|
||||||
p12-file-base64: ${{ secrets.MACOS_P12_BASE64 }}
|
p12-file-base64: ${{ secrets.MACOS_P12_BASE64 }}
|
||||||
@ -157,11 +163,13 @@ jobs:
|
|||||||
keychain: rustdesk
|
keychain: rustdesk
|
||||||
|
|
||||||
- name: Check sign and import sign key
|
- name: Check sign and import sign key
|
||||||
|
if: ${{ env.MACOS_P12_BASE64== 'true' }}
|
||||||
run: |
|
run: |
|
||||||
security default-keychain -s rustdesk.keychain
|
security default-keychain -s rustdesk.keychain
|
||||||
security find-identity -v
|
security find-identity -v
|
||||||
|
|
||||||
- name: Import notarize key
|
- name: Import notarize key
|
||||||
|
if: ${{ env.MACOS_P12_BASE64== 'true' }}
|
||||||
uses: timheuer/base64-to-file@v1.2
|
uses: timheuer/base64-to-file@v1.2
|
||||||
with:
|
with:
|
||||||
# https://gregoryszorc.com/docs/apple-codesign/stable/apple_codesign_rcodesign.html#notarizing-and-stapling
|
# https://gregoryszorc.com/docs/apple-codesign/stable/apple_codesign_rcodesign.html#notarizing-and-stapling
|
||||||
@ -170,6 +178,7 @@ jobs:
|
|||||||
encodedString: ${{ secrets.MACOS_NOTARIZE_JSON }}
|
encodedString: ${{ secrets.MACOS_NOTARIZE_JSON }}
|
||||||
|
|
||||||
- name: Install rcodesign tool
|
- name: Install rcodesign tool
|
||||||
|
if: ${{ env.MACOS_P12_BASE64== 'true' }}
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
pushd /tmp
|
pushd /tmp
|
||||||
@ -240,6 +249,7 @@ jobs:
|
|||||||
./build.py --flutter ${{ matrix.job.extra-build-args }}
|
./build.py --flutter ${{ matrix.job.extra-build-args }}
|
||||||
|
|
||||||
- name: Codesign app and create signed dmg
|
- name: Codesign app and create signed dmg
|
||||||
|
if: ${{ env.MACOS_P12_BASE64== 'true' }}
|
||||||
run: |
|
run: |
|
||||||
security default-keychain -s rustdesk.keychain
|
security default-keychain -s rustdesk.keychain
|
||||||
security unlock-keychain -p ${{ secrets.MACOS_P12_PASSWORD }} rustdesk.keychain
|
security unlock-keychain -p ${{ secrets.MACOS_P12_PASSWORD }} rustdesk.keychain
|
||||||
@ -552,6 +562,7 @@ jobs:
|
|||||||
|
|
||||||
- uses: r0adkll/sign-android-release@v1
|
- uses: r0adkll/sign-android-release@v1
|
||||||
name: Sign app APK
|
name: Sign app APK
|
||||||
|
if: ${{ env.ANDROID_SIGNING_KEY== 'true' }}
|
||||||
id: sign-rustdesk
|
id: sign-rustdesk
|
||||||
with:
|
with:
|
||||||
releaseDirectory: ./signed-apk
|
releaseDirectory: ./signed-apk
|
||||||
@ -564,12 +575,14 @@ jobs:
|
|||||||
BUILD_TOOLS_VERSION: "30.0.2"
|
BUILD_TOOLS_VERSION: "30.0.2"
|
||||||
|
|
||||||
- name: Upload Artifacts
|
- name: Upload Artifacts
|
||||||
|
if: ${{ env.ANDROID_SIGNING_KEY== 'true' }}
|
||||||
uses: actions/upload-artifact@master
|
uses: actions/upload-artifact@master
|
||||||
with:
|
with:
|
||||||
name: rustdesk-${{ env.VERSION }}-${{ matrix.job.target }}-release-signed.apk
|
name: rustdesk-${{ env.VERSION }}-${{ matrix.job.target }}-release-signed.apk
|
||||||
path: ${{steps.sign-rustdesk.outputs.signedReleaseFile}}
|
path: ${{steps.sign-rustdesk.outputs.signedReleaseFile}}
|
||||||
|
|
||||||
- name: Publish apk package
|
- name: Publish signed apk package
|
||||||
|
if: ${{ env.ANDROID_SIGNING_KEY== 'true' }}
|
||||||
uses: softprops/action-gh-release@v1
|
uses: softprops/action-gh-release@v1
|
||||||
with:
|
with:
|
||||||
prerelease: true
|
prerelease: true
|
||||||
@ -577,6 +590,15 @@ jobs:
|
|||||||
files: |
|
files: |
|
||||||
${{steps.sign-rustdesk.outputs.signedReleaseFile}}
|
${{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:
|
build-rustdesk-lib-linux-amd64:
|
||||||
needs: [generate-bridge-linux, build-vcpkg-deps-linux]
|
needs: [generate-bridge-linux, build-vcpkg-deps-linux]
|
||||||
name: build-rust-lib ${{ matrix.job.target }} (${{ matrix.job.os }}) [${{ matrix.job.extra-build-features }}]
|
name: build-rust-lib ${{ matrix.job.target }} (${{ matrix.job.os }}) [${{ matrix.job.extra-build-features }}]
|
||||||
|
@ -77,12 +77,20 @@ const CHARS: &'static [char] = &[
|
|||||||
'm', 'n', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z',
|
'm', 'n', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z',
|
||||||
];
|
];
|
||||||
|
|
||||||
pub const RENDEZVOUS_SERVERS: &'static [&'static str] = &[
|
//check for env variable RENDEZVOUS_SERVER if not use the default
|
||||||
"rs-ny.rustdesk.com",
|
pub const RENDEZVOUS_SERVERS: [&'static str;3] =
|
||||||
"rs-sg.rustdesk.com",
|
match option_env!("RENDEZVOUS_SERVER") {
|
||||||
"rs-cn.rustdesk.com",
|
Some(key) => [key, key, key],
|
||||||
];
|
None => ["rs-ny.rustdesk.com","rs-sg.rustdesk.com","rs-cn.rustdesk.com"],
|
||||||
pub const RS_PUB_KEY: &'static str = "OeVuKk5nlHiXp+APNn0Y3pC1Iwpwn44JGqrQCsWqmBw=";
|
};
|
||||||
|
|
||||||
|
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_PORT: i32 = 21116;
|
pub const RENDEZVOUS_PORT: i32 = 21116;
|
||||||
pub const RELAY_PORT: i32 = 21117;
|
pub const RELAY_PORT: i32 = 21117;
|
||||||
|
|
||||||
|
@ -243,7 +243,11 @@ pub fn set_peer_option(id: String, name: String, value: String) {
|
|||||||
|
|
||||||
#[inline]
|
#[inline]
|
||||||
pub fn using_public_server() -> bool {
|
pub fn using_public_server() -> bool {
|
||||||
crate::get_custom_rendezvous_server(get_option_("custom-rendezvous-server")).is_empty()
|
if hbb_common::config::RS_PUB_KEY == hbb_common::config::RS_DEF_PUB_KEY {
|
||||||
|
return true
|
||||||
|
} else {
|
||||||
|
return false
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[inline]
|
#[inline]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user