fix setup_server_tip

This commit is contained in:
Bryan Gerlach
2025-02-19 18:05:33 -06:00
parent 1b7468a1f2
commit e882a604d7
5 changed files with 54 additions and 9 deletions

29
.github/patches/allowCustom.diff vendored Normal file
View File

@@ -0,0 +1,29 @@
diff --git a/src/common.rs b/src/common.rs
index 56361a5da..92b221e9a 100644
--- a/src/common.rs
+++ b/src/common.rs
@@ -1474,15 +1474,15 @@ pub fn read_custom_client(config: &str) {
log::error!("Failed to decode custom client config");
return;
};
- const KEY: &str = "5Qbwsde3unUcJBtrx9ZkvUmwFNoExHzpryHuPUdqlWM=";
- let Some(pk) = get_rs_pk(KEY) else {
- log::error!("Failed to parse public key of custom client");
- return;
- };
- let Ok(data) = sign::verify(&data, &pk) else {
- log::error!("Failed to dec custom client config");
- return;
- };
+ // const KEY: &str = "5Qbwsde3unUcJBtrx9ZkvUmwFNoExHzpryHuPUdqlWM=";
+ // let Some(pk) = get_rs_pk(KEY) else {
+ // log::error!("Failed to parse public key of custom client");
+ // return;
+ // };
+ // let Ok(data) = sign::verify(&data, &pk) else {
+ // log::error!("Failed to dec custom client config");
+ // return;
+ // };
let Ok(mut data) =
serde_json::from_slice::<std::collections::HashMap<String, serde_json::Value>>(&data)
else {

View File

@@ -0,0 +1,13 @@
diff --git a/flutter/lib/desktop/pages/connection_page.dart b/flutter/lib/desktop/pages/connection_page.dart
index d9dc3eec4..76f386b76 100644
--- a/flutter/lib/desktop/pages/connection_page.dart
+++ b/flutter/lib/desktop/pages/connection_page.dart
@@ -131,7 +131,7 @@ class _OnlineStatusWidgetState extends State<OnlineStatusWidget> {
if (!isIncomingOnly) startServiceWidget(),
// ready && public
// No need to show the guide if is custom client.
- if (!isIncomingOnly) setupServerWidget(),
+ //if (!isIncomingOnly) setupServerWidget(),
],
);

View File

@@ -293,9 +293,10 @@ jobs:
run: | run: |
sed -i -e 's|rs-ny.rustdesk.com|${{ inputs.server }}|' ./libs/hbb_common/src/config.rs sed -i -e 's|rs-ny.rustdesk.com|${{ inputs.server }}|' ./libs/hbb_common/src/config.rs
sed -i -e 's|OeVuKk5nlHiXp+APNn0Y3pC1Iwpwn44JGqrQCsWqmBw=|${{ inputs.key }}|' ./libs/hbb_common/src/config.rs sed -i -e 's|OeVuKk5nlHiXp+APNn0Y3pC1Iwpwn44JGqrQCsWqmBw=|${{ inputs.key }}|' ./libs/hbb_common/src/config.rs
sed -i -e 's|For faster connection, please set up your own server||' ./src/lang/en.rs wget https://raw.githubusercontent.com/bryangerlach/rdgen/refs/heads/master/.github/patches/allowCustom.diff
sed -i -e '/const KEY:/,/};/d' ./src/common.rs git apply allowCustom.diff
sed -i -e '/let Ok(data) = sign::verify(&data, &pk)/,/};/d' ./src/common.rs wget https://raw.githubusercontent.com/bryangerlach/rdgen/refs/heads/master/.github/patches/removeSetupServerTip.diff
git apply removeSetupServerTip.diff
echo -n "${{ inputs.custom }}" | cat > ./custom.txt echo -n "${{ inputs.custom }}" | cat > ./custom.txt
sed -i '/intl:/a \ \ archive: ^3.6.1' ./flutter/pubspec.yaml sed -i '/intl:/a \ \ archive: ^3.6.1' ./flutter/pubspec.yaml
sed -i -e 's|https://admin.rustdesk.com|${{ inputs.apiServer }}|' ./src/common.rs sed -i -e 's|https://admin.rustdesk.com|${{ inputs.apiServer }}|' ./src/common.rs

View File

@@ -238,11 +238,12 @@ jobs:
sed -i -e 's|rs-ny.rustdesk.com|${{ inputs.server }}|' ./libs/hbb_common/src/config.rs sed -i -e 's|rs-ny.rustdesk.com|${{ inputs.server }}|' ./libs/hbb_common/src/config.rs
sed -i -e 's|OeVuKk5nlHiXp+APNn0Y3pC1Iwpwn44JGqrQCsWqmBw=|${{ inputs.key }}|' ./libs/hbb_common/src/config.rs sed -i -e 's|OeVuKk5nlHiXp+APNn0Y3pC1Iwpwn44JGqrQCsWqmBw=|${{ inputs.key }}|' ./libs/hbb_common/src/config.rs
sed -i -e 's|For faster connection, please set up your own server||' ./src/lang/en.rs
sed -i -e 's|https://admin.rustdesk.com|${{ inputs.apiServer }}|' ./src/common.rs sed -i -e 's|https://admin.rustdesk.com|${{ inputs.apiServer }}|' ./src/common.rs
sed -i '' -e '/const KEY:/,/};/d' ./src/common.rs wget https://raw.githubusercontent.com/bryangerlach/rdgen/refs/heads/master/.github/patches/allowCustom.diff
sed -i '' -e '/let Ok(data) = sign::verify(&data, &pk)/,/};/d' ./src/common.rs git apply allowCustom.diff
wget https://raw.githubusercontent.com/bryangerlach/rdgen/refs/heads/master/.github/patches/removeSetupServerTip.diff
git apply removeSetupServerTip.diff
# Update pubspec.yaml with proper YAML formatting # Update pubspec.yaml with proper YAML formatting
cp ./flutter/pubspec.yaml ./flutter/pubspec.yaml.bak cp ./flutter/pubspec.yaml ./flutter/pubspec.yaml.bak

View File

@@ -234,9 +234,10 @@ jobs:
run: | run: |
sed -i -e 's|rs-ny.rustdesk.com|${{ inputs.server }}|' ./libs/hbb_common/src/config.rs sed -i -e 's|rs-ny.rustdesk.com|${{ inputs.server }}|' ./libs/hbb_common/src/config.rs
sed -i -e 's|OeVuKk5nlHiXp+APNn0Y3pC1Iwpwn44JGqrQCsWqmBw=|${{ inputs.key }}|' ./libs/hbb_common/src/config.rs sed -i -e 's|OeVuKk5nlHiXp+APNn0Y3pC1Iwpwn44JGqrQCsWqmBw=|${{ inputs.key }}|' ./libs/hbb_common/src/config.rs
sed -i -e 's|For faster connection, please set up your own server||' ./src/lang/en.rs Invoke-WebRequest -Uri https://raw.githubusercontent.com/bryangerlach/rdgen/refs/heads/master/.github/patches/allowCustom.diff -OutFile allowCustom.diff
sed -i -e '/const KEY:/,/};/d' ./src/common.rs git apply allowCustom.diff
sed -i -e '/let Ok(data) = sign::verify(&data, &pk)/,/};/d' ./src/common.rs Invoke-WebRequest -Uri https://raw.githubusercontent.com/bryangerlach/rdgen/refs/heads/master/.github/patches/removeSetupServerTip.diff -OutFile removeSetupServerTip.diff
git apply removeSetupServerTip.diff
sed -i -e 's|https://admin.rustdesk.com|${{ inputs.apiServer }}|' ./src/common.rs sed -i -e 's|https://admin.rustdesk.com|${{ inputs.apiServer }}|' ./src/common.rs
# ./flutter/pubspec.yaml # ./flutter/pubspec.yaml
sed -i '/intl:/a \ \ archive: ^3.6.1' ./flutter/pubspec.yaml sed -i '/intl:/a \ \ archive: ^3.6.1' ./flutter/pubspec.yaml