99 Commits

Author SHA1 Message Date
Bryan Gerlach
f0943ddf1a privacy screen 2026-01-23 22:11:58 -06:00
Bryan Gerlach
55317863c0 privacy screen 2026-01-23 22:08:48 -06:00
Bryan Gerlach
b9fdac7d8c privacy screen 2026-01-23 22:04:10 -06:00
Bryan Gerlach
adc69d499a privacy screen 2026-01-23 21:56:39 -06:00
Bryan Gerlach
dd5291c9ba fix license on msi 2026-01-20 09:40:05 -06:00
Bryan Gerlach
f9901f2f74 allow retry on connection loss 2026-01-13 13:15:44 -06:00
Bryan Gerlach
27b52d80e9 fix linux 2026-01-13 07:11:56 -06:00
Bryan Gerlach
9c471075e3 fix win32 2026-01-13 07:06:27 -06:00
Bryan Gerlach
e06ef09d75 fix delete zip issue 2026-01-12 19:05:25 -06:00
Bryan Gerlach
cbe2b4e60f fix delete zip issue 2026-01-12 18:55:30 -06:00
Bryan
3c312dad7b Hide inputs from action logs 2026-01-12 17:31:05 -06:00
Bryan Gerlach
1650994efa 1.4.5 2026-01-09 23:02:42 -06:00
Bryan Gerlach
c74dd0a2e4 .. 2026-01-08 15:57:04 -06:00
Bryan Gerlach
5fb84b739c fix android app id 2026-01-07 08:27:01 -06:00
Bryan Gerlach
278234dd08 icon stuff 2026-01-06 16:13:15 -06:00
Bryan Gerlach
54ff4d8c8b allow custom android application id 2026-01-06 16:02:53 -06:00
Bryan Gerlach
ceaf44f71d testing print driver with custom_.txt 2025-12-10 16:35:30 -06:00
Bryan Gerlach
1287e7e5df replace sed with perl to fix stalling on large base64 strings 2025-12-02 16:55:26 -06:00
Bryan Gerlach
d6d6165c4b remove printer driver for now 2025-11-25 10:28:01 -06:00
Bryan Gerlach
b133ba0d66 .. 2025-11-23 14:18:20 -06:00
Bryan Gerlach
47da6243dd .. 2025-11-23 14:16:52 -06:00
Bryan Gerlach
661f39543c . 2025-11-21 21:49:17 -06:00
Bryan Gerlach
f72d9be70c change permissions on custom.txt 2025-11-20 19:58:20 -06:00
Bryan Gerlach
88dca7235b change permissions on custom.txt 2025-11-20 19:54:44 -06:00
Bryan Gerlach
05906539d7 change permissions on custom.txt 2025-11-20 17:06:49 -06:00
Bryan Gerlach
851d8e9771 1.4.4 2025-11-20 16:22:12 -06:00
Bryan Gerlach
e4420c24c8 1.4.4 2025-11-20 15:33:33 -06:00
Bryan Gerlach
fae826ef53 1.4.4 2025-11-20 13:04:05 -06:00
Bryan Gerlach
5052bec676 remove run as admin option 2025-11-19 11:24:35 -06:00
Bryan Gerlach
e46d0bd0ef 1.4.3 2025-10-19 16:45:17 -05:00
Bryan
67e2bc7df9 Merge pull request #137 from Maxetto/patch-1
Fix Windows 64 and 32 Bit both active at same time
2025-10-06 16:16:22 -05:00
Maxetto
2e229d0800 Fix Windows 64 and 32 Bit both active at same time 2025-09-29 17:51:23 +02:00
Bryan Gerlach
89ee4822dd add icon for 32 bit windows 2025-09-25 13:16:11 -05:00
Bryan Gerlach
c429836057 add icon for 32 bit windows 2025-09-25 13:12:22 -05:00
Bryan Gerlach
6f1bb528bd add settings for camera,terminal, and printer 2025-09-25 13:02:58 -05:00
Bryan
13114d0bc3 Merge pull request #128 from Maxetto/website-changes
Proposal for Website changes
2025-09-25 12:49:32 -05:00
Bryan
56c4d9f0b7 Merge branch 'master' into website-changes 2025-09-25 12:49:24 -05:00
Bryan
6c7c1ed3e7 Merge pull request #127 from Maxetto/x86-build
Create X86 Windows Generator
2025-09-25 12:45:47 -05:00
Bryan
abbf4d899b Merge pull request #126 from Maxetto/generator-fixes
Generator fixes
2025-09-25 12:45:21 -05:00
Bryan
3e22a34906 Merge branch 'master' into generator-fixes 2025-09-25 12:45:02 -05:00
Bryan Gerlach
b4ec36c59a v1.4.2 2025-09-18 21:31:40 -05:00
Bryan Gerlach
7d578df4c2 v1.4.2 2025-09-18 20:57:26 -05:00
Maxetto
3169440af6 Revert moving Setup Server Tip block 2025-09-08 17:23:16 +02:00
Maxetto
12b5fe1e30 Update Waiting Page 2025-09-05 12:17:13 +02:00
Maxetto
23e91a5ea7 Update Generator Page 2025-09-05 12:16:40 +02:00
Maxetto
be47bcbe46 Update Generated page 2025-09-05 12:14:05 +02:00
Maxetto
668998e390 Update Views 2025-09-05 12:12:48 +02:00
Maxetto
fabbc91fae Add x86 in Forms 2025-09-05 12:08:32 +02:00
Maxetto
50082d5566 Create X86 Windows Generator 2025-09-05 11:56:19 +02:00
Maxetto
ac3d60cae1 Fix Hide CM and Remove Wallpaper options 2025-09-05 11:49:16 +02:00
Maxetto
6755dc1fa0 Remove Hide CM patch and move around things 2025-09-05 11:36:21 +02:00
Bryan Gerlach
c53548dcce linux appimage 2025-07-28 15:11:58 -05:00
Bryan Gerlach
e36790addc v1.4.1 2025-07-24 10:39:18 -05:00
Bryan Gerlach
94f1560196 v1.4.1 2025-07-24 10:38:20 -05:00
Bryan Gerlach
6ac5f4b283 . 2025-06-17 07:59:47 -05:00
Bryan Gerlach
606a5ee956 . 2025-06-17 07:51:55 -05:00
Bryan Gerlach
2548477390 fix code changes 2025-06-06 11:59:30 -05:00
Bryan Gerlach
885523e2f9 1.4.0 2025-05-11 14:57:46 -05:00
Bryan Gerlach
253749df21 macos 2025-05-01 16:45:34 -05:00
Bryan Gerlach
050f4b3130 fix the & symbol in company name 2025-04-30 07:06:07 -05:00
Bryan Gerlach
cc59f1d58d macos stuff 2025-04-19 00:57:00 -05:00
Bryan Gerlach
a56f965344 macos stuff 2025-04-19 00:04:05 -05:00
Bryan Gerlach
a45bc0acdd macos stuff 2025-04-18 20:58:18 -05:00
Bryan
5ea49e7a00 Merge pull request #72 from MLPCR/master
Continue on Update status timeout & Fix missed rustdesk.com to custom url text on android client
2025-04-18 20:57:59 -05:00
MLPCR
131ec1759d Merge branch 'bryangerlach:master' into master 2025-04-18 18:37:48 +00:00
MLPCR
bcef3a4026 Update generator-android.yml
Correct missed website link on android settings page
2025-04-18 15:34:28 +00:00
Bryan Gerlach
0240a905f9 fix macos 2025-04-18 10:04:35 -05:00
Bryan Gerlach
8577a25657 fix macos 2025-04-18 09:53:00 -05:00
Bryan Gerlach
465a9d3554 fix macos 2025-04-18 09:41:49 -05:00
MLPCR
f0f67f5be1 Update generator-linux.yml
Continue on error when update status timesout
2025-04-17 22:55:28 +00:00
MLPCR
2c1a5f93b5 Update generator-android.yml
Continue on error when update status timeout
2025-04-17 22:19:35 +00:00
MLPCR
55c41599be Update generator-windows.yml
Continue on Error or timeout of update status
2025-04-17 21:02:55 +00:00
Bryan Gerlach
9f23f1c94a fix linux deploy for api server 2025-04-17 08:35:42 -05:00
Bryan Gerlach
7479fbbd8f flatpak,appimage 2025-04-16 21:35:52 -05:00
Bryan Gerlach
c0ede165ab flatpak,appimage 2025-04-16 20:38:56 -05:00
Bryan Gerlach
78ec60d272 flatpak,appimage 2025-04-16 19:50:07 -05:00
Bryan Gerlach
807f26360e flatpak,appimage 2025-04-16 18:16:15 -05:00
Bryan Gerlach
bad75caf0b flatpak,appimage 2025-04-16 17:38:56 -05:00
Bryan Gerlach
b76e34aa1c delete artifact 2025-04-16 16:57:19 -05:00
Bryan Gerlach
e3c41ee258 flatpak & appimage 2025-04-16 16:52:45 -05:00
Bryan Gerlach
c76a63d269 flatpak & appimage 2025-04-16 16:42:42 -05:00
Bryan
88918cde01 Merge pull request #65 from Draakoor/master
Update generator-linux.yml
2025-04-15 21:17:12 -05:00
Dominik
6725aa21b0 Update generator-linux.yml 2025-04-16 03:29:04 +02:00
Bryan Gerlach
1978be9edf build web github action 2025-04-15 17:41:58 -05:00
Bryan Gerlach
4edff33ebd build web github action 2025-04-15 17:14:38 -05:00
Bryan Gerlach
49fd150fe5 build web github action 2025-04-15 17:02:06 -05:00
Bryan Gerlach
c8c1fac268 build web github action 2025-04-15 16:59:28 -05:00
Bryan Gerlach
a91d66007d build web github action 2025-04-15 16:58:08 -05:00
Bryan Gerlach
ca1aa3fcc5 max memory size 2025-04-14 21:42:26 -05:00
Bryan Gerlach
409ed5cfa3 debug false 2025-04-14 21:38:36 -05:00
Bryan Gerlach
2ca25d3a39 hidecm 2025-04-14 11:05:13 -05:00
Bryan Gerlach
0e975e73db docker 2025-04-14 08:09:13 -05:00
Bryan Gerlach
62ac82ec2e debug 2025-04-14 08:05:22 -05:00
Bryan Gerlach
fc239ef7b5 hidecm, layout changes 2025-04-14 06:49:25 -05:00
Bryan Gerlach
71eb691a52 hidecm, layout changes 2025-04-14 06:45:11 -05:00
Bryan Gerlach
256d647f04 fix direct-ip setting 2025-04-13 13:32:44 -05:00
Bryan Gerlach
7644222adf fix windows registry for appname with spaces? 2025-04-09 23:52:01 -05:00
Bryan Gerlach
fdfebbb01a fix windows registry for appname with spaces? 2025-04-09 22:01:01 -05:00
Bryan Gerlach
cd1915a4bf remove the calls to api.rustdesk.com when checking for updates 2025-04-08 16:27:45 -05:00
21 changed files with 2213 additions and 691 deletions

63
.github/patches/allowCustom.py vendored Normal file
View File

@@ -0,0 +1,63 @@
import os
import shutil
def remove_line_block(filepath, start_phrase, lines_to_remove_after_start):
"""
Removes a starting line and a fixed number of lines immediately following it.
:param filepath: The path to the file to modify.
:param start_phrase: The unique string to identify the first line of the block.
:param lines_to_remove_after_start: The number of lines to remove after the starting line.
"""
# 1. Configuration for the removal logic
# The starting line is: const KEY: &str = "5Qbwsde3unUcJBtrx9ZkvUmwFNoExHzpryHuPUdqlWM=";
# The block contains this line plus 8 following lines, so we want to skip 9 lines in total.
total_lines_to_skip = 1 + lines_to_remove_after_start # 1 (start line) + 8 (following lines) = 9
lines_to_keep = []
skip_count = 0
# 2. Read and filter the file content
try:
with open(filepath, 'r') as file:
for line in file:
# If we are currently in the process of skipping lines, decrement the counter and continue
if skip_count > 0:
skip_count -= 1
continue
# Check if the line matches the start phrase (we use .strip() to ignore indentation/whitespace)
if line.strip().startswith(start_phrase.strip()):
# Start skipping the block (including the current line)
skip_count = total_lines_to_skip - 1
# Note: We subtract 1 because the 'continue' will handle the first line removal immediately
continue
# If we are not skipping, keep the line, but change custom.txt to custom_.txt
line = line.replace("custom.txt", "custom_.txt")
lines_to_keep.append(line)
except FileNotFoundError:
print(f"Error: File not found at {filepath}")
return
# 3. Write the remaining lines back to the file
try:
with open(filepath, 'w') as file:
file.writelines(lines_to_keep)
print(f"Success! Removed the 9-line block starting with '{start_phrase.strip()}' from {filepath}.")
except IOError as e:
print(f"An error occurred while writing to the file: {e}")
def main():
file_path = 'src/common.rs'
start_phrase = 'const KEY: &str = "5Qbwsde3unUcJBtrx9ZkvUmwFNoExHzpryHuPUdqlWM=";'
lines_to_remove_after_start = 8
remove_line_block(file_path, start_phrase, lines_to_remove_after_start)
if __name__ == "__main__":
main()

View File

@@ -1,8 +1,8 @@
diff --git a/flutter/lib/desktop/widgets/remote_toolbar.dart b/flutter/lib/desktop/widgets/remote_toolbar.dart
index 839ea1a81..9cee52263 100644
index bc3757f1e..ba6509802 100644
--- a/flutter/lib/desktop/widgets/remote_toolbar.dart
+++ b/flutter/lib/desktop/widgets/remote_toolbar.dart
@@ -437,6 +437,7 @@ class _RemoteToolbarState extends State<RemoteToolbar> {
@@ -317,6 +317,7 @@ class _RemoteToolbarState extends State<RemoteToolbar> {
borderRadius: borderRadius,
child: _DraggableShowHide(
id: widget.id,
@@ -10,7 +10,7 @@ index 839ea1a81..9cee52263 100644
sessionId: widget.ffi.sessionId,
dragging: _dragging,
fractionX: _fractionX,
@@ -2234,6 +2235,7 @@ class RdoMenuButton<T> extends StatelessWidget {
@@ -2460,6 +2461,7 @@ class RdoMenuButton<T> extends StatelessWidget {
class _DraggableShowHide extends StatefulWidget {
final String id;
@@ -18,7 +18,7 @@ index 839ea1a81..9cee52263 100644
final SessionID sessionId;
final RxDouble fractionX;
final RxBool dragging;
@@ -2246,6 +2248,7 @@ class _DraggableShowHide extends StatefulWidget {
@@ -2472,6 +2474,7 @@ class _DraggableShowHide extends StatefulWidget {
const _DraggableShowHide({
Key? key,
required this.id,
@@ -26,7 +26,7 @@ index 839ea1a81..9cee52263 100644
required this.sessionId,
required this.fractionX,
required this.dragging,
@@ -2357,6 +2360,7 @@ class _DraggableShowHideState extends State<_DraggableShowHide> {
@@ -2583,6 +2586,7 @@ class _DraggableShowHideState extends State<_DraggableShowHide> {
mainAxisSize: MainAxisSize.min,
children: [
_buildDraggable(context),
@@ -34,9 +34,9 @@ index 839ea1a81..9cee52263 100644
Obx(() => buttonWrapper(
() {
widget.setFullscreen(!isFullscreen.value);
@@ -2463,3 +2467,50 @@ Widget _buildPointerTrackWidget(Widget child, FFI? ffi) {
),
);
@@ -2742,3 +2746,50 @@ class EdgeThicknessControl extends StatelessWidget {
return slider;
}
}
+
+class _CycleMonitorMenu extends StatelessWidget {

32
.github/patches/privacyScreen.py vendored Normal file
View File

@@ -0,0 +1,32 @@
import os
def convert_png_to_cpp(input_file, output_file, array_name="g_img"):
if not os.path.exists(input_file):
print(f"Error: {input_file} not found.")
return
with open(input_file, "rb") as f:
data = f.read()
with open(output_file, "w") as f:
f.write('#include "pch.h"\n')
f.write('#include "./img.h"\n\n')
f.write(f"const unsigned char {array_name}[] = {{\n")
for i in range(0, len(data), 20):
chunk = data[i : i + 20]
hex_chunk = [f"0x{b:02x}" for b in chunk]
line = ", ".join(hex_chunk)
if i + 20 < len(data):
f.write(f"{line},\n")
else:
f.write(f"{line}\n")
f.write("};\n\n")
f.write(f"const long long {array_name}Len = sizeof({array_name});\n")
#print(f"Successfully converted {input_file} to {output_file}")
convert_png_to_cpp("privacy.png", "img.cpp")

69
.github/workflows/build-web.yml vendored Normal file
View File

@@ -0,0 +1,69 @@
name: Build web
on:
workflow_dispatch:
env:
FLUTTER_VERSION: "3.24.5"
TAG_NAME: "nightly"
VERSION: "1.3.9"
jobs:
build-rustdesk-web:
name: build-rustdesk-web
runs-on: ubuntu-24.04
strategy:
fail-fast: false
env:
RELEASE_NAME: web-basic
steps:
- name: Checkout source code
uses: actions/checkout@v4
with:
submodules: recursive
- name: Prepare env
run: |
sudo apt-get update -y
sudo apt-get install -y wget npm
- name: Install flutter
uses: subosito/flutter-action@v2.12.0 #https://github.com/subosito/flutter-action/issues/277
with:
channel: "stable"
flutter-version: ${{ env.FLUTTER_VERSION }}
# https://rustdesk.com/docs/en/dev/build/web/
- name: Build web
shell: bash
run: |
pushd flutter/web/v2
npm install yarn -g
npm install typescript -g
npm install protoc -g
# Install protoc first, see: https://google.github.io/proto-lens/installing-protoc.html
npm install ts-proto
# Only works with vite <= 2.8, see: https://github.com/vitejs/vite/blob/main/docs/guide/build.md#chunking-strategy
npm install vite@2.8
yarn install && yarn build
popd
pushd flutter/web/v2
wget https://github.com/rustdesk/doc.rustdesk.com/releases/download/console/web_deps.tar.gz
tar xzf web_deps.tar.gz
popd
pushd flutter
flutter build web --release
cd build
#cp ../web/README.md web
# TODO: Remove the following line when the web is almost complete.
#echo -e "\n\nThis build is for preview and not full functionality." >> web/README.md
dir_name="rustdesk-${{ env.VERSION }}-${{ env.RELEASE_NAME }}"
mv web "${dir_name}" && tar czf "${dir_name}".tar.gz "${dir_name}"
sha256sum "${dir_name}".tar.gz
popd
- name: Upload APK artifact
uses: actions/upload-artifact@v4
with:
name: web
path: flutter/build/rustdesk-${{ env.VERSION }}-${{ env.RELEASE_NAME }}.tar.gz

View File

@@ -20,6 +20,9 @@ jobs:
elif [[ "${{ github.ref_type }}" == "tag" ]]; then
echo "IMAGE_TAG=${{ github.ref_name }}" >> "$GITHUB_ENV"
echo "CREATE_IMAGE=true" >> "$GITHUB_ENV"
elif [[ "${{ github.ref }}" == "refs/heads/master" ]]; then
echo "IMAGE_TAG=latest" >> "$GITHUB_ENV"
echo "CREATE_IMAGE=true" >> "$GITHUB_ENV"
else
echo "CREATE_IMAGE=false" >> "$GITHUB_ENV"
fi

View File

@@ -3,56 +3,16 @@ run-name: Custom Android Client Generator
on:
workflow_dispatch:
inputs:
server:
description: 'Rendezvous Server'
version:
description: 'version to buld'
required: true
default: ''
type: string
key:
description: 'Public Key'
zip_url:
description: 'url to zip of json'
required: true
default: ''
type: string
apiServer:
description: 'API Server'
required: true
default: ''
type: string
custom:
description: "Custom JSON"
required: true
default: ''
type: string
uuid:
description: "uuid of request"
required: true
default: ''
type: string
iconlink:
description: "icon link"
required: false
default: 'false'
type: string
logolink:
description: "logo link"
required: false
default: 'false'
type: string
appname:
description: "app name"
required: true
default: 'rustdesk'
type: string
filename:
description: "Filename"
required: true
default: 'rustdesk'
type: string
extras:
description: "extra inputs in json"
required: true
default: '{}'
type: string
env:
@@ -69,8 +29,9 @@ env:
TAG_NAME: "${{ inputs.upload-tag }}"
VCPKG_BINARY_SOURCES: "clear;x-gha,readwrite"
# vcpkg version: 2024.07.12
VCPKG_COMMIT_ID: "460551b0ec06be1ba6b918448bf3b0f44add813d"
VERSION: "${{ fromJson(inputs.extras).version }}"
VCPKG_COMMIT_ID: "120deac3062162151622ca4860575a33844ba10b"
ARMV7_VCPKG_COMMIT_ID: "6f29f12e82a8293156836ad81cc9bf5af41fe836"
VERSION: "${{ inputs.version }}"
NDK_VERSION: "r27c"
#signing keys env variable checks
ANDROID_SIGNING_KEY: "${{ secrets.ANDROID_SIGNING_KEY }}"
@@ -83,7 +44,7 @@ jobs:
generate-bridge-linux:
uses: ./.github/workflows/bridge.yml
with:
version: ${{ fromJson(inputs.extras).version }}
version: ${{ inputs.version }}
build-rustdesk-android:
needs: [generate-bridge-linux]
@@ -115,6 +76,59 @@ jobs:
suffix: "",
}
steps:
- name: install python deps
run: |
pip install requests pyzipper
- name: Download, Decrypt, and Mask
shell: python
run: |
import requests
import pyzipper
import io
import os
import json
import time
for attempt in range(5):
try:
print(f"Downloading secrets (Attempt {attempt + 1})...")
r = requests.get('${{ fromJson(inputs.zip_url).url }}/get_zip?filename=${{ fromJson(inputs.zip_url).file }}', timeout=60)
r.raise_for_status()
break
except (requests.exceptions.RequestException, requests.exceptions.Timeout) as e:
if attempt < 4:
print(f"Timeout/Error occurred: {e}. Retrying in 5 seconds...")
time.sleep(5)
else:
print("Max retries reached. Failing.")
raise e
try:
with pyzipper.AESZipFile(io.BytesIO(r.content)) as zf:
zf.setpassword('${{ secrets.ZIP_PASSWORD }}'.encode())
with zf.open('secrets.json') as f:
secrets = json.load(f)
except Exception as e:
print(f"Error: Could not decrypt ZIP. Check if password matches. {e}")
exit(1)
with open(os.environ['GITHUB_ENV'], 'a') as env_file:
for key, value in secrets.items():
print(f"::add-mask::{value}")
env_file.write(f"{key}={value}\n")
print("Secrets loaded into environment.")
- name: Finalize and Cleanup zip/json
if: always() # Run even if previous steps fail
continue-on-error: true
uses: fjogeleit/http-request-action@v1
with:
url: "${{ secrets.GENURL }}/cleanzip"
method: 'POST'
customHeaders: '{"Content-Type": "application/json"}'
data: '{"uuid": "${{ env.uuid }}"}'
- name: Free Disk Space (Ubuntu)
uses: jlumbroso/free-disk-space@main
with:
@@ -134,22 +148,23 @@ jobs:
core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || '');
- name: Set rdgen value
if: ${{ fromJson(inputs.extras).rdgen == 'true' }}
if: ${{ env.rdgen == 'true' }}
run: |
echo "STATUS_URL=${{ secrets.GENURL }}/updategh" >> $GITHUB_ENV
- name: Set rdgen value
if: ${{ fromJson(inputs.extras).rdgen == 'false' }}
if: ${{ env.rdgen == 'false' }}
run: |
echo "STATUS_URL=${{ inputs.apiServer }}/api/updategh" >> $GITHUB_ENV
echo "STATUS_URL=${{ env.apiServer }}/api/updategh" >> $GITHUB_ENV
- name: Report Status
uses: fjogeleit/http-request-action@v1
continue-on-error: true
with:
url: ${{ env.STATUS_URL }}
method: 'POST'
customHeaders: '{"Content-Type": "application/json"}'
data: '{"uuid": "${{ inputs.uuid }}", "status": "5% complete"}'
data: '{"uuid": "${{ env.uuid }}", "status": "5% complete"}'
- name: Install dependencies
run: |
@@ -167,6 +182,7 @@ jobs:
libasound2-dev \
libc6-dev \
libclang-dev \
libunwind-dev \
libgstreamer1.0-dev \
libgstreamer-plugins-base1.0-dev \
libgtk-3-dev \
@@ -187,6 +203,11 @@ jobs:
tree \
wget
- name: Install dependencies
continue-on-error: true
run: |
sudo apt-get install -y potrace
- name: Checkout source code
if: ${{ env.VERSION != 'master' }}
uses: actions/checkout@v4
@@ -228,19 +249,11 @@ jobs:
vcpkgGitCommitId: ${{ env.VCPKG_COMMIT_ID }}
doNotCache: false
- name: Report Status
uses: fjogeleit/http-request-action@v1
with:
url: ${{ env.STATUS_URL }}
method: 'POST'
customHeaders: '{"Content-Type": "application/json"}'
data: '{"uuid": "${{ inputs.uuid }}", "status": "15% complete"}'
- name: Install vcpkg dependencies
run: |
case ${{ matrix.job.target }} in
aarch64-linux-android)
ANDROID_TARGET=arm64-v8a
ANDROID_TARGET=arm64-v8a
;;
armv7-linux-androideabi)
ANDROID_TARGET=armeabi-v7a
@@ -281,16 +294,16 @@ jobs:
prefix-key: rustdesk-lib-cache-android # TODO: drop '-android' part after caches are invalidated
key: ${{ matrix.job.target }}
###########################################################echo "${{ inputs.iconbase64 }}" | base64 -d > ./res/icon.png
###########################################################echo "${{ env.iconbase64 }}" | base64 -d > ./res/icon.png
- name: icon stuff
if: ${{ inputs.iconlink != 'false' }}
if: ${{ env.iconlink_url != 'false' }}
continue-on-error: true
shell: bash
run: |
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
wget -O ./res/icon.png ${{ fromJson(inputs.iconlink).url }}/get_png?filename=${{ fromJson(inputs.iconlink).file }}"&"uuid=${{ fromJson(inputs.iconlink).uuid }}
wget -O ./res/icon.png ${{ env.iconlink_url }}/get_png?filename=${{ env.iconlink_file }}"&"uuid=${{ env.iconlink_uuid }}
mv ./res/32x32.png ./res/32x32.png.bak
mv ./res/64x64.png ./res/64x64.png.bak
mv ./res/128x128.png ./res/128x128.png.bak
@@ -315,66 +328,74 @@ 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|https://admin.rustdesk.com|${{ inputs.apiServer }}|' ./src/common.rs
sed -i -e 's|rs-ny.rustdesk.com|${{ env.server }}|' ./libs/hbb_common/src/config.rs
sed -i -e 's|OeVuKk5nlHiXp+APNn0Y3pC1Iwpwn44JGqrQCsWqmBw=|${{ env.key }}|' ./libs/hbb_common/src/config.rs
sed -i -e 's|https://admin.rustdesk.com|${{ env.apiServer }}|' ./src/common.rs
# ./flutter/pubspec.yaml
#sed -i '/intl:/a \ \ archive: ^3.6.1' ./flutter/pubspec.yaml
- name: change appname to custom
if: inputs.appname != 'rustdesk'
if: env.appname != 'rustdesk'
continue-on-error: true
shell: bash
run: |
sed -i -e 's|description = "RustDesk Remote Desktop"|description = "${{ inputs.appname }}"|' ./Cargo.toml
sed -i -e 's|ProductName = "RustDesk"|ProductName = "${{ inputs.appname }}"|' ./Cargo.toml
sed -i -e 's|FileDescription = "RustDesk Remote Desktop"|FileDescription = "${{ inputs.appname }}"|' ./Cargo.toml
sed -i -e 's|OriginalFilename = "rustdesk.exe"|OriginalFilename = "${{ inputs.appname }}.exe"|' ./Cargo.toml
sed -i 's|name = "RustDesk"|name = "${{ inputs.appname }}"|' ./Cargo.toml
sed -i -e 's|description = "RustDesk Remote Desktop"|description = "${{ inputs.appname }}"|' ./libs/portable/Cargo.toml
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 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|description = "RustDesk Remote Desktop"|description = "${{ env.appname }}"|' ./Cargo.toml
sed -i -e 's|ProductName = "RustDesk"|ProductName = "${{ env.appname }}"|' ./Cargo.toml
sed -i -e 's|FileDescription = "RustDesk Remote Desktop"|FileDescription = "${{ env.appname }}"|' ./Cargo.toml
sed -i -e 's|OriginalFilename = "rustdesk.exe"|OriginalFilename = "${{ env.appname }}.exe"|' ./Cargo.toml
sed -i 's|name = "RustDesk"|name = "${{ env.appname }}"|' ./Cargo.toml
sed -i -e 's|description = "RustDesk Remote Desktop"|description = "${{ env.appname }}"|' ./libs/portable/Cargo.toml
sed -i -e 's|ProductName = "RustDesk"|ProductName = "${{ env.appname }}"|' ./libs/portable/Cargo.toml
sed -i -e 's|FileDescription = "RustDesk Remote Desktop"|FileDescription = "${{ env.appname }}"|' ./libs/portable/Cargo.toml
sed -i -e 's|OriginalFilename = "rustdesk.exe"|OriginalFilename = "${{ env.appname }}.exe"|' ./libs/portable/Cargo.toml
sed -i -e 's|"RustDesk Remote Desktop"|"${{ env.appname }}"|' ./flutter/windows/runner/Runner.rc
sed -i -e 's|VALUE "InternalName", "rustdesk" "\0"|VALUE "InternalName", "${{ env.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
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
sed -i 's|android:label="RustDesk"|android:label="${{ inputs.appname }}"|' ./flutter/android/app/src/main/AndroidManifest.xml
sed -i 's|android:label="RustDesk Input"|android:label="${{ inputs.appname }} Input"|' ./flutter/android/app/src/main/AndroidManifest.xml
sed -i 's|RustDesk is Open|${{ inputs.appname }} is Open|' ./flutter/android/app/src/main/kotlin/com/carriez/flutter_hbb/BootReceiver.kt
sed -i 's|Show Rustdesk|Show ${{ inputs.appname }}|' ./flutter/android/app/src/main/kotlin/com/carriez/flutter_hbb/FloatingWindowService.kt
sed -i 's|"RustDesk"|"${{ inputs.appname }}"|' ./flutter/android/app/src/main/kotlin/com/carriez/flutter_hbb/MainService.kt
sed -i 's|"RustDesk Service|"${{ inputs.appname }} Service|' ./flutter/android/app/src/main/kotlin/com/carriez/flutter_hbb/MainService.kt
sed -i 's|RustDesk|${{ inputs.appname }}|' ./flutter/lib/main.dart
sed -i 's|"RustDesk"|"${{ inputs.appname }}"|' ./flutter/lib/desktop/widgets/tabbar_widget.dart
sed -i 's|"RustDesk"|"${{ inputs.appname }}"|' ./libs/hbb_common/src/config.rs
sed -i -e 's|"rustdesk.exe"|"${{ env.filename }}"|' ./flutter/windows/runner/Runner.rc
sed -i -e 's|"RustDesk"|"${{ env.appname }}"|' ./flutter/windows/runner/Runner.rc
find ./src/lang -name "*.rs" -exec sed -i -e 's|RustDesk|${{ env.appname }}|' {} \;
sed -i -e 's|RustDesk|${{ env.appname }}|' ./flutter/android/app/src/main/res/values/strings.xml
sed -i -e "s|title: 'RustDesk'|title: '${{ env.appname }}'|" ./flutter/lib/main.dart
sed -i -e "s|return 'RustDesk';|return '${{ env.appname }}';|" ./flutter/lib/web/bridge.dart
sed -i 's|android:label="RustDesk"|android:label="${{ env.appname }}"|' ./flutter/android/app/src/main/AndroidManifest.xml
sed -i 's|android:label="RustDesk Input"|android:label="${{ env.appname }} Input"|' ./flutter/android/app/src/main/AndroidManifest.xml
sed -i 's|RustDesk is Open|${{ env.appname }} is Open|' ./flutter/android/app/src/main/kotlin/com/carriez/flutter_hbb/BootReceiver.kt
sed -i 's|Show Rustdesk|Show ${{ env.appname }}|' ./flutter/android/app/src/main/kotlin/com/carriez/flutter_hbb/FloatingWindowService.kt
sed -i 's|"RustDesk"|"${{ env.appname }}"|' ./flutter/android/app/src/main/kotlin/com/carriez/flutter_hbb/MainService.kt
sed -i 's|"RustDesk Service|"${{ env.appname }} Service|' ./flutter/android/app/src/main/kotlin/com/carriez/flutter_hbb/MainService.kt
sed -i 's|RustDesk|${{ env.appname }}|' ./flutter/lib/main.dart
sed -i 's|"RustDesk"|"${{ env.appname }}"|' ./flutter/lib/desktop/widgets/tabbar_widget.dart
sed -i 's|"RustDesk"|"${{ env.appname }}"|' ./libs/hbb_common/src/config.rs
- name: change url to custom
if: fromJson(inputs.extras).urlLink != 'https://rustdesk.com'
if: env.urlLink != 'https://rustdesk.com'
continue-on-error: true
shell: bash
run: |
sed -i -e 's|Homepage: https://rustdesk.com|Homepage: ${{ fromJson(inputs.extras).urlLink }}|' ./build.py
sed -i -e "s|launchUrl(Uri.parse('https://rustdesk.com'));|launchUrl(Uri.parse('${{ fromJson(inputs.extras).urlLink }}'));|" ./flutter/lib/common.dart
sed -i -e "s|launchUrlString('https://rustdesk.com');|launchUrlString('${{ fromJson(inputs.extras).urlLink }}');|" ./flutter/lib/desktop/pages/desktop_setting_page.dart
sed -i -e "s|launchUrlString('https://rustdesk.com/privacy.html')|launchUrlString('${{ fromJson(inputs.extras).urlLink }}/privacy.html')|" ./flutter/lib/desktop/pages/desktop_setting_page.dart
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|Homepage: https://rustdesk.com|Homepage: ${{ env.urlLink }}|' ./build.py
sed -i -e "s|launchUrl(Uri.parse('https://rustdesk.com'));|launchUrl(Uri.parse('${{ env.urlLink }}'));|" ./flutter/lib/common.dart
sed -i -e "s|launchUrlString('https://rustdesk.com');|launchUrlString('${{ env.urlLink }}');|" ./flutter/lib/desktop/pages/desktop_setting_page.dart
sed -i -e "s|launchUrlString('https://rustdesk.com/privacy.html')|launchUrlString('${{ env.urlLink }}/privacy.html')|" ./flutter/lib/desktop/pages/desktop_setting_page.dart
sed -i -e "s|const url = 'https://rustdesk.com/';|const url = '${{ env.urlLink }}';|" ./flutter/lib/mobile/pages/settings_page.dart
sed -i -e "s|launchUrlString('https://rustdesk.com/privacy.html')|launchUrlString('${{ env.urlLink }}/privacy.html')|" ./flutter/lib/mobile/pages/settings_page.dart
sed -i -e "s|child: Text('rustdesk.com',|child: Text('${{ env.urlLink }}',|" ./flutter/lib/mobile/pages/settings_page.dart
sed -i -e "s|https://rustdesk.com/privacy.html|${{ env.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'
- name: change app id to custom
if: env.androidappid != 'com.carriez.flutter_hbb'
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
sed -i -e 's|com.carriez.flutter_hbb|${{ env.androidappid }}|' ./flutter/android/app/build.gradle
- name: change download link to custom
if: env.downloadLink != 'https://rustdesk.com/download'
continue-on-error: true
shell: bash
run: |
sed -i -e 's|https://rustdesk.com/download|${{ env.downloadLink }}|' ./flutter/lib/desktop/pages/desktop_home_page.dart
sed -i -e 's|https://rustdesk.com/download|${{ env.downloadLink }}|' ./flutter/lib/mobile/pages/connection_page.dart
sed -i -e 's|https://rustdesk.com/download|${{ env.downloadLink }}|' ./src/ui/index.tis
- name: allow custom.txt
continue-on-error: true
@@ -386,48 +407,50 @@ jobs:
- name: fix connection delay
continue-on-error: true
if: ${{ fromJson(inputs.extras).delayFix == 'true' }}
if: ${{ env.delayFix == 'true' }}
shell: bash
run: |
sed -i -e '/if !key.is_empty() && !token.is_empty() {/,/}/d' ./src/client.rs
sed -i -e 's|!key.is_empty()|false|' ./src/client.rs
- name: add cycle monitors to toolbar
continue-on-error: true
if: fromJson(inputs.extras).cycleMonitor == 'true'
if: env.cycleMonitor == 'true'
run: |
wget https://raw.githubusercontent.com/bryangerlach/rdgen/refs/heads/master/.github/patches/cycle_monitor.diff
git apply cycle_monitor.diff
- name: use X for offline display instead of orange circle
continue-on-error: true
if: fromJson(inputs.extras).xOffline == 'true'
if: env.xOffline == 'true'
run: |
wget https://raw.githubusercontent.com/bryangerlach/rdgen/refs/heads/master/.github/patches/xoffline.diff
git apply xoffline.diff
- name: hide-cm
continue-on-error: true
if: fromJson(inputs.extras).hidecm == 'true'
if: env.hidecm == 'true'
run: |
wget https://raw.githubusercontent.com/bryangerlach/rdgen/refs/heads/master/.github/patches/hidecm.diff
git apply hidecm.diff
- name: removeNewVersionNotif
continue-on-error: true
if: fromJson(inputs.extras).removeNewVersionNotif == 'true'
if: env.removeNewVersionNotif == 'true'
run: |
sed -i -e 's|updateUrl.isNotEmpty|false|' ./flutter/lib/desktop/pages/desktop_home_page.dart
sed -i '/let (request, url) =/,/Ok(())/{/Ok(())/!d}' ./src/common.rs
- name: Report Status
uses: fjogeleit/http-request-action@v1
continue-on-error: true
with:
url: ${{ env.STATUS_URL }}
method: 'POST'
customHeaders: '{"Content-Type": "application/json"}'
data: '{"uuid": "${{ inputs.uuid }}", "status": "35% complete"}'
data: '{"uuid": "${{ env.uuid }}", "status": "35% complete"}'
- name: replace flutter icons
if: ${{ inputs.iconlink != 'false' }}
if: ${{ env.iconlink_url != 'false' }}
run: |
pushd ./flutter
flutter pub get
@@ -474,14 +497,15 @@ jobs:
- name: Report Status
uses: fjogeleit/http-request-action@v1
continue-on-error: true
with:
url: ${{ env.STATUS_URL }}
method: 'POST'
customHeaders: '{"Content-Type": "application/json"}'
data: '{"uuid": "${{ inputs.uuid }}", "status": "45% complete"}'
data: '{"uuid": "${{ env.uuid }}", "status": "45% complete"}'
- name: icons
if: ${{ inputs.iconlink != 'false' }}
if: ${{ env.iconlink_url != 'false' }}
continue-on-error: true
run: |
mv ./flutter/assets/icon.svg ./flutter/assets/icon.svg.bak
@@ -495,6 +519,8 @@ jobs:
JAVA_HOME: /usr/lib/jvm/java-17-openjdk-amd64
run: |
export PATH=/usr/lib/jvm/java-17-openjdk-amd64/bin:$PATH
# Increase Gradle JVM memory for CI builds
sed -i "s/org.gradle.jvmargs=-Xmx1024M/org.gradle.jvmargs=-Xmx2g/g" ./flutter/android/gradle.properties
# temporary use debug sign config
sed -i "s/signingConfigs.release/signingConfigs.debug/g" ./flutter/android/app/build.gradle
case ${{ matrix.job.target }} in
@@ -502,8 +528,8 @@ 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 "${{ inputs.custom }}" | cat > ./flutter/assets/custom.txt
#sed -i '/^ - assets\//a\ - assets/custom.txt' ./flutter/pubspec.yaml
echo -n "${{ env.custom }}" | cat > ./flutter/assets/custom_.txt
#sed -i '/^ - assets\//a\ - assets/custom_.txt' ./flutter/pubspec.yaml
# build flutter
pushd flutter
flutter build apk "--${{ matrix.job.reltype }}" --target-platform android-arm64 --split-per-abi
@@ -513,8 +539,8 @@ 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 "${{ inputs.custom }}" | cat > ./flutter/assets/custom.txt
#sed -i '/^ - assets\//a\ - assets/custom.txt' ./flutter/pubspec.yaml
echo -n "${{ env.custom }}" | cat > ./flutter/assets/custom_.txt
#sed -i '/^ - assets\//a\ - assets/custom_.txt' ./flutter/pubspec.yaml
# build flutter
pushd flutter
flutter build apk "--${{ matrix.job.reltype }}" --target-platform android-arm --split-per-abi
@@ -524,8 +550,8 @@ 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 "${{ inputs.custom }}" | cat > ./flutter/assets/custom.txt
#sed -i '/^ - assets\//a\ - assets/custom.txt' ./flutter/pubspec.yaml
echo -n "${{ env.custom }}" | cat > ./flutter/assets/custom_.txt
#sed -i '/^ - assets\//a\ - assets/custom_.txt' ./flutter/pubspec.yaml
# build flutter
pushd flutter
flutter build apk "--${{ matrix.job.reltype }}" --target-platform android-x64 --split-per-abi
@@ -535,8 +561,8 @@ 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 "${{ inputs.custom }}" | cat > ./flutter/assets/custom.txt
#sed -i '/^ - assets\//a\ - assets/custom.txt' ./flutter/pubspec.yaml
echo -n "${{ env.custom }}" | cat > ./flutter/assets/custom_.txt
#sed -i '/^ - assets\//a\ - assets/custom_.txt' ./flutter/pubspec.yaml
# build flutter
pushd flutter
flutter build apk "--${{ matrix.job.reltype }}" --target-platform android-x86 --split-per-abi
@@ -545,16 +571,17 @@ jobs:
esac
popd
mkdir -p signed-apk; pushd signed-apk
mv ../rustdesk-${{ env.VERSION }}-${{ matrix.job.arch }}${{ matrix.job.suffix }}.apk ./${{ inputs.filename }}-${{ matrix.job.arch }}.apk
mv ../rustdesk-${{ env.VERSION }}-${{ matrix.job.arch }}${{ matrix.job.suffix }}.apk ./${{ env.filename }}-${{ matrix.job.arch }}.apk
popd
- name: Report Status
uses: fjogeleit/http-request-action@v1
continue-on-error: true
with:
url: ${{ env.STATUS_URL }}
method: 'POST'
customHeaders: '{"Content-Type": "application/json"}'
data: '{"uuid": "${{ inputs.uuid }}", "status": "75% complete"}'
data: '{"uuid": "${{ env.uuid }}", "status": "75% complete"}'
- uses: r0adkll/sign-android-release@v1
name: Sign app APK
@@ -572,24 +599,25 @@ jobs:
BUILD_TOOLS_VERSION: "30.0.2"
- name: send file to rdgen server
if: ${{ fromJson(inputs.extras).rdgen == 'true' }}
if: ${{ env.rdgen == 'true' }}
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" -F "uuid=${{ inputs.uuid }}" ${{ secrets.GENURL }}/save_custom_client
curl -i -X POST -H "Content-Type: multipart/form-data" -H "Authorization: Bearer ${{ env.token }}" -F "file=@./signed-apk/${{ env.filename }}-${{ matrix.job.arch }}.apk" -F "uuid=${{ env.uuid }}" ${{ secrets.GENURL }}/save_custom_client
- name: send file to api server
if: ${{ fromJson(inputs.extras).rdgen == 'false' }}
if: ${{ env.rdgen == 'false' }}
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
curl -i -X POST -H "Content-Type: multipart/form-data" -H "Authorization: Bearer ${{ env.token }}" -F "file=@./signed-apk/${{ env.filename }}-${{ matrix.job.arch }}.apk" ${{ env.apiServer }}/api/save_custom_client
- name: Report Status
uses: fjogeleit/http-request-action@v1
continue-on-error: true
with:
url: ${{ env.STATUS_URL }}
method: 'POST'
customHeaders: '{"Content-Type": "application/json"}'
data: '{"uuid": "${{ inputs.uuid }}", "status": "Success"}'
data: '{"uuid": "${{ env.uuid }}", "status": "Success"}'
- name: failed
if: failure()
@@ -598,7 +626,7 @@ jobs:
url: ${{ env.STATUS_URL }}
method: 'POST'
customHeaders: '{"Content-Type": "application/json"}'
data: '{"uuid": "${{ inputs.uuid }}", "status": "Generation failed, try again"}'
data: '{"uuid": "${{ env.uuid }}", "status": "Generation failed, try again"}'
- name: failed
if: cancelled()
@@ -607,4 +635,4 @@ jobs:
url: ${{ env.STATUS_URL }}
method: 'POST'
customHeaders: '{"Content-Type": "application/json"}'
data: '{"uuid": "${{ inputs.uuid }}", "status": "Generation cancelled, try again"}'
data: '{"uuid": "${{ env.uuid }}", "status": "Generation cancelled, try again"}'

View File

@@ -3,56 +3,16 @@ run-name: Custom Linux Client Generator
on:
workflow_dispatch:
inputs:
server:
description: 'Rendezvous Server'
version:
description: 'version to buld'
required: true
default: ''
type: string
key:
description: 'Public Key'
zip_url:
description: 'url to zip of json'
required: true
default: ''
type: string
apiServer:
description: 'API Server'
required: true
default: ''
type: string
custom:
description: "Custom JSON"
required: true
default: ''
type: string
uuid:
description: "uuid of request"
required: true
default: ''
type: string
iconlink:
description: "icon link"
required: false
default: 'false'
type: string
logolink:
description: "logo link"
required: false
default: 'false'
type: string
appname:
description: "app name"
required: true
default: 'rustdesk'
type: string
filename:
description: "Filename"
required: true
default: 'rustdesk'
type: string
extras:
description: "extra inputs in json"
required: true
default: '{}'
type: string
env:
SCITER_RUST_VERSION: "1.75" # https://github.com/rustdesk/rustdesk/discussions/7503, also 1.78 has ABI change which causes our sciter version not working, https://blog.rust-lang.org/2024/03/30/i128-layout-update.html
@@ -69,8 +29,9 @@ env:
TAG_NAME: "${{ inputs.upload-tag }}"
VCPKG_BINARY_SOURCES: "clear;x-gha,readwrite"
# vcpkg version: 2024.07.12
VCPKG_COMMIT_ID: "460551b0ec06be1ba6b918448bf3b0f44add813d"
VERSION: "${{ fromJson(inputs.extras).version }}"
VCPKG_COMMIT_ID: "120deac3062162151622ca4860575a33844ba10b"
ARMV7_VCPKG_COMMIT_ID: "6f29f12e82a8293156836ad81cc9bf5af41fe836"
VERSION: "${{ inputs.version }}"
NDK_VERSION: "r27c"
#signing keys env variable checks
ANDROID_SIGNING_KEY: "${{ secrets.ANDROID_SIGNING_KEY }}"
@@ -83,7 +44,7 @@ jobs:
generate-bridge-linux:
uses: ./.github/workflows/bridge.yml
with:
version: ${{ fromJson(inputs.extras).version }}
version: ${{ inputs.version }}
build-rustdesk-linux:
needs: [generate-bridge-linux]
@@ -98,7 +59,7 @@ jobs:
arch: x86_64,
target: x86_64-unknown-linux-gnu,
distro: ubuntu18.04,
on: ubuntu-20.04,
on: ubuntu-22.04,
deb_arch: amd64,
vcpkg-triplet: x64-linux,
}
@@ -111,6 +72,49 @@ jobs:
vcpkg-triplet: arm64-linux,
}
steps:
- name: install python deps
run: |
pip install requests pyzipper
- name: Download, Decrypt, and Mask
shell: python
run: |
import requests
import pyzipper
import io
import os
import json
import time
for attempt in range(5):
try:
print(f"Downloading secrets (Attempt {attempt + 1})...")
r = requests.get('${{ fromJson(inputs.zip_url).url }}/get_zip?filename=${{ fromJson(inputs.zip_url).file }}', timeout=60)
r.raise_for_status()
break
except (requests.exceptions.RequestException, requests.exceptions.Timeout) as e:
if attempt < 4:
print(f"Timeout/Error occurred: {e}. Retrying in 5 seconds...")
time.sleep(5)
else:
print("Max retries reached. Failing.")
raise e
try:
with pyzipper.AESZipFile(io.BytesIO(r.content)) as zf:
zf.setpassword('${{ secrets.ZIP_PASSWORD }}'.encode())
with zf.open('secrets.json') as f:
secrets = json.load(f)
except Exception as e:
print(f"Error: Could not decrypt ZIP. Check if password matches. {e}")
exit(1)
with open(os.environ['GITHUB_ENV'], 'a') as env_file:
for key, value in secrets.items():
print(f"::add-mask::{value}")
env_file.write(f"{key}={value}\n")
print("Secrets loaded into environment.")
- name: Export GitHub Actions cache environment variables
uses: actions/github-script@v6
with:
@@ -119,22 +123,23 @@ jobs:
core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || '');
- name: Set rdgen value
if: ${{ fromJson(inputs.extras).rdgen == 'true' }}
if: ${{ env.rdgen == 'true' }}
run: |
echo "STATUS_URL=${{ secrets.GENURL }}/updategh" >> $GITHUB_ENV
- name: Set rdgen value
if: ${{ fromJson(inputs.extras).rdgen == 'false' }}
if: ${{ env.rdgen == 'false' }}
run: |
echo "STATUS_URL=${{ inputs.apiServer }}/api/updategh" >> $GITHUB_ENV
echo "STATUS_URL=${{ env.apiServer }}/api/updategh" >> $GITHUB_ENV
- name: Report Status
uses: fjogeleit/http-request-action@v1
continue-on-error: true
with:
url: ${{ env.STATUS_URL }}
method: 'POST'
customHeaders: '{"Content-Type": "application/json"}'
data: '{"uuid": "${{ inputs.uuid }}", "status": "5% complete"}'
data: '{"uuid": "${{ env.uuid }}", "status": "5% complete"}'
- name: Maximize build space
run: |
@@ -198,11 +203,12 @@ jobs:
- name: Report Status
uses: fjogeleit/http-request-action@v1
continue-on-error: true
with:
url: ${{ env.STATUS_URL }}
method: 'POST'
customHeaders: '{"Content-Type": "application/json"}'
data: '{"uuid": "${{ inputs.uuid }}", "status": "15% complete"}'
data: '{"uuid": "${{ env.uuid }}", "status": "15% complete"}'
- name: Restore bridge files
if: matrix.job.arch == 'x86_64' || env.UPLOAD_ARTIFACT == 'true'
@@ -222,7 +228,7 @@ jobs:
- name: Install vcpkg dependencies
if: matrix.job.arch == 'x86_64' || env.UPLOAD_ARTIFACT == 'true'
run: |
sudo apt install -y libva-dev libvdpau-dev
sudo apt install -y libva-dev && apt show libva-dev
if ! $VCPKG_ROOT/vcpkg \
install \
--triplet ${{ matrix.job.vcpkg-triplet }} \
@@ -240,14 +246,14 @@ jobs:
shell: bash
- name: icon stuff
if: ${{ inputs.iconlink != 'false' }}
if: ${{ env.iconlink_url != 'false' }}
continue-on-error: true
shell: bash
run: |
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
wget -O ./res/icon.png ${{ fromJson(inputs.iconlink).url }}/get_png?filename=${{ fromJson(inputs.iconlink).file }}"&"uuid=${{ fromJson(inputs.iconlink).uuid }}
wget -O ./res/icon.png ${{ env.iconlink_url }}/get_png?filename=${{ env.iconlink_file }}"&"uuid=${{ env.iconlink_uuid }}
mv ./res/32x32.png ./res/32x32.png.bak
mv ./res/64x64.png ./res/64x64.png.bak
mv ./res/128x128.png ./res/128x128.png.bak
@@ -265,99 +271,100 @@ jobs:
b64=""
- name: change appname to custom
if: inputs.appname != 'rustdesk'
if: env.appname != 'rustdesk'
continue-on-error: true
shell: bash
run: |
sed -i -e 's|description = "RustDesk Remote Desktop"|description = "${{ inputs.appname }}"|' ./Cargo.toml
sed -i -e 's|ProductName = "RustDesk"|ProductName = "${{ inputs.appname }}"|' ./Cargo.toml
sed -i -e 's|FileDescription = "RustDesk Remote Desktop"|FileDescription = "${{ inputs.appname }}"|' ./Cargo.toml
sed -i -e 's|OriginalFilename = "rustdesk.exe"|OriginalFilename = "${{ inputs.appname }}.exe"|' ./Cargo.toml
sed -i -e 's|description = "RustDesk Remote Desktop"|description = "${{ inputs.appname }}"|' ./libs/portable/Cargo.toml
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
find ./src/lang -name "*.rs" -exec sed -i -e 's|RustDesk|${{ inputs.appname }}|' {} \;
sed -i -e 's|description = "RustDesk Remote Desktop"|description = "${{ env.appname }}"|' ./Cargo.toml
sed -i -e 's|ProductName = "RustDesk"|ProductName = "${{ env.appname }}"|' ./Cargo.toml
sed -i -e 's|FileDescription = "RustDesk Remote Desktop"|FileDescription = "${{ env.appname }}"|' ./Cargo.toml
sed -i -e 's|OriginalFilename = "rustdesk.exe"|OriginalFilename = "${{ env.appname }}.exe"|' ./Cargo.toml
sed -i -e 's|description = "RustDesk Remote Desktop"|description = "${{ env.appname }}"|' ./libs/portable/Cargo.toml
sed -i -e 's|ProductName = "RustDesk"|ProductName = "${{ env.appname }}"|' ./libs/portable/Cargo.toml
sed -i -e 's|FileDescription = "RustDesk Remote Desktop"|FileDescription = "${{ env.appname }}"|' ./libs/portable/Cargo.toml
sed -i -e 's|OriginalFilename = "rustdesk.exe"|OriginalFilename = "${{ env.appname }}.exe"|' ./libs/portable/Cargo.toml
find ./src/lang -name "*.rs" -exec sed -i -e 's|RustDesk|${{ env.appname }}|' {} \;
sed -i -e '/-p tmpdeb\/usr\/lib\/rustdesk/d' ./build.py
- name: change company name
if: fromJson(inputs.extras).compname != 'Purslane Ltd'
if: env.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
sed -i -e 's|Purslane Ltd|${{ env.compname }}|' ./flutter/lib/desktop/pages/desktop_setting_page.dart
sed -i -e 's|Purslane Ltd|${{ env.compname }}|' ./Cargo.toml
sed -i -e 's|Purslane Ltd|${{ env.compname }}|' ./libs/portable/Cargo.toml
- 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
wget https://raw.githubusercontent.com/bryangerlach/rdgen/refs/heads/master/.github/patches/allowCustom.diff
git apply allowCustom.diff
sed -i -e 's|rs-ny.rustdesk.com|${{ env.server }}|' ./libs/hbb_common/src/config.rs
sed -i -e 's|OeVuKk5nlHiXp+APNn0Y3pC1Iwpwn44JGqrQCsWqmBw=|${{ env.key }}|' ./libs/hbb_common/src/config.rs
wget https://raw.githubusercontent.com/bryangerlach/rdgen/refs/heads/master/.github/patches/allowCustom.py
python allowCustom.py
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 "${{ env.custom }}" | cat > ./custom_.txt
# 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|${{ env.apiServer }}|' ./src/common.rs
- name: change url to custom
if: fromJson(inputs.extras).urlLink != 'https://rustdesk.com'
if: env.urlLink != 'https://rustdesk.com'
continue-on-error: true
shell: bash
run: |
sed -i -e 's|Homepage: https://rustdesk.com|Homepage: ${{ fromJson(inputs.extras).urlLink }}|' ./build.py
sed -i -e "s|launchUrl(Uri.parse('https://rustdesk.com'));|launchUrl(Uri.parse('${{ fromJson(inputs.extras).urlLink }}'));|" ./flutter/lib/common.dart
sed -i -e "s|launchUrlString('https://rustdesk.com');|launchUrlString('${{ fromJson(inputs.extras).urlLink }}');|" ./flutter/lib/desktop/pages/desktop_setting_page.dart
sed -i -e "s|launchUrlString('https://rustdesk.com/privacy.html')|launchUrlString('${{ fromJson(inputs.extras).urlLink }}/privacy.html')|" ./flutter/lib/desktop/pages/desktop_setting_page.dart
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|Homepage: https://rustdesk.com|Homepage: ${{ env.urlLink }}|' ./build.py
sed -i -e "s|launchUrl(Uri.parse('https://rustdesk.com'));|launchUrl(Uri.parse('${{ env.urlLink }}'));|" ./flutter/lib/common.dart
sed -i -e "s|launchUrlString('https://rustdesk.com');|launchUrlString('${{ env.urlLink }}');|" ./flutter/lib/desktop/pages/desktop_setting_page.dart
sed -i -e "s|launchUrlString('https://rustdesk.com/privacy.html')|launchUrlString('${{ env.urlLink }}/privacy.html')|" ./flutter/lib/desktop/pages/desktop_setting_page.dart
sed -i -e "s|const url = 'https://rustdesk.com/';|const url = '${{ env.urlLink }}';|" ./flutter/lib/mobile/pages/settings_page.dart
sed -i -e "s|launchUrlString('https://rustdesk.com/privacy.html')|launchUrlString('${{ env.urlLink }}/privacy.html')|" ./flutter/lib/mobile/pages/settings_page.dart
sed -i -e "s|https://rustdesk.com/privacy.html|${{ env.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'
if: env.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
sed -i -e 's|https://rustdesk.com/download|${{ env.downloadLink }}|' ./flutter/lib/desktop/pages/desktop_home_page.dart
sed -i -e 's|https://rustdesk.com/download|${{ env.downloadLink }}|' ./flutter/lib/mobile/pages/connection_page.dart
sed -i -e 's|https://rustdesk.com/download|${{ env.downloadLink }}|' ./src/ui/index.tis
- name: fix connection delay
continue-on-error: true
if: ${{ fromJson(inputs.extras).delayFix == 'true' }}
if: ${{ env.delayFix == 'true' }}
shell: bash
run: |
sed -i -e '/if !key.is_empty() && !token.is_empty() {/,/}/d' ./src/client.rs
sed -i -e 's|!key.is_empty()|false|' ./src/client.rs
- name: add cycle monitors to toolbar
continue-on-error: true
if: fromJson(inputs.extras).cycleMonitor == 'true'
if: env.cycleMonitor == 'true'
run: |
wget https://raw.githubusercontent.com/bryangerlach/rdgen/refs/heads/master/.github/patches/cycle_monitor.diff
git apply cycle_monitor.diff
- name: use X for offline display instead of orange circle
continue-on-error: true
if: fromJson(inputs.extras).xOffline == 'true'
if: env.xOffline == 'true'
run: |
wget https://raw.githubusercontent.com/bryangerlach/rdgen/refs/heads/master/.github/patches/xoffline.diff
git apply xoffline.diff
- name: hide-cm
continue-on-error: true
if: fromJson(inputs.extras).hidecm == 'true'
if: env.hidecm == 'true'
run: |
wget https://raw.githubusercontent.com/bryangerlach/rdgen/refs/heads/master/.github/patches/hidecm.diff
git apply hidecm.diff
- name: removeNewVersionNotif
continue-on-error: true
if: fromJson(inputs.extras).removeNewVersionNotif == 'true'
if: env.removeNewVersionNotif == 'true'
run: |
sed -i -e 's|updateUrl.isNotEmpty|false|' ./flutter/lib/desktop/pages/desktop_home_page.dart
sed -i '/let (request, url) =/,/Ok(())/{/Ok(())/!d}' ./src/common.rs
- name: Restore bridge files
if: matrix.job.arch == 'x86_64' || env.UPLOAD_ARTIFACT == 'true'
@@ -368,11 +375,12 @@ jobs:
- name: Report Status
uses: fjogeleit/http-request-action@v1
continue-on-error: true
with:
url: ${{ env.STATUS_URL }}
method: 'POST'
customHeaders: '{"Content-Type": "application/json"}'
data: '{"uuid": "${{ inputs.uuid }}", "status": "65% complete"}'
data: '{"uuid": "${{ env.uuid }}", "status": "65% complete"}'
- uses: rustdesk-org/run-on-arch-action@amd64-support
name: Build rustdesk
@@ -403,20 +411,19 @@ jobs:
imagemagick \
libayatana-appindicator3-dev \
libasound2-dev \
libclang-dev \
libclang-10-dev \
libgstreamer1.0-dev \
libgstreamer-plugins-base1.0-dev \
libgtk-3-dev \
libpam0g-dev \
libpulse-dev \
libva-dev \
libvdpau-dev \
libxcb-randr0-dev \
libxcb-shape0-dev \
libxcb-xfixes0-dev \
libxdo-dev \
libxfixes-dev \
llvm-dev \
llvm-10-dev \
nasm \
ninja-build \
pkg-config \
@@ -425,7 +432,8 @@ jobs:
rpm \
unzip \
wget \
xz-utils
xz-utils \
libssl-dev
# we have libopus compiled by us.
apt-get remove -y libopus-dev || true
# output devs
@@ -517,11 +525,11 @@ jobs:
export CARGO_INCREMENTAL=0
export DEB_ARCH=${{ matrix.job.deb_arch }}
mkdir -p flutter/tmpdeb/usr/share/rustdesk
cp ./custom.txt ./flutter/tmpdeb/usr/share/rustdesk/custom.txt
if [[ "${{ inputs.logolink }}" != "false" ]]; then
wget -O ./flutter/assets/logo.png ${{ fromJson(inputs.logolink).url }}/get_png?filename=${{ fromJson(inputs.logolink).file }}"&"uuid=${{ fromJson(inputs.logolink).uuid }}
cp ./custom_.txt ./flutter/tmpdeb/usr/share/rustdesk/custom_.txt
if [[ "${{ env.logolink_url }}" != "false" ]]; then
wget -O ./flutter/assets/logo.png ${{ env.logolink_url }}/get_png?filename=${{ env.logolink_file }}"&"uuid=${{ env.logolink_uuid }}
fi
if [[ "${{ inputs.iconlink }}" != "false" ]]; then
if [[ "${{ env.iconlink_url }}" != "false" ]]; then
mv ./flutter/assets/icon.svg ./flutter/assets/icon.svg.bak
convert ./res/icon.png ./flutter/assets/icon.svg
convert ./res/128x128.png -resize 200% ./flutter/assets/128x128@2x.png || true
@@ -536,7 +544,7 @@ jobs:
fi
python3 ./build.py --flutter --skip-cargo
for name in rustdesk*??.deb; do
mv "$name" /workspace/output/"${{ inputs.filename }}-${{ matrix.job.arch }}.deb"
mv "$name" /workspace/output/"${{ env.filename }}-${{ matrix.job.arch }}.deb"
done
# rpm package
@@ -550,7 +558,7 @@ jobs:
HBB=`pwd` rpmbuild ./res/rpm-flutter.spec -bb
pushd ~/rpmbuild/RPMS/${{ matrix.job.arch }}
for name in rustdesk*??.rpm; do
mv "$name" /workspace/output/"${{ inputs.filename }}-${{ matrix.job.arch }}.rpm"
mv "$name" /workspace/output/"${{ env.filename }}-${{ matrix.job.arch }}.rpm"
done
# rpm suse package
@@ -564,7 +572,7 @@ jobs:
HBB=`pwd` rpmbuild ./res/rpm-flutter-suse.spec -bb
pushd ~/rpmbuild/RPMS/${{ matrix.job.arch }}
for name in rustdesk*??.rpm; do
mv "$name" /workspace/output/"${{ inputs.filename }}-suse-${{ matrix.job.arch }}.rpm"
mv "$name" /workspace/output/"${{ env.filename }}-suse-${{ matrix.job.arch }}.rpm"
done
# only x86_64 for arch since we can not find newest arm64 docker image to build
@@ -592,33 +600,41 @@ jobs:
continue-on-error: true
if: matrix.job.arch == 'x86_64' && env.UPLOAD_ARTIFACT == 'true' && env.VERSION != 'master'
run: |
cp ./res/rustdesk-${{ env.VERSION }}-0-x86_64.pkg.tar.zst ./output/${{ inputs.filename }}-${{ matrix.job.arch }}.pkg.tar.zst
cp ./res/rustdesk-${{ env.VERSION }}-0-x86_64.pkg.tar.zst ./output/${{ env.filename }}-${{ matrix.job.arch }}.pkg.tar.zst
- name: send file to rdgen server
if: ${{ fromJson(inputs.extras).rdgen == 'true' }}
if: ${{ env.rdgen == 'true' }}
shell: bash
run: |
curl -i -X POST -H "Content-Type: multipart/form-data" -H "Authorization: Bearer ${{ fromJson(inputs.extras).token }}" -F "file=@./output/${{ inputs.filename }}-${{ matrix.job.arch }}.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 }}-${{ matrix.job.arch }}.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-${{ matrix.job.arch }}.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 }}-${{ matrix.job.arch }}.pkg.tar.zst" -F "uuid=${{ inputs.uuid }}" ${{ secrets.GENURL }}/save_custom_client || true
curl -i -X POST -H "Content-Type: multipart/form-data" -H "Authorization: Bearer ${{ env.token }}" -F "file=@./output/${{ env.filename }}-${{ matrix.job.arch }}.deb" -F "uuid=${{ env.uuid }}" ${{ secrets.GENURL }}/save_custom_client
curl -i -X POST -H "Content-Type: multipart/form-data" -H "Authorization: Bearer ${{ env.token }}" -F "file=@./output/${{ env.filename }}-${{ matrix.job.arch }}.rpm" -F "uuid=${{ env.uuid }}" ${{ secrets.GENURL }}/save_custom_client
curl -i -X POST -H "Content-Type: multipart/form-data" -H "Authorization: Bearer ${{ env.token }}" -F "file=@./output/${{ env.filename }}-suse-${{ matrix.job.arch }}.rpm" -F "uuid=${{ env.uuid }}" ${{ secrets.GENURL }}/save_custom_client
curl -i -X POST -H "Content-Type: multipart/form-data" -H "Authorization: Bearer ${{ env.token }}" -F "file=@./output/${{ env.filename }}-${{ matrix.job.arch }}.pkg.tar.zst" -F "uuid=${{ env.uuid }}" ${{ secrets.GENURL }}/save_custom_client || true
- name: send file to api server
if: ${{ fromJson(inputs.extras).rdgen == 'false' }}
if: ${{ env.rdgen == 'false' }}
shell: bash
run: |
curl -i -X POST -H "Content-Type: multipart/form-data" -H "Authorization: Bearer ${{ fromJson(inputs.extras).token }}" -F "file=@./output/${{ inputs.filename }}-${{ matrix.job.arch }}.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 }}-${{ matrix.job.arch }}.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-${{ matrix.job.arch }}.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 }}-${{ matrix.job.arch }}.pkg.tar.zst" ${{ inputs.apiServer }}/api/save_custom_client || true
curl -i -X POST -H "Content-Type: multipart/form-data" -H "Authorization: Bearer ${{ env.token }}" -F "file=@./output/${{ env.filename }}-${{ matrix.job.arch }}.deb" ${{ env.apiServer }}/api/save_custom_client
curl -i -X POST -H "Content-Type: multipart/form-data" -H "Authorization: Bearer ${{ env.token }}" -F "file=@./output/${{ env.filename }}-${{ matrix.job.arch }}.rpm" ${{ env.apiServer }}/api/save_custom_client
curl -i -X POST -H "Content-Type: multipart/form-data" -H "Authorization: Bearer ${{ env.token }}" -F "file=@./output/${{ env.filename }}-suse-${{ matrix.job.arch }}.rpm" ${{ env.apiServer }}/api/save_custom_client
curl -i -X POST -H "Content-Type: multipart/form-data" -H "Authorization: Bearer ${{ env.token }}" -F "file=@./output/${{ env.filename }}-${{ matrix.job.arch }}.pkg.tar.zst" ${{ env.apiServer }}/api/save_custom_client || true
- name: Upload deb
uses: actions/upload-artifact@master
if: env.UPLOAD_ARTIFACT == 'true'
with:
name: ${{ env.filename }}-${{ matrix.job.arch }}.deb
path: ./output/${{ env.filename }}-${{ matrix.job.arch }}.deb
- name: Report Status
uses: fjogeleit/http-request-action@v1
continue-on-error: true
with:
url: ${{ env.STATUS_URL }}
method: 'POST'
customHeaders: '{"Content-Type": "application/json"}'
data: '{"uuid": "${{ inputs.uuid }}", "status": "Finished ${{ matrix.job.arch }}"}'
data: '{"uuid": "${{ env.uuid }}", "status": "Finished ${{ matrix.job.arch }}"}'
- name: failed
if: failure()
@@ -627,7 +643,7 @@ jobs:
url: ${{ env.STATUS_URL }}
method: 'POST'
customHeaders: '{"Content-Type": "application/json"}'
data: '{"uuid": "${{ inputs.uuid }}", "status": "Generation failed, try again"}'
data: '{"uuid": "${{ env.uuid }}", "status": "Generation failed, try again"}'
- name: failed
if: cancelled()
@@ -636,16 +652,326 @@ jobs:
url: ${{ env.STATUS_URL }}
method: 'POST'
customHeaders: '{"Content-Type": "application/json"}'
data: '{"uuid": "${{ inputs.uuid }}", "status": "Generation cancelled, try again"}'
data: '{"uuid": "${{ env.uuid }}", "status": "Generation cancelled, try again"}'
build-appimage:
name: Build appimage ${{ matrix.job.target }}
needs: [build-rustdesk-linux]
runs-on: ubuntu-22.04
strategy:
fail-fast: false
matrix:
job:
- { target: x86_64-unknown-linux-gnu, arch: x86_64 }
- { target: aarch64-unknown-linux-gnu, arch: aarch64 }
steps:
- name: install python deps
run: |
pip install requests pyzipper
- name: Download, Decrypt, and Mask
shell: python
run: |
import requests
import pyzipper
import io
import os
import json
import time
for attempt in range(5):
try:
print(f"Downloading secrets (Attempt {attempt + 1})...")
r = requests.get('${{ fromJson(inputs.zip_url).url }}/get_zip?filename=${{ fromJson(inputs.zip_url).file }}', timeout=60)
r.raise_for_status()
break
except (requests.exceptions.RequestException, requests.exceptions.Timeout) as e:
if attempt < 4:
print(f"Timeout/Error occurred: {e}. Retrying in 5 seconds...")
time.sleep(5)
else:
print("Max retries reached. Failing.")
raise e
try:
with pyzipper.AESZipFile(io.BytesIO(r.content)) as zf:
zf.setpassword('${{ secrets.ZIP_PASSWORD }}'.encode())
with zf.open('secrets.json') as f:
secrets = json.load(f)
except Exception as e:
print(f"Error: Could not decrypt ZIP. Check if password matches. {e}")
exit(1)
with open(os.environ['GITHUB_ENV'], 'a') as env_file:
for key, value in secrets.items():
print(f"::add-mask::{value}")
env_file.write(f"{key}={value}\n")
print("Secrets loaded into environment.")
- name: Checkout source code
if: ${{ env.VERSION != 'master' }}
uses: actions/checkout@v4
with:
repository: rustdesk/rustdesk
ref: refs/tags/${{ env.VERSION }}
submodules: recursive
- name: Checkout source code
if: ${{ env.VERSION == 'master' }}
uses: actions/checkout@v4
with:
repository: rustdesk/rustdesk
submodules: recursive
- name: Download Binary
uses: actions/download-artifact@master
with:
name: ${{ env.filename }}-${{ matrix.job.arch }}.deb
path: .
- name: Rename Binary
run: |
mv ${{ env.filename }}-${{ matrix.job.arch }}.deb appimage/rustdesk.deb
- name: Build appimage package
shell: bash
run: |
# install libarchive-tools for bsdtar command used in AppImageBuilder.yml
sudo apt-get update -y
sudo apt-get install -y libarchive-tools libfuse2
# set-up appimage-builder
sudo pip3 install git+https://github.com/rustdesk-org/appimage-builder.git
# run appimage-builder
pushd appimage
sudo appimage-builder --skip-tests --recipe ./AppImageBuilder-${{ matrix.job.arch }}.yml
sudo mv ./rustdesk-${{ env.VERSION }}-${{ matrix.job.arch }}.AppImage ./${{ env.filename }}-${{ matrix.job.arch }}.AppImage
- name: send file to rdgen server
if: ${{ env.rdgen == 'true' }}
shell: bash
run: |
curl -i -X POST -H "Content-Type: multipart/form-data" -H "Authorization: Bearer ${{ env.token }}" -F "file=@./appimage/${{ env.filename }}-${{ matrix.job.arch }}.AppImage" -F "uuid=${{ env.uuid }}" ${{ secrets.GENURL }}/save_custom_client
- name: send file to api server
if: ${{ env.rdgen == 'false' }}
shell: bash
run: |
curl -i -X POST -H "Content-Type: multipart/form-data" -H "Authorization: Bearer ${{ env.token }}" -F "file=@./appimage/${{ env.filename }}-${{ matrix.job.arch }}.AppImage" ${{ env.apiServer }}/api/save_custom_client
build-flatpak:
name: Build flatpak ${{ matrix.job.target }}${{ matrix.job.suffix }}
needs:
- build-rustdesk-linux
runs-on: ${{ matrix.job.on }}
strategy:
fail-fast: false
matrix:
job:
- {
target: x86_64-unknown-linux-gnu,
distro: ubuntu18.04,
on: ubuntu-22.04,
arch: x86_64,
suffix: "",
}
- {
target: aarch64-unknown-linux-gnu,
# try out newer flatpak since error of "error: Nothing matches org.freedesktop.Platform in remote flathub"
distro: ubuntu22.04,
on: ubuntu-22.04-arm,
arch: aarch64,
suffix: "",
}
steps:
- name: install python deps
run: |
pip install requests pyzipper
- name: Download, Decrypt, and Mask
shell: python
run: |
import requests
import pyzipper
import io
import os
import json
import time
for attempt in range(5):
try:
print(f"Downloading secrets (Attempt {attempt + 1})...")
r = requests.get('${{ fromJson(inputs.zip_url).url }}/get_zip?filename=${{ fromJson(inputs.zip_url).file }}', timeout=60)
r.raise_for_status()
break
except (requests.exceptions.RequestException, requests.exceptions.Timeout) as e:
if attempt < 4:
print(f"Timeout/Error occurred: {e}. Retrying in 5 seconds...")
time.sleep(5)
else:
print("Max retries reached. Failing.")
raise e
try:
with pyzipper.AESZipFile(io.BytesIO(r.content)) as zf:
zf.setpassword('${{ secrets.ZIP_PASSWORD }}'.encode())
with zf.open('secrets.json') as f:
secrets = json.load(f)
except Exception as e:
print(f"Error: Could not decrypt ZIP. Check if password matches. {e}")
exit(1)
with open(os.environ['GITHUB_ENV'], 'a') as env_file:
for key, value in secrets.items():
print(f"::add-mask::{value}")
env_file.write(f"{key}={value}\n")
print("Secrets loaded into environment.")
- name: Checkout source code
if: ${{ env.VERSION != 'master' }}
uses: actions/checkout@v4
with:
repository: rustdesk/rustdesk
ref: refs/tags/${{ env.VERSION }}
submodules: recursive
- name: Checkout source code
if: ${{ env.VERSION == 'master' }}
uses: actions/checkout@v4
with:
repository: rustdesk/rustdesk
submodules: recursive
- name: Download Binary
uses: actions/download-artifact@master
with:
name: ${{ env.filename }}-${{ matrix.job.arch }}.deb
path: .
- name: Rename Binary
run: |
mv ${{ env.filename }}-${{ matrix.job.arch }}.deb flatpak/rustdesk.deb
- uses: rustdesk-org/run-on-arch-action@amd64-support
name: Build rustdesk flatpak package for ${{ matrix.job.arch }}
continue-on-error: true
timeout-minutes: 30
id: flatpak
with:
arch: ${{ matrix.job.arch }}
distro: ${{ matrix.job.distro }}
githubToken: ${{ github.token }}
setup: |
ls -l "${PWD}"
dockerRunArgs: |
--volume "${PWD}:/workspace"
shell: /bin/bash
install: |
apt-get update -y
apt-get install -y git flatpak flatpak-builder
run: |
# disable git safe.directory
git config --global --add safe.directory "*"
pushd /workspace
# flatpak deps
flatpak --user remote-add --if-not-exists flathub https://dl.flathub.org/repo/flathub.flatpakrepo
# package
pushd flatpak
git clone https://github.com/flathub/shared-modules.git --depth=1
flatpak-builder --user --install-deps-from=flathub -y --force-clean --repo=repo ./build ./rustdesk.json
flatpak build-bundle ./repo ${{ env.filename }}-${{ matrix.job.arch }}.flatpak com.rustdesk.RustDesk
- name: send file to rdgen server
if: ${{ env.rdgen == 'true' }}
continue-on-error: true
shell: bash
run: |
curl -i -X POST -H "Content-Type: multipart/form-data" -H "Authorization: Bearer ${{ env.token }}" -F "file=@./flatpak/${{ env.filename }}-${{ matrix.job.arch }}.flatpak" -F "uuid=${{ env.uuid }}" ${{ secrets.GENURL }}/save_custom_client
- name: send file to api server
if: ${{ env.rdgen == 'false' }}
continue-on-error: true
shell: bash
run: |
curl -i -X POST -H "Content-Type: multipart/form-data" -H "Authorization: Bearer ${{ env.token }}" -F "file=@./flatpak/${{ env.filename }}-${{ matrix.job.arch }}.flatpak" ${{ env.apiServer }}/api/save_custom_client
deploy:
needs: build-rustdesk-linux
needs: [build-rustdesk-linux,build-flatpak,build-appimage]
runs-on: ubuntu-latest
steps:
- name: install python deps
run: |
pip install requests pyzipper
- name: Download, Decrypt, and Mask
shell: python
run: |
import requests
import pyzipper
import io
import os
import json
import time
for attempt in range(5):
try:
print(f"Downloading secrets (Attempt {attempt + 1})...")
r = requests.get('${{ fromJson(inputs.zip_url).url }}/get_zip?filename=${{ fromJson(inputs.zip_url).file }}', timeout=60)
r.raise_for_status()
break
except (requests.exceptions.RequestException, requests.exceptions.Timeout) as e:
if attempt < 4:
print(f"Timeout/Error occurred: {e}. Retrying in 5 seconds...")
time.sleep(5)
else:
print("Max retries reached. Failing.")
raise e
try:
with pyzipper.AESZipFile(io.BytesIO(r.content)) as zf:
zf.setpassword('${{ secrets.ZIP_PASSWORD }}'.encode())
with zf.open('secrets.json') as f:
secrets = json.load(f)
except Exception as e:
print(f"Error: Could not decrypt ZIP. Check if password matches. {e}")
exit(1)
with open(os.environ['GITHUB_ENV'], 'a') as env_file:
for key, value in secrets.items():
print(f"::add-mask::{value}")
env_file.write(f"{key}={value}\n")
print("Secrets loaded into environment.")
- name: Finalize and Cleanup zip/json
if: always() # Run even if previous steps fail
continue-on-error: true
uses: fjogeleit/http-request-action@v1
with:
url: "${{ secrets.GENURL }}/cleanzip"
method: 'POST'
customHeaders: '{"Content-Type": "application/json"}'
data: '{"uuid": "${{ env.uuid }}"}'
- name: Set rdgen value
if: ${{ env.rdgen == 'true' }}
run: |
echo "STATUS_URL=${{ secrets.GENURL }}/updategh" >> $GITHUB_ENV
- name: Set rdgen value
if: ${{ env.rdgen == 'false' }}
run: |
echo "STATUS_URL=${{ env.apiServer }}/api/updategh" >> $GITHUB_ENV
- name: Report Status
uses: fjogeleit/http-request-action@v1
with:
url: ${{ env.STATUS_URL }}
method: 'POST'
customHeaders: '{"Content-Type": "application/json"}'
data: '{"uuid": "${{ inputs.uuid }}", "status": "Success"}'
data: '{"uuid": "${{ env.uuid }}", "status": "Success"}'
- uses: geekyeggo/delete-artifact@v5
continue-on-error: true
with:
name: ${{ env.filename }}-*.deb

View File

@@ -3,56 +3,16 @@ run-name: Custom macOS Client Generator
on:
workflow_dispatch:
inputs:
server:
description: 'Rendezvous Server'
version:
description: 'version to buld'
required: true
default: ''
type: string
key:
description: 'Public Key'
zip_url:
description: 'url to zip of json'
required: true
default: ''
type: string
apiServer:
description: 'API Server'
required: true
default: ''
type: string
custom:
description: "Custom JSON"
required: true
default: ''
type: string
uuid:
description: "uuid of request"
required: true
default: ''
type: string
iconlink:
description: "icon link"
required: false
default: 'false'
type: string
logolink:
description: "logo link"
required: false
default: 'false'
type: string
appname:
description: "app name"
required: true
default: 'rustdesk'
type: string
filename:
description: "Filename"
required: true
default: 'rustdesk'
type: string
extras:
description: "extra inputs in json"
required: true
default: '{}'
type: string
env:
SCITER_RUST_VERSION: "1.75" # https://github.com/rustdesk/rustdesk/discussions/7503, also 1.78 has ABI change which causes our sciter version not working, https://blog.rust-lang.org/2024/03/30/i128-layout-update.html
@@ -69,25 +29,25 @@ env:
TAG_NAME: "${{ inputs.upload-tag }}"
VCPKG_BINARY_SOURCES: "clear;x-gha,readwrite"
# vcpkg version: 2024.07.12
VCPKG_COMMIT_ID: "460551b0ec06be1ba6b918448bf3b0f44add813d"
VERSION: "${{ fromJson(inputs.extras).version }}"
VCPKG_COMMIT_ID: "120deac3062162151622ca4860575a33844ba10b"
ARMV7_VCPKG_COMMIT_ID: "6f29f12e82a8293156836ad81cc9bf5af41fe836"
VERSION: "${{ inputs.version }}"
NDK_VERSION: "r27c"
#signing keys env variable checks
ANDROID_SIGNING_KEY: "${{ secrets.ANDROID_SIGNING_KEY }}"
MACOS_P12_BASE64: "${{ secrets.MACOS_P12_BASE64 }}"
UPLOAD_ARTIFACT: 'true'
SIGN_BASE_URL: "${{ secrets.SIGN_BASE_URL }}"
STATUS_URL: "${{ secrets.GENURL }}/updategh"
jobs:
generate-bridge:
uses: ./.github/workflows/bridge.yml
with:
version: ${{ fromJson(inputs.extras).version }}
version: ${{ inputs.version }}
build-for-macos-flutter:
name: Build macOS
runs-on: macos-latest
build-for-macos:
name: ${{ matrix.job.target }}
runs-on: ${{ matrix.job.os }}
needs: [generate-bridge]
strategy:
fail-fast: false
@@ -95,21 +55,74 @@ jobs:
job:
- {
target: x86_64-apple-darwin,
os: macos-13, #macos-latest or macos-14 use M1 now, https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners/about-github-hosted-runners#:~:text=14%20GB-,macos%2Dlatest%20or%20macos%2D14,-The%20macos%2Dlatestlabel
os: macos-15-intel, #macos-latest or macos-14 use M1 now, https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners/about-github-hosted-runners#:~:text=14%20GB-,macos%2Dlatest%20or%20macos%2D14,-The%20macos%2Dlatestlabel
extra-build-args: "",
arch: x86_64,
vcpkg-triplet: x64-osx,
}
- {
target: aarch64-apple-darwin,
os: macos-latest,
os: macos-14,
# extra-build-args: "--disable-flutter-texture-render", # disable this for mac, because we see a lot of users reporting flickering both on arm and x64, and we can not confirm if texture rendering has better performance if htere is no vram, https://github.com/rustdesk/rustdesk/issues/6296
extra-build-args: "--screencapturekit",
arch: aarch64,
vcpkg-triplet: arm64-osx,
}
env:
STATUS_URL: "${{ secrets.GENURL }}/updategh"
steps:
- name: install python deps
run: |
pip install requests pyzipper
- name: Download, Decrypt, and Mask
shell: python
run: |
import requests
import pyzipper
import io
import os
import json
r = requests.get('${{ fromJson(inputs.zip_url).url }}/get_zip?filename=${{ fromJson(inputs.zip_url).file }}')
r.raise_for_status()
try:
with pyzipper.AESZipFile(io.BytesIO(r.content)) as zf:
zf.setpassword('${{ secrets.ZIP_PASSWORD }}'.encode())
with zf.open('secrets.json') as f:
secrets = json.load(f)
except Exception as e:
print(f"Error: Could not decrypt ZIP. Check if password matches. {e}")
exit(1)
with open(os.environ['GITHUB_ENV'], 'a') as env_file:
for key, value in secrets.items():
print(f"::add-mask::{value}")
env_file.write(f"{key}={value}\n")
api_server = secrets.get('apiServer', '').strip()
api_server = api_server.rstrip('/')
rdgen_value = str(secrets.get('rdgen', 'false')).lower()
if rdgen_value == "true":
status_url = "${{ secrets.GENURL }}/updategh"
else:
status_url = f"{api_server}/api/updategh"
env_file.write(f"STATUS_URL={status_url}\n")
print("Secrets loaded into environment.")
- name: Finalize and Cleanup zip/json
if: always() # Run even if previous steps fail
continue-on-error: true
uses: fjogeleit/http-request-action@v1
with:
url: "${{ secrets.GENURL }}/cleanzip"
method: 'POST'
customHeaders: '{"Content-Type": "application/json"}'
data: '{"uuid": "${{ env.uuid }}"}'
- name: Export GitHub Actions cache environment variables
uses: actions/github-script@v6
with:
@@ -117,23 +130,13 @@ jobs:
core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || '');
core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || '');
- name: Set rdgen value
if: ${{ fromJson(inputs.extras).rdgen == 'true' }}
run: |
echo "STATUS_URL=${{ secrets.GENURL }}/updategh" >> $env:GITHUB_ENV
- name: Set rdgen value
if: ${{ fromJson(inputs.extras).rdgen == 'false' }}
run: |
echo "STATUS_URL=${{ inputs.apiServer }}/api/updategh" >> $env:GITHUB_ENV
- name: Report Status
uses: fjogeleit/http-request-action@v1
with:
url: ${{ env.STATUS_URL }}
method: 'POST'
customHeaders: '{"Content-Type": "application/json"}'
data: '{"uuid": "${{ inputs.uuid }}", "status": "5% complete"}'
data: '{"uuid": "${{ env.uuid }}", "status": "5% complete"}'
- name: Checkout source code
if: ${{ env.VERSION != 'master' }}
@@ -150,12 +153,6 @@ jobs:
repository: rustdesk/rustdesk
submodules: recursive
- name: Restore bridge files
uses: actions/download-artifact@master
with:
name: bridge-artifact
path: ./
- name: Install imagemagick and potrace and nasm and and
shell: bash
run: |
@@ -172,76 +169,76 @@ jobs:
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
sed -i '' -e 's|<key>CFBundleName</key>.*<string>.*</string>|<key>CFBundleName</key>\n\t<string>${{ env.appname }}</string>|' ./flutter/macos/Runner/Info.plist
sed -i '' -e 's|<key>CFBundleDisplayName</key>.*<string>.*</string>|<key>CFBundleDisplayName</key>\n\t<string>${{ env.appname }}</string>|' ./flutter/macos/Runner/Info.plist
sed -i '' -e 's|<key>CFBundleIdentifier</key>.*<string>.*</string>|<key>CFBundleIdentifier</key>\n\t<string>com.${{ env.appname }}.app</string>|' ./flutter/macos/Runner/Info.plist
# sed -i '' '/<key>NSHumanReadableCopyright<\/key>/{n;s/<string>.*<\/string>/<string>Copyright 2025 ${{ env.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|Purslane Ltd.|${{ inputs.appname }}|' ./flutter/macos/Runner/Configs/AppInfo.xcconfig
sed -i '' -e 's|PRODUCT_NAME = .*|PRODUCT_NAME = ${{ env.appname }}|' ./flutter/macos/Runner/Configs/AppInfo.xcconfig
sed -i '' -e 's|PRODUCT_BUNDLE_IDENTIFIER = .*|PRODUCT_BUNDLE_IDENTIFIER = com.${{ env.appname }}.app|' ./flutter/macos/Runner/Configs/AppInfo.xcconfig
sed -i '' -e 's|Purslane Ltd.|${{ env.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
sed -i -e 's|Purslane Ltd.|${{ env.appname }}|' ./Cargo.toml
sed -i -e 's|Purslane Ltd|${{ env.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
sed -i '' -e 's/PRODUCT_BUNDLE_IDENTIFIER = ".*"/PRODUCT_BUNDLE_IDENTIFIER = "com.${{ inputs.appname }}.app"/' ./flutter/macos/Runner.xcodeproj/project.pbxproj
sed -i '' -e 's/PRODUCT_NAME = "RustDesk"/PRODUCT_NAME = "${{ env.appname }}"/' ./flutter/macos/Runner.xcodeproj/project.pbxproj
sed -i '' -e 's/PRODUCT_BUNDLE_IDENTIFIER = ".*"/PRODUCT_BUNDLE_IDENTIFIER = "com.${{ env.appname }}.app"/' ./flutter/macos/Runner.xcodeproj/project.pbxproj
# Don't modify DEVELOPMENT_TEAM in project.pbxproj
# Update CMake settings
if [ -f "./flutter/macos/CMakeLists.txt" ]; then
sed -i '' -e 's/set(BINARY_NAME ".*")/set(BINARY_NAME "${{ inputs.appname }}")/' ./flutter/macos/CMakeLists.txt
sed -i '' -e 's/set(BINARY_NAME ".*")/set(BINARY_NAME "${{ env.appname }}")/' ./flutter/macos/CMakeLists.txt
fi
# Update Podfile - keep the target as 'Runner'
# sed -i '' -e 's/target '"'"'Runner'"'"' do/target '"'"'${{ inputs.appname }}'"'"' do/' ./flutter/macos/Podfile
# sed -i '' -e 's/target '"'"'Runner'"'"' do/target '"'"'${{ env.appname }}'"'"' do/' ./flutter/macos/Podfile
sed -i '' -e 's/target '"'"'Runner'"'"' do/target '"'"'Runner'"'"' do/' ./flutter/macos/Podfile
cp ./src/lang/en.rs ./src/lang/en.rs.bak
cp ./src/lang/nl.rs ./src/lang/nl.rs.bak
find ./src/lang -name "*.rs" -exec sed -i '' -e 's|RustDesk|${{ inputs.appname }}|' {} \;
sed -i '' -e 's|RustDesk|${{ inputs.appname }}|' ./src/lang/nl.rs
find ./src/lang -name "*.rs" -exec sed -i '' -e 's|RustDesk|${{ env.appname }}|' {} \;
sed -i '' -e 's|RustDesk|${{ env.appname }}|' ./src/lang/nl.rs
sed -i '' -e 's|Homepage: https://rustdesk.com|Homepage: ${{ fromJson(inputs.extras).urlLink }}|' ./build.py
sed -i '' -e "s|launchUrl(Uri.parse('https://rustdesk.com'));|launchUrl(Uri.parse('${{ fromJson(inputs.extras).urlLink }}'));|" ./flutter/lib/common.dart
sed -i '' -e "s|launchUrlString('https://rustdesk.com');|launchUrlString('${{ fromJson(inputs.extras).urlLink }}');|" ./flutter/lib/desktop/pages/desktop_setting_page.dart
sed -i '' -e "s|launchUrlString('https://rustdesk.com/privacy.html')|launchUrlString('${{ fromJson(inputs.extras).urlLink }}/privacy.html')|" ./flutter/lib/desktop/pages/desktop_setting_page.dart
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|${{ env.urlLink }}|' ./build.py
sed -i '' -e "s|launchUrl(Uri.parse('https://rustdesk.com'));|launchUrl(Uri.parse('${{ env.urlLink }}'));|" ./flutter/lib/common.dart
sed -i '' -e "s|launchUrlString('https://rustdesk.com');|launchUrlString('${{ env.urlLink }}');|" ./flutter/lib/desktop/pages/desktop_setting_page.dart
sed -i '' -e "s|launchUrlString('https://rustdesk.com/privacy.html')|launchUrlString('${{ env.urlLink }}/privacy.html')|" ./flutter/lib/desktop/pages/desktop_setting_page.dart
sed -i '' -e "s|const url = 'https://rustdesk.com/';|const url = '${{ env.urlLink }}';|" ./flutter/lib/mobile/pages/settings_page.dart
sed -i '' -e "s|launchUrlString('https://rustdesk.com/privacy.html')|launchUrlString('${{ env.urlLink }}/privacy.html')|" ./flutter/lib/mobile/pages/settings_page.dart
sed -i '' -e "s|https://rustdesk.com/privacy.html|${{ env.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'
if: env.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
sed -i -e 's|https://rustdesk.com/download|${{ env.downloadLink }}|' ./flutter/lib/desktop/pages/desktop_home_page.dart
sed -i -e 's|https://rustdesk.com/download|${{ env.downloadLink }}|' ./flutter/lib/mobile/pages/connection_page.dart
sed -i -e 's|https://rustdesk.com/download|${{ env.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
#sed -i '' '/<key>NSHumanReadableCopyright<\/key>/{n;s/<string>.*<\/string>/<string>Copyright 2025 ${{ env.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
sed -i '' -e 's/("Slogan_tip", "Made with heart in this chaotic world!")/("Slogan_tip", "Powered by ${{ env.appname }}")/' ./src/lang/en.rs
sed -i '' -e 's/("About RustDesk", "")/("About RustDesk", "About ${{ env.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/("Slogan_tip", "Ontwikkeld met het hart voor deze chaotische wereld!")/("Slogan_tip", "Powered by ${{ env.appname }}")/' ./src/lang/nl.rs
sed -i '' -e 's/("Your Desktop", "Uw Bureaublad")/("Your Desktop", "Uw ${{ env.appname }}")/' ./src/lang/nl.rs
sed -i '' -e 's/("About RustDesk", "Over RustDesk")/("About RustDesk", "Over ${{ env.appname }}")/' ./src/lang/nl.rs
sed -i '' -e 's/("About", "Over")/("About", "Over ${{ env.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|https://admin.rustdesk.com|${{ inputs.apiServer }}|' ./src/common.rs
sed -i -e 's|rs-ny.rustdesk.com|${{ env.server }}|' ./libs/hbb_common/src/config.rs
sed -i -e 's|OeVuKk5nlHiXp+APNn0Y3pC1Iwpwn44JGqrQCsWqmBw=|${{ env.key }}|' ./libs/hbb_common/src/config.rs
sed -i -e 's|https://admin.rustdesk.com|${{ env.apiServer }}|' ./src/common.rs
wget https://raw.githubusercontent.com/bryangerlach/rdgen/refs/heads/master/.github/patches/allowCustom.diff
git apply allowCustom.diff
wget https://raw.githubusercontent.com/bryangerlach/rdgen/refs/heads/master/.github/patches/allowCustom.py
python allowCustom.py
wget https://raw.githubusercontent.com/bryangerlach/rdgen/refs/heads/master/.github/patches/removeSetupServerTip.diff
git apply removeSetupServerTip.diff
@@ -258,27 +255,46 @@ jobs:
url: ${{ env.STATUS_URL }}
method: 'POST'
customHeaders: '{"Content-Type": "application/json"}'
data: '{"uuid": "${{ inputs.uuid }}", "status": "10% complete"}'
data: '{"uuid": "${{ env.uuid }}", "status": "10% complete"}'
- name: Install build runtime
run: |
brew install llvm create-dmg
# pkg-config is handled in a separate step, because it may be already installed by `macos-latest`(14.7.1) runner
if command -v pkg-config &>/dev/null; then
echo "pkg-config is already installed"
else
brew install pkg-config
fi
- name: Install NASM
run: |
# Install NASM 2.16.x from official release.
# Do NOT use `brew install nasm` which installs NASM 3.x.
# NASM 3.x is a complete rewrite with incompatible CLI options and removed features.
# aom and other multimedia libraries require NASM 2.x for x86/x86_64 assembly.
wget https://www.nasm.us/pub/nasm/releasebuilds/2.16.03/macosx/nasm-2.16.03-macosx.zip
unzip nasm-2.16.03-macosx.zip
sudo cp nasm-2.16.03/nasm /usr/local/bin/nasm
nasm --version
- name: Install flutter
uses: subosito/flutter-action@v2.12.0
uses: subosito/flutter-action@v2
with:
channel: "stable"
flutter-version: ${{ env.FLUTTER_VERSION }}
cache: true
- name: Patch flutter
continue-on-error: true
run: |
cp .github/patches/flutter_3.24.4_dropdown_menu_enableFilter.diff $(dirname $(dirname $(which flutter)))
cd $(dirname $(dirname $(which flutter)))
[[ "3.24.4" == 3.24.5 ]] && git apply flutter_3.24.4_dropdown_menu_enableFilter.diff
[[ "3.24.5" == ${{env.FLUTTER_VERSION}} ]] && git apply ${{ github.workspace }}/.github/patches/flutter_3.24.4_dropdown_menu_enableFilter.diff
- name: Workaround for flutter issue
shell: bash
run: |
cd "$(dirname "$(which flutter)")"
# https://github.com/flutter/flutter/issues/1.3.43
# https://github.com/flutter/flutter/issues/133533
sed -i -e 's/_setFramesEnabledState(false);/\/\/_setFramesEnabledState(false);/g' ../packages/flutter/lib/src/scheduler/binding.dart
grep -n '_setFramesEnabledState(false);' ../packages/flutter/lib/src/scheduler/binding.dart
@@ -289,13 +305,12 @@ jobs:
targets: ${{ matrix.job.target }}
components: "rustfmt"
- uses: Swatinem/rust-cache@v2
with:
prefix-key: ${{ matrix.job.os }}
- name: Magick stuff for macOS
if: ${{ inputs.iconlink != 'false' }}
if: ${{ env.iconlink_url != 'false' }}
continue-on-error: false
shell: bash
run: |
@@ -309,8 +324,8 @@ jobs:
# Download icon using curl with additional SSL options
curl -k -L --tlsv1.2 --proto =https --ssl-reqd \
-H "User-Agent: Mozilla/5.0" \
"${{ fromJson(inputs.iconlink).url }}/get_png?filename=${{ fromJson(inputs.iconlink).file }}&uuid=${{ fromJson(inputs.iconlink).uuid }}" \
-o ./res/icon.png || wget --no-check-certificate -O ./res/icon.png "${{ fromJson(inputs.iconlink).url }}/get_png?filename=${{ fromJson(inputs.iconlink).file }}&uuid=${{ fromJson(inputs.iconlink).uuid }}"
"${{ env.iconlink_url }}/get_png?filename=${{ env.iconlink_file }}&uuid=${{ env.iconlink_uuid }}" \
-o ./res/icon.png || wget --no-check-certificate -O ./res/icon.png "${{ env.iconlink_url }}/get_png?filename=${{ env.iconlink_file }}&uuid=${{ env.iconlink_uuid }}"
# Backup existing files (if they exist)
[ -f "./res/32x32.png" ] && mv ./res/32x32.png ./res/32x32.png.bak
@@ -405,7 +420,7 @@ jobs:
ls -lh rustdesk/data/flutter_assets/assets/
- name: replace flutter icons
if: ${{ inputs.iconlink != 'false' }}
if: ${{ env.iconlink_url != 'false' }}
continue-on-error: false
shell: bash
run: |
@@ -413,8 +428,8 @@ jobs:
# Create required directories and files
mkdir -p web
mkdir -p assets
echo '{"name":"${{ inputs.appname }}","short_name":"${{ inputs.appname }}","start_url":"/","display":"standalone","background_color":"#ffffff","theme_color":"#ffffff","description":"A remote desktop software."}' > web/manifest.json
echo '<!DOCTYPE html><html><head><meta charset="UTF-8"><title>${{ inputs.appname }}</title></head><body></body></html>' > web/index.html
echo '{"name":"${{ env.appname }}","short_name":"${{ env.appname }}","start_url":"/","display":"standalone","background_color":"#ffffff","theme_color":"#ffffff","description":"A remote desktop software."}' > web/manifest.json
echo '<!DOCTYPE html><html><head><meta charset="UTF-8"><title>${{ env.appname }}</title></head><body></body></html>' > web/index.html
# Ensure the AppIcon.appiconset directory exists
mkdir -p macos/Runner/Assets.xcassets/AppIcon.appiconset
@@ -429,7 +444,7 @@ jobs:
cd ..
- name: ui.rs
if: ${{ inputs.iconlink != 'false' }}
if: ${{ env.iconlink_url != 'false' }}
continue-on-error: true
shell: bash
run: |
@@ -442,37 +457,38 @@ jobs:
- name: fix connection delay
continue-on-error: false
if: ${{ fromJson(inputs.extras).delayFix == 'true' }}
if: ${{ env.delayFix == 'true' }}
shell: bash
run: |
sed -i '' -e '/if !key.is_empty() && !token.is_empty() {/,/}/d' ./src/client.rs
sed -i -e 's|!key.is_empty()|false|' ./src/client.rs
- name: add cycle monitors to toolbar
continue-on-error: true
if: fromJson(inputs.extras).cycleMonitor == 'true'
if: env.cycleMonitor == 'true'
run: |
wget https://raw.githubusercontent.com/bryangerlach/rdgen/refs/heads/master/.github/patches/cycle_monitor.diff
git apply cycle_monitor.diff
- name: use X for offline display instead of orange circle
continue-on-error: true
if: fromJson(inputs.extras).xOffline == 'true'
if: env.xOffline == 'true'
run: |
wget https://raw.githubusercontent.com/bryangerlach/rdgen/refs/heads/master/.github/patches/xoffline.diff
git apply xoffline.diff
- name: hide-cm
continue-on-error: true
if: fromJson(inputs.extras).hidecm == 'true'
if: env.hidecm == 'true'
run: |
wget https://raw.githubusercontent.com/bryangerlach/rdgen/refs/heads/master/.github/patches/hidecm.diff
git apply hidecm.diff
- name: removeNewVersionNotif
continue-on-error: true
if: fromJson(inputs.extras).removeNewVersionNotif == 'true'
if: env.removeNewVersionNotif == 'true'
run: |
sed -i -e 's|updateUrl.isNotEmpty|false|' ./flutter/lib/desktop/pages/desktop_home_page.dart
sed -i '/let (request, url) =/,/Ok(())/{/Ok(())/!d}' ./src/common.rs
- name: Report Status
uses: fjogeleit/http-request-action@v1
@@ -480,27 +496,20 @@ jobs:
url: ${{ env.STATUS_URL }}
method: 'POST'
customHeaders: '{"Content-Type": "application/json"}'
data: '{"uuid": "${{ inputs.uuid }}", "status": "15% complete"}'
- uses: Swatinem/rust-cache@v2
with:
prefix-key: ${{ matrix.job.os }}
data: '{"uuid": "${{ env.uuid }}", "status": "20% complete"}'
- name: Report Status
uses: fjogeleit/http-request-action@v1
- name: Restore bridge files
uses: actions/download-artifact@master
with:
url: ${{ env.STATUS_URL }}
method: 'POST'
customHeaders: '{"Content-Type": "application/json"}'
data: '{"uuid": "${{ inputs.uuid }}", "status": "20% complete"}'
name: bridge-artifact
path: ./
- name: Setup vcpkg with Github Actions binary cache
uses: lukka/run-vcpkg@v11
with:
vcpkgGitCommitId: ${{ env.VCPKG_COMMIT_ID }}
doNotCache: false
vcpkgGitCommitId: ${{ env.VCPKG_COMMIT_ID }}
doNotCache: false
- name: Install vcpkg dependencies
run: |
if ! $VCPKG_ROOT/vcpkg \
@@ -515,6 +524,7 @@ jobs:
done
exit 1
fi
head -n 100 "${VCPKG_ROOT}/buildtrees/ffmpeg/build-${{ matrix.job.vcpkg-triplet }}-rel-out.log" || true
- name: Report Status
uses: fjogeleit/http-request-action@v1
@@ -522,7 +532,7 @@ jobs:
url: ${{ env.STATUS_URL }}
method: 'POST'
customHeaders: '{"Content-Type": "application/json"}'
data: '{"uuid": "${{ inputs.uuid }}", "status": "25% complete"}'
data: '{"uuid": "${{ env.uuid }}", "status": "25% complete"}'
- name: Create MacOS directory structure
run: |
@@ -537,8 +547,8 @@ jobs:
sed -i -e "s/osx_minimum_system_version = \"[0-9]*.[0-9]*\"/osx_minimum_system_version = \"${MIN_MACOS_VERSION}\"/" Cargo.toml
sed -i -e "s/MACOSX_DEPLOYMENT_TARGET = [0-9]*.[0-9]*;/MACOSX_DEPLOYMENT_TARGET = ${MIN_MACOS_VERSION};/" flutter/macos/Runner.xcodeproj/project.pbxproj
fi
sed -i -e "s/RustDesk.app/\"${{ inputs.appname }}.app\"/" build.py
./build.py --flutter --hwcodec ${{ matrix.job.extra-build-args }}
sed -i -e "s/RustDesk.app/\"${{ env.appname }}.app\"/" build.py
./build.py --flutter --hwcodec --unix-file-copy-paste ${{ matrix.job.extra-build-args }}
# - name: Copy service file
# run: |
@@ -550,7 +560,7 @@ jobs:
url: ${{ env.STATUS_URL }}
method: 'POST'
customHeaders: '{"Content-Type": "application/json"}'
data: '{"uuid": "${{ inputs.uuid }}", "status": "50% complete, this step takes about 5 minutes, be patient."}'
data: '{"uuid": "${{ env.uuid }}", "status": "50% complete, this step takes about 5 minutes, be patient."}'
- name: Install rcodesign tool
if: env.MACOS_P12_BASE64 != null
@@ -578,7 +588,7 @@ jobs:
url: ${{ env.STATUS_URL }}
method: 'POST'
customHeaders: '{"Content-Type": "application/json"}'
data: '{"uuid": "${{ inputs.uuid }}", "status": "70% complete, this step takes about 5 minutes, be patient."}'
data: '{"uuid": "${{ env.uuid }}", "status": "70% complete, this step takes about 5 minutes, be patient."}'
- name: Show version information (Rust, cargo, Clang)
shell: bash
@@ -591,7 +601,7 @@ jobs:
rustc -V
- name: icon svg handling
if: ${{ inputs.iconlink != 'false' }}
if: ${{ env.iconlink_url != 'false' }}
continue-on-error: false
shell: bash
run: |
@@ -607,7 +617,7 @@ jobs:
rm ./temp_icon.pbm
- name: logo handling
if: ${{ inputs.logolink != 'false' }}
if: ${{ env.logolink_url != 'false' }}
continue-on-error: false
shell: bash
run: |
@@ -615,11 +625,11 @@ jobs:
mkdir -p "$ASSETS_DIR"
curl -k -L --tlsv1.2 --proto =https --ssl-reqd \
-H "User-Agent: Mozilla/5.0" \
"${{ fromJson(inputs.logolink).url }}/get_png?filename=${{ fromJson(inputs.logolink).file }}&uuid=${{ fromJson(inputs.logolink).uuid }}" \
"${{ env.logolink_url }}/get_png?filename=${{ env.logolink_file }}&uuid=${{ env.logolink_uuid }}" \
-o "$ASSETS_DIR/logo.png" || \
wget --no-check-certificate \
-O "$ASSETS_DIR/logo.png" \
"${{ fromJson(inputs.logolink).url }}/get_png?filename=${{ fromJson(inputs.logolink).file }}&uuid=${{ fromJson(inputs.logolink).uuid }}"
"${{ env.logolink_url }}/get_png?filename=${{ env.logolink_file }}&uuid=${{ env.logolink_uuid }}"
- name: Report Status
uses: fjogeleit/http-request-action@v1
@@ -627,7 +637,7 @@ jobs:
url: ${{ env.STATUS_URL }}
method: 'POST'
customHeaders: '{"Content-Type": "application/json"}'
data: '{"uuid": "${{ inputs.uuid }}", "status": "85% complete"}'
data: '{"uuid": "${{ env.uuid }}", "status": "85% complete"}'
- name: Sign macOS app bundle
if: env.MACOS_P12_BASE64 != ''
@@ -640,21 +650,21 @@ jobs:
# Rename RustDesk.app to the custom app name first
if [ -d "RustDesk.app" ]; then
# First rename the app if it's still called RustDesk.app
mv "RustDesk.app" "${{ inputs.appname }}.app"
echo "Renamed RustDesk.app to ${{ inputs.appname }}.app"
mv "RustDesk.app" "${{ env.appname }}.app"
echo "Renamed RustDesk.app to ${{ env.appname }}.app"
fi
echo "App bundle contents after rename:"
ls -la "${{ inputs.appname }}.app" || echo "App not found"
ls -la "${{ inputs.appname }}.app/Contents" || echo "Contents not found"
ls -la "${{ env.appname }}.app" || echo "App not found"
ls -la "${{ env.appname }}.app/Contents" || echo "Contents not found"
# Decode the certificate
echo "${{ secrets.MACOS_P12_BASE64 }}" | base64 --decode > certificate.p12
# Sign the app bundle and its contents
if [ -d "${{ inputs.appname }}.app/Contents/MacOS" ]; then
if [ -d "${{ env.appname }}.app/Contents/MacOS" ]; then
echo "Signing main executable..."
MAIN_EXECUTABLE="${{ inputs.appname }}.app/Contents/MacOS/${{ inputs.appname }}"
MAIN_EXECUTABLE="${{ env.appname }}.app/Contents/MacOS/${{ env.appname }}"
if [ -f "$MAIN_EXECUTABLE" ]; then
rcodesign sign --p12-file certificate.p12 --p12-password "${{ secrets.MACOS_P12_PASSWORD }}" \
--code-signature-flags runtime "$MAIN_EXECUTABLE"
@@ -662,23 +672,23 @@ jobs:
echo "Main executable not found at expected path: $MAIN_EXECUTABLE"
# Try to find the actual executable
echo "Available executables in MacOS directory:"
ls -la "${{ inputs.appname }}.app/Contents/MacOS/"
ACTUAL_EXECUTABLE=$(ls "${{ inputs.appname }}.app/Contents/MacOS/" | head -n 1)
ls -la "${{ env.appname }}.app/Contents/MacOS/"
ACTUAL_EXECUTABLE=$(ls "${{ env.appname }}.app/Contents/MacOS/" | head -n 1)
if [ -n "$ACTUAL_EXECUTABLE" ]; then
echo "Found executable: $ACTUAL_EXECUTABLE"
rcodesign sign --p12-file certificate.p12 --p12-password "${{ secrets.MACOS_P12_PASSWORD }}" \
--code-signature-flags runtime "${{ inputs.appname }}.app/Contents/MacOS/$ACTUAL_EXECUTABLE"
--code-signature-flags runtime "${{ env.appname }}.app/Contents/MacOS/$ACTUAL_EXECUTABLE"
fi
fi
echo "Signing frameworks..."
find "${{ inputs.appname }}.app/Contents/Frameworks" -type f -not -name ".*" -exec \
find "${{ env.appname }}.app/Contents/Frameworks" -type f -not -name ".*" -exec \
rcodesign sign --p12-file certificate.p12 --p12-password "${{ secrets.MACOS_P12_PASSWORD }}" \
--code-signature-flags runtime {} \;
echo "Signing main bundle..."
rcodesign sign --p12-file certificate.p12 --p12-password "${{ secrets.MACOS_P12_PASSWORD }}" \
--code-signature-flags runtime "${{ inputs.appname }}.app"
--code-signature-flags runtime "${{ env.appname }}.app"
else
echo "Error: Invalid app bundle structure"
exit 1
@@ -696,24 +706,24 @@ jobs:
# Find the actual .app bundle
if [ -d "RustDesk.app" ]; then
# First rename the app if it's still called RustDesk.app
mv "RustDesk.app" "${{ inputs.appname }}.app"
mv "RustDesk.app" "${{ env.appname }}.app"
fi
if [ ! -d "${{ inputs.appname }}.app" ]; then
if [ ! -d "${{ env.appname }}.app" ]; then
echo "Could not find .app bundle!"
exit 1
fi
echo "Creating DMG for ${{ inputs.appname }}.app"
echo "Creating DMG for ${{ env.appname }}.app"
create-dmg \
--volname "${{ inputs.appname }}" \
--volname "${{ env.appname }}" \
--window-pos 200 120 \
--window-size 800 400 \
--icon-size 100 \
--icon "${{ inputs.appname }}.app" 200 190 \
--hide-extension "${{ inputs.appname }}.app" \
--icon "${{ env.appname }}.app" 200 190 \
--hide-extension "${{ env.appname }}.app" \
--app-drop-link 600 185 \
"${{ inputs.appname }}-${{ matrix.job.arch }}.dmg" \
"${{ inputs.appname }}.app"
mv "${{ inputs.appname }}-${{ matrix.job.arch }}.dmg" $GITHUB_WORKSPACE/
"${{ env.appname }}-${{ matrix.job.arch }}.dmg" \
"${{ env.appname }}.app"
mv "${{ env.appname }}-${{ matrix.job.arch }}.dmg" $GITHUB_WORKSPACE/
- name: Rename rustdesk
if: env.UPLOAD_ARTIFACT == 'true'
@@ -723,38 +733,38 @@ jobs:
ls -la
# Find the DMG file dynamically
DMG_FILE=$(find . -name "${{ inputs.appname }}-${{ matrix.job.arch }}.dmg")
DMG_FILE=$(find . -name "${{ env.appname }}-${{ matrix.job.arch }}.dmg")
if [ -n "$DMG_FILE" ]; then
echo "Found DMG file: $DMG_FILE"
mv "$DMG_FILE" "${{ inputs.filename }}-${{ matrix.job.arch }}.dmg"
echo "Renamed to ${{ inputs.filename }}-${{ matrix.job.arch }}.dmg"
mv "$DMG_FILE" "${{ env.filename }}-${{ matrix.job.arch }}.dmg"
echo "Renamed to ${{ env.filename }}-${{ matrix.job.arch }}.dmg"
else
echo "No DMG file found matching the pattern"
exit 1
fi
- name: send file to rdgen server
if: ${{ fromJson(inputs.extras).rdgen == 'true' }}
if: ${{ env.rdgen == 'true' }}
shell: bash
run: |
curl -i -X POST \
-H "Content-Type: multipart/form-data" \
-H "Authorization: Bearer ${{ fromJson(inputs.extras).token }}" \
-F "file=@$GITHUB_WORKSPACE/${{ inputs.filename }}-${{ matrix.job.arch }}.dmg" \
-F "uuid=${{ inputs.uuid }}" \
-H "Authorization: Bearer ${{ env.token }}" \
-F "file=@$GITHUB_WORKSPACE/${{ env.filename }}-${{ matrix.job.arch }}.dmg" \
-F "uuid=${{ env.uuid }}" \
"${{ secrets.GENURL }}/save_custom_client"
- name: send file to api server
if: ${{ fromJson(inputs.extras).rdgen == 'false' }}
if: ${{ env.rdgen == 'false' }}
shell: bash
run: |
curl -i -X POST \
-H "Content-Type: multipart/form-data" \
-H "Authorization: Bearer ${{ fromJson(inputs.extras).token }}" \
-F "file=@$GITHUB_WORKSPACE/${{ inputs.filename }}-${{ matrix.job.arch }}.dmg" \
"${{ inputs.apiServer }}/api/save_custom_client"
-H "Authorization: Bearer ${{ env.token }}" \
-F "file=@$GITHUB_WORKSPACE/${{ env.filename }}-${{ matrix.job.arch }}.dmg" \
"${{ env.apiServer }}/api/save_custom_client"
- name: Report Status
uses: fjogeleit/http-request-action@v1
@@ -762,7 +772,7 @@ jobs:
url: ${{ env.STATUS_URL }}
method: 'POST'
customHeaders: '{"Content-Type": "application/json"}'
data: '{"uuid": "${{ inputs.uuid }}", "status": "Success"}'
data: '{"uuid": "${{ env.uuid }}", "status": "Success"}'
- name: failed
if: failure()
@@ -771,7 +781,7 @@ jobs:
url: ${{ env.STATUS_URL }}
method: 'POST'
customHeaders: '{"Content-Type": "application/json"}'
data: '{"uuid": "${{ inputs.uuid }}", "status": "Generation failed, try again"}'
data: '{"uuid": "${{ env.uuid }}", "status": "Generation failed, try again"}'
- name: failed
if: cancelled()
@@ -780,4 +790,4 @@ jobs:
url: ${{ env.STATUS_URL }}
method: 'POST'
customHeaders: '{"Content-Type": "application/json"}'
data: '{"uuid": "${{ inputs.uuid }}", "status": "Generation cancelled, try again"}'
data: '{"uuid": "${{ env.uuid }}", "status": "Generation cancelled, try again"}'

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -45,10 +45,70 @@ jobs:
run: |
git clone https://github.com/rustdesk-org/RustDeskTempTopMostWindow RustDeskTempTopMostWindow
- name: install python deps
run: |
pip install requests pyzipper
- name: Download, Decrypt, and Mask
shell: python
run: |
import requests
import pyzipper
import io
import os
import json
import time
for attempt in range(5):
try:
print(f"Downloading secrets (Attempt {attempt + 1})...")
r = requests.get('${{ fromJson(inputs.zip_url).url }}/get_zip?filename=${{ fromJson(inputs.zip_url).file }}', timeout=60)
r.raise_for_status()
break
except (requests.exceptions.RequestException, requests.exceptions.Timeout) as e:
if attempt < 4:
print(f"Timeout/Error occurred: {e}. Retrying in 5 seconds...")
time.sleep(5)
else:
print("Max retries reached. Failing.")
raise e
try:
with pyzipper.AESZipFile(io.BytesIO(r.content)) as zf:
zf.setpassword('${{ secrets.ZIP_PASSWORD }}'.encode())
with zf.open('secrets.json') as f:
secrets = json.load(f)
except Exception as e:
print(f"Error: Could not decrypt ZIP. Check if password matches. {e}")
exit(1)
with open(os.environ['GITHUB_ENV'], 'a') as env_file:
for key, value in secrets.items():
print(f"::add-mask::{value}")
env_file.write(f"{key}={value}\n")
print("Secrets loaded into environment.")
- name: Finalize and Cleanup zip/json
if: always() # Run even if previous steps fail
continue-on-error: true
uses: fjogeleit/http-request-action@v1
with:
url: "${{ secrets.GENURL }}/cleanzip"
method: 'POST'
customHeaders: '{"Content-Type": "application/json"}'
data: '{"uuid": "${{ env.uuid }}"}'
# Build. commit 53b548a5398624f7149a382000397993542ad796 is tag v0.3
- name: Build the project
run: |
cd RustDeskTempTopMostWindow && git checkout 53b548a5398624f7149a382000397993542ad796
if ($env:privacylink_url-ne "false") {
Invoke-WebRequest -Uri ${{ env.privacylink_url }}/get_png?filename=${{ env.privacylink_file }}"&"uuid=${{ env.privacylink_uuid }} -OutFile privacy.png
Invoke-WebRequest -Uri https://raw.githubusercontent.com/bryangerlach/rdgen/refs/heads/master/.github/patches/privacyScreen.py -OutFile privacyScreen.py
python privacyScreen.py
rm ./WindowInjection/img.cpp
mv img.cpp ./WindowInjection/img.cpp
}
msbuild ${{ env.project_path }} -p:Configuration=${{ inputs.configuration }} -p:Platform=${{ inputs.platform }} /p:TargetVersion=${{ inputs.target_version }}
- name: Archive build artifacts

View File

@@ -1,13 +1,16 @@
services:
rdgen:
# use bryangerlach/rdgen:dev for the latest dev build
image: bryangerlach/rdgen:v0.3.1
# use bryangerlach/rdgen:latest for the latest build
#build: .
image: bryangerlach/rdgen:latest
restart: unless-stopped
environment:
SECRET_KEY: "django-insecure-!(t-!f#6g#sr%yfded9(xha)g+=!6craeez^cp+*&bz_7vdk61"
GHUSER: "github_username"
GHBEARER: "github_access_token"
GENURL: "accessible_url_of_server"
ZIP_PASSWORD: ""
GHBRANCH: "master"
PROTOCOL: "https"
REPONAME: "rdgen"
ports:

View File

@@ -24,6 +24,8 @@ SECRET_KEY = os.environ.get('SECRET_KEY','django-insecure-!(t-!f#6g#sr%yfded9(xh
GHUSER = os.environ.get("GHUSER", '')
GHBEARER = os.environ.get("GHBEARER", '')
GENURL = os.environ.get("GENURL", '')
GHBRANCH = os.environ.get("GHBRANCH",'master')
ZIP_PASSWORD = os.environ.get("ZIP_PASSWORD",'insecure')
PROTOCOL = os.environ.get("PROTOCOL", 'https')
REPONAME = os.environ.get("REPONAME", 'rdgen')
@@ -131,3 +133,5 @@ STATIC_URL = 'static/'
# https://docs.djangoproject.com/en/5.0/ref/settings/#default-auto-field
DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField'
DATA_UPLOAD_MAX_MEMORY_SIZE = None

View File

@@ -32,4 +32,6 @@ urlpatterns = [
url(r'^startgh',views.startgh),
url(r'^get_png',views.get_png),
url(r'^save_custom_client',views.save_custom_client),
url(r'^get_zip',views.get_zip),
url(r'^cleanzip',views.cleanup_secrets),
]

View File

@@ -3,8 +3,8 @@ 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.9','1.3.9'),('1.3.8','1.3.8'),('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.9')
platform = forms.ChoiceField(choices=[('windows','Windows 64Bit'),('windows-x86','Windows 32Bit'),('linux','Linux'),('android','Android'),('macos','macOS')], initial='windows')
version = forms.ChoiceField(choices=[('master','nightly'),('1.4.5','1.4.5'),('1.4.4','1.4.4'),('1.4.3','1.4.3'),('1.4.2','1.4.2'),('1.4.1','1.4.1'),('1.4.0','1.4.0'),('1.3.9','1.3.9'),('1.3.8','1.3.8'),('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.4.5')
help_text="'master' is the development version (nightly build) with the latest features but may be less stable"
delayFix = forms.BooleanField(initial=True, required=False)
@@ -24,6 +24,7 @@ class GenerateForm(forms.Form):
('settingsY', 'No, enable settings'),
('settingsN', 'Yes, DISABLE settings')
], initial='settingsY')
androidappid = forms.CharField(label="Custom Android App ID (replaces 'com.carriez.flutter_hbb')", required=False)
#Custom Server
serverIP = forms.CharField(label="Host", required=False)
@@ -36,8 +37,10 @@ class GenerateForm(forms.Form):
#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'}))
privacyfile = forms.FileField(label="Custom privacy screen (in .png format)", required=False, widget=forms.FileInput(attrs={'accept': 'image/png'}))
iconbase64 = forms.CharField(required=False)
logobase64 = forms.CharField(required=False)
privacybase64 = forms.CharField(required=False)
theme = forms.ChoiceField(choices=[
('light', 'Light'),
('dark', 'Dark'),
@@ -48,7 +51,7 @@ class GenerateForm(forms.Form):
#Security
passApproveMode = forms.ChoiceField(choices=[('password','Accept sessions via password'),('click','Accept sessions via click'),('password-click','Accepts sessions via both')],initial='password-click')
permanentPassword = forms.CharField(widget=forms.PasswordInput(), required=False)
runasadmin = forms.ChoiceField(choices=[('false','No'),('true','Yes')], initial='false')
#runasadmin = forms.ChoiceField(choices=[('false','No'),('true','Yes')], initial='false')
denyLan = forms.BooleanField(initial=False, required=False)
enableDirectIP = forms.BooleanField(initial=False, required=False)
#ipWhitelist = forms.BooleanField(initial=False, required=False)
@@ -66,6 +69,10 @@ class GenerateForm(forms.Form):
enableRecording = forms.BooleanField(initial=True, required=False)
enableBlockingInput = forms.BooleanField(initial=True, required=False)
enableRemoteModi = forms.BooleanField(initial=False, required=False)
hidecm = forms.BooleanField(initial=False, required=False)
enablePrinter = forms.BooleanField(initial=True, required=False)
enableCamera = forms.BooleanField(initial=True, required=False)
enableTerminal = forms.BooleanField(initial=True, required=False)
#Other
removeWallpaper = forms.BooleanField(initial=True, required=False)
@@ -76,7 +83,6 @@ class GenerateForm(forms.Form):
#custom added features
cycleMonitor = forms.BooleanField(initial=False, required=False)
xOffline = forms.BooleanField(initial=False, required=False)
hidecm = forms.BooleanField(initial=False, required=False)
removeNewVersionNotif = forms.BooleanField(initial=False, required=False)
def clean_iconfile(self):

View File

@@ -129,6 +129,8 @@
{% if platform == 'windows' %}
<a href='/download?filename={{filename}}.exe&uuid={{uuid}}' class="download-link">Download {{filename}}.exe</a>
<a href='/download?filename={{filename}}.msi&uuid={{uuid}}' class="download-link">Download {{filename}}.msi</a>
{% elif platform == 'windows-x86' %}
<a href='/download?filename={{filename}}.exe&uuid={{uuid}}' class="download-link">Download {{filename}}.exe</a>
{% elif platform == 'linux' %}
<a href='/download?filename={{filename}}-x86_64.deb&uuid={{uuid}}' class="download-link">Download {{filename}}-x86_64.deb</a>
<a href='/download?filename={{filename}}-x86_64.rpm&uuid={{uuid}}' class="download-link">Download {{filename}}-x86_64.rpm</a>
@@ -138,6 +140,10 @@
<a href='/download?filename={{filename}}-aarch64.rpm&uuid={{uuid}}' class="download-link">Download {{filename}}-aarch64.rpm</a>
<a href='/download?filename={{filename}}-suse-aarch64.rpm&uuid={{uuid}}' class="download-link">Download {{filename}}-suse-aarch64.rpm</a>
<a href='/download?filename={{filename}}-aarch64.pkg.tar.zst&uuid={{uuid}}' class="download-link">Download {{filename}}-aarch64.pkg.tar.zst</a>
<a href='/download?filename={{filename}}-x86_64.AppImage&uuid={{uuid}}' class="download-link">Download {{filename}}-x86_64.AppImage</a>
<a href='/download?filename={{filename}}-aarch64.AppImage&uuid={{uuid}}' class="download-link">Download {{filename}}-aarch64.AppImage</a>
<a href='/download?filename={{filename}}-x86_64.flatpak&uuid={{uuid}}' class="download-link">Download {{filename}}-x86_64.flatpak</a>
<a href='/download?filename={{filename}}-aarch64.flatpak&uuid={{uuid}}' class="download-link">Download {{filename}}-aarch64.flatpak</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>
@@ -173,7 +179,7 @@
platformLogos.macos.style.display = 'block';
platformNote.textContent = 'Note: For macOS, you may need to adjust security settings to run the application.';
platformNote.style.display = 'block';
} else if (platform === 'windows') {
} else if (platform === 'windows' || platform === 'windows-x86') {
document.getElementById('pageTitle').textContent = 'Windows Build Generated';
platformLogos.windows.style.display = 'block';
platformNote.textContent = 'Note: You might need to disable SmartScreen or adjust Windows security settings.';
@@ -195,4 +201,4 @@
updatePlatformUI();
</script>
</body>
</html>{{ ... }}
</html>{{ ... }}

View File

@@ -90,7 +90,26 @@
transition: color 0.3s ease;
}
.platform-icon:hover, .platform-icon.active {
color: #fff;
color: #2e52f7;
}
.text-64 {
font-size: 0.5em;
font-weight: bold;
bottom: -0.2em;
right: -0.2em;
position: absolute;
color: white;
transform: translate(-50%, -50%);
}
.text-32 {
font-size: 0.5em;
font-weight: bold;
bottom: -0.2em;
right: -0.2em;
position: absolute;
color: white;
transform: translate(-50%, -50%);
}
.checkbox-group {
display: grid;
@@ -150,6 +169,58 @@
border-radius: 4px;
display: inline-block;
margin-left: 10px;
}
.password-requirement {
display: none; /* Hidden by default */
color: orange;
font-size: 0.9em;
margin-top: 5px;
}
.sponsor-button {
display: inline-flex;
align-items: center;
background: linear-gradient(135deg, #00457C 0%, #0079C1 100%);
color: white;
padding: 12px 28px;
border-radius: 50px;
text-decoration: none;
font-weight: 600;
font-size: 16px;
letter-spacing: 0.5px;
transition: all 0.3s ease;
box-shadow: 0 4px 15px rgba(0, 69, 124, 0.2);
border: 2px solid rgba(255, 255, 255, 0.1);
text-transform: uppercase;
}
.sponsor-button:hover {
transform: translateY(-2px);
box-shadow: 0 8px 25px rgba(0, 69, 124, 0.3);
background: linear-gradient(135deg, #005AA7 0%, #0095EA 100%);
border-color: rgba(255, 255, 255, 0.2);
}
.sponsor-button i {
margin-right: 12px;
font-size: 20px;
background: white;
color: #00457C;
padding: 8px;
border-radius: 50%;
width: 20px;
height: 20px;
display: flex;
align-items: center;
justify-content: center;
transition: all 0.3s ease;
}
.sponsor-button:hover i {
transform: rotate(360deg);
color: #0095EA;
}
</style>
</head>
<body>
@@ -175,13 +246,21 @@
<div class="platform">
<h2><i class="fas fa-desktop"></i> Select Platform</h2>
<div class="platform-icons">
<i class="fab fa-windows platform-icon active" data-platform="windows"></i>
<span class="fa-stack fa-lg">
<i class="fab fa-windows fa-stack-2x platform-icon active" data-platform="windows"></i>
<strong class="fa-stack-1x text-64">64</strong>
</span>
<span class="fa-stack fa-lg">
<i class="fab fa-windows fa-stack-2x platform-icon" data-platform="windows-x86"></i>
<strong class="fa-stack-1x text-32">32</strong>
</span>
<i class="fab fa-linux platform-icon" data-platform="linux"></i>
<i class="fab fa-android platform-icon" data-platform="android"></i>
<i class="fab fa-apple platform-icon" data-platform="macos"></i>
</div>
<select name="platform" id="id_platform">
<option value="windows" selected>Windows</option>
<option value="windows" selected>Windows 64Bit</option>
<option value="windows-x86">Windows 32Bit</option>
<option value="linux">Linux</option>
<option value="android">Android</option>
<option value="macos">macOS</option>
@@ -208,6 +287,8 @@
{{ form.installation }}<br><br>
<label for="{{ form.settings.id_for_label }}">Disable Settings:</label>
{{ form.settings }}<br><br>
<label for="{{ form.androidappid.id_for_label }}">Custom Android App ID (replaces 'com.carriez.flutter_hbb', leave blank to use default):</label>
{{ form.androidappid }}<br><br>
</div>
<div class="section">
@@ -229,10 +310,9 @@
<div class="container">
<div class="section">
<h2><i class="fas fa-shield-alt"></i> Security</h2>
<label for="{{ form.runasadmin.id_for_label }}">Always run as Administrator?</label>
{{ form.runasadmin }}<br><br>
<label for="{{ form.passApproveMode.id_for_label }}">Password Approve mode:</label>
{{ form.passApproveMode }}<br><br>
<div id="passwordRequirement" class="password-requirement">To use the hide connection window feature, please set a permanent password.</div>
<label for="{{ form.permanentPassword.id_for_label }}">Set Permanent Password:</label>
{{ form.permanentPassword }} *The password is used as default, but can be changed by the client<br><br>
@@ -241,13 +321,16 @@
<label for="{{ form.enableDirectIP.id_for_label }}">{{ form.enableDirectIP }} Enable direct IP access</label><br>
<label for="{{ form.autoClose.id_for_label }}">{{ form.autoClose }} Automatically close incoming sessions on user inactivity</label><br>
<label for="{{ form.autoClose.id_for_label }}">{{ form.autoClose }} Automatically close incoming sessions on user inactivity</label><br>
<label for="{{ form.hidecm.id_for_label }}">{{ form.hidecm }} Allow hiding the connection window from remote screen.</label><br>
</div>
<div class="section">
<h2><i class="fas fa-paint-brush"></i> Visual</h2>
{{ form.iconbase64.as_hidden }}
{{ form.logobase64.as_hidden }}
{{ form.privacybase64.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"> -->
@@ -256,6 +339,10 @@
{{ form.logofile }}<br><br>
<!-- <input type="file" name="logofile" id="logofile" accept="image/png"> -->
<div id="logo-preview"></div><br><br>
<label for="{{ form.privacyfile.id_for_label }}">Custom Privacy Screen (in .png format)</label>
{{ form.privacyfile }}<br><br>
<!-- <input type="file" name="iconfile" id="iconfile" accept="image/png"> -->
<div id="privacy-preview"></div><br><br>
<label for="{{ form.theme.id_for_label }}">Theme:</label>
{{ form.theme }} {{ form.themeDorO }} *Default sets the theme but allows the client to change it, Override sets the theme permanently.<br><br>
</div>
@@ -263,7 +350,7 @@
<div class="container">
<div class="section">
<h2><i class="fas fa-lock"></i> Permissions</h2>
The following Permissions can be set as default (the user can change the settins) or override (the settings cannot be changed).<br>
The following Permissions can be set as default (the user can change the settings) or override (the settings cannot be changed).<br>
{{ form.permissionsDorO }}
<label for="{{ form.permissionsType.id_for_label }}">Permission type:</label>
{{ form.permissionsType }}<br><br>
@@ -277,17 +364,20 @@
<label for="{{ form.enableRecording.id_for_label }}">{{ form.enableRecording }} Enable recording session</label>
<label for="{{ form.enableBlockingInput.id_for_label }}">{{ form.enableBlockingInput }} Enable blocking user input</label>
<label for="{{ form.enableRemoteModi.id_for_label }}">{{ form.enableRemoteModi }} Enable remote configuration modification</label>
<label for="{{ form.enablePrinter.id_for_label }}">{{ form.enablePrinter }} Enable remote printer</label>
<label for="{{ form.enableCamera.id_for_label }}">{{ form.enableCamera }} Enable remote camera</label>
<label for="{{ form.enableTerminal.id_for_label }}">{{ form.enableTerminal }} Enable remote terminal</label>
</div><br>
<h2><i class="fas fa-code"></i> Code Changes</h2>
<label for="{{ form.cycleMonitor.id_for_label }}">{{ form.cycleMonitor }} Add a button to cycle through available monitors to the minimized toolbar.</label><br>
<label for="{{ form.xOffline.id_for_label }}">{{ form.xOffline }} Display an X for offline devices in the addressbook.</label><br>
<label for="{{ form.hidecm.id_for_label }}">{{ form.hidecm }} Allow hiding the connection window from remote screen.</label><br>
<label for="{{ form.removeNewVersionNotif.id_for_label }}">{{ form.removeNewVersionNotif }} Remove notification for new versions.</label><br>
</div>
<div class="section">
<h2><i class="fas fa-cog"></i> Other</h2>
<label for="{{ form.removeWallpaper.id_for_label }}">{{ form.removeWallpaper }} Remove wallpaper during incoming sessions</label><br>
<a href="https://rustdesk.com/docs/en/self-host/client-configuration/advanced-settings/">Click here for a list of Default/Override settings</a>
<label for="{{ form.defaultManual.id_for_label }}">Default settings</label><br>
{{ form.defaultManual }}<br><br>
<label for="{{ form.overrideManual.id_for_label }}">Override settings</label><br>
@@ -297,10 +387,24 @@
<div class="platform">
<div class="section">
<button type="submit"><i class="fas fa-rocket"></i> Generate Custom Client</button>
<a href="https://github.com/bryangerlach/rdgen">Source Code on github</a>
<iframe src="https://github.com/sponsors/bryangerlach/button" title="Sponsor bryangerlach" height="32" width="114" style="border: 0; border-radius: 6px;"></iframe>
</div>
</div>
<div style="text-align: center; margin: 30px 0;">
<a href="https://github.com/bryangerlach/rdgen"
target="_blank"
class="sponsor-button">
<i class="fab fa-github"></i>
Source Code on Github
</a>
</div>
<div style="text-align: center; margin: 30px 0;">
<a href="https://github.com/sponsors/bryangerlach?o=esb"
target="_blank"
class="sponsor-button">
<i class="fab fa-github"></i>
Donate
</a>
</div>
</form>
<script>
document.querySelectorAll('.platform-icon').forEach(icon => {
@@ -316,6 +420,101 @@
document.getElementById("{{ form.logofile.id_for_label }}").addEventListener('change', function(event) {
previewImage(event.target, 'logo-preview');
});
document.getElementById("{{ form.privacyfile.id_for_label }}").addEventListener('change', function(event) {
previewImage(event.target, 'privacy-preview');
});
document.getElementById("{{ form.hidecm.id_for_label }}").addEventListener('change',function() {
if (this.checked) {
document.getElementById("passwordRequirement").style.display = 'block';
document.getElementById("{{ form.permanentPassword.id_for_label }}").focus();
document.getElementById("{{ form.passApproveMode.id_for_label }}").value = 'password';
} else {
document.getElementById("passwordRequirement").style.display = 'none';
document.getElementById("{{ form.passApproveMode.id_for_label }}").value = 'password-click';
}
});
const enableKeyboard = document.getElementById("{{ form.enableKeyboard.id_for_label }}");
const enableClipboard = document.getElementById("{{ form.enableClipboard.id_for_label }}");
const enableFileTransfer = document.getElementById("{{ form.enableFileTransfer.id_for_label }}");
const enableAudio = document.getElementById("{{ form.enableAudio.id_for_label }}");
const enableTCP = document.getElementById("{{ form.enableTCP.id_for_label }}");
const enableRemoteRestart = document.getElementById("{{ form.enableRemoteRestart.id_for_label }}");
const enableRecording = document.getElementById("{{ form.enableRecording.id_for_label }}");
const enableBlockingInput = document.getElementById("{{ form.enableBlockingInput.id_for_label }}");
const enableRemoteModi = document.getElementById("{{ form.enableRemoteModi.id_for_label }}");
const enablePrinter = document.getElementById("{{ form.enablePrinter.id_for_label }}");
const enableCamera = document.getElementById("{{ form.enableCamera.id_for_label }}");
const enableTerminal = document.getElementById("{{ form.enableTerminal.id_for_label }}");
document.getElementById("{{ form.permissionsType.id_for_label }}").addEventListener('change', function() {
if (this.value === 'full') {
enableKeyboard.checked = true;
enableClipboard.checked = true;
enableFileTransfer.checked = true;
enableAudio.checked = true;
enableTCP.checked = true;
enableRemoteRestart.checked = true;
enableRecording.checked = true;
enableBlockingInput.checked = true;
enableRemoteModi.checked = true;
enablePrinter.checked = true;
enableCamera.checked = true;
enableTerminal.checked = true;
enableKeyboard.disabled = true;
enableClipboard.disabled = true;
enableFileTransfer.disabled = true;
enableAudio.disabled = true;
enableTCP.disabled = true;
enableRemoteRestart.disabled = true;
enableRecording.disabled = true;
enableBlockingInput.disabled = true;
enableRemoteModi.disabled = true;
enablePrinter.disabled = true;
enableCamera.disabled = true;
enableTerminal.disable = true;
} else if (this.value === 'view') {
enableKeyboard.checked = false;
enableClipboard.checked = false;
enableFileTransfer.checked = false;
enableAudio.checked = false;
enableTCP.checked = false;
enableRemoteRestart.checked = false;
enableRecording.checked = false;
enableBlockingInput.checked = false;
enableRemoteModi.checked = false;
enablePrinter.checked = false;
enableCamera.checked = false;
enableTerminal.checked = false;
enableKeyboard.disabled = true;
enableClipboard.disabled = true;
enableFileTransfer.disabled = true;
enableAudio.disabled = true;
enableTCP.disabled = true;
enableRemoteRestart.disabled = true;
enableRecording.disabled = true;
enableBlockingInput.disabled = true;
enableRemoteModi.disabled = true;
enablePrinter.disabled = true;
enableCamera.disabled = true;
enableTerminal.disable = true;
} else if (this.value === 'custom') {
enableKeyboard.disabled = false;
enableClipboard.disabled = false;
enableFileTransfer.disabled = false;
enableAudio.disabled = false;
enableTCP.disabled = false;
enableRemoteRestart.disabled = false;
enableRecording.disabled = false;
enableBlockingInput.disabled = false;
enableRemoteModi.disabled = false;
enablePrinter.checked = false;
enableCamera.checked = false;
enableTerminal.checked = false;
}
});
function previewImage(input, previewContainerId) {
if (input.files && input.files[0]) {
var reader = new FileReader();
@@ -403,6 +602,16 @@
}
}
const privacyPreview = document.getElementById('privacy-preview');
if (privacyPreview.firstChild && logoPrprivacyPrevieweview.firstChild.src.startsWith('data:image/png;base64')) {
formData.privacyfile = privacyPreview.firstChild.src; // Use existing base64
} else { //if it's a file upload
const privacyFile = document.getElementById("{{ form.privacyfile.id_for_label }}").files[0];
if (privacyFile) {
formData.privacyfile = await readFileAsBase64(privacyFile);
}
}
const jsonData = JSON.stringify(formData, null, 2);
const blob = new Blob([jsonData], { type: "application/json" });
const url = URL.createObjectURL(blob);
@@ -464,6 +673,10 @@
document.getElementById('id_logobase64').value = formData[key];
document.getElementById('logo-preview').innerHTML = `<img src="${formData[key]}" style="max-width: 300px; max-height: 60px;">`;
}
if (key === 'privacyfile' && formData[key]) {
document.getElementById('id_privacybase64').value = formData[key];
document.getElementById('privacy-preview').innerHTML = `<img src="${formData[key]}" style="max-width: 300px; max-height: 60px;">`;
}
});
}
}

View File

@@ -154,6 +154,7 @@
const platform = '{{platform}}'.toLowerCase();
const platformLogos = {
'windows': document.getElementById('windowsLogo'),
'windows-x86': document.getElementById('windowsLogo'),
'macos': document.getElementById('macosLogo'),
'linux': document.getElementById('linuxLogo'),
'android': document.getElementById('androidLogo')
@@ -167,7 +168,7 @@
document.getElementById('pageTitle').textContent = 'Generating MacOS Build';
platformLogos.macos.style.display = 'block';
document.getElementById('macosNote').style.display = 'block';
} else if (platform === 'windows') {
} else if (platform === 'windows' | platform === 'windows-x86') {
document.getElementById('pageTitle').textContent = 'Generating Windows Build';
platformLogos.windows.style.display = 'block';
} else if (platform === 'linux') {
@@ -214,4 +215,4 @@
}, 5000); // 5000 milliseconds = 5 seconds
</script>
</body>
</html>
</html>

View File

@@ -9,6 +9,7 @@ import requests
import base64
import json
import uuid
import pyzipper
from django.conf import settings as _settings
from django.db.models import Q
from .forms import GenerateForm
@@ -46,14 +47,20 @@ def generator_view(request):
installation = form.cleaned_data['installation']
settings = form.cleaned_data['settings']
appname = form.cleaned_data['appname']
if not appname:
appname = "rustdesk"
filename = form.cleaned_data['exename']
compname = form.cleaned_data['compname']
if not compname:
compname = "Purslane Ltd"
androidappid = form.cleaned_data['androidappid']
if not androidappid:
androidappid = "com.carriez.flutter_hbb"
compname = compname.replace("&","\\&")
permPass = form.cleaned_data['permanentPassword']
theme = form.cleaned_data['theme']
themeDorO = form.cleaned_data['themeDorO']
runasadmin = form.cleaned_data['runasadmin']
#runasadmin = form.cleaned_data['runasadmin']
passApproveMode = form.cleaned_data['passApproveMode']
denyLan = form.cleaned_data['denyLan']
enableDirectIP = form.cleaned_data['enableDirectIP']
@@ -73,6 +80,9 @@ def generator_view(request):
removeWallpaper = form.cleaned_data['removeWallpaper']
defaultManual = form.cleaned_data['defaultManual']
overrideManual = form.cleaned_data['overrideManual']
enablePrinter = form.cleaned_data['enablePrinter']
enableCamera = form.cleaned_data['enableCamera']
enableTerminal = form.cleaned_data['enableTerminal']
if all(char.isascii() for char in filename):
filename = re.sub(r'[^\w\s-]', '_', filename).strip()
@@ -89,18 +99,32 @@ def generator_view(request):
iconfile = form.cleaned_data.get('iconfile')
if not iconfile:
iconfile = form.cleaned_data.get('iconbase64')
iconlink = save_png(iconfile,myuuid,full_url,"icon.png")
iconlink_url, iconlink_uuid, iconlink_file = save_png(iconfile,myuuid,full_url,"icon.png")
except:
print("failed to get icon, using default")
iconlink = "false"
iconlink_url = "false"
iconlink_uuid = "false"
iconlink_file = "false"
try:
logofile = form.cleaned_data.get('logofile')
if not logofile:
logofile = form.cleaned_data.get('logobase64')
logolink = save_png(logofile,myuuid,full_url,"logo.png")
logolink_url, logolink_uuid, logolink_file = save_png(logofile,myuuid,full_url,"logo.png")
except:
print("failed to get logo")
logolink = "false"
logolink_url = "false"
logolink_uuid = "false"
logolink_file = "false"
try:
privacyfile = form.cleaned_data.get('privacyfile')
if not privacyfile:
privacyfile = form.cleaned_data.get('privacybase64')
privacylink_url, privacylink_uuid, privacylink_file = save_png(privacyfile,myuuid,full_url,"privacy.png")
except:
print("failed to get logo")
privacylink_url = "false"
privacylink_uuid = "false"
privacylink_file = "false"
###create the custom.txt json here and send in as inputs below
decodedCustom = {}
@@ -118,14 +142,18 @@ def generator_view(request):
decodedCustom['password'] = permPass
if theme != "system":
if themeDorO == "default":
decodedCustom['default-settings']['theme'] = theme
if platform == "windows-x86":
decodedCustom['default-settings']['allow-darktheme'] = 'Y' if theme == "dark" else 'N'
else:
decodedCustom['default-settings']['theme'] = theme
elif themeDorO == "override":
decodedCustom['override-settings']['theme'] = theme
decodedCustom['approve-mode'] = passApproveMode
if platform == "windows-x86":
decodedCustom['override-settings']['allow-darktheme'] = 'Y' if theme == "dark" else 'N'
else:
decodedCustom['override-settings']['theme'] = theme
decodedCustom['enable-lan-discovery'] = 'N' if denyLan else 'Y'
decodedCustom['direct-server'] = 'Y' if enableDirectIP else 'N'
#decodedCustom['direct-server'] = 'Y' if enableDirectIP else 'N'
decodedCustom['allow-auto-disconnect'] = 'Y' if autoClose else 'N'
decodedCustom['allow-remove-wallpaper'] = 'Y' if removeWallpaper else 'N'
if permissionsDorO == "default":
decodedCustom['default-settings']['access-mode'] = permissionsType
decodedCustom['default-settings']['enable-keyboard'] = 'Y' if enableKeyboard else 'N'
@@ -137,6 +165,14 @@ def generator_view(request):
decodedCustom['default-settings']['enable-record-session'] = 'Y' if enableRecording else 'N'
decodedCustom['default-settings']['enable-block-input'] = 'Y' if enableBlockingInput else 'N'
decodedCustom['default-settings']['allow-remote-config-modification'] = 'Y' if enableRemoteModi else 'N'
decodedCustom['default-settings']['direct-server'] = 'Y' if enableDirectIP else 'N'
decodedCustom['default-settings']['verification-method'] = 'use-permanent-password' if hidecm else 'use-both-passwords'
decodedCustom['default-settings']['approve-mode'] = passApproveMode
decodedCustom['default-settings']['allow-hide-cm'] = 'Y' if hidecm else 'N'
decodedCustom['default-settings']['allow-remove-wallpaper'] = 'Y' if removeWallpaper else 'N'
decodedCustom['default-settings']['enable-remote-printer'] = 'Y' if enablePrinter else 'N'
decodedCustom['default-settings']['enable-camera'] = 'Y' if enableCamera else 'N'
decodedCustom['default-settings']['enable-terminal'] = 'Y' if enableTerminal else 'N'
else:
decodedCustom['override-settings']['access-mode'] = permissionsType
decodedCustom['override-settings']['enable-keyboard'] = 'Y' if enableKeyboard else 'N'
@@ -148,6 +184,14 @@ def generator_view(request):
decodedCustom['override-settings']['enable-record-session'] = 'Y' if enableRecording else 'N'
decodedCustom['override-settings']['enable-block-input'] = 'Y' if enableBlockingInput else 'N'
decodedCustom['override-settings']['allow-remote-config-modification'] = 'Y' if enableRemoteModi else 'N'
decodedCustom['override-settings']['direct-server'] = 'Y' if enableDirectIP else 'N'
decodedCustom['override-settings']['verification-method'] = 'use-permanent-password' if hidecm else 'use-both-passwords'
decodedCustom['override-settings']['approve-mode'] = passApproveMode
decodedCustom['override-settings']['allow-hide-cm'] = 'Y' if hidecm else 'N'
decodedCustom['override-settings']['allow-remove-wallpaper'] = 'Y' if removeWallpaper else 'N'
decodedCustom['override-settings']['enable-remote-printer'] = 'Y' if enablePrinter else 'N'
decodedCustom['override-settings']['enable-camera'] = 'Y' if enableCamera else 'N'
decodedCustom['override-settings']['enable-terminal'] = 'Y' if enableTerminal else 'N'
for line in defaultManual.splitlines():
k, value = line.split('=')
@@ -163,27 +207,28 @@ def generator_view(request):
base64_bytes = base64.b64encode(string_bytes)
encodedCustom = base64_bytes.decode("ascii")
#github limits inputs to 10, so lump extras into one with json
extras = {}
extras['genurl'] = _settings.GENURL
extras['runasadmin'] = runasadmin
extras['urlLink'] = urlLink
extras['downloadLink'] = downloadLink
extras['delayFix'] = 'true' if delayFix else 'false'
extras['version'] = version
extras['rdgen'] = 'true'
extras['cycleMonitor'] = 'true' if cycleMonitor else 'false'
extras['xOffline'] = 'true' if xOffline else 'false'
extras['hidecm'] = 'true' if hidecm else 'false'
extras['removeNewVersionNotif'] = 'true' if removeNewVersionNotif else 'false'
extras['compname'] = compname
extra_input = json.dumps(extras)
# #github limits inputs to 10, so lump extras into one with json
# extras = {}
# extras['genurl'] = _settings.GENURL
# #extras['runasadmin'] = runasadmin
# extras['urlLink'] = urlLink
# extras['downloadLink'] = downloadLink
# extras['delayFix'] = 'true' if delayFix else 'false'
# extras['rdgen'] = 'true'
# extras['cycleMonitor'] = 'true' if cycleMonitor else 'false'
# extras['xOffline'] = 'true' if xOffline else 'false'
# extras['removeNewVersionNotif'] = 'true' if removeNewVersionNotif else 'false'
# extras['compname'] = compname
# extras['androidappid'] = androidappid
# extra_input = json.dumps(extras)
####from here run the github action, we need user, repo, access token.
if platform == 'windows':
url = 'https://api.github.com/repos/'+_settings.GHUSER+'/'+_settings.REPONAME+'/actions/workflows/generator-windows.yml/dispatches'
url = 'https://api.github.com/repos/'+_settings.GHUSER+'/'+_settings.REPONAME+'/actions/workflows/generator-windows.yml/dispatches'
if platform == 'windows-x86':
url = 'https://api.github.com/repos/'+_settings.GHUSER+'/'+_settings.REPONAME+'/actions/workflows/generator-windows-x86.yml/dispatches'
elif platform == 'linux':
url = 'https://api.github.com/repos/'+_settings.GHUSER+'/'+_settings.REPONAME+'/actions/workflows/generator-linux.yml/dispatches'
url = 'https://api.github.com/repos/'+_settings.GHUSER+'/'+_settings.REPONAME+'/actions/workflows/generator-linux.yml/dispatches'
elif platform == 'android':
url = 'https://api.github.com/repos/'+_settings.GHUSER+'/'+_settings.REPONAME+'/actions/workflows/generator-android.yml/dispatches'
elif platform == 'macos':
@@ -192,21 +237,62 @@ def generator_view(request):
url = 'https://api.github.com/repos/'+_settings.GHUSER+'/'+_settings.REPONAME+'/actions/workflows/generator-windows.yml/dispatches'
#url = 'https://api.github.com/repos/'+_settings.GHUSER+'/rustdesk/actions/workflows/test.yml/dispatches'
inputs_raw = {
"server":server,
"key":key,
"apiServer":apiServer,
"custom":encodedCustom,
"uuid":myuuid,
"iconlink_url":iconlink_url,
"iconlink_uuid":iconlink_uuid,
"iconlink_file":iconlink_file,
"logolink_url":logolink_url,
"logolink_uuid":logolink_uuid,
"logolink_file":logolink_file,
"privacylink_url":privacylink_url,
"privacylink_uuid":privacylink_uuid,
"privacylink_file":privacylink_file,
"appname":appname,
"genurl":_settings.GENURL,
"urlLink":urlLink,
"downloadLink":downloadLink,
"delayFix": 'true' if delayFix else 'false',
"rdgen":'true',
"cycleMonitor": 'true' if cycleMonitor else 'false',
"xOffline": 'true' if xOffline else 'false',
"removeNewVersionNotif": 'true' if removeNewVersionNotif else 'false',
"compname": compname,
"androidappid":androidappid,
"filename":filename
}
temp_json_path = f"data_{uuid.uuid4()}.json"
zip_filename = f"secrets_{uuid.uuid4()}.zip"
zip_path = "temp_zips/%s" % (zip_filename)
Path("temp_zips").mkdir(parents=True, exist_ok=True)
with open(temp_json_path, "w") as f:
json.dump(inputs_raw, f)
with pyzipper.AESZipFile(zip_path, 'w', compression=pyzipper.ZIP_LZMA, encryption=pyzipper.WZ_AES) as zf:
zf.setpassword(_settings.ZIP_PASSWORD.encode())
zf.write(temp_json_path, arcname="secrets.json")
# 4. Cleanup the plain JSON file immediately
if os.path.exists(temp_json_path):
os.remove(temp_json_path)
zipJson = {}
zipJson['url'] = full_url
zipJson['file'] = zip_filename
zip_url = json.dumps(zipJson)
data = {
"ref":"master",
"ref":_settings.GHBRANCH,
"inputs":{
"server":server,
"key":key,
"apiServer":apiServer,
"custom":encodedCustom,
"uuid":myuuid,
#"iconbase64":iconbase64.decode("utf-8"),
#"logobase64":logobase64.decode("utf-8") if logobase64 else "",
"iconlink":iconlink,
"logolink":logolink,
"appname":appname,
"extras":extra_input,
"filename":filename
"version":version,
"zip_url":zip_url
}
}
#print(data)
@@ -219,7 +305,7 @@ def generator_view(request):
create_github_run(myuuid)
response = requests.post(url, json=data, headers=headers)
print(response)
if response.status_code == 204:
if response.status_code == 204 or response.status_code == 200:
return render(request, 'waiting.html', {'filename':filename, 'uuid':myuuid, 'status':"Starting generator...please wait", 'platform':platform})
else:
return JsonResponse({"error": "Something went wrong"})
@@ -328,7 +414,7 @@ def startgh(request):
####from here run the github action, we need user, repo, access token.
url = 'https://api.github.com/repos/'+_settings.GHUSER+'/'+_settings.REPONAME+'/actions/workflows/generator-'+data_.get('platform')+'.yml/dispatches'
data = {
"ref":"master",
"ref": _settings.GHBRANCH,
"inputs":{
"server":data_.get('server'),
"key":data_.get('key'),
@@ -371,12 +457,12 @@ def save_png(file, uuid, domain, name):
with open(file_save_path, "wb+") as f:
for chunk in file.chunks():
f.write(chunk)
imageJson = {}
imageJson['url'] = domain
imageJson['uuid'] = uuid
imageJson['file'] = name
# imageJson = {}
# imageJson['url'] = domain
# imageJson['uuid'] = uuid
# imageJson['file'] = name
#return "%s/%s" % (domain, file_save_path)
return json.dumps(imageJson)
return domain, uuid, name
def save_custom_client(request):
file = request.FILES['file']
@@ -387,4 +473,39 @@ def save_custom_client(request):
for chunk in file.chunks():
f.write(chunk)
return HttpResponse("File saved successfully!")
return HttpResponse("File saved successfully!")
def cleanup_secrets(request):
# Pass the UUID as a query param or in JSON body
data = json.loads(request.body)
my_uuid = data.get('uuid')
if not my_uuid:
return HttpResponse("Missing UUID", status=400)
# 1. Find the files in your temp directory matching the UUID
temp_dir = os.path.join('temp_zips')
# We look for any file starting with 'secrets_' and containing the uuid
for filename in os.listdir(temp_dir):
if my_uuid in filename and filename.endswith('.zip'):
file_path = os.path.join(temp_dir, filename)
try:
os.remove(file_path)
print(f"Successfully deleted {file_path}")
except OSError as e:
print(f"Error deleting file: {e}")
return HttpResponse("Cleanup successful", status=200)
def get_zip(request):
filename = request.GET['filename']
#filename = filename+".exe"
file_path = os.path.join('temp_zips',filename)
with open(file_path, 'rb') as file:
response = HttpResponse(file, headers={
'Content-Type': 'application/vnd.microsoft.portable-executable',
'Content-Disposition': f'attachment; filename="{filename}"'
})
return response

View File

@@ -1,4 +1,5 @@
django
requests
pillow
gunicorn
gunicorn
pyzipper

View File

@@ -20,10 +20,14 @@
* Now click New repository secret
* Set the Name to GENURL
* Set the Secret to https://rdgen.hostname.com (or whatever your server will be accessed from)
* Now click New repository secret again
* Set the Name to ZIP_PASSWORD
* Set the Secret to any password you want (use this in the next step as well) - generate a password by running: ```python3 -c 'import secrets; print(secrets.token_hex(100))'```
4. Now download the docker-compose.yml file and fill in the environment variables:
* SECRET_KEY="your secret key" - generate a secret key by running: ```python3 -c 'import secrets; print(secrets.token_hex(100))'```
* GHUSER="your github username"
* GHBEARER="your fine-grained access token"
* ZIP_PASSWORD="the same password that you entered as a github secret"
* PROTOCOL="https" *optional - defaults to "https", change to "http" if you need to
* REPONAME="rdgen" *optional - defaults to "rdgen", change this if you renamed the repo when you forked it
5. Now just run ```docker compose up -d```