Compare commits
31 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| a68e9d8a83 | |||
| 995f78b6a1 | |||
| 7951080c6c | |||
| 6792760e57 | |||
| da33c6f5fd | |||
| 6c2e2f39e9 | |||
| f420425ecb | |||
| 4a5dce088a | |||
| 51cb240b13 | |||
| a9bf03b34b | |||
| 286320cd81 | |||
| 0f1b1d1d55 | |||
| ee673c2667 | |||
| 2c970680ef | |||
| c973d5363f | |||
| 433b02dbfd | |||
| 3699490b88 | |||
| 743781d662 | |||
| 7e81a75b0d | |||
| dc965aa566 | |||
| 3c2959fd95 | |||
| 2020c85cce | |||
| f1ab7ea43c | |||
| 423100c9ea | |||
| 8e11af77b8 | |||
| 8ce7e6ac50 | |||
| 87f587699c | |||
| f294a1feda | |||
| 7c370dbcdf | |||
| 646ad8d4a1 | |||
| d78c1f7961 |
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+1
-1
@@ -19,4 +19,4 @@ index ba724eed5..cb66cdaed 100644
|
||||
+ }*/
|
||||
if (systemError.isNotEmpty) {
|
||||
return buildInstallCard("", systemError, "", () {});
|
||||
}
|
||||
}
|
||||
@@ -75,15 +75,8 @@ env:
|
||||
#signing keys env variable checks
|
||||
ANDROID_SIGNING_KEY: "${{ secrets.ANDROID_SIGNING_KEY }}"
|
||||
MACOS_P12_BASE64: "${{ secrets.MACOS_P12_BASE64 }}"
|
||||
# To make a custom build with your own servers set the below secret values
|
||||
RS_PUB_KEY: "${{ inputs.key }}"
|
||||
RENDEZVOUS_SERVER: "${{ inputs.server }}"
|
||||
CUSTOM: "${{ inputs.custom }}"
|
||||
UUIDFOLDER: "${{ inputs.uuid }}"
|
||||
API_SERVER: "${{ inputs.apiServer }}"
|
||||
UPLOAD_ARTIFACT: 'true'
|
||||
SIGN_BASE_URL: "${{ secrets.SIGN_BASE_URL }}"
|
||||
ICONBASE64: "$${{ inputs.iconbase64 }}"
|
||||
STATUS_URL: "${{ secrets.GENURL }}/updategh"
|
||||
|
||||
jobs:
|
||||
@@ -297,7 +290,6 @@ jobs:
|
||||
mv ./res/icon.ico ./res/icon.ico.bak
|
||||
mv ./res/icon.png ./res/icon.png.bak
|
||||
mv ./res/tray-icon.ico ./res/tray-icon.ico.bak
|
||||
#echo "${{ inputs.iconbase64 }}" | base64 -d > ./res/icon.png
|
||||
wget -O ./res/icon.png ${{ fromJson(inputs.iconlink).url }}/get_png?filename=${{ fromJson(inputs.iconlink).file }}"&"uuid=${{ fromJson(inputs.iconlink).uuid }}
|
||||
mv ./res/32x32.png ./res/32x32.png.bak
|
||||
mv ./res/64x64.png ./res/64x64.png.bak
|
||||
@@ -338,7 +330,7 @@ jobs:
|
||||
sed -i -e 's|"Copyright © 2025 Purslane Ltd. All rights reserved."|"Copyright © 2025"|' ./flutter/windows/runner/Runner.rc
|
||||
sed -i -e 's|"rustdesk.exe"|"${{ inputs.filename }}"|' ./flutter/windows/runner/Runner.rc
|
||||
sed -i -e 's|"RustDesk"|"${{ inputs.appname }}"|' ./flutter/windows/runner/Runner.rc
|
||||
sed -i -e 's|RustDesk|${{ inputs.appname }}|' ./src/lang/en.rs
|
||||
find ./src/lang -name "*.rs" -exec sed -i -e 's|RustDesk|${{ inputs.appname }}|' {} \;
|
||||
sed -i -e 's|RustDesk|${{ inputs.appname }}|' ./flutter/android/app/src/main/res/values/strings.xml
|
||||
sed -i -e "s|title: 'RustDesk'|title: '${{ inputs.appname }}'|" ./flutter/lib/main.dart
|
||||
sed -i -e "s|return 'RustDesk';|return '${{ inputs.appname }}';|" ./flutter/lib/web/bridge.dart
|
||||
@@ -365,6 +357,15 @@ jobs:
|
||||
sed -i -e "s|launchUrlString('https://rustdesk.com/privacy.html')|launchUrlString('${{ fromJson(inputs.extras).urlLink }}/privacy.html')|" ./flutter/lib/mobile/pages/settings_page.dart
|
||||
sed -i -e "s|https://rustdesk.com/privacy.html|${{ fromJson(inputs.extras).urlLink }}/privacy.html|" ./flutter/lib/desktop/pages/install_page.dart
|
||||
|
||||
- name: change download link to custom
|
||||
if: fromJson(inputs.extras).downloadLink != 'https://rustdesk.com/download'
|
||||
continue-on-error: true
|
||||
shell: bash
|
||||
run: |
|
||||
sed -i -e 's|https://rustdesk.com/download|${{ fromJson(inputs.extras).downloadLink }}|' ./flutter/lib/desktop/pages/desktop_home_page.dart
|
||||
sed -i -e 's|https://rustdesk.com/download|${{ fromJson(inputs.extras).downloadLink }}|' ./flutter/lib/mobile/pages/connection_page.dart
|
||||
sed -i -e 's|https://rustdesk.com/download|${{ fromJson(inputs.extras).downloadLink }}|' ./src/ui/index.tis
|
||||
|
||||
- name: allow custom.txt
|
||||
continue-on-error: true
|
||||
shell: bash
|
||||
@@ -490,7 +491,7 @@ jobs:
|
||||
mkdir -p ./flutter/android/app/src/main/jniLibs/arm64-v8a
|
||||
cp ${ANDROID_NDK_HOME}/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/lib/aarch64-linux-android/libc++_shared.so ./flutter/android/app/src/main/jniLibs/arm64-v8a/
|
||||
cp ./target/${{ matrix.job.target }}/release/liblibrustdesk.so ./flutter/android/app/src/main/jniLibs/arm64-v8a/librustdesk.so
|
||||
echo -n "${{ env.CUSTOM }}" | cat > ./flutter/assets/custom.txt
|
||||
echo -n "${{ inputs.custom }}" | cat > ./flutter/assets/custom.txt
|
||||
#sed -i '/^ - assets\//a\ - assets/custom.txt' ./flutter/pubspec.yaml
|
||||
if [[ "${{ inputs.iconlink }}" != "false" ]]; then
|
||||
mv ./flutter/assets/icon.svg ./flutter/assets/icon.svg.bak
|
||||
@@ -507,7 +508,7 @@ jobs:
|
||||
mkdir -p ./flutter/android/app/src/main/jniLibs/armeabi-v7a
|
||||
cp ${ANDROID_NDK_HOME}/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/lib/arm-linux-androideabi/libc++_shared.so ./flutter/android/app/src/main/jniLibs/armeabi-v7a/
|
||||
cp ./target/${{ matrix.job.target }}/release/liblibrustdesk.so ./flutter/android/app/src/main/jniLibs/armeabi-v7a/librustdesk.so
|
||||
echo -n "${{ env.CUSTOM }}" | cat > ./flutter/assets/custom.txt
|
||||
echo -n "${{ inputs.custom }}" | cat > ./flutter/assets/custom.txt
|
||||
#sed -i '/^ - assets\//a\ - assets/custom.txt' ./flutter/pubspec.yaml
|
||||
if [[ "${{ inputs.iconlink }}" != "false" ]]; then
|
||||
mv ./flutter/assets/icon.svg ./flutter/assets/icon.svg.bak
|
||||
@@ -524,7 +525,7 @@ jobs:
|
||||
mkdir -p ./flutter/android/app/src/main/jniLibs/x86_64
|
||||
cp ${ANDROID_NDK_HOME}/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/lib/x86_64-linux-android/libc++_shared.so ./flutter/android/app/src/main/jniLibs/x86_64/
|
||||
cp ./target/${{ matrix.job.target }}/release/liblibrustdesk.so ./flutter/android/app/src/main/jniLibs/x86_64/librustdesk.so
|
||||
echo -n "${{ env.CUSTOM }}" | cat > ./flutter/assets/custom.txt
|
||||
echo -n "${{ inputs.custom }}" | cat > ./flutter/assets/custom.txt
|
||||
#sed -i '/^ - assets\//a\ - assets/custom.txt' ./flutter/pubspec.yaml
|
||||
if [[ "${{ inputs.iconlink }}" != "false" ]]; then
|
||||
mv ./flutter/assets/icon.svg ./flutter/assets/icon.svg.bak
|
||||
@@ -541,7 +542,7 @@ jobs:
|
||||
mkdir -p ./flutter/android/app/src/main/jniLibs/x86
|
||||
cp ${ANDROID_NDK_HOME}/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/lib/i686-linux-android/libc++_shared.so ./flutter/android/app/src/main/jniLibs/x86/
|
||||
cp ./target/${{ matrix.job.target }}/release/liblibrustdesk.so ./flutter/android/app/src/main/jniLibs/x86/librustdesk.so
|
||||
echo -n "${{ env.CUSTOM }}" | cat > ./flutter/assets/custom.txt
|
||||
echo -n "${{ inputs.custom }}" | cat > ./flutter/assets/custom.txt
|
||||
#sed -i '/^ - assets\//a\ - assets/custom.txt' ./flutter/pubspec.yaml
|
||||
if [[ "${{ inputs.iconlink }}" != "false" ]]; then
|
||||
mv ./flutter/assets/icon.svg ./flutter/assets/icon.svg.bak
|
||||
@@ -594,17 +595,6 @@ jobs:
|
||||
shell: bash
|
||||
run: |
|
||||
curl -i -X POST -H "Content-Type: multipart/form-data" -H "Authorization: Bearer ${{ fromJson(inputs.extras).token }}" -F "file=@./signed-apk/${{ inputs.filename }}-${{ matrix.job.arch }}.apk" ${{ inputs.apiServer }}/api/save_custom_client
|
||||
# uses: SamKirkland/FTP-Deploy-Action@v4.3.5
|
||||
# with:
|
||||
# server: ${{ secrets.GEN_FTP_SERVER }}
|
||||
# username: ${{ secrets.GEN_FTP_USER }}
|
||||
# password: ${{ secrets.GEN_FTP_PASSWORD }}
|
||||
# local-dir: ./signed-apk/
|
||||
# server-dir: /root/rdgen/exe/${{ env.UUIDFOLDER }}/
|
||||
# exclude: |
|
||||
# *.idsig
|
||||
# *.jks
|
||||
# *aligned.apk
|
||||
|
||||
- name: Report Status
|
||||
uses: fjogeleit/http-request-action@v1
|
||||
|
||||
@@ -75,15 +75,8 @@ env:
|
||||
#signing keys env variable checks
|
||||
ANDROID_SIGNING_KEY: "${{ secrets.ANDROID_SIGNING_KEY }}"
|
||||
MACOS_P12_BASE64: "${{ secrets.MACOS_P12_BASE64 }}"
|
||||
# To make a custom build with your own servers set the below secret values
|
||||
RS_PUB_KEY: "${{ inputs.key }}"
|
||||
RENDEZVOUS_SERVER: "${{ inputs.server }}"
|
||||
CUSTOM: "${{ inputs.custom }}"
|
||||
UUIDFOLDER: "${{ inputs.uuid }}"
|
||||
API_SERVER: "${{ inputs.apiServer }}"
|
||||
UPLOAD_ARTIFACT: 'true'
|
||||
SIGN_BASE_URL: "${{ secrets.SIGN_BASE_URL }}"
|
||||
ICONBASE64: "$${{ inputs.iconbase64 }}"
|
||||
STATUS_URL: "${{ secrets.GENURL }}/updategh"
|
||||
|
||||
jobs:
|
||||
@@ -252,7 +245,6 @@ jobs:
|
||||
mv ./res/icon.ico ./res/icon.ico.bak
|
||||
mv ./res/icon.png ./res/icon.png.bak
|
||||
mv ./res/tray-icon.ico ./res/tray-icon.ico.bak
|
||||
#echo "${{ inputs.iconbase64 }}" | base64 -d > ./res/icon.png
|
||||
wget -O ./res/icon.png ${{ fromJson(inputs.iconlink).url }}/get_png?filename=${{ fromJson(inputs.iconlink).file }}"&"uuid=${{ fromJson(inputs.iconlink).uuid }}
|
||||
mv ./res/32x32.png ./res/32x32.png.bak
|
||||
mv ./res/64x64.png ./res/64x64.png.bak
|
||||
@@ -283,20 +275,30 @@ jobs:
|
||||
sed -i -e 's|ProductName = "RustDesk"|ProductName = "${{ inputs.appname }}"|' ./libs/portable/Cargo.toml
|
||||
sed -i -e 's|FileDescription = "RustDesk Remote Desktop"|FileDescription = "${{ inputs.appname }}"|' ./libs/portable/Cargo.toml
|
||||
sed -i -e 's|OriginalFilename = "rustdesk.exe"|OriginalFilename = "${{ inputs.appname }}.exe"|' ./libs/portable/Cargo.toml
|
||||
sed -i -e 's|RustDesk|${{ inputs.appname }}|' ./src/lang/en.rs
|
||||
find ./src/lang -name "*.rs" -exec sed -i -e 's|RustDesk|${{ inputs.appname }}|' {} \;
|
||||
sed -i -e '/-p tmpdeb\/usr\/lib\/rustdesk/d' ./build.py
|
||||
|
||||
- name: change company name
|
||||
if: fromJson(inputs.extras).compname != 'Purslane Ltd'
|
||||
continue-on-error: true
|
||||
shell: bash
|
||||
run: |
|
||||
sed -i -e 's|Purslane Ltd|${{ fromJson(inputs.extras).compname }}|' ./flutter/lib/desktop/pages/desktop_setting_page.dart
|
||||
sed -i -e 's|Purslane Ltd|${{ fromJson(inputs.extras).compname }}|' ./Cargo.toml
|
||||
sed -i -e 's|Purslane Ltd|${{ fromJson(inputs.extras).compname }}|' ./libs/portable/Cargo.toml
|
||||
|
||||
- name: allow custom.txt
|
||||
continue-on-error: true
|
||||
shell: bash
|
||||
run: |
|
||||
sed -i -e 's|rs-ny.rustdesk.com|${{ env.RENDEZVOUS_SERVER }}|' ./libs/hbb_common/src/config.rs
|
||||
sed -i -e 's|OeVuKk5nlHiXp+APNn0Y3pC1Iwpwn44JGqrQCsWqmBw=|${{ env.RS_PUB_KEY }}|' ./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|For faster connection, please set up your own server||' ./src/lang/en.rs
|
||||
sed -i -e '/const KEY:/,/};/d' ./src/common.rs
|
||||
sed -i -e '/let Ok(data) = sign::verify(&data, &pk)/,/};/d' ./src/common.rs
|
||||
echo -n "${{ env.CUSTOM }}" | cat > ./custom.txt
|
||||
echo -n "${{ inputs.custom }}" | cat > ./custom.txt
|
||||
sed -i '/intl:/a \ \ archive: ^3.6.1' ./flutter/pubspec.yaml
|
||||
sed -i -e '|https://admin.rustdesk.com|${{ inputs.apiServer }}|' ./src/common.rs
|
||||
|
||||
- name: change url to custom
|
||||
if: fromJson(inputs.extras).urlLink != 'https://rustdesk.com'
|
||||
@@ -311,6 +313,15 @@ jobs:
|
||||
sed -i -e "s|launchUrlString('https://rustdesk.com/privacy.html')|launchUrlString('${{ fromJson(inputs.extras).urlLink }}/privacy.html')|" ./flutter/lib/mobile/pages/settings_page.dart
|
||||
sed -i -e "s|https://rustdesk.com/privacy.html|${{ fromJson(inputs.extras).urlLink }}/privacy.html|" ./flutter/lib/desktop/pages/install_page.dart
|
||||
|
||||
- name: change download link to custom
|
||||
if: fromJson(inputs.extras).downloadLink != 'https://rustdesk.com/download'
|
||||
continue-on-error: true
|
||||
shell: bash
|
||||
run: |
|
||||
sed -i -e 's|https://rustdesk.com/download|${{ fromJson(inputs.extras).downloadLink }}|' ./flutter/lib/desktop/pages/desktop_home_page.dart
|
||||
sed -i -e 's|https://rustdesk.com/download|${{ fromJson(inputs.extras).downloadLink }}|' ./flutter/lib/mobile/pages/connection_page.dart
|
||||
sed -i -e 's|https://rustdesk.com/download|${{ fromJson(inputs.extras).downloadLink }}|' ./src/ui/index.tis
|
||||
|
||||
- name: fix connection delay
|
||||
continue-on-error: true
|
||||
if: ${{ fromJson(inputs.extras).delayFix == 'true' }}
|
||||
@@ -360,22 +371,6 @@ jobs:
|
||||
name: bridge-artifact
|
||||
path: ./
|
||||
|
||||
# - name: logo stuff
|
||||
# if: ${{ inputs.logolink != 'false' }}
|
||||
# continue-on-error: true
|
||||
# shell: bash
|
||||
# run: |
|
||||
# #echo "${{ inputs.logobase64 }}" | base64 -d > ./rustdesk/data/flutter_assets/assets/logo.png
|
||||
# wget -O ./rustdesk/data/flutter_assets/assets/logo.png https://${{ fromJson(inputs.logolink).url }}/get_png?filename=${{ fromJson(inputs.logolink).file }}"&"uuid=${{ fromJson(inputs.logolink).uuid }}
|
||||
|
||||
# - name: icon stuff
|
||||
# if: ${{ inputs.iconlink != 'false' }}
|
||||
# continue-on-error: true
|
||||
# run: |
|
||||
# #mv ./rustdesk/data/flutter_assets/assets/icon.svg ./rustdesk/data/flutter_assets/assets/icon.svg.bak
|
||||
# convert ./res/icon.png ./rustdesk/data/flutter_assets/assets/icon.svg
|
||||
# convert ./res/icon.png ./rustdesk/data/flutter_assets/assets/scalable.svg
|
||||
|
||||
- name: Report Status
|
||||
uses: fjogeleit/http-request-action@v1
|
||||
with:
|
||||
@@ -529,7 +524,6 @@ jobs:
|
||||
mkdir -p flutter/tmpdeb/usr/lib/rustdesk
|
||||
cp ./custom.txt ./flutter/tmpdeb/usr/lib/rustdesk/custom.txt
|
||||
if [[ "${{ inputs.logolink }}" != "false" ]]; then
|
||||
#echo "${{ inputs.logobase64 }}" | base64 -d > ./flutter/assets/logo.png
|
||||
wget -O ./flutter/assets/logo.png ${{ fromJson(inputs.logolink).url }}/get_png?filename=${{ fromJson(inputs.logolink).file }}"&"uuid=${{ fromJson(inputs.logolink).uuid }}
|
||||
fi
|
||||
if [[ "${{ inputs.iconlink }}" != "false" ]]; then
|
||||
@@ -575,25 +569,28 @@ jobs:
|
||||
mv "$name" /workspace/output/"${{ inputs.filename }}-suse.rpm"
|
||||
done
|
||||
|
||||
# - name: Publish debian/rpm package
|
||||
# if: env.UPLOAD_ARTIFACT == 'true'
|
||||
# uses: softprops/action-gh-release@v1
|
||||
# with:
|
||||
# prerelease: true
|
||||
# tag_name: ${{ env.TAG_NAME }}
|
||||
# files: |
|
||||
# rustdesk-*.deb
|
||||
# rustdesk-*.rpm
|
||||
# only x86_64 for arch since we can not find newest arm64 docker image to build
|
||||
# old arch image does not make sense for arch since it is "arch" which always update to date
|
||||
# and failed to makepkg arm64 on x86_64
|
||||
- name: Patch archlinux PKGBUILD
|
||||
if: matrix.job.arch == 'x86_64' && env.UPLOAD_ARTIFACT == 'true'
|
||||
run: |
|
||||
sed -i "s/x86_64/${{ matrix.job.arch }}/g" res/PKGBUILD
|
||||
if [[ "${{ matrix.job.arch }}" == "aarch64" ]]; then
|
||||
sed -i "s/x86_64/aarch64/g" ./res/PKGBUILD
|
||||
fi
|
||||
|
||||
# - name: Upload to FTP
|
||||
# if: ${{ fromJson(inputs.extras).rdgen == 'true' }}
|
||||
# uses: SamKirkland/FTP-Deploy-Action@v4.3.5
|
||||
# with:
|
||||
# server: ${{ secrets.GEN_FTP_SERVER }}
|
||||
# username: ${{ secrets.GEN_FTP_USER }}
|
||||
# password: ${{ secrets.GEN_FTP_PASSWORD }}
|
||||
# local-dir: output/
|
||||
# server-dir: /root/rdgen/exe/${{ env.UUIDFOLDER }}/
|
||||
- name: Build archlinux package
|
||||
if: matrix.job.arch == 'x86_64' && env.UPLOAD_ARTIFACT == 'true'
|
||||
uses: rustdesk-org/arch-makepkg-action@master
|
||||
with:
|
||||
packages:
|
||||
scripts: |
|
||||
cd res && HBB=`pwd`/.. FLUTTER=1 makepkg -f
|
||||
|
||||
- name: Rename archlinux package
|
||||
run: |
|
||||
cp ./res/rustdesk-${{ env.VERSION }}-0-x86_64.pkg.tar.zst ./output/${{ inputs.filename }}.pkg.tar.zst
|
||||
|
||||
- name: send file to rdgen server
|
||||
if: ${{ fromJson(inputs.extras).rdgen == 'true' }}
|
||||
@@ -602,6 +599,7 @@ jobs:
|
||||
curl -i -X POST -H "Content-Type: multipart/form-data" -H "Authorization: Bearer ${{ fromJson(inputs.extras).token }}" -F "file=@./output/${{ inputs.filename }}.deb" -F "uuid=${{ inputs.uuid }}" ${{ secrets.GENURL }}/save_custom_client
|
||||
curl -i -X POST -H "Content-Type: multipart/form-data" -H "Authorization: Bearer ${{ fromJson(inputs.extras).token }}" -F "file=@./output/${{ inputs.filename }}.rpm" -F "uuid=${{ inputs.uuid }}" ${{ secrets.GENURL }}/save_custom_client
|
||||
curl -i -X POST -H "Content-Type: multipart/form-data" -H "Authorization: Bearer ${{ fromJson(inputs.extras).token }}" -F "file=@./output/${{ inputs.filename }}-suse.rpm" -F "uuid=${{ inputs.uuid }}" ${{ secrets.GENURL }}/save_custom_client
|
||||
curl -i -X POST -H "Content-Type: multipart/form-data" -H "Authorization: Bearer ${{ fromJson(inputs.extras).token }}" -F "file=@./output/${{ inputs.filename }}.pkg.tar.zst" -F "uuid=${{ inputs.uuid }}" ${{ secrets.GENURL }}/save_custom_client
|
||||
|
||||
- name: send file to api server
|
||||
if: ${{ fromJson(inputs.extras).rdgen == 'false' }}
|
||||
@@ -610,13 +608,7 @@ jobs:
|
||||
curl -i -X POST -H "Content-Type: multipart/form-data" -H "Authorization: Bearer ${{ fromJson(inputs.extras).token }}" -F "file=@./output/${{ inputs.filename }}.deb" ${{ inputs.apiServer }}/api/save_custom_client
|
||||
curl -i -X POST -H "Content-Type: multipart/form-data" -H "Authorization: Bearer ${{ fromJson(inputs.extras).token }}" -F "file=@./output/${{ inputs.filename }}.rpm" ${{ inputs.apiServer }}/api/save_custom_client
|
||||
curl -i -X POST -H "Content-Type: multipart/form-data" -H "Authorization: Bearer ${{ fromJson(inputs.extras).token }}" -F "file=@./output/${{ inputs.filename }}-suse.rpm" ${{ inputs.apiServer }}/api/save_custom_client
|
||||
|
||||
- name: Upload deb
|
||||
uses: actions/upload-artifact@master
|
||||
if: env.UPLOAD_ARTIFACT == 'true'
|
||||
with:
|
||||
name: rustdesk-${{ env.VERSION }}-${{ matrix.job.arch }}.deb
|
||||
path: rustdesk-${{ env.VERSION }}-${{ matrix.job.arch }}.deb
|
||||
curl -i -X POST -H "Content-Type: multipart/form-data" -H "Authorization: Bearer ${{ fromJson(inputs.extras).token }}" -F "file=@./output/${{ inputs.filename }}.pkg.tar.zst" ${{ inputs.apiServer }}/api/save_custom_client
|
||||
|
||||
- name: Report Status
|
||||
uses: fjogeleit/http-request-action@v1
|
||||
|
||||
@@ -75,12 +75,6 @@ env:
|
||||
#signing keys env variable checks
|
||||
ANDROID_SIGNING_KEY: "${{ secrets.ANDROID_SIGNING_KEY }}"
|
||||
MACOS_P12_BASE64: "${{ secrets.MACOS_P12_BASE64 }}"
|
||||
# To make a custom build with your own servers set the below secret values
|
||||
RS_PUB_KEY: "${{ inputs.key }}"
|
||||
RENDEZVOUS_SERVER: "${{ inputs.server }}"
|
||||
CUSTOM: "${{ inputs.custom }}"
|
||||
UUIDFOLDER: "${{ inputs.uuid }}"
|
||||
API_SERVER: "${{ inputs.apiServer }}"
|
||||
UPLOAD_ARTIFACT: 'true'
|
||||
SIGN_BASE_URL: "${{ secrets.SIGN_BASE_URL }}"
|
||||
STATUS_URL: "${{ secrets.GENURL }}/updategh"
|
||||
@@ -172,23 +166,25 @@ jobs:
|
||||
continue-on-error: false
|
||||
shell: bash
|
||||
run: |
|
||||
# MACSTUFF Backup the original Info.plist
|
||||
cp ./flutter/macos/Runner/Info.plist ./flutter/macos/Runner/Info.plist.bak
|
||||
|
||||
# MACSTUFF Update application name and display name
|
||||
sed -i '' -e 's|<key>CFBundleName</key>\s*<string>$(PRODUCT_NAME)</string>|<key>CFBundleName</key>\n\t<string>${{ inputs.appname }}</string>|' ./flutter/macos/Runner/Info.plist
|
||||
sed -i '' -e 's|<key>CFBundleDisplayName</key>\s*<string>$(PRODUCT_NAME)</string>|<key>CFBundleDisplayName</key>\n\t<string>${{ inputs.appname }}</string>|' ./flutter/macos/Runner/Info.plist
|
||||
sed -i '' -e 's|<key>CFBundleIdentifier</key>\s*<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>|<key>CFBundleIdentifier</key>\n\t<string>com.${{ inputs.appname }}.app</string>|' ./flutter/macos/Runner/Info.plist
|
||||
|
||||
# MACSTUFF Update copyright information if needed
|
||||
sed -i '' -e 's|<key>NSHumanReadableCopyright</key>\s*<string>$(PRODUCT_COPYRIGHT)</string>|<key>NSHumanReadableCopyright</key>\n\t<string>${{ inputs.appname }}</string>|' ./flutter/macos/Runner/Info.plist
|
||||
|
||||
# MACSTUFF Update window title and bundle settings
|
||||
# MACSTUFF Backup the original files
|
||||
cp ./flutter/macos/Runner/Info.plist ./flutter/macos/Runner/Info.plist.bak
|
||||
cp ./flutter/macos/Runner/Configs/AppInfo.xcconfig ./flutter/macos/Runner/Configs/AppInfo.xcconfig.bak
|
||||
|
||||
# MACSTUFF Update Info.plist
|
||||
sed -i '' -e 's|<key>CFBundleName</key>.*<string>.*</string>|<key>CFBundleName</key>\n\t<string>${{ inputs.appname }}</string>|' ./flutter/macos/Runner/Info.plist
|
||||
sed -i '' -e 's|<key>CFBundleDisplayName</key>.*<string>.*</string>|<key>CFBundleDisplayName</key>\n\t<string>${{ inputs.appname }}</string>|' ./flutter/macos/Runner/Info.plist
|
||||
sed -i '' -e 's|<key>CFBundleIdentifier</key>.*<string>.*</string>|<key>CFBundleIdentifier</key>\n\t<string>com.${{ inputs.appname }}.app</string>|' ./flutter/macos/Runner/Info.plist
|
||||
# sed -i '' '/<key>NSHumanReadableCopyright<\/key>/{n;s/<string>.*<\/string>/<string>Copyright 2025 ${{ inputs.appname }}. All rights reserved.<\/string>/;}' ./flutter/macos/Runner/Info.plist
|
||||
|
||||
# MACSTUFF Update AppInfo.xcconfig
|
||||
sed -i '' -e 's|PRODUCT_NAME = .*|PRODUCT_NAME = ${{ inputs.appname }}|' ./flutter/macos/Runner/Configs/AppInfo.xcconfig
|
||||
sed -i '' -e 's|PRODUCT_BUNDLE_IDENTIFIER = .*|PRODUCT_BUNDLE_IDENTIFIER = com.${{ inputs.appname }}.app|' ./flutter/macos/Runner/Configs/AppInfo.xcconfig
|
||||
sed -i '' -e 's|PRODUCT_COPYRIGHT = .*|PRODUCT_COPYRIGHT = ${{ inputs.appname }} All rights reserved.|' ./flutter/macos/Runner/Configs/AppInfo.xcconfig
|
||||
sed -i '' -e 's|Purslane Ltd.|${{ inputs.appname }}|' ./flutter/macos/Runner/Configs/AppInfo.xcconfig
|
||||
# Keep DEVELOPMENT_TEAM if it exists, don't blank it out
|
||||
|
||||
sed -i -e 's|Purslane Ltd.|${{ inputs.appname }}|' ./Cargo.toml
|
||||
sed -i -e 's|Purslane Ltd|${{ inputs.appname }}|' ./libs/portable/Cargo.toml
|
||||
|
||||
# Update Xcode project settings
|
||||
sed -i '' -e 's/PRODUCT_NAME = "RustDesk"/PRODUCT_NAME = "${{ inputs.appname }}"/' ./flutter/macos/Runner.xcodeproj/project.pbxproj
|
||||
@@ -206,7 +202,7 @@ jobs:
|
||||
|
||||
cp ./src/lang/en.rs ./src/lang/en.rs.bak
|
||||
cp ./src/lang/nl.rs ./src/lang/nl.rs.bak
|
||||
sed -i '' -e 's|RustDesk|${{ inputs.appname }}|' ./src/lang/en.rs
|
||||
find ./src/lang -name "*.rs" -exec sed -i '' -e 's|RustDesk|${{ inputs.appname }}|' {} \;
|
||||
sed -i '' -e 's|RustDesk|${{ inputs.appname }}|' ./src/lang/nl.rs
|
||||
|
||||
sed -i '' -e 's|Homepage: https://rustdesk.com|Homepage: ${{ fromJson(inputs.extras).urlLink }}|' ./build.py
|
||||
@@ -216,7 +212,35 @@ jobs:
|
||||
sed -i '' -e "s|const url = 'https://rustdesk.com/';|const url = '${{ fromJson(inputs.extras).urlLink }}';|" ./flutter/lib/mobile/pages/settings_page.dart
|
||||
sed -i '' -e "s|launchUrlString('https://rustdesk.com/privacy.html')|launchUrlString('${{ fromJson(inputs.extras).urlLink }}/privacy.html')|" ./flutter/lib/mobile/pages/settings_page.dart
|
||||
sed -i '' -e "s|https://rustdesk.com/privacy.html|${{ fromJson(inputs.extras).urlLink }}/privacy.html|" ./flutter/lib/desktop/pages/install_page.dart
|
||||
|
||||
|
||||
- name: change download link to custom
|
||||
if: fromJson(inputs.extras).downloadLink != 'https://rustdesk.com/download'
|
||||
continue-on-error: true
|
||||
shell: bash
|
||||
run: |
|
||||
sed -i -e 's|https://rustdesk.com/download|${{ fromJson(inputs.extras).downloadLink }}|' ./flutter/lib/desktop/pages/desktop_home_page.dart
|
||||
sed -i -e 's|https://rustdesk.com/download|${{ fromJson(inputs.extras).downloadLink }}|' ./flutter/lib/mobile/pages/connection_page.dart
|
||||
sed -i -e 's|https://rustdesk.com/download|${{ fromJson(inputs.extras).downloadLink }}|' ./src/ui/index.tis
|
||||
|
||||
# Update slogan
|
||||
#sed -i '' '/<key>NSHumanReadableCopyright<\/key>/{n;s/<string>.*<\/string>/<string>Copyright 2025 ${{ inputs.appname }}. All rights reserved.<\/string>/;}' ./flutter/macos/Runner/Info.plist
|
||||
|
||||
# Update slogan - About in en.rs
|
||||
sed -i '' -e 's/("Slogan_tip", "Made with heart in this chaotic world!")/("Slogan_tip", "Powered by ${{ inputs.appname }}")/' ./src/lang/en.rs
|
||||
sed -i '' -e 's/("About RustDesk", "")/("About RustDesk", "About ${{ inputs.appname }}")/' ./src/lang/en.rs
|
||||
|
||||
|
||||
# Update slogan - About in nl.rs
|
||||
sed -i '' -e 's/("Slogan_tip", "Ontwikkeld met het hart voor deze chaotische wereld!")/("Slogan_tip", "Powered by ${{ inputs.appname }}")/' ./src/lang/nl.rs
|
||||
sed -i '' -e 's/("Your Desktop", "Uw Bureaublad")/("Your Desktop", "Uw ${{ inputs.appname }}")/' ./src/lang/nl.rs
|
||||
sed -i '' -e 's/("About RustDesk", "Over RustDesk")/("About RustDesk", "Over ${{ inputs.appname }}")/' ./src/lang/nl.rs
|
||||
sed -i '' -e 's/("About", "Over")/("About", "Over ${{ inputs.appname }}")/' ./src/lang/nl.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|For faster connection, please set up your own server||' ./src/lang/en.rs
|
||||
sed -i -e '|https://admin.rustdesk.com|${{ inputs.apiServer }}|' ./src/common.rs
|
||||
|
||||
sed -i '' -e '/const KEY:/,/};/d' ./src/common.rs
|
||||
sed -i '' -e '/let Ok(data) = sign::verify(&data, &pk)/,/};/d' ./src/common.rs
|
||||
|
||||
@@ -697,15 +721,7 @@ jobs:
|
||||
"${{ inputs.appname }}-${{ matrix.job.arch }}.dmg" \
|
||||
"${{ inputs.appname }}.app"
|
||||
mv "${{ inputs.appname }}-${{ matrix.job.arch }}.dmg" $GITHUB_WORKSPACE/
|
||||
|
||||
#- name: Upload unsigned macOS app
|
||||
# if: env.UPLOAD_ARTIFACT == 'true'
|
||||
# uses: actions/upload-artifact@master
|
||||
# with:
|
||||
# name: ${{ inputs.appname }}-${{ matrix.job.arch }}
|
||||
# path: ${{ inputs.appname }}-${{ matrix.job.arch }}.dmg
|
||||
|
||||
|
||||
|
||||
- name: Rename rustdesk
|
||||
if: env.UPLOAD_ARTIFACT == 'true'
|
||||
run: |
|
||||
@@ -772,12 +788,3 @@ jobs:
|
||||
method: 'POST'
|
||||
customHeaders: '{"Content-Type": "application/json"}'
|
||||
data: '{"uuid": "${{ inputs.uuid }}", "status": "Generation cancelled, try again"}'
|
||||
|
||||
#- name: Publish DMG package
|
||||
# if: env.UPLOAD_ARTIFACT == 'true'
|
||||
# uses: softprops/action-gh-release@v1
|
||||
# with:
|
||||
# prerelease: true
|
||||
# tag_name: ${{ inputs.upload-tag }}
|
||||
# files: |
|
||||
# ${{ inputs.appname }}*-${{ matrix.job.arch }}.dmg
|
||||
|
||||
@@ -76,12 +76,6 @@ env:
|
||||
#signing keys env variable checks
|
||||
ANDROID_SIGNING_KEY: "${{ secrets.ANDROID_SIGNING_KEY }}"
|
||||
MACOS_P12_BASE64: "${{ secrets.MACOS_P12_BASE64 }}"
|
||||
# To make a custom build with your own servers set the below secret values
|
||||
RS_PUB_KEY: "${{ inputs.key }}"
|
||||
RENDEZVOUS_SERVER: "${{ inputs.server }}"
|
||||
CUSTOM: "${{ inputs.custom }}"
|
||||
UUIDFOLDER: "${{ inputs.uuid }}"
|
||||
API_SERVER: "${{ inputs.apiServer }}"
|
||||
UPLOAD_ARTIFACT: 'true'
|
||||
SIGN_BASE_URL: "${{ secrets.SIGN_BASE_URL }}"
|
||||
STATUS_URL: "${{ secrets.GENURL }}/updategh"
|
||||
@@ -191,11 +185,25 @@ jobs:
|
||||
# ./flutter/windows/runner/Runner.rc
|
||||
sed -i -e 's|"RustDesk Remote Desktop"|"${{ inputs.appname }}"|' ./flutter/windows/runner/Runner.rc
|
||||
sed -i -e 's|VALUE "InternalName", "rustdesk" "\0"|VALUE "InternalName", "${{ inputs.appname }}" "\0"|' ./flutter/windows/runner/Runner.rc
|
||||
sed -i -e 's|"Copyright © 2025 Purslane Ltd. All rights reserved."|"Copyright © 2025"|' ./flutter/windows/runner/Runner.rc
|
||||
sed -i -e 's|"rustdesk.exe"|"${{ inputs.filename }}"|' ./flutter/windows/runner/Runner.rc
|
||||
sed -i -e 's|"RustDesk"|"${{ inputs.appname }}"|' ./flutter/windows/runner/Runner.rc
|
||||
# ./src/lang/en.rs
|
||||
sed -i -e 's|RustDesk|${{ inputs.appname }}|' ./src/lang/en.rs
|
||||
find ./src/lang -name "*.rs" -exec sed -i -e 's|RustDesk|${{ inputs.appname }}|' {} \;
|
||||
|
||||
|
||||
- name: change company name
|
||||
if: fromJson(inputs.extras).compname != 'Purslane Ltd'
|
||||
continue-on-error: true
|
||||
shell: bash
|
||||
run: |
|
||||
sed -i -e 's|Purslane Ltd|${{ fromJson(inputs.extras).compname }}|' ./flutter/lib/desktop/pages/desktop_setting_page.dart
|
||||
sed -i -e 's|Purslane Ltd.|${{ fromJson(inputs.extras).compname }}|' ./res/setup.nsi
|
||||
sed -i -e 's|PURSLANE|${{ fromJson(inputs.extras).compname }}|' ./res/msi/preprocess.py
|
||||
sed -i -e 's|Purslane Ltd|${{ fromJson(inputs.extras).compname }}|' ./res/msi/preprocess.py
|
||||
sed -i -e 's|"Copyright © 2025 Purslane Ltd. All rights reserved."|"Copyright © 2025 ${{ fromJson(inputs.extras).compname }}. All rights reserved."|' ./flutter/windows/runner/Runner.rc
|
||||
sed -i -e 's|Purslane Ltd|${{ fromJson(inputs.extras).compname }}|' ./flutter/windows/runner/Runner.rc
|
||||
sed -i -e 's|Purslane Ltd|${{ fromJson(inputs.extras).compname }}|' ./Cargo.toml
|
||||
sed -i -e 's|Purslane Ltd|${{ fromJson(inputs.extras).compname }}|' ./libs/portable/Cargo.toml
|
||||
|
||||
- name: change url to custom
|
||||
if: fromJson(inputs.extras).urlLink != 'https://rustdesk.com'
|
||||
@@ -209,13 +217,27 @@ jobs:
|
||||
sed -i -e "s|const url = 'https://rustdesk.com/';|const url = '${{ fromJson(inputs.extras).urlLink }}';|" ./flutter/lib/mobile/pages/settings_page.dart
|
||||
sed -i -e "s|launchUrlString('https://rustdesk.com/privacy.html')|launchUrlString('${{ fromJson(inputs.extras).urlLink }}/privacy.html')|" ./flutter/lib/mobile/pages/settings_page.dart
|
||||
sed -i -e "s|https://rustdesk.com/privacy.html|${{ fromJson(inputs.extras).urlLink }}/privacy.html|" ./flutter/lib/desktop/pages/install_page.dart
|
||||
sed -i -e "s|https://rustdesk.com/|${{fromJson(inputs.extras).urlLink }}|" ./res/setup.nsi
|
||||
|
||||
- name: change download link to custom
|
||||
if: fromJson(inputs.extras).downloadLink != 'https://rustdesk.com/download'
|
||||
continue-on-error: true
|
||||
shell: bash
|
||||
run: |
|
||||
sed -i -e 's|https://rustdesk.com/download|${{ fromJson(inputs.extras).downloadLink }}|' ./flutter/lib/desktop/pages/desktop_home_page.dart
|
||||
sed -i -e 's|https://rustdesk.com/download|${{ fromJson(inputs.extras).downloadLink }}|' ./flutter/lib/mobile/pages/connection_page.dart
|
||||
sed -i -e 's|https://rustdesk.com/download|${{ fromJson(inputs.extras).downloadLink }}|' ./src/ui/index.tis
|
||||
|
||||
- name: allow custom.txt
|
||||
continue-on-error: true
|
||||
shell: bash
|
||||
run: |
|
||||
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|For faster connection, please set up your own server||' ./src/lang/en.rs
|
||||
sed -i -e '/const KEY:/,/};/d' ./src/common.rs
|
||||
sed -i -e '/let Ok(data) = sign::verify(&data, &pk)/,/};/d' ./src/common.rs
|
||||
sed -i -e '|https://admin.rustdesk.com|${{ inputs.apiServer }}|' ./src/common.rs
|
||||
# ./flutter/pubspec.yaml
|
||||
sed -i '/intl:/a \ \ archive: ^3.6.1' ./flutter/pubspec.yaml
|
||||
|
||||
@@ -241,7 +263,6 @@ jobs:
|
||||
|
||||
# https://github.com/flutter/flutter/issues/155685
|
||||
- name: Replace engine with rustdesk custom flutter engine
|
||||
if: false
|
||||
run: |
|
||||
flutter doctor -v
|
||||
flutter precache --windows
|
||||
@@ -319,7 +340,6 @@ jobs:
|
||||
mv ./res/icon.ico ./res/icon.ico.bak
|
||||
mv ./res/icon.png ./res/icon.png.bak
|
||||
mv ./res/tray-icon.ico ./res/tray-icon.ico.bak
|
||||
#echo "${{ inputs.iconbase64 }}" | base64 -d > ./res/icon.png
|
||||
|
||||
- name: magick stuff
|
||||
if: ${{ inputs.iconlink != 'false' }}
|
||||
@@ -472,20 +492,6 @@ jobs:
|
||||
name: topmostwindow-artifacts
|
||||
path: "./rustdesk"
|
||||
|
||||
- name: Upload unsigned
|
||||
if: env.UPLOAD_ARTIFACT == 'true'
|
||||
uses: actions/upload-artifact@master
|
||||
with:
|
||||
name: rustdesk-unsigned-windows-${{ matrix.job.arch }}
|
||||
path: rustdesk
|
||||
|
||||
# - name: Sign rustdesk files
|
||||
# if: env.UPLOAD_ARTIFACT == 'true' && env.SIGN_BASE_URL != ''
|
||||
# shell: bash
|
||||
# run: |
|
||||
# pip3 install requests argparse
|
||||
# BASE_URL=${{ secrets.SIGN_BASE_URL }} SECRET_KEY=${{ secrets.SIGN_SECRET_KEY }} python3 res/job.py sign_files ./rustdesk/
|
||||
|
||||
- name: Report Status
|
||||
uses: fjogeleit/http-request-action@v1
|
||||
with:
|
||||
@@ -504,22 +510,27 @@ jobs:
|
||||
continue-on-error: true
|
||||
shell: bash
|
||||
run: |
|
||||
curl -X POST -F "file=@./rustdesk/unsigned_files.zip" \
|
||||
-H "X-API-KEY: ${{ secrets.SIGN_API_KEY }}" \
|
||||
-m 900 \
|
||||
"${{ secrets.SIGN_URL }}/sign/" -o ./rustdesk/signed_files.zip
|
||||
if [ ! -z "${{ secrets.SIGN_BASE_URL }}" ] && [ ! -z "${{ secrets.SIGN_API_KEY }}" ]; then
|
||||
curl -X POST -F "file=@./rustdesk/unsigned_files.zip" \
|
||||
-H "X-API-KEY: ${{ secrets.SIGN_API_KEY }}" \
|
||||
-m 900 \
|
||||
"${{ secrets.SIGN_BASE_URL }}/sign/" -o ./rustdesk/signed_files.zip
|
||||
else
|
||||
echo "Signing skipped - signing URL or API key not configured"
|
||||
cp ./rustdesk/unsigned_files.zip ./rustdesk/signed_files.zip
|
||||
fi
|
||||
|
||||
- name: unzip dlls
|
||||
continue-on-error: true
|
||||
shell: pwsh
|
||||
run: |
|
||||
Expand-Archive -Path ./rustdesk/signed_files.zip -DestinationPath ./rustdek/ -Force
|
||||
Expand-Archive -Path ./rustdesk/signed_files.zip -DestinationPath ./rustdesk/ -Force
|
||||
|
||||
|
||||
- name: Create custom.txt file
|
||||
shell: bash
|
||||
run: |
|
||||
echo -n "${{ env.CUSTOM }}" | cat > ./rustdesk/custom.txt
|
||||
echo -n "${{ inputs.custom }}" | cat > ./rustdesk/custom.txt
|
||||
|
||||
|
||||
- name: Build self-extracted executable
|
||||
@@ -552,12 +563,6 @@ jobs:
|
||||
mv ./Package/bin/x64/Release/en-us/Package.msi ../../SignOutput/rustdesk.msi
|
||||
sha256sum ../../SignOutput/rustdesk.msi
|
||||
|
||||
# - name: Sign rustdesk self-extracted file
|
||||
# if: env.UPLOAD_ARTIFACT == 'true' && env.SIGN_BASE_URL != ''
|
||||
# shell: bash
|
||||
# run: |
|
||||
# BASE_URL=${{ secrets.SIGN_BASE_URL }} SECRET_KEY=${{ secrets.SIGN_SECRET_KEY }} python3 res/job.py sign_files ./SignOutput
|
||||
|
||||
- name: Report Status
|
||||
uses: fjogeleit/http-request-action@v1
|
||||
with:
|
||||
@@ -576,10 +581,15 @@ jobs:
|
||||
continue-on-error: true
|
||||
shell: bash
|
||||
run: |
|
||||
curl -X POST -F "file=@./SignOutput/unsigned_files.zip" \
|
||||
-H "X-API-KEY: ${{ secrets.SIGN_API_KEY }}" \
|
||||
-m 900 \
|
||||
"${{ secrets.SIGN_URL }}/sign/" -o ./SignOutput/signed_files.zip
|
||||
if [ ! -z "${{ secrets.SIGN_BASE_URL }}" ] && [ ! -z "${{ secrets.SIGN_API_KEY }}" ]; then
|
||||
curl -X POST -F "file=@./SignOutput/unsigned_files.zip" \
|
||||
-H "X-API-KEY: ${{ secrets.SIGN_API_KEY }}" \
|
||||
-m 900 \
|
||||
"${{ secrets.SIGN_BASE_URL }}/sign/" -o ./SignOutput/signed_files.zip
|
||||
else
|
||||
echo "Signing skipped - signing URL or API key not configured"
|
||||
cp ./SignOutput/unsigned_files.zip ./SignOutput/signed_files.zip
|
||||
fi
|
||||
|
||||
- name: unzip exe and msi
|
||||
continue-on-error: true
|
||||
@@ -587,27 +597,6 @@ jobs:
|
||||
run: |
|
||||
Expand-Archive -Path ./SignOutput/signed_files.zip -DestinationPath ./SignOutput/ -Force
|
||||
|
||||
# - name: Sign rustdesk self-extracted file
|
||||
# uses: GermanBluefox/code-sign-action@v7
|
||||
# if: env.UPLOAD_ARTIFACT == 'true'
|
||||
# with:
|
||||
# certificate: '${{ secrets.WINDOWS_PFX_BASE64 }}'
|
||||
# password: '${{ secrets.WINDOWS_PFX_PASSWORD }}'
|
||||
# certificatesha1: '${{ secrets.WINDOWS_PFX_SHA1_THUMBPRINT }}'
|
||||
# # certificatename: '${{ secrets.WINDOWS_PFX_NAME }}'
|
||||
# folder: './SignOutput'
|
||||
# recursive: false
|
||||
|
||||
# - name: Publish Release
|
||||
# uses: softprops/action-gh-release@v1
|
||||
# if: env.UPLOAD_ARTIFACT == 'true'
|
||||
# with:
|
||||
# prerelease: true
|
||||
# tag_name: ${{ env.TAG_NAME }}
|
||||
# files: |
|
||||
# ./SignOutput/rustdesk-*.msi
|
||||
# ./SignOutput/rustdesk-*.exe
|
||||
|
||||
- name: rename rustdesk.exe to filename.exe
|
||||
run: |
|
||||
mv ./SignOutput/rustdesk.exe "./SignOutput/${{ inputs.filename }}.exe" || echo "rustdesk"
|
||||
@@ -617,15 +606,6 @@ jobs:
|
||||
run: |
|
||||
mv ./SignOutput/rustdesk.msi "./SignOutput/${{ inputs.filename }}.msi" || echo "rustdesk"
|
||||
|
||||
# - name: Upload to FTP
|
||||
# if: ${{ fromJson(inputs.extras).rdgen == 'true' }}
|
||||
# uses: SamKirkland/FTP-Deploy-Action@v4.3.5
|
||||
# with:
|
||||
# server: ${{ secrets.GEN_FTP_SERVER }}
|
||||
# username: ${{ secrets.GEN_FTP_USER }}
|
||||
# password: ${{ secrets.GEN_FTP_PASSWORD }}
|
||||
# local-dir: ./SignOutput/
|
||||
# server-dir: /root/rdgen/exe/${{ env.UUIDFOLDER }}/
|
||||
- name: send file to rdgen server
|
||||
if: ${{ fromJson(inputs.extras).rdgen == 'true' }}
|
||||
shell: bash
|
||||
|
||||
@@ -75,12 +75,6 @@ env:
|
||||
#signing keys env variable checks
|
||||
ANDROID_SIGNING_KEY: "${{ secrets.ANDROID_SIGNING_KEY }}"
|
||||
MACOS_P12_BASE64: "${{ secrets.MACOS_P12_BASE64 }}"
|
||||
# To make a custom build with your own servers set the below secret values
|
||||
RS_PUB_KEY: "${{ inputs.key }}"
|
||||
RENDEZVOUS_SERVER: "${{ inputs.server }}"
|
||||
CUSTOM: "${{ inputs.custom }}"
|
||||
UUIDFOLDER: "${{ inputs.uuid }}"
|
||||
API_SERVER: "${{ inputs.apiServer }}"
|
||||
UPLOAD_ARTIFACT: 'true'
|
||||
SIGN_BASE_URL: "${{ secrets.SIGN_BASE_URL }}"
|
||||
ICONBASE64: "$${{ inputs.iconbase64 }}"
|
||||
@@ -488,7 +482,7 @@ jobs:
|
||||
mkdir -p ./flutter/android/app/src/main/jniLibs/arm64-v8a
|
||||
cp ${ANDROID_NDK_HOME}/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/lib/aarch64-linux-android/libc++_shared.so ./flutter/android/app/src/main/jniLibs/arm64-v8a/
|
||||
cp ./target/${{ matrix.job.target }}/release/liblibrustdesk.so ./flutter/android/app/src/main/jniLibs/arm64-v8a/librustdesk.so
|
||||
echo -n "${{ env.CUSTOM }}" | cat > ./flutter/assets/custom.txt
|
||||
echo -n "${{ inputs.custom }}" | cat > ./flutter/assets/custom.txt
|
||||
#sed -i '/^ - assets\//a\ - assets/custom.txt' ./flutter/pubspec.yaml
|
||||
if [[ "${{ inputs.iconlink }}" != "false" ]]; then
|
||||
mv ./flutter/assets/icon.svg ./flutter/assets/icon.svg.bak
|
||||
@@ -505,7 +499,7 @@ jobs:
|
||||
mkdir -p ./flutter/android/app/src/main/jniLibs/armeabi-v7a
|
||||
cp ${ANDROID_NDK_HOME}/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/lib/arm-linux-androideabi/libc++_shared.so ./flutter/android/app/src/main/jniLibs/armeabi-v7a/
|
||||
cp ./target/${{ matrix.job.target }}/release/liblibrustdesk.so ./flutter/android/app/src/main/jniLibs/armeabi-v7a/librustdesk.so
|
||||
echo -n "${{ env.CUSTOM }}" | cat > ./flutter/assets/custom.txt
|
||||
echo -n "${{ inputs.custom }}" | cat > ./flutter/assets/custom.txt
|
||||
#sed -i '/^ - assets\//a\ - assets/custom.txt' ./flutter/pubspec.yaml
|
||||
if [[ "${{ inputs.iconlink }}" != "false" ]]; then
|
||||
mv ./flutter/assets/icon.svg ./flutter/assets/icon.svg.bak
|
||||
@@ -522,7 +516,7 @@ jobs:
|
||||
mkdir -p ./flutter/android/app/src/main/jniLibs/x86_64
|
||||
cp ${ANDROID_NDK_HOME}/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/lib/x86_64-linux-android/libc++_shared.so ./flutter/android/app/src/main/jniLibs/x86_64/
|
||||
cp ./target/${{ matrix.job.target }}/release/liblibrustdesk.so ./flutter/android/app/src/main/jniLibs/x86_64/librustdesk.so
|
||||
echo -n "${{ env.CUSTOM }}" | cat > ./flutter/assets/custom.txt
|
||||
echo -n "${{ inputs.custom }}" | cat > ./flutter/assets/custom.txt
|
||||
#sed -i '/^ - assets\//a\ - assets/custom.txt' ./flutter/pubspec.yaml
|
||||
if [[ "${{ inputs.iconlink }}" != "false" ]]; then
|
||||
mv ./flutter/assets/icon.svg ./flutter/assets/icon.svg.bak
|
||||
@@ -539,7 +533,7 @@ jobs:
|
||||
mkdir -p ./flutter/android/app/src/main/jniLibs/x86
|
||||
cp ${ANDROID_NDK_HOME}/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/lib/i686-linux-android/libc++_shared.so ./flutter/android/app/src/main/jniLibs/x86/
|
||||
cp ./target/${{ matrix.job.target }}/release/liblibrustdesk.so ./flutter/android/app/src/main/jniLibs/x86/librustdesk.so
|
||||
echo -n "${{ env.CUSTOM }}" | cat > ./flutter/assets/custom.txt
|
||||
echo -n "${{ inputs.custom }}" | cat > ./flutter/assets/custom.txt
|
||||
#sed -i '/^ - assets\//a\ - assets/custom.txt' ./flutter/pubspec.yaml
|
||||
if [[ "${{ inputs.iconlink }}" != "false" ]]; then
|
||||
mv ./flutter/assets/icon.svg ./flutter/assets/icon.svg.bak
|
||||
|
||||
@@ -76,11 +76,6 @@ env:
|
||||
ANDROID_SIGNING_KEY: "${{ secrets.ANDROID_SIGNING_KEY }}"
|
||||
MACOS_P12_BASE64: "${{ secrets.MACOS_P12_BASE64 }}"
|
||||
# To make a custom build with your own servers set the below secret values
|
||||
RS_PUB_KEY: "${{ inputs.key }}"
|
||||
RENDEZVOUS_SERVER: "${{ inputs.server }}"
|
||||
CUSTOM: "${{ inputs.custom }}"
|
||||
UUIDFOLDER: "${{ inputs.uuid }}"
|
||||
API_SERVER: "${{ inputs.apiServer }}"
|
||||
UPLOAD_ARTIFACT: 'true'
|
||||
SIGN_BASE_URL: "${{ secrets.SIGN_BASE_URL }}"
|
||||
ICONBASE64: "$${{ inputs.iconbase64 }}"
|
||||
@@ -250,7 +245,6 @@ jobs:
|
||||
mv ./res/icon.ico ./res/icon.ico.bak
|
||||
mv ./res/icon.png ./res/icon.png.bak
|
||||
mv ./res/tray-icon.ico ./res/tray-icon.ico.bak
|
||||
#echo "${{ inputs.iconbase64 }}" | base64 -d > ./res/icon.png
|
||||
wget -O ./res/icon.png ${{ fromJson(inputs.iconlink).url }}/get_png?filename=${{ fromJson(inputs.iconlink).file }}"&"uuid=${{ fromJson(inputs.iconlink).uuid }}
|
||||
mv ./res/32x32.png ./res/32x32.png.bak
|
||||
mv ./res/64x64.png ./res/64x64.png.bak
|
||||
@@ -288,12 +282,12 @@ jobs:
|
||||
continue-on-error: true
|
||||
shell: bash
|
||||
run: |
|
||||
sed -i -e 's|rs-ny.rustdesk.com|${{ env.RENDEZVOUS_SERVER }}|' ./libs/hbb_common/src/config.rs
|
||||
sed -i -e 's|OeVuKk5nlHiXp+APNn0Y3pC1Iwpwn44JGqrQCsWqmBw=|${{ env.RS_PUB_KEY }}|' ./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|For faster connection, please set up your own server||' ./src/lang/en.rs
|
||||
sed -i -e '/const KEY:/,/};/d' ./src/common.rs
|
||||
sed -i -e '/let Ok(data) = sign::verify(&data, &pk)/,/};/d' ./src/common.rs
|
||||
echo -n "${{ env.CUSTOM }}" | cat > ./custom.txt
|
||||
echo -n "${{ inputs.custom }}" | cat > ./custom.txt
|
||||
sed -i '/intl:/a \ \ archive: ^3.6.1' ./flutter/pubspec.yaml
|
||||
|
||||
- name: change url to custom
|
||||
@@ -527,7 +521,6 @@ jobs:
|
||||
mkdir -p flutter/tmpdeb/usr/lib/rustdesk
|
||||
cp ./custom.txt ./flutter/tmpdeb/usr/lib/rustdesk/custom.txt
|
||||
if [[ "${{ inputs.logolink }}" != "false" ]]; then
|
||||
#echo "${{ inputs.logobase64 }}" | base64 -d > ./flutter/assets/logo.png
|
||||
wget -O ./flutter/assets/logo.png ${{ fromJson(inputs.logolink).url }}/get_png?filename=${{ fromJson(inputs.logolink).file }}"&"uuid=${{ fromJson(inputs.logolink).uuid }}
|
||||
fi
|
||||
if [[ "${{ inputs.iconlink }}" != "false" ]]; then
|
||||
|
||||
@@ -76,12 +76,6 @@ env:
|
||||
#signing keys env variable checks
|
||||
ANDROID_SIGNING_KEY: "${{ secrets.ANDROID_SIGNING_KEY }}"
|
||||
MACOS_P12_BASE64: "${{ secrets.MACOS_P12_BASE64 }}"
|
||||
# To make a custom build with your own servers set the below secret values
|
||||
RS_PUB_KEY: "${{ inputs.key }}"
|
||||
RENDEZVOUS_SERVER: "${{ inputs.server }}"
|
||||
CUSTOM: "${{ inputs.custom }}"
|
||||
UUIDFOLDER: "${{ inputs.uuid }}"
|
||||
API_SERVER: "${{ inputs.apiServer }}"
|
||||
UPLOAD_ARTIFACT: 'true'
|
||||
SIGN_BASE_URL: "${{ secrets.SIGN_BASE_URL }}"
|
||||
STATUS_URL: "${{ secrets.GENURL }}/updategh"
|
||||
@@ -212,6 +206,9 @@ jobs:
|
||||
continue-on-error: true
|
||||
shell: bash
|
||||
run: |
|
||||
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|For faster connection, please set up your own server||' ./src/lang/en.rs
|
||||
sed -i -e '/const KEY:/,/};/d' ./src/common.rs
|
||||
sed -i -e '/let Ok(data) = sign::verify(&data, &pk)/,/};/d' ./src/common.rs
|
||||
# ./flutter/pubspec.yaml
|
||||
@@ -317,7 +314,6 @@ jobs:
|
||||
mv ./res/icon.ico ./res/icon.ico.bak
|
||||
mv ./res/icon.png ./res/icon.png.bak
|
||||
mv ./res/tray-icon.ico ./res/tray-icon.ico.bak
|
||||
#echo "${{ inputs.iconbase64 }}" | base64 -d > ./res/icon.png
|
||||
|
||||
- name: magick stuff
|
||||
if: ${{ inputs.iconlink != 'false' }}
|
||||
@@ -502,22 +498,27 @@ jobs:
|
||||
continue-on-error: true
|
||||
shell: bash
|
||||
run: |
|
||||
curl -X POST -F "file=@./rustdesk/unsigned_files.zip" \
|
||||
-H "X-API-KEY: ${{ secrets.SIGN_API_KEY }}" \
|
||||
-m 900 \
|
||||
"${{ secrets.SIGN_URL }}/sign/" -o ./rustdesk/signed_files.zip
|
||||
if [ ! -z "${{ secrets.SIGN_BASE_URL }}" ] && [ ! -z "${{ secrets.SIGN_API_KEY }}" ]; then
|
||||
curl -X POST -F "file=@./rustdesk/unsigned_files.zip" \
|
||||
-H "X-API-KEY: ${{ secrets.SIGN_API_KEY }}" \
|
||||
-m 900 \
|
||||
"${{ secrets.SIGN_BASE_URL }}/sign/" -o ./rustdesk/signed_files.zip
|
||||
else
|
||||
echo "Signing skipped - signing URL or API key not configured"
|
||||
cp ./rustdesk/unsigned_files.zip ./rustdesk/signed_files.zip
|
||||
fi
|
||||
|
||||
- name: unzip dlls
|
||||
continue-on-error: true
|
||||
shell: pwsh
|
||||
run: |
|
||||
Expand-Archive -Path ./rustdesk/signed_files.zip -DestinationPath ./rustdek/ -Force
|
||||
Expand-Archive -Path ./rustdesk/signed_files.zip -DestinationPath ./rustdesk/ -Force
|
||||
|
||||
|
||||
- name: Create custom.txt file
|
||||
shell: bash
|
||||
run: |
|
||||
echo -n "${{ env.CUSTOM }}" | cat > ./rustdesk/custom.txt
|
||||
echo -n "${{ inputs.custom }}" | cat > ./rustdesk/custom.txt
|
||||
|
||||
|
||||
- name: Build self-extracted executable
|
||||
@@ -574,10 +575,15 @@ jobs:
|
||||
continue-on-error: true
|
||||
shell: bash
|
||||
run: |
|
||||
curl -X POST -F "file=@./SignOutput/unsigned_files.zip" \
|
||||
-H "X-API-KEY: ${{ secrets.SIGN_API_KEY }}" \
|
||||
-m 900 \
|
||||
"${{ secrets.SIGN_URL }}/sign/" -o ./SignOutput/signed_files.zip
|
||||
if [ ! -z "${{ secrets.SIGN_BASE_URL }}" ] && [ ! -z "${{ secrets.SIGN_API_KEY }}" ]; then
|
||||
curl -X POST -F "file=@./SignOutput/unsigned_files.zip" \
|
||||
-H "X-API-KEY: ${{ secrets.SIGN_API_KEY }}" \
|
||||
-m 900 \
|
||||
"${{ secrets.SIGN_BASE_URL }}/sign/" -o ./SignOutput/signed_files.zip
|
||||
else
|
||||
echo "Signing skipped - signing URL or API key not configured"
|
||||
cp ./SignOutput/unsigned_files.zip ./SignOutput/signed_files.zip
|
||||
fi
|
||||
|
||||
- name: unzip exe and msi
|
||||
continue-on-error: true
|
||||
|
||||
+31
-2
@@ -1,9 +1,10 @@
|
||||
from django import forms
|
||||
from PIL import Image
|
||||
|
||||
class GenerateForm(forms.Form):
|
||||
#Platform
|
||||
platform = forms.ChoiceField(choices=[('windows','Windows'),('linux','Linux (currently unavailable)'),('android','Android'),('macos','macOS')], initial='windows')
|
||||
version = forms.ChoiceField(choices=[('master','nightly'),('1.3.7','1.3.7'),('1.3.6','1.3.6'),('1.3.5','1.3.5'),('1.3.4','1.3.4'),('1.3.3','1.3.3')], initial='1.3.7')
|
||||
version = forms.ChoiceField(choices=[('1.3.8','nightly'),('1.3.7','1.3.7'),('1.3.6','1.3.6'),('1.3.5','1.3.5'),('1.3.4','1.3.4'),('1.3.3','1.3.3')], initial='1.3.7')
|
||||
delayFix = forms.BooleanField(initial=True, required=False)
|
||||
|
||||
#General
|
||||
@@ -28,10 +29,14 @@ class GenerateForm(forms.Form):
|
||||
apiServer = forms.CharField(label="API Server", required=False)
|
||||
key = forms.CharField(label="Key", required=False)
|
||||
urlLink = forms.CharField(label="Custom URL for links", required=False)
|
||||
downloadLink = forms.CharField(label="Custom URL for downloading new versions", required=False)
|
||||
compname = forms.CharField(label="Company name",required=False)
|
||||
|
||||
#Visual
|
||||
iconfile = forms.FileField(label="Custom App Icon (in .png format)", required=False, widget=forms.FileInput(attrs={'accept': 'image/png'}))
|
||||
logofile = forms.FileField(label="Custom App Logo (in .png format)", required=False, widget=forms.FileInput(attrs={'accept': 'image/png'}))
|
||||
iconbase64 = forms.CharField(required=False)
|
||||
logobase64 = forms.CharField(required=False)
|
||||
theme = forms.ChoiceField(choices=[
|
||||
('light', 'Light'),
|
||||
('dark', 'Dark'),
|
||||
@@ -72,4 +77,28 @@ class GenerateForm(forms.Form):
|
||||
xOffline = forms.BooleanField(initial=False, required=False)
|
||||
hidecm = forms.BooleanField(initial=False, required=False)
|
||||
statussort = forms.BooleanField(initial=False, required=False)
|
||||
removeNewVersionNotif = forms.BooleanField(initial=False, required=False)
|
||||
removeNewVersionNotif = forms.BooleanField(initial=False, required=False)
|
||||
|
||||
def clean_iconfile(self):
|
||||
print("checking icon")
|
||||
image = self.cleaned_data['iconfile']
|
||||
try:
|
||||
# Open the image using Pillow
|
||||
img = Image.open(image)
|
||||
|
||||
# Check if the image is a PNG (optional, but good practice)
|
||||
if img.format != 'PNG':
|
||||
raise forms.ValidationError("Only PNG images are allowed.")
|
||||
|
||||
# Get image dimensions
|
||||
width, height = img.size
|
||||
|
||||
# Check for square dimensions
|
||||
if width != height:
|
||||
raise forms.ValidationError("Custom App Icon dimensions must be square.")
|
||||
|
||||
return image
|
||||
except OSError: # Handle cases where the uploaded file is not a valid image
|
||||
raise forms.ValidationError("Invalid icon file.")
|
||||
except Exception as e: # Catch any other image processing errors
|
||||
raise forms.ValidationError(f"Error processing icon: {e}")
|
||||
@@ -133,6 +133,7 @@
|
||||
<a href='/download?filename={{filename}}.deb&uuid={{uuid}}' class="download-link">Download {{filename}}.deb</a>
|
||||
<a href='/download?filename={{filename}}.rpm&uuid={{uuid}}' class="download-link">Download {{filename}}.rpm</a>
|
||||
<a href='/download?filename={{filename}}-suse.rpm&uuid={{uuid}}' class="download-link">Download {{filename}}-suse.rpm</a>
|
||||
<a href='/download?filename={{filename}}.pkg.tar.zst&uuid={{uuid}}' class="download-link">Download {{filename}}.pkg.tar.zst</a>
|
||||
{% elif platform == 'android' %}
|
||||
<a href='/download?filename={{filename}}-aarch64.apk&uuid={{uuid}}' class="download-link">Download {{filename}}-aarch64.apk</a>
|
||||
<a href='/download?filename={{filename}}-x86_64.apk&uuid={{uuid}}' class="download-link">Download {{filename}}-x86_64.apk</a>
|
||||
|
||||
@@ -106,11 +106,58 @@
|
||||
max-height: 100px;
|
||||
margin-top: 10px;
|
||||
}
|
||||
.save-load-section-container { /* New container for fixed positioning */
|
||||
position: fixed;
|
||||
top: 20px; /* Adjust as needed */
|
||||
left: 20px; /* Adjust as needed */
|
||||
background-color: #111; /* Match your section background */
|
||||
padding: 0px;
|
||||
border-radius: 8px;
|
||||
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
|
||||
z-index: 100; /* Ensure it's above other content */
|
||||
}
|
||||
.save-load-section {
|
||||
display: none; /* Initially hidden */
|
||||
}
|
||||
.error {
|
||||
color: red;
|
||||
}
|
||||
.errorlist {
|
||||
color: red;
|
||||
display: flex; /* Enable flexbox for centering */
|
||||
justify-content: center; /* Center horizontally */
|
||||
align-items: center; /* Center vertically (if needed) */
|
||||
list-style: none; /* Remove bullet points if it's a list */
|
||||
padding: 0; /* Remove default padding */
|
||||
margin: 10px auto; /* Center the list itself, add some top/bottom margin */
|
||||
width: fit-content; /* Make the width fit the content */
|
||||
}
|
||||
|
||||
.errorlist li {
|
||||
margin: 5px; /* Add some spacing between list items */
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<h1><i class="fas fa-cogs"></i> RustDesk Custom Client Builder</h1>
|
||||
<form action="/generator" method="post" enctype="multipart/form-data">
|
||||
<form id="myForm" action="/generator" method="post" enctype="multipart/form-data">
|
||||
<div class="save-load-section-container">
|
||||
<div class="section">
|
||||
<h2 id="saveLoadTitle">Save/Load Configuration <i class="fas fa-chevron-down"></i></h2>
|
||||
<div class="save-load-section">
|
||||
<button type="button" onclick="saveFormData()">Save Configuration</button>
|
||||
<input type="file" id="fileInput" style="display:none;" accept=".json">
|
||||
<button type="button" onclick="loadFormData()">Load Configuration</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% if form.iconfile.errors %}
|
||||
<ul class="errorlist">
|
||||
{% for error in form.iconfile.errors %}
|
||||
<li>{{ error }}</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
{% endif %}
|
||||
<div class="platform">
|
||||
<h2><i class="fas fa-desktop"></i> Select Platform</h2>
|
||||
<div class="platform-icons">
|
||||
@@ -134,7 +181,7 @@
|
||||
<div class="section">
|
||||
<h2><i class="fas fa-sliders-h"></i> General</h2>
|
||||
<label for="{{ form.exename.id_for_label }}">Name of the configuration (no spaces or special characters, English characters only):</label>
|
||||
{{ form.exename }}<br><br>
|
||||
{{ form.exename }}<span id="filenameError" class="error"></span><br><br>
|
||||
<label for="{{ form.appname.id_for_label }}">Custom Application Name (leave blank to use default):</label>
|
||||
{{ form.appname }}<br><br>
|
||||
<label for="{{ form.direction.id_for_label }}">Connection Type:</label>
|
||||
@@ -155,6 +202,10 @@
|
||||
{{ form.apiServer }}<br><br>
|
||||
<label for="{{ form.urlLink.id_for_label }}">Custom URL for links (replaces https://rustdesk.com):</label>
|
||||
{{ form.urlLink }}<br><br>
|
||||
<label for="{{ form.downloadLink.id_for_label }}">Custom URL for downloading updates (replaces https://rustdesk.com/download):</label>
|
||||
{{ form.downloadLink }}<br><br>
|
||||
<label for="{{ form.compname.id_for_label }}">Company name for copyright (replaces Purslane Ltd):</label>
|
||||
{{ form.compname }}<br><br>
|
||||
</div>
|
||||
</div>
|
||||
<div class="container">
|
||||
@@ -177,6 +228,8 @@
|
||||
|
||||
<div class="section">
|
||||
<h2><i class="fas fa-paint-brush"></i> Visual</h2>
|
||||
{{ form.iconbase64.as_hidden }}
|
||||
{{ form.logobase64.as_hidden }}
|
||||
<label for="{{ form.iconfile.id_for_label }}">Custom App Icon (in .png format)</label>
|
||||
{{ form.iconfile }}<br><br>
|
||||
<!-- <input type="file" name="iconfile" id="iconfile" accept="image/png"> -->
|
||||
@@ -260,6 +313,151 @@
|
||||
reader.readAsDataURL(input.files[0]);
|
||||
}
|
||||
}
|
||||
const saveLoadTitle = document.getElementById("saveLoadTitle");
|
||||
const saveLoadSection = document.querySelector(".save-load-section");
|
||||
|
||||
saveLoadTitle.addEventListener("click", () => {
|
||||
if (!saveLoadSection.style.display || saveLoadSection.style.display === "none") {
|
||||
saveLoadSection.style.display = "block";
|
||||
} else {
|
||||
saveLoadSection.style.display = "none";
|
||||
}
|
||||
|
||||
const icon = saveLoadTitle.querySelector("i");
|
||||
icon.classList.toggle("fa-chevron-down");
|
||||
icon.classList.toggle("fa-chevron-up");
|
||||
});
|
||||
|
||||
async function saveFormData() {
|
||||
const filename = document.getElementById("{{ form.exename.id_for_label }}").value;
|
||||
if (!filename) {
|
||||
document.getElementById("filenameError").textContent = "Filename is required.";
|
||||
return;
|
||||
} else {
|
||||
document.getElementById("filenameError").textContent = "";
|
||||
}
|
||||
|
||||
const formData = {};
|
||||
const form = document.getElementById("myForm"); // Get the form element
|
||||
|
||||
// 1. Use FormData for robust data collection (handles most input types):
|
||||
const formDataObj = new FormData(form); // Create a FormData object
|
||||
|
||||
formDataObj.forEach((value, key) => {
|
||||
formData[key] = value; // Add each key/value pair to the formData object.
|
||||
});
|
||||
|
||||
// 2. Handle select elements separately (more reliable):
|
||||
const selectElements = form.querySelectorAll('select');
|
||||
selectElements.forEach(select => {
|
||||
formData[select.name] = select.value;
|
||||
});
|
||||
|
||||
// 3. Handle checkboxes and radio buttons (important!):
|
||||
const checkboxRadioElements = form.querySelectorAll('input[type="checkbox"], input[type="radio"]');
|
||||
checkboxRadioElements.forEach(input => {
|
||||
if (input.name) { //only add to form data if it has a name
|
||||
if (input.checked) {
|
||||
formData[input.name] = input.value;
|
||||
} else if (!formData.hasOwnProperty(input.name) && input.type === 'checkbox') { //if it's a checkbox and it's not checked, add it as false
|
||||
formData[input.name] = false;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
// 4. Handle icon and logo
|
||||
const iconPreview = document.getElementById('icon-preview');
|
||||
if (iconPreview.firstChild && iconPreview.firstChild.src.startsWith('data:image/png;base64')) {
|
||||
formData.iconfile = iconPreview.firstChild.src; // Use existing base64
|
||||
} else { //if it's a file upload
|
||||
const iconFile = document.getElementById("{{ form.iconfile.id_for_label }}").files[0];
|
||||
if (iconFile) {
|
||||
formData.iconfile = await readFileAsBase64(iconFile);
|
||||
}
|
||||
}
|
||||
|
||||
const logoPreview = document.getElementById('logo-preview');
|
||||
if (logoPreview.firstChild && logoPreview.firstChild.src.startsWith('data:image/png;base64')) {
|
||||
formData.logofile = logoPreview.firstChild.src; // Use existing base64
|
||||
} else { //if it's a file upload
|
||||
const logoFile = document.getElementById("{{ form.logofile.id_for_label }}").files[0];
|
||||
if (logoFile) {
|
||||
formData.logofile = await readFileAsBase64(logoFile);
|
||||
}
|
||||
}
|
||||
|
||||
const jsonData = JSON.stringify(formData, null, 2);
|
||||
const blob = new Blob([jsonData], { type: "application/json" });
|
||||
const url = URL.createObjectURL(blob);
|
||||
|
||||
const a = document.createElement("a");
|
||||
a.href = url;
|
||||
a.download = filename + ".json";
|
||||
document.body.appendChild(a);
|
||||
a.click();
|
||||
document.body.removeChild(a);
|
||||
URL.revokeObjectURL(url);
|
||||
}
|
||||
|
||||
async function readFileAsBase64(file) {
|
||||
return new Promise((resolve, reject) => {
|
||||
const reader = new FileReader();
|
||||
reader.onload = (event) => resolve(event.target.result);
|
||||
reader.onerror = (error) => reject(error);
|
||||
reader.readAsDataURL(file);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
function loadFormData() {
|
||||
const fileInput = document.getElementById("fileInput");
|
||||
fileInput.click();
|
||||
|
||||
fileInput.addEventListener("change", (event) => {
|
||||
const file = event.target.files[0];
|
||||
if (file) {
|
||||
const reader = new FileReader();
|
||||
reader.onload = (e) => {
|
||||
try {
|
||||
const formData = JSON.parse(e.target.result);
|
||||
for (const key in formData) {
|
||||
// More robust selector: checks for name OR id
|
||||
const elements = document.querySelectorAll(`[name="${key}"], [id="${key}"]`);
|
||||
|
||||
if (elements.length > 0) { // Check if any element(s) exist
|
||||
elements.forEach(element => { // Loop through all matching elements (important for radios)
|
||||
if (element.type === 'radio') {
|
||||
if (element.value === String(formData[key])) { // Compare value, crucial for radios
|
||||
element.checked = true;
|
||||
} else {
|
||||
element.checked = false; // Uncheck others in the group
|
||||
}
|
||||
} else if (element.type === 'checkbox') {
|
||||
element.checked = formData[key];
|
||||
} else if (element.type !== 'file') {
|
||||
element.value = formData[key];
|
||||
}
|
||||
|
||||
// Handle image previews (as before)
|
||||
if (key === 'iconfile' && formData[key]) {
|
||||
document.getElementById('id_iconbase64').value = formData[key];
|
||||
document.getElementById('icon-preview').innerHTML = `<img src="${formData[key]}" style="max-width: 300px; max-height: 60px;">`;
|
||||
}
|
||||
if (key === 'logofile' && formData[key]) {
|
||||
document.getElementById('id_logobase64').value = formData[key];
|
||||
document.getElementById('logo-preview').innerHTML = `<img src="${formData[key]}" style="max-width: 300px; max-height: 60px;">`;
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
} catch (error) {
|
||||
alert("Error loading data. Invalid JSON file.");
|
||||
}
|
||||
};
|
||||
reader.readAsText(file);
|
||||
}
|
||||
});
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
+32
-8
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user