23 Commits
master ... dev

Author SHA1 Message Date
Bryan Gerlach
cbd6eceaa3 test input hiding 2026-01-12 15:54:04 -06:00
Bryan Gerlach
c20c90814b test input hiding 2026-01-12 14:20:25 -06:00
Bryan Gerlach
7ccf863a8f test input hiding 2026-01-12 14:12:08 -06:00
Bryan Gerlach
56900a2548 test input hiding 2026-01-12 13:48:22 -06:00
Bryan Gerlach
15b6923164 test input hiding 2026-01-12 12:18:34 -06:00
Bryan Gerlach
ee2e27de44 test input hiding 2026-01-12 10:06:35 -06:00
Bryan Gerlach
30e83c107e test input hiding 2026-01-11 19:23:06 -06:00
Bryan Gerlach
6f5b0f944b test input hiding 2026-01-11 18:02:24 -06:00
Bryan Gerlach
a85b6fcda5 test input hiding 2026-01-11 17:56:01 -06:00
Bryan Gerlach
12d71cc5c5 test input hiding 2026-01-11 17:33:50 -06:00
Bryan Gerlach
164c51f44b test input hiding 2026-01-11 17:29:11 -06:00
Bryan Gerlach
2caaea562b test input hiding 2026-01-11 17:05:19 -06:00
Bryan Gerlach
a76e26e58b test input hiding 2026-01-11 16:46:21 -06:00
Bryan Gerlach
b98d2d0187 test input hiding 2026-01-11 16:43:26 -06:00
Bryan Gerlach
18a7cf37b6 test input hiding 2026-01-11 16:39:15 -06:00
Bryan Gerlach
4068167379 test input hiding 2026-01-11 15:26:19 -06:00
Bryan Gerlach
14703c9f91 test input hiding 2026-01-11 15:22:12 -06:00
Bryan Gerlach
2f33b26441 test input hiding 2026-01-11 15:20:31 -06:00
Bryan Gerlach
0bd1d7d55e test input hiding 2026-01-11 15:12:19 -06:00
Bryan Gerlach
ea6dc088e8 test input hiding 2026-01-11 15:05:02 -06:00
Bryan Gerlach
50237b8725 test input hiding 2026-01-11 14:57:40 -06:00
Bryan Gerlach
78e037c763 test input hiding 2026-01-11 14:50:35 -06:00
Bryan
52682fec1d Merge pull request #178 from bryangerlach/master
merge master into dev
2026-01-10 18:48:38 -06:00
11 changed files with 130 additions and 310 deletions

View File

@@ -1,32 +0,0 @@
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")

View File

@@ -87,44 +87,31 @@ jobs:
import io import io
import os import os
import json import json
import time
for attempt in range(5): r = requests.get('${{ fromJson(inputs.zip_url).url }}/get_zip?filename=${{ fromJson(inputs.zip_url).file }}')
try: r.raise_for_status()
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: try:
with pyzipper.AESZipFile(io.BytesIO(r.content)) as zf: with pyzipper.AESZipFile(io.BytesIO(r.content)) as zf:
zf.setpassword('${{ secrets.ZIP_PASSWORD }}'.encode()) zf.setpassword('${{ secrets.ZIP_PASSWORD }}'.encode())
with zf.open('secrets.json') as f: with zf.open('secrets.json') as f:
secrets = json.load(f) secrets = json.load(f)
except Exception as e: except Exception as e:
print(f"Error: Could not decrypt ZIP. Check if password matches. {e}") print(f"Error: Could not decrypt ZIP. Check if password matches. {e}")
exit(1) exit(1)
with open(os.environ['GITHUB_ENV'], 'a') as env_file: with open(os.environ['GITHUB_ENV'], 'a') as env_file:
for key, value in secrets.items(): for key, value in secrets.items():
print(f"::add-mask::{value}") print(f"::add-mask::{value}")
env_file.write(f"{key}={value}\n") env_file.write(f"{key}={value}\n")
print("Secrets loaded into environment.") print("Secrets loaded into environment.")
- name: Finalize and Cleanup zip/json - name: Finalize and Cleanup zip/json
if: always() # Run even if previous steps fail if: always() # Run even if previous steps fail
continue-on-error: true
uses: fjogeleit/http-request-action@v1 uses: fjogeleit/http-request-action@v1
with: with:
url: "${{ secrets.GENURL }}/cleanzip" url: ${{ env.STATUS_URL }}
method: 'POST' method: 'POST'
customHeaders: '{"Content-Type": "application/json"}' customHeaders: '{"Content-Type": "application/json"}'
data: '{"uuid": "${{ env.uuid }}"}' data: '{"uuid": "${{ env.uuid }}"}'

View File

@@ -83,7 +83,6 @@ jobs:
import io import io
import os import os
import json import json
import time
for attempt in range(5): for attempt in range(5):
try: try:
@@ -301,8 +300,8 @@ jobs:
run: | run: |
sed -i -e 's|rs-ny.rustdesk.com|${{ env.server }}|' ./libs/hbb_common/src/config.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|OeVuKk5nlHiXp+APNn0Y3pC1Iwpwn44JGqrQCsWqmBw=|${{ env.key }}|' ./libs/hbb_common/src/config.rs
wget https://raw.githubusercontent.com/bryangerlach/rdgen/refs/heads/master/.github/patches/allowCustom.py wget https://raw.githubusercontent.com/bryangerlach/rdgen/refs/heads/master/.github/patches/allowCustom.diff
python allowCustom.py git apply allowCustom.diff
wget https://raw.githubusercontent.com/bryangerlach/rdgen/refs/heads/master/.github/patches/removeSetupServerTip.diff wget https://raw.githubusercontent.com/bryangerlach/rdgen/refs/heads/master/.github/patches/removeSetupServerTip.diff
git apply removeSetupServerTip.diff git apply removeSetupServerTip.diff
echo -n "${{ env.custom }}" | cat > ./custom_.txt echo -n "${{ env.custom }}" | cat > ./custom_.txt
@@ -676,7 +675,6 @@ jobs:
import io import io
import os import os
import json import json
import time
for attempt in range(5): for attempt in range(5):
try: try:
@@ -794,7 +792,6 @@ jobs:
import io import io
import os import os
import json import json
import time
for attempt in range(5): for attempt in range(5):
try: try:
@@ -911,7 +908,6 @@ jobs:
import io import io
import os import os
import json import json
import time
for attempt in range(5): for attempt in range(5):
try: try:
@@ -945,10 +941,9 @@ jobs:
- name: Finalize and Cleanup zip/json - name: Finalize and Cleanup zip/json
if: always() # Run even if previous steps fail if: always() # Run even if previous steps fail
continue-on-error: true
uses: fjogeleit/http-request-action@v1 uses: fjogeleit/http-request-action@v1
with: with:
url: "${{ secrets.GENURL }}/cleanzip" url: ${{ env.STATUS_URL }}
method: 'POST' method: 'POST'
customHeaders: '{"Content-Type": "application/json"}' customHeaders: '{"Content-Type": "application/json"}'
data: '{"uuid": "${{ env.uuid }}"}' data: '{"uuid": "${{ env.uuid }}"}'

View File

@@ -115,10 +115,9 @@ jobs:
- name: Finalize and Cleanup zip/json - name: Finalize and Cleanup zip/json
if: always() # Run even if previous steps fail if: always() # Run even if previous steps fail
continue-on-error: true
uses: fjogeleit/http-request-action@v1 uses: fjogeleit/http-request-action@v1
with: with:
url: "${{ secrets.GENURL }}/cleanzip" url: ${{ env.STATUS_URL }}
method: 'POST' method: 'POST'
customHeaders: '{"Content-Type": "application/json"}' customHeaders: '{"Content-Type": "application/json"}'
data: '{"uuid": "${{ env.uuid }}"}' data: '{"uuid": "${{ env.uuid }}"}'
@@ -237,8 +236,8 @@ jobs:
sed -i -e 's|OeVuKk5nlHiXp+APNn0Y3pC1Iwpwn44JGqrQCsWqmBw=|${{ env.key }}|' ./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 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.py wget https://raw.githubusercontent.com/bryangerlach/rdgen/refs/heads/master/.github/patches/allowCustom.diff
python allowCustom.py git apply allowCustom.diff
wget https://raw.githubusercontent.com/bryangerlach/rdgen/refs/heads/master/.github/patches/removeSetupServerTip.diff wget https://raw.githubusercontent.com/bryangerlach/rdgen/refs/heads/master/.github/patches/removeSetupServerTip.diff
git apply removeSetupServerTip.diff git apply removeSetupServerTip.diff

View File

@@ -3,16 +3,56 @@ run-name: Custom Windows x86 Client Generator
on: on:
workflow_dispatch: workflow_dispatch:
inputs: inputs:
version: server:
description: 'version to buld' description: 'Rendezvous Server'
required: true required: true
default: '' default: ''
type: string type: string
zip_url: key:
description: 'url to zip of json' description: 'Public Key'
required: true required: true
default: '' default: ''
type: string 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: 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 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
@@ -36,7 +76,7 @@ env:
# 2. Update the `VCPKG_COMMIT_ID` in `ci.yml` and `playground.yml`. # 2. Update the `VCPKG_COMMIT_ID` in `ci.yml` and `playground.yml`.
VCPKG_COMMIT_ID: "120deac3062162151622ca4860575a33844ba10b" VCPKG_COMMIT_ID: "120deac3062162151622ca4860575a33844ba10b"
ARMV7_VCPKG_COMMIT_ID: "6f29f12e82a8293156836ad81cc9bf5af41fe836" # 2025.01.13, got "/opt/artifacts/vcpkg/vcpkg: No such file or directory" with latest version ARMV7_VCPKG_COMMIT_ID: "6f29f12e82a8293156836ad81cc9bf5af41fe836" # 2025.01.13, got "/opt/artifacts/vcpkg/vcpkg: No such file or directory" with latest version
VERSION: "${{ inputs.version }}" VERSION: "${{ fromJson(inputs.extras).version }}"
NDK_VERSION: "r27c" NDK_VERSION: "r27c"
#signing keys env variable checks #signing keys env variable checks
ANDROID_SIGNING_KEY: "${{ secrets.ANDROID_SIGNING_KEY }}" ANDROID_SIGNING_KEY: "${{ secrets.ANDROID_SIGNING_KEY }}"
@@ -65,59 +105,6 @@ jobs:
} }
# - { target: aarch64-pc-windows-msvc, os: windows-2022 } # - { target: aarch64-pc-windows-msvc, os: windows-2022 }
steps: 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: Export GitHub Actions cache environment variables - name: Export GitHub Actions cache environment variables
uses: actions/github-script@v6 uses: actions/github-script@v6
with: with:
@@ -126,14 +113,14 @@ jobs:
core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || ''); core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || '');
- name: Set rdgen value - name: Set rdgen value
if: ${{ env.rdgen == 'true' }} if: ${{ fromJson(inputs.extras).rdgen == 'true' }}
run: | run: |
echo "STATUS_URL=${{ secrets.GENURL }}/updategh" >> $env:GITHUB_ENV echo "STATUS_URL=${{ secrets.GENURL }}/updategh" >> $env:GITHUB_ENV
- name: Set rdgen value - name: Set rdgen value
if: ${{ env.rdgen == 'false' }} if: ${{ fromJson(inputs.extras).rdgen == 'false' }}
run: | run: |
echo "STATUS_URL=${{ env.apiServer }}/api/updategh" >> $env:GITHUB_ENV echo "STATUS_URL=${{ inputs.apiServer }}/api/updategh" >> $env:GITHUB_ENV
- name: Report Status - name: Report Status
uses: fjogeleit/http-request-action@v1 uses: fjogeleit/http-request-action@v1
@@ -142,7 +129,7 @@ jobs:
url: ${{ env.STATUS_URL }} url: ${{ env.STATUS_URL }}
method: 'POST' method: 'POST'
customHeaders: '{"Content-Type": "application/json"}' customHeaders: '{"Content-Type": "application/json"}'
data: '{"uuid": "${{ env.uuid }}", "status": "5% complete"}' data: '{"uuid": "${{ inputs.uuid }}", "status": "5% complete"}'
- name: Checkout source code - name: Checkout source code
if: ${{ env.VERSION != 'master' }} if: ${{ env.VERSION != 'master' }}
@@ -165,25 +152,25 @@ jobs:
Get-ChildItem -Path "${env:ProgramFiles}" | % { $_.FullName } | Select-String -Pattern "[\/\\]ImageMagick[^\/\\]*$" | Out-File -Append -FilePath $env:GITHUB_PATH -Encoding utf8 Get-ChildItem -Path "${env:ProgramFiles}" | % { $_.FullName } | Select-String -Pattern "[\/\\]ImageMagick[^\/\\]*$" | Out-File -Append -FilePath $env:GITHUB_PATH -Encoding utf8
- name: change appname to custom - name: change appname to custom
if: env.appname != 'rustdesk' if: inputs.appname != 'rustdesk'
continue-on-error: true continue-on-error: true
shell: bash shell: bash
run: | run: |
# ./Cargo.toml # ./Cargo.toml
sed -i -e 's|description = "RustDesk Remote Desktop"|description = "${{ env.appname }}"|' ./Cargo.toml sed -i -e 's|description = "RustDesk Remote Desktop"|description = "${{ inputs.appname }}"|' ./Cargo.toml
sed -i -e 's|ProductName = "RustDesk"|ProductName = "${{ env.appname }}"|' ./Cargo.toml sed -i -e 's|ProductName = "RustDesk"|ProductName = "${{ inputs.appname }}"|' ./Cargo.toml
sed -i -e 's|FileDescription = "RustDesk Remote Desktop"|FileDescription = "${{ env.appname }}"|' ./Cargo.toml sed -i -e 's|FileDescription = "RustDesk Remote Desktop"|FileDescription = "${{ inputs.appname }}"|' ./Cargo.toml
sed -i -e 's|OriginalFilename = "rustdesk.exe"|OriginalFilename = "${{ env.appname }}.exe"|' ./Cargo.toml sed -i -e 's|OriginalFilename = "rustdesk.exe"|OriginalFilename = "${{ inputs.appname }}.exe"|' ./Cargo.toml
# ./libs/portable/Cargo.toml # ./libs/portable/Cargo.toml
sed -i -e 's|description = "RustDesk Remote Desktop"|description = "${{ env.appname }}"|' ./libs/portable/Cargo.toml sed -i -e 's|description = "RustDesk Remote Desktop"|description = "${{ inputs.appname }}"|' ./libs/portable/Cargo.toml
sed -i -e 's|ProductName = "RustDesk"|ProductName = "${{ env.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 = "${{ env.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 = "${{ env.appname }}.exe"|' ./libs/portable/Cargo.toml sed -i -e 's|OriginalFilename = "rustdesk.exe"|OriginalFilename = "${{ inputs.appname }}.exe"|' ./libs/portable/Cargo.toml
# ./src/lang/en.rs # ./src/lang/en.rs
find ./src/lang -name "*.rs" -exec sed -i -e 's|RustDesk|${{ env.appname }}|' {} \; find ./src/lang -name "*.rs" -exec sed -i -e 's|RustDesk|${{ inputs.appname }}|' {} \;
- name: fix registry if appname has a space - name: fix registry if appname has a space
if: contains(env.appname, ' ') if: contains(inputs.appname, ' ')
continue-on-error: true continue-on-error: true
shell: bash shell: bash
run: | run: |
@@ -203,41 +190,41 @@ jobs:
sed -i -e 's|reg delete HKEY_CLASSES_ROOT\\\\{ext} /f|reg delete \\\"HKEY_CLASSES_ROOT\\\\{ext}\\\" /f|' ./src/platform/windows.rs sed -i -e 's|reg delete HKEY_CLASSES_ROOT\\\\{ext} /f|reg delete \\\"HKEY_CLASSES_ROOT\\\\{ext}\\\" /f|' ./src/platform/windows.rs
- name: change company name - name: change company name
if: env.compname != 'Purslane Ltd' if: fromJson(inputs.extras).compname != 'Purslane Ltd'
continue-on-error: true continue-on-error: true
shell: bash shell: bash
run: | run: |
sed -i -e 's|PURSLANE|${{ env.compname }}|' ./res/msi/preprocess.py sed -i -e 's|PURSLANE|${{ fromJson(inputs.extras).compname }}|' ./res/msi/preprocess.py
sed -i -e 's|Purslane Ltd|${{ env.compname }}|' ./res/msi/preprocess.py sed -i -e 's|Purslane Ltd|${{ fromJson(inputs.extras).compname }}|' ./res/msi/preprocess.py
sed -i -e 's|Copyright &copy; 2025 Purslane Ltd.|Copyright \&copy; 2025 ${{ env.compname }}|' ./src/ui/index.tis sed -i -e 's|Copyright &copy; 2025 Purslane Ltd.|Copyright \&copy; 2025 ${{ fromJson(inputs.extras).compname }}|' ./src/ui/index.tis
sed -i -e 's|Purslane Ltd|${{ env.compname }}|' ./Cargo.toml sed -i -e 's|Purslane Ltd|${{ fromJson(inputs.extras).compname }}|' ./Cargo.toml
sed -i -e 's|Purslane Ltd|${{ env.compname }}|' ./libs/portable/Cargo.toml sed -i -e 's|Purslane Ltd|${{ fromJson(inputs.extras).compname }}|' ./libs/portable/Cargo.toml
sed -i -e 's|Purslane Ltd.|${{ env.compname }}|' ./res/setup.nsi sed -i -e 's|Purslane Ltd.|${{ fromJson(inputs.extras).compname }}|' ./res/setup.nsi
- name: change url to custom - name: change url to custom
if: env.urlLink != 'https://rustdesk.com' if: fromJson(inputs.extras).urlLink != 'https://rustdesk.com'
continue-on-error: true continue-on-error: true
shell: bash shell: bash
run: | run: |
sed -i -e 's|Homepage: https://rustdesk.com|Homepage: ${{ env.urlLink }}|' ./build.py sed -i -e 's|Homepage: https://rustdesk.com|Homepage: ${{ fromJson(inputs.extras).urlLink }}|' ./build.py
sed -i -e "s|<div .link .custom-event url='https://rustdesk.com'>|<div .link .custom-event url='${{ env.urlLink }}'>|" ./src/ui/index.tis sed -i -e "s|<div .link .custom-event url='https://rustdesk.com'>|<div .link .custom-event url='${{ fromJson(inputs.extras).urlLink }}'>|" ./src/ui/index.tis
sed -i -e "s|<div .link .custom-event url='https://rustdesk.com/privacy.html'>|<div .link .custom-event url='${{ env.urlLink }}/privacy.html'>|" ./src/ui/index.tis sed -i -e "s|<div .link .custom-event url='https://rustdesk.com/privacy.html'>|<div .link .custom-event url='${{ fromJson(inputs.extras).urlLink }}/privacy.html'>|" ./src/ui/index.tis
sed -i -e "s|https://rustdesk.com/|${{env.urlLink }}|" ./res/setup.nsi sed -i -e "s|https://rustdesk.com/|${{fromJson(inputs.extras).urlLink }}|" ./res/setup.nsi
- name: change download link to custom - name: change download link to custom
if: env.downloadLink != 'https://rustdesk.com/download' if: fromJson(inputs.extras).downloadLink != 'https://rustdesk.com/download'
continue-on-error: true continue-on-error: true
shell: bash shell: bash
run: | run: |
sed -i -e 's|https://rustdesk.com/download|${{ env.downloadLink }}|' ./src/ui/index.tis sed -i -e 's|https://rustdesk.com/download|${{ fromJson(inputs.extras).downloadLink }}|' ./src/ui/index.tis
- name: set server, key, and apiserver - name: set server, key, and apiserver
continue-on-error: true continue-on-error: true
shell: bash shell: bash
run: | run: |
sed -i -e 's|rs-ny.rustdesk.com|${{ env.server }}|' ./libs/hbb_common/src/config.rs sed -i -e 's|rs-ny.rustdesk.com|${{ inputs.server }}|' ./libs/hbb_common/src/config.rs
sed -i -e 's|OeVuKk5nlHiXp+APNn0Y3pC1Iwpwn44JGqrQCsWqmBw=|${{ env.key }}|' ./libs/hbb_common/src/config.rs sed -i -e 's|OeVuKk5nlHiXp+APNn0Y3pC1Iwpwn44JGqrQCsWqmBw=|${{ inputs.key }}|' ./libs/hbb_common/src/config.rs
sed -i -e 's|https://admin.rustdesk.com|${{ env.apiServer }}|' ./src/common.rs sed -i -e 's|https://admin.rustdesk.com|${{ inputs.apiServer }}|' ./src/common.rs
sed -i -e 's|<span>{translate("Ready")}, <span .link #setup-server>{translate("setup_server_tip")}</span></span>|translate("Ready")|' ./src/ui/index.tis sed -i -e 's|<span>{translate("Ready")}, <span .link #setup-server>{translate("setup_server_tip")}</span></span>|translate("Ready")|' ./src/ui/index.tis
- name: allow custom.txt - name: allow custom.txt
@@ -258,7 +245,7 @@ jobs:
url: ${{ env.STATUS_URL }} url: ${{ env.STATUS_URL }}
method: 'POST' method: 'POST'
customHeaders: '{"Content-Type": "application/json"}' customHeaders: '{"Content-Type": "application/json"}'
data: '{"uuid": "${{ env.uuid }}", "status": "10% complete"}' data: '{"uuid": "${{ inputs.uuid }}", "status": "10% complete"}'
- name: Install Rust toolchain - name: Install Rust toolchain
uses: dtolnay/rust-toolchain@v1 uses: dtolnay/rust-toolchain@v1
@@ -278,7 +265,7 @@ jobs:
url: ${{ env.STATUS_URL }} url: ${{ env.STATUS_URL }}
method: 'POST' method: 'POST'
customHeaders: '{"Content-Type": "application/json"}' customHeaders: '{"Content-Type": "application/json"}'
data: '{"uuid": "${{ env.uuid }}", "status": "20% complete"}' data: '{"uuid": "${{ inputs.uuid }}", "status": "20% complete"}'
- name: Setup vcpkg with Github Actions binary cache - name: Setup vcpkg with Github Actions binary cache
uses: lukka/run-vcpkg@v11 uses: lukka/run-vcpkg@v11
@@ -308,7 +295,7 @@ jobs:
shell: bash shell: bash
- name: icon stuff - name: icon stuff
if: ${{ env.iconlink_url != 'false' }} if: ${{ inputs.iconlink != 'false' }}
continue-on-error: true continue-on-error: true
shell: bash shell: bash
run: | run: |
@@ -317,10 +304,10 @@ jobs:
mv ./res/tray-icon.ico ./res/tray-icon.ico.bak mv ./res/tray-icon.ico ./res/tray-icon.ico.bak
- name: magick stuff - name: magick stuff
if: ${{ env.iconlink_url != 'false' }} if: ${{ inputs.iconlink != 'false' }}
continue-on-error: true continue-on-error: true
run: | run: |
Invoke-WebRequest -Uri ${{ env.iconlink_url }}/get_png?filename=${{ env.iconlink_file }}"&"uuid=${{ env.iconlink_uuid }} -OutFile ./res/icon.png Invoke-WebRequest -Uri ${{ fromJson(inputs.iconlink).url }}/get_png?filename=${{ fromJson(inputs.iconlink).file }}"&"uuid=${{ fromJson(inputs.iconlink).uuid }} -OutFile ./res/icon.png
mv ./res/32x32.png ./res/32x32.png.bak mv ./res/32x32.png ./res/32x32.png.bak
mv ./res/64x64.png ./res/64x64.png.bak mv ./res/64x64.png ./res/64x64.png.bak
mv ./res/128x128.png ./res/128x128.png.bak mv ./res/128x128.png ./res/128x128.png.bak
@@ -334,7 +321,7 @@ jobs:
- name: ui.rs icon - name: ui.rs icon
if: ${{ env.iconlink_url != 'false' }} if: ${{ inputs.iconlink != 'false' }}
continue-on-error: true continue-on-error: true
shell: bash shell: bash
run: | run: |
@@ -345,14 +332,14 @@ jobs:
- name: fix connection delay - name: fix connection delay
continue-on-error: true continue-on-error: true
if: ${{ env.delayFix == 'true' }} if: ${{ fromJson(inputs.extras).delayFix == 'true' }}
shell: bash shell: bash
run: | run: |
sed -i -e 's|!key.is_empty()|false|' ./src/client.rs sed -i -e 's|!key.is_empty()|false|' ./src/client.rs
- name: removeNewVersionNotif - name: removeNewVersionNotif
continue-on-error: true continue-on-error: true
if: env.removeNewVersionNotif == 'true' if: fromJson(inputs.extras).removeNewVersionNotif == 'true'
shell: bash shell: bash
run: | run: |
sed -i -e 's|{software_update_url ? <UpdateMe /> : ""}||' ./src/ui/index.tis sed -i -e 's|{software_update_url ? <UpdateMe /> : ""}||' ./src/ui/index.tis
@@ -365,7 +352,7 @@ jobs:
url: ${{ env.STATUS_URL }} url: ${{ env.STATUS_URL }}
method: 'POST' method: 'POST'
customHeaders: '{"Content-Type": "application/json"}' customHeaders: '{"Content-Type": "application/json"}'
data: '{"uuid": "${{ env.uuid }}", "status": "50% complete, this step takes about 5 minutes, be patient."}' data: '{"uuid": "${{ inputs.uuid }}", "status": "50% complete, this step takes about 5 minutes, be patient."}'
- name: Build rustdesk - name: Build rustdesk
id: build id: build
@@ -410,7 +397,7 @@ jobs:
url: ${{ env.STATUS_URL }} url: ${{ env.STATUS_URL }}
method: 'POST' method: 'POST'
customHeaders: '{"Content-Type": "application/json"}' customHeaders: '{"Content-Type": "application/json"}'
data: '{"uuid": "${{ env.uuid }}", "status": "70% complete, this step takes about 5 minutes, be patient."}' data: '{"uuid": "${{ inputs.uuid }}", "status": "70% complete, this step takes about 5 minutes, be patient."}'
- name: zip dlls - name: zip dlls
continue-on-error: true continue-on-error: true
@@ -443,16 +430,16 @@ jobs:
- name: Create custom.txt file - name: Create custom.txt file
shell: bash shell: bash
run: | run: |
echo -n "${{ env.custom }}" | cat > ./Release/custom.txt echo -n "${{ inputs.custom }}" | cat > ./Release/custom.txt
- name: Build self-extracted executable - name: Build self-extracted executable
shell: bash shell: bash
run: | run: |
mv "./Release/rustdesk.exe" "./Release/${{ env.appname }}.exe" || echo "rustdesk.exe" mv "./Release/rustdesk.exe" "./Release/${{ inputs.appname }}.exe" || echo "rustdesk.exe"
sed -i '/dpiAware/d' res/manifest.xml sed -i '/dpiAware/d' res/manifest.xml
pushd ./libs/portable pushd ./libs/portable
pip3 install -r requirements.txt pip3 install -r requirements.txt
python3 ./generate.py -f ../../Release/ -o . -e "../../Release/${{ env.appname }}.exe" python3 ./generate.py -f ../../Release/ -o . -e "../../Release/${{ inputs.appname }}.exe"
popd popd
mkdir -p ./SignOutput mkdir -p ./SignOutput
mv ./target/release/rustdesk-portable-packer.exe "./SignOutput/rustdesk.exe" mv ./target/release/rustdesk-portable-packer.exe "./SignOutput/rustdesk.exe"
@@ -464,7 +451,7 @@ jobs:
url: ${{ env.STATUS_URL }} url: ${{ env.STATUS_URL }}
method: 'POST' method: 'POST'
customHeaders: '{"Content-Type": "application/json"}' customHeaders: '{"Content-Type": "application/json"}'
data: '{"uuid": "${{ env.uuid }}", "status": "85% complete"}' data: '{"uuid": "${{ inputs.uuid }}", "status": "85% complete"}'
- name: zip exe - name: zip exe
continue-on-error: true continue-on-error: true
@@ -496,19 +483,19 @@ jobs:
- name: rename rustdesk.exe to filename.exe - name: rename rustdesk.exe to filename.exe
run: | run: |
mv ./SignOutput/rustdesk.exe "./SignOutput/${{ env.filename }}.exe" || echo "rustdesk" mv ./SignOutput/rustdesk.exe "./SignOutput/${{ inputs.filename }}.exe" || echo "rustdesk"
- name: send file to rdgen server - name: send file to rdgen server
if: ${{ env.rdgen == 'true' }} if: ${{ fromJson(inputs.extras).rdgen == 'true' }}
shell: bash shell: bash
run: | run: |
curl -i -X POST -H "Content-Type: multipart/form-data" -H "Authorization: Bearer ${{ env.token }}" -F "file=@./SignOutput/${{ env.filename }}.exe" -F "uuid=${{ env.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=@./SignOutput/${{ inputs.filename }}.exe" -F "uuid=${{ inputs.uuid }}" ${{ secrets.GENURL }}/save_custom_client
- name: send file to api server - name: send file to api server
if: ${{ env.rdgen == 'false' }} if: ${{ fromJson(inputs.extras).rdgen == 'false' }}
shell: bash shell: bash
run: | run: |
curl -i -X POST -H "Content-Type: multipart/form-data" -H "Authorization: Bearer ${{ env.token }}" -F "file=@./SignOutput/${{ env.filename }}.exe" ${{ env.apiServer }}/api/save_custom_client curl -i -X POST -H "Content-Type: multipart/form-data" -H "Authorization: Bearer ${{ fromJson(inputs.extras).token }}" -F "file=@./SignOutput/${{ inputs.filename }}.exe" ${{ inputs.apiServer }}/api/save_custom_client
- name: Report Status - name: Report Status
uses: fjogeleit/http-request-action@v1 uses: fjogeleit/http-request-action@v1
@@ -516,7 +503,7 @@ jobs:
url: ${{ env.STATUS_URL }} url: ${{ env.STATUS_URL }}
method: 'POST' method: 'POST'
customHeaders: '{"Content-Type": "application/json"}' customHeaders: '{"Content-Type": "application/json"}'
data: '{"uuid": "${{ env.uuid }}", "status": "Success"}' data: '{"uuid": "${{ inputs.uuid }}", "status": "Success"}'
- name: failed - name: failed
if: failure() if: failure()
@@ -525,7 +512,7 @@ jobs:
url: ${{ env.STATUS_URL }} url: ${{ env.STATUS_URL }}
method: 'POST' method: 'POST'
customHeaders: '{"Content-Type": "application/json"}' customHeaders: '{"Content-Type": "application/json"}'
data: '{"uuid": "${{ env.uuid }}", "status": "Generation failed, try again"}' data: '{"uuid": "${{ inputs.uuid }}", "status": "Generation failed, try again"}'
- name: failed - name: failed
if: cancelled() if: cancelled()
@@ -534,4 +521,4 @@ jobs:
url: ${{ env.STATUS_URL }} url: ${{ env.STATUS_URL }}
method: 'POST' method: 'POST'
customHeaders: '{"Content-Type": "application/json"}' customHeaders: '{"Content-Type": "application/json"}'
data: '{"uuid": "${{ env.uuid }}", "status": "Generation cancelled, try again"}' data: '{"uuid": "${{ inputs.uuid }}", "status": "Generation cancelled, try again"}'

View File

@@ -55,7 +55,6 @@ jobs:
configuration: Release configuration: Release
platform: x64 platform: x64
target_version: Windows10 target_version: Windows10
secrets: inherit
strategy: strategy:
fail-fast: false fail-fast: false
@@ -88,44 +87,31 @@ jobs:
import io import io
import os import os
import json import json
import time
for attempt in range(5): r = requests.get('${{ fromJson(inputs.zip_url).url }}/get_zip?filename=${{ fromJson(inputs.zip_url).file }}')
try: r.raise_for_status()
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: try:
with pyzipper.AESZipFile(io.BytesIO(r.content)) as zf: with pyzipper.AESZipFile(io.BytesIO(r.content)) as zf:
zf.setpassword('${{ secrets.ZIP_PASSWORD }}'.encode()) zf.setpassword('${{ secrets.ZIP_PASSWORD }}'.encode())
with zf.open('secrets.json') as f: with zf.open('secrets.json') as f:
secrets = json.load(f) secrets = json.load(f)
except Exception as e: except Exception as e:
print(f"Error: Could not decrypt ZIP. Check if password matches. {e}") print(f"Error: Could not decrypt ZIP. Check if password matches. {e}")
exit(1) exit(1)
with open(os.environ['GITHUB_ENV'], 'a') as env_file: with open(os.environ['GITHUB_ENV'], 'a') as env_file:
for key, value in secrets.items(): for key, value in secrets.items():
print(f"::add-mask::{value}") print(f"::add-mask::{value}")
env_file.write(f"{key}={value}\n") env_file.write(f"{key}={value}\n")
print("Secrets loaded into environment.") print("Secrets loaded into environment.")
- name: Finalize and Cleanup zip/json - name: Finalize and Cleanup zip/json
if: always() # Run even if previous steps fail if: always() # Run even if previous steps fail
continue-on-error: true
uses: fjogeleit/http-request-action@v1 uses: fjogeleit/http-request-action@v1
with: with:
url: "${{ secrets.GENURL }}/cleanzip" url: ${{ env.STATUS_URL }}
method: 'POST' method: 'POST'
customHeaders: '{"Content-Type": "application/json"}' customHeaders: '{"Content-Type": "application/json"}'
data: '{"uuid": "${{ env.uuid }}"}' data: '{"uuid": "${{ env.uuid }}"}'
@@ -214,7 +200,6 @@ jobs:
find ./src/lang -name "*.rs" -exec sed -i '/powered_by_me/s|RustDesk|${{ env.compname }}|g' {} \; find ./src/lang -name "*.rs" -exec sed -i '/powered_by_me/s|RustDesk|${{ env.compname }}|g' {} \;
fi fi
find ./src/lang -name "*.rs" -exec sed -i -e 's|RustDesk|${{ env.appname }}|' {} \; find ./src/lang -name "*.rs" -exec sed -i -e 's|RustDesk|${{ env.appname }}|' {} \;
sed -i -e 's|RustDesk|${{ env.appname }}|' ./res/msi/Package/License.rtf
- name: fix registry if appname has a space - name: fix registry if appname has a space
if: contains(env.appname, ' ') if: contains(env.appname, ' ')
@@ -248,7 +233,6 @@ jobs:
sed -i -e 's|Purslane Ltd|${{ env.compname }}|' ./flutter/windows/runner/Runner.rc sed -i -e 's|Purslane Ltd|${{ env.compname }}|' ./flutter/windows/runner/Runner.rc
sed -i -e 's|Purslane Ltd|${{ env.compname }}|' ./Cargo.toml sed -i -e 's|Purslane Ltd|${{ env.compname }}|' ./Cargo.toml
sed -i -e 's|Purslane Ltd|${{ env.compname }}|' ./libs/portable/Cargo.toml sed -i -e 's|Purslane Ltd|${{ env.compname }}|' ./libs/portable/Cargo.toml
sed -i -e 's|Purslane Ltd|${{ env.compname }}|' ./res/msi/Package/License.rtf
- name: change url to custom - name: change url to custom
if: env.urlLink != 'https://rustdesk.com' if: env.urlLink != 'https://rustdesk.com'
@@ -262,7 +246,6 @@ jobs:
sed -i -e "s|const url = 'https://rustdesk.com/';|const url = '${{ env.urlLink }}';|" ./flutter/lib/mobile/pages/settings_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|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 sed -i -e "s|https://rustdesk.com/privacy.html|${{ env.urlLink }}/privacy.html|" ./flutter/lib/desktop/pages/install_page.dart
sed -i -e "s|rustdesk.com|${{ env.urlLink }}|" ./res/msi/Package/License.rtf
- name: change download link to custom - name: change download link to custom
if: env.downloadLink != 'https://rustdesk.com/download' if: env.downloadLink != 'https://rustdesk.com/download'

View File

@@ -45,70 +45,10 @@ jobs:
run: | run: |
git clone https://github.com/rustdesk-org/RustDeskTempTopMostWindow RustDeskTempTopMostWindow 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 # Build. commit 53b548a5398624f7149a382000397993542ad796 is tag v0.3
- name: Build the project - name: Build the project
run: | run: |
cd RustDeskTempTopMostWindow && git checkout 53b548a5398624f7149a382000397993542ad796 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 }} msbuild ${{ env.project_path }} -p:Configuration=${{ inputs.configuration }} -p:Platform=${{ inputs.platform }} /p:TargetVersion=${{ inputs.target_version }}
- name: Archive build artifacts - name: Archive build artifacts

View File

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

View File

@@ -37,10 +37,8 @@ class GenerateForm(forms.Form):
#Visual #Visual
iconfile = forms.FileField(label="Custom App Icon (in .png format)", required=False, widget=forms.FileInput(attrs={'accept': 'image/png'})) 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'})) 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) iconbase64 = forms.CharField(required=False)
logobase64 = forms.CharField(required=False) logobase64 = forms.CharField(required=False)
privacybase64 = forms.CharField(required=False)
theme = forms.ChoiceField(choices=[ theme = forms.ChoiceField(choices=[
('light', 'Light'), ('light', 'Light'),
('dark', 'Dark'), ('dark', 'Dark'),

View File

@@ -330,7 +330,6 @@
<h2><i class="fas fa-paint-brush"></i> Visual</h2> <h2><i class="fas fa-paint-brush"></i> Visual</h2>
{{ form.iconbase64.as_hidden }} {{ form.iconbase64.as_hidden }}
{{ form.logobase64.as_hidden }} {{ form.logobase64.as_hidden }}
{{ form.privacybase64.as_hidden }}
<label for="{{ form.iconfile.id_for_label }}">Custom App Icon (in .png format)</label> <label for="{{ form.iconfile.id_for_label }}">Custom App Icon (in .png format)</label>
{{ form.iconfile }}<br><br> {{ form.iconfile }}<br><br>
<!-- <input type="file" name="iconfile" id="iconfile" accept="image/png"> --> <!-- <input type="file" name="iconfile" id="iconfile" accept="image/png"> -->
@@ -339,10 +338,6 @@
{{ form.logofile }}<br><br> {{ form.logofile }}<br><br>
<!-- <input type="file" name="logofile" id="logofile" accept="image/png"> --> <!-- <input type="file" name="logofile" id="logofile" accept="image/png"> -->
<div id="logo-preview"></div><br><br> <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> <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> {{ form.theme }} {{ form.themeDorO }} *Default sets the theme but allows the client to change it, Override sets the theme permanently.<br><br>
</div> </div>
@@ -420,9 +415,6 @@
document.getElementById("{{ form.logofile.id_for_label }}").addEventListener('change', function(event) { document.getElementById("{{ form.logofile.id_for_label }}").addEventListener('change', function(event) {
previewImage(event.target, 'logo-preview'); 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() { document.getElementById("{{ form.hidecm.id_for_label }}").addEventListener('change',function() {
if (this.checked) { if (this.checked) {
@@ -602,16 +594,6 @@
} }
} }
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 jsonData = JSON.stringify(formData, null, 2);
const blob = new Blob([jsonData], { type: "application/json" }); const blob = new Blob([jsonData], { type: "application/json" });
const url = URL.createObjectURL(blob); const url = URL.createObjectURL(blob);
@@ -673,10 +655,6 @@
document.getElementById('id_logobase64').value = formData[key]; document.getElementById('id_logobase64').value = formData[key];
document.getElementById('logo-preview').innerHTML = `<img src="${formData[key]}" style="max-width: 300px; max-height: 60px;">`; 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

@@ -115,16 +115,6 @@ def generator_view(request):
logolink_url = "false" logolink_url = "false"
logolink_uuid = "false" logolink_uuid = "false"
logolink_file = "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 ###create the custom.txt json here and send in as inputs below
decodedCustom = {} decodedCustom = {}
@@ -249,9 +239,6 @@ def generator_view(request):
"logolink_url":logolink_url, "logolink_url":logolink_url,
"logolink_uuid":logolink_uuid, "logolink_uuid":logolink_uuid,
"logolink_file":logolink_file, "logolink_file":logolink_file,
"privacylink_url":privacylink_url,
"privacylink_uuid":privacylink_uuid,
"privacylink_file":privacylink_file,
"appname":appname, "appname":appname,
"genurl":_settings.GENURL, "genurl":_settings.GENURL,
"urlLink":urlLink, "urlLink":urlLink,
@@ -477,8 +464,7 @@ def save_custom_client(request):
def cleanup_secrets(request): def cleanup_secrets(request):
# Pass the UUID as a query param or in JSON body # Pass the UUID as a query param or in JSON body
data = json.loads(request.body) my_uuid = request.GET.get('uuid')
my_uuid = data.get('uuid')
if not my_uuid: if not my_uuid:
return HttpResponse("Missing UUID", status=400) return HttpResponse("Missing UUID", status=400)