diff --git a/.github/workflows/generator-macos.yml b/.github/workflows/generator-macos.yml index 89eacbf..154031b 100644 --- a/.github/workflows/generator-macos.yml +++ b/.github/workflows/generator-macos.yml @@ -543,6 +543,7 @@ 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 }} # - name: Copy service file diff --git a/.github/workflows/generator-windows.yml b/.github/workflows/generator-windows.yml index 2e5e3be..d06cc19 100644 --- a/.github/workflows/generator-windows.yml +++ b/.github/workflows/generator-windows.yml @@ -535,9 +535,9 @@ jobs: continue-on-error: true if: env.UPLOAD_ARTIFACT == 'true' run: | + $myappname = "${{ inputs.appname }}" -replace '\s','_' + cp "rustdesk/${{ inputs.appname }}.exe" "rustdesk/${myappname}.exe" pushd ./res/msi - $myappname = "${{ inputs.appname }}" - $myappname = $myappname -replace '\s','_' python preprocess.py --app-name "$myappname" --arp -d ../../rustdesk nuget restore msi.sln msbuild msi.sln -p:Configuration=Release -p:Platform=x64 /p:TargetVersion=Windows10 diff --git a/.github/workflows/pre137-generator-macos.yml b/.github/workflows/pre137-generator-macos.yml index 232c85f..85db444 100644 --- a/.github/workflows/pre137-generator-macos.yml +++ b/.github/workflows/pre137-generator-macos.yml @@ -532,6 +532,7 @@ 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 }} - name: Report Status diff --git a/.github/workflows/pre137-generator-windows.yml b/.github/workflows/pre137-generator-windows.yml index 14c6819..27ae99e 100644 --- a/.github/workflows/pre137-generator-windows.yml +++ b/.github/workflows/pre137-generator-windows.yml @@ -533,9 +533,9 @@ jobs: continue-on-error: true if: env.UPLOAD_ARTIFACT == 'true' run: | + $myappname = "${{ inputs.appname }}" -replace '\s','_' + cp "rustdesk/${{ inputs.appname }}.exe" "rustdesk/${myappname}.exe" pushd ./res/msi - $myappname = "${{ inputs.appname }}" - $myappname = $myappname -replace '\s','_' python preprocess.py --app-name "$myappname" --arp -d ../../rustdesk nuget restore msi.sln msbuild msi.sln -p:Configuration=Release -p:Platform=x64 /p:TargetVersion=Windows10 diff --git a/.gitignore b/.gitignore index 8d17d21..402d3e9 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,4 @@ *.pyc +db.sqlite3 gunicorn.conf +.venv diff --git a/README.md b/README.md index edf533b..ef55fee 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,10 @@ -## RDGEN is a RustDesk client generator to use with your self-hosted rustdesk server. +# RDGen, a RustDesk client generator to use with your self-hosted RustDesk server -## The client generator is currently hosted [here](https://rdgen.crayoneater.org). If you would like to host the generator yourself, see [here](setup.md) - -## This client generator is currently integrated into my rustdesk [api server](https://github.com/bryangerlach/rustdesk-api-server), which is a fork of [rustdesk-api-server](https://github.com/kingmo888/rustdesk-api-server). If you are running my api server, then you will still need to fork RDGEN and go through the setup process, but you won't need to actually run the rdgen server. +The client generator is currently hosted [here](https://rdgen.crayoneater.org). +If you would like to host the generator yourself, see [here](setup.md) +This client generator is currently integrated into my rustdesk [api +server](https://github.com/bryangerlach/rustdesk-api-server), which is a fork +of [rustdesk-api-server](https://github.com/kingmo888/rustdesk-api-server). If +you are running my api server, then you will still need to fork RDGen and go +through the setup process, but you won't need to actually run the rdgen server. diff --git a/db.sqlite3 b/db.sqlite3 deleted file mode 100644 index e69de29..0000000 diff --git a/rdgen/__pycache__/__init__.cpython-312.pyc b/rdgen/__pycache__/__init__.cpython-312.pyc deleted file mode 100644 index dc95201..0000000 Binary files a/rdgen/__pycache__/__init__.cpython-312.pyc and /dev/null differ diff --git a/rdgen/__pycache__/settings.cpython-312.pyc b/rdgen/__pycache__/settings.cpython-312.pyc deleted file mode 100644 index f742648..0000000 Binary files a/rdgen/__pycache__/settings.cpython-312.pyc and /dev/null differ diff --git a/rdgen/__pycache__/urls.cpython-312.pyc b/rdgen/__pycache__/urls.cpython-312.pyc deleted file mode 100644 index b58eab8..0000000 Binary files a/rdgen/__pycache__/urls.cpython-312.pyc and /dev/null differ diff --git a/rdgen/__pycache__/wsgi.cpython-312.pyc b/rdgen/__pycache__/wsgi.cpython-312.pyc deleted file mode 100644 index f711d6b..0000000 Binary files a/rdgen/__pycache__/wsgi.cpython-312.pyc and /dev/null differ diff --git a/rdgenerator/__pycache__/__init__.cpython-312.pyc b/rdgenerator/__pycache__/__init__.cpython-312.pyc deleted file mode 100644 index e851237..0000000 Binary files a/rdgenerator/__pycache__/__init__.cpython-312.pyc and /dev/null differ diff --git a/rdgenerator/__pycache__/admin.cpython-312.pyc b/rdgenerator/__pycache__/admin.cpython-312.pyc deleted file mode 100644 index 330d91a..0000000 Binary files a/rdgenerator/__pycache__/admin.cpython-312.pyc and /dev/null differ diff --git a/rdgenerator/__pycache__/apps.cpython-312.pyc b/rdgenerator/__pycache__/apps.cpython-312.pyc deleted file mode 100644 index 3f1108e..0000000 Binary files a/rdgenerator/__pycache__/apps.cpython-312.pyc and /dev/null differ diff --git a/rdgenerator/__pycache__/models.cpython-312.pyc b/rdgenerator/__pycache__/models.cpython-312.pyc deleted file mode 100644 index a47b9ab..0000000 Binary files a/rdgenerator/__pycache__/models.cpython-312.pyc and /dev/null differ diff --git a/rdgenerator/__pycache__/views.cpython-312.pyc b/rdgenerator/__pycache__/views.cpython-312.pyc deleted file mode 100644 index 6637b7a..0000000 Binary files a/rdgenerator/__pycache__/views.cpython-312.pyc and /dev/null differ diff --git a/rdgenerator/migrations/__pycache__/__init__.cpython-312.pyc b/rdgenerator/migrations/__pycache__/__init__.cpython-312.pyc deleted file mode 100644 index eb9cc2a..0000000 Binary files a/rdgenerator/migrations/__pycache__/__init__.cpython-312.pyc and /dev/null differ diff --git a/setup.md b/setup.md index 13251a5..b8c8f67 100644 --- a/setup.md +++ b/setup.md @@ -1,92 +1,76 @@ ## To fully host the client generator yourself, you will need to following: -
    -
  1. A Github account with a fork of this repo
  2. -
  3. A Github fine-grained access token with permissions for your rdgen repository - -
  4. -
  5. Setup environment variables / secrets: -
  6. -
  7. optional github secrets (for signing the code): -
  8. - - -
+1. A Github account with a fork of this repo +2. A Github fine-grained access token with permissions for your rdgen + repository: + * login to your github account + * click on your profile picture at the top right, click Settings + * at the bottom of the left panel, click Developer Settings + * click Personal access tokens + * click Fine-grained tokens + * click Generate new token + * give a token name, change expiration to whatever you want + * under Repository access, select Only select repositories, then pick your + rdgen repo + * give Read and Write access to actions and workflows +3. Setup environment variables/secrets: + * environment variables on the server running rdgen: + * GHUSER="your github username" + * GHBEARER="your fine-grained access token" + * github secrets (setup on your github account for your rdgen repo): + * GENURL="example.com:8000" *this is the domain and port that you are + running rdgen on, needs to be accessible on the internet, depending + on how you have this setup the port may not be needed + * optional github secrets (for signing the code): + * WINDOWS_PFX_BASE64 + * WINDOWS_PFX_PASSWORD + * WINDOWS_PFX_SHA1_THUMBPRINT ## To run rdgen on your server: -### open to the directory you want to install rdgen (change /opt to wherever you want) +``` +# Open to the directory you want to install rdgen (change /opt to wherever you want) +cd /opt -> cd /opt +# Clone your rdgen repo, change bryangerlach to your github username +git clone https://github.com/bryangerlach/rdgen.git -### clone your rdgen repo, change bryangerlach to your github username +# Open the rdgen directory +cd rdgen -> git clone https://github.com/bryangerlach/rdgen.git +# Setup a python virtual environment called rdgen +python -m venv .venv -### open the rdgen directory +# Activate the python virtual environment +source .venv/bin/activate -> cd rdgen +# Install the python dependencies +pip install -r requirements.txt -### setup a python virtual environment called rdgen +# Setup the database +python manage.py migrate -> python -m venv rdgen +# Run the server, change 8000 with whatever you want +python manage.py runserver 0.0.0.0:8000 +``` -### activate the python virtual environment +open your web browser to yourdomain:8000 -> source rdgen/bin/activate - -### install the python dependencies - -> pip install -r requirements.txt - -### setup the database - -> python manage.py migrate - -### run the server, change 8000 with whatever you want - -> python manage.py runserver 0.0.0.0:8000 - -### open your web browser to yourdomain:8000 - -### use nginx, caddy, traefik, etc. for ssl reverse proxy +use nginx, caddy, traefik, etc. for ssl reverse proxy ## A few notes: - +* If you change your repository name, make sure to change the url on lines + 161-168 of views.py to reflect the change +* If you are running on http instead of https, make sure to make the change on + line 70 of views.py ## To autostart the server on boot, you can set up a systemd service called rdgen.service -replace user, group, and port if you need to -replace /opt with wherever you have installed rdgen -save the following file as /etc/systemd/system/rdgen.service, and make sure to change GHUSER, GHBEARER +replace user, group, and port if you need to replace /opt with wherever you +have installed rdgen save the following file as +/etc/systemd/system/rdgen.service, and make sure to change GHUSER, GHBEARER + ``` [Unit] Description=Rustdesk Client Generator @@ -96,7 +80,7 @@ LimitNOFILE=1000000 Environment="GHUSER=yourgithubusername" Environment="GHBEARER=yourgithubtoken" PassEnvironment=GHUSER GHBEARER -ExecStart=/opt/rdgen/rdgen/bin/python3 /opt/rdgen/manage.py runserver 0.0.0.0:8000 +ExecStart=/opt/rdgen/.venv/bin/python3 /opt/rdgen/manage.py runserver 0.0.0.0:8000 WorkingDirectory=/opt/rdgen/ User=root Group=root @@ -109,7 +93,9 @@ RestartSec=10 WantedBy=multi-user.target ``` -then run this to enable autostarting the service on boot, and then start it manually this time: +then run this to enable autostarting the service on boot, and then start it +manually this time: + ``` sudo systemctl enable rdgen.service sudo systemctl start rdgen.service @@ -117,4 +103,4 @@ sudo systemctl start rdgen.service and to get the status of the server, run: ``` sudo systemctl status rdgen.service -``` \ No newline at end of file +```