NetDesk 1.5.0 — source release
This commit is contained in:
commit
40318aafdd
227 files changed
+80798
No files matched your search
@@ -0,0 +1,46 @@
|
||||
#!/usr/bin/env bash
|
||||
# NetDesk build for Apple Silicon / Intel Macs.
|
||||
# Run ON the Mac (PyInstaller cannot cross-compile):
|
||||
# bash scripts/build_mac.sh
|
||||
# Produces:
|
||||
# dist/NetDesk.app - desktop control panel (double-click app)
|
||||
# dist/netdesk-engine - headless agent binary (LaunchAgent / CLI)
|
||||
# dist/NetDeskServer - server binary (optional, if the Mac is the VPS)
|
||||
set -euo pipefail
|
||||
cd "$(dirname "$0")/.." # netdesk root
|
||||
|
||||
echo "==> creating build venv"
|
||||
python3 -m venv .venv-build
|
||||
./.venv-build/bin/pip install --quiet --upgrade pip
|
||||
./.venv-build/bin/pip install --quiet aiohttp cryptography mss numpy av pillow pyinstaller
|
||||
|
||||
echo "==> building NetDesk.app (desktop control panel, double-click to run)"
|
||||
./.venv-build/bin/pyinstaller --windowed --name NetDesk \
|
||||
--distpath dist --workpath build --specpath build host/netdesk_host.py
|
||||
|
||||
echo "==> building netdesk-engine (headless agent for LaunchAgent/CLI)"
|
||||
./.venv-build/bin/pyinstaller --onefile --name netdesk-engine \
|
||||
--distpath dist --workpath build --specpath build host/netdesk_host.py
|
||||
|
||||
echo "==> building NetDeskServer"
|
||||
./.venv-build/bin/pyinstaller --onefile --name NetDeskServer \
|
||||
--add-data "server/web:web" \
|
||||
--distpath dist --workpath build --specpath build server/netdesk_server.py
|
||||
|
||||
rm -rf build .venv-build
|
||||
echo
|
||||
echo "==> done:"
|
||||
ls -lh dist/
|
||||
echo
|
||||
echo "What you got:"
|
||||
echo " dist/NetDesk.app - the desktop control panel (double-click)"
|
||||
echo " dist/netdesk-engine - headless agent (used by Start-at-Login and CLI)"
|
||||
echo " dist/NetDeskServer - the server binary (optional, if the Mac is the VPS)"
|
||||
echo
|
||||
echo "First run: macOS asks for Screen Recording and Accessibility"
|
||||
echo "(System Settings -> Privacy & Security) - both are required for"
|
||||
echo "remote control, same as RustDesk/TeamViewer."
|
||||
echo "If Gatekeeper blocks an app: xattr -cr dist/NetDesk.app"
|
||||
echo
|
||||
echo "Autostart: open NetDesk.app -> enter server + key -> Start at Login."
|
||||
echo "This installs ~/Library/LaunchAgents/com.netdesk.host.plist (invisible engine)."
|
||||
Executable
+27
@@ -0,0 +1,27 @@
|
||||
@echo off
|
||||
REM Build the NetDesk portable Windows binaries (host app + server) with PyInstaller.
|
||||
REM Run from the repo root: scripts\build_windows.bat
|
||||
setlocal
|
||||
cd /d "%~dp0.."
|
||||
set PY=..\.venv\Scripts\python.exe
|
||||
|
||||
echo === Building NetDeskHost.exe (windowed desktop app + engine) ===
|
||||
"%PY%" -m PyInstaller --noconfirm --clean --onefile --name NetDeskHost --windowed ^
|
||||
--icon host\icon.ico ^
|
||||
--add-data "host\netdesk_gui.html;." ^
|
||||
--paths host ^
|
||||
--hidden-import netdesk_gui ^
|
||||
--hidden-import pyaudiowpatch ^
|
||||
host\netdesk_host.py
|
||||
if errorlevel 1 exit /b 1
|
||||
|
||||
echo === Building NetDeskServer.exe (console signaling/relay server) ===
|
||||
"%PY%" -m PyInstaller --noconfirm --clean --onefile --name NetDeskServer --console ^
|
||||
--add-data "server\web;web" ^
|
||||
server\netdesk_server.py
|
||||
if errorlevel 1 exit /b 1
|
||||
|
||||
echo === Done. Binaries in dist\ ===
|
||||
copy /Y dist\NetDeskHost.exe portable\NetDeskHost.exe
|
||||
copy /Y dist\NetDeskServer.exe portable\NetDeskServer.exe
|
||||
endlocal
|
||||
@@ -0,0 +1,27 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>Label</key>
|
||||
<string>com.netdesk.host</string>
|
||||
|
||||
<key>ProgramArguments</key>
|
||||
<array>
|
||||
<!-- EDIT: full path to your NetDeskHost binary -->
|
||||
<string>/Applications/NetDesk/NetDeskHost</string>
|
||||
<!-- EDIT: your server URL -->
|
||||
<string>--server</string>
|
||||
<string>wss://your-vps.example:8443/ws</string>
|
||||
</array>
|
||||
|
||||
<key>RunAtLoad</key>
|
||||
<true/>
|
||||
<key>KeepAlive</key>
|
||||
<true/>
|
||||
|
||||
<key>StandardOutPath</key>
|
||||
<string>/tmp/netdesk-host.log</string>
|
||||
<key>StandardErrorPath</key>
|
||||
<string>/tmp/netdesk-host.log</string>
|
||||
</dict>
|
||||
</plist>
|
||||
@@ -0,0 +1,51 @@
|
||||
#!/usr/bin/env bash
|
||||
# NetDesk VPS deployment helper - run as root on a fresh Debian/Ubuntu VPS.
|
||||
# Reads REG_KEY from the environment or generates one and prints it.
|
||||
set -euo pipefail
|
||||
|
||||
REG_KEY="${REG_KEY:-$(head -c 24 /dev/urandom | base64 | tr -d '/+=')}"
|
||||
STATUS_KEY="${STATUS_KEY:-$(head -c 24 /dev/urandom | base64 | tr -d '/+=')}"
|
||||
PORT="${PORT:-8443}"
|
||||
DEST=/opt/netdesk
|
||||
|
||||
echo "==> installing python deps"
|
||||
apt-get update -qq
|
||||
apt-get install -y -qq python3 python3-pip
|
||||
python3 -m pip install --break-system-packages --quiet aiohttp cryptography || \
|
||||
python3 -m pip install --quiet aiohttp cryptography
|
||||
|
||||
echo "==> installing files to $DEST"
|
||||
mkdir -p "$DEST/server"
|
||||
cp -r "$(dirname "$0")/../server/." "$DEST/server/"
|
||||
|
||||
echo "==> creating service user"
|
||||
id -u netdesk >/dev/null 2>&1 || useradd --system --no-create-home --shell /usr/sbin/nologin netdesk
|
||||
chown -R netdesk:netdesk "$DEST"
|
||||
|
||||
echo "==> writing systemd unit"
|
||||
sed -e "s/CHANGE_ME_STRONG_KEY/$REG_KEY/" \
|
||||
-e "s/CHANGE_ME_TOO/$STATUS_KEY/" \
|
||||
-e "s/--port 8443/--port $PORT/" \
|
||||
"$(dirname "$0")/netdesk.service" > /etc/systemd/system/netdesk.service
|
||||
systemctl daemon-reload
|
||||
systemctl enable --now netdesk
|
||||
|
||||
cat <<EOF
|
||||
|
||||
=============================================================
|
||||
NetDesk server is running on port $PORT
|
||||
|
||||
Registration key (put in host's --reg-key): $REG_KEY
|
||||
Status key (for /status?token=...): $STATUS_KEY
|
||||
|
||||
Next steps:
|
||||
1. Open the firewall: ufw allow $PORT/tcp
|
||||
2. TLS strongly recommended for internet use:
|
||||
apt install certbot && certbot certonly --standalone -d your.domain
|
||||
then add: --cert /etc/letsencrypt/live/your.domain/fullchain.pem \\
|
||||
--key /etc/letsencrypt/live/your.domain/privkey.pem
|
||||
(or quick start: --gen-cert and accept the browser warning)
|
||||
3. On the Windows PC: netdesk_host.py --server wss://your.domain:$PORT/ws --reg-key $REG_KEY
|
||||
4. Travel: open https://your.domain:$PORT/ in Chrome/Edge, enter ID + password.
|
||||
=============================================================
|
||||
EOF
|
||||
@@ -0,0 +1,23 @@
|
||||
[Unit]
|
||||
Description=NetDesk signaling/relay server
|
||||
After=network-online.target
|
||||
Wants=network-online.target
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
# Adjust paths to where you put netdesk on the VPS:
|
||||
WorkingDirectory=/opt/netdesk/server
|
||||
ExecStart=/usr/bin/python3 /opt/netdesk/server/netdesk_server.py --port 8443 --reg-key CHANGE_ME_STRONG_KEY --status-key CHANGE_ME_TOO
|
||||
Restart=always
|
||||
RestartSec=3
|
||||
User=netdesk
|
||||
Group=netdesk
|
||||
# Hardening (optional but recommended)
|
||||
NoNewPrivileges=true
|
||||
ProtectSystem=strict
|
||||
ReadWritePaths=/opt/netdesk/server
|
||||
ProtectHome=true
|
||||
PrivateTmp=true
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
Executable
+13
@@ -0,0 +1,13 @@
|
||||
@echo off
|
||||
rem Installs NetDesk as a boot-time service (SYSTEM).
|
||||
rem REQUIRES: run once from an elevated (Run as administrator) prompt.
|
||||
setlocal
|
||||
cd /d "%~dp0.."
|
||||
set PY=%~dp0..\.venv\Scripts\python.exe
|
||||
if not exist "%PY%" set PY=python
|
||||
|
||||
"%PY%" host\netdesk_host.py --install %*
|
||||
echo.
|
||||
echo If this failed with an elevation error, right-click this file and
|
||||
echo choose "Run as administrator", then run it again.
|
||||
pause
|
||||
Executable
+22
@@ -0,0 +1,22 @@
|
||||
@echo off
|
||||
rem NetDesk local demo: server + host + browser viewer, all on this PC.
|
||||
rem For a first look / testing. Real use = VPS server + this host + remote viewer.
|
||||
setlocal
|
||||
cd /d "%~dp0.."
|
||||
set PY=%~dp0..\.venv\Scripts\python.exe
|
||||
if not exist "%PY%" set PY=python
|
||||
|
||||
echo [netdesk] starting server on http://127.0.0.1:8443 ...
|
||||
start "NetDesk Server" "%PY%" server\netdesk_server.py --port 8443
|
||||
timeout /t 2 /nobreak >nul
|
||||
|
||||
echo [netdesk] starting host agent (finds server URL from its config) ...
|
||||
start "NetDesk Host" "%PY%" host\netdesk_host.py --server ws://127.0.0.1:8443/ws
|
||||
|
||||
timeout /t 3 /nobreak >nul
|
||||
echo [netdesk] opening viewer in browser...
|
||||
start http://127.0.0.1:8443/
|
||||
echo.
|
||||
echo Your host ID and password are in %%APPDATA%%\NetDesk\config.json
|
||||
echo (password is printed by the host on its FIRST run only; use --set-password to change)
|
||||
endlocal
|
||||
@@ -0,0 +1,6 @@
|
||||
' Runs the NetDesk host agent with no console window.
|
||||
Set sh = CreateObject("WScript.Shell")
|
||||
repo = Left(WScript.ScriptFullName, InStrRev(WScript.ScriptFullName, "\scripts\") - 1)
|
||||
py = repo & "\.venv\Scripts\pythonw.exe"
|
||||
If Not CreateObject("Scripting.FileSystemObject").FileExists(py) Then py = "pythonw.exe"
|
||||
sh.Run """" & py & """ """ & repo & "\host\netdesk_host.py""", 0, False
|
||||
Executable
+8
@@ -0,0 +1,8 @@
|
||||
@echo off
|
||||
rem Removes the NetDesk boot-time service.
|
||||
setlocal
|
||||
cd /d "%~dp0.."
|
||||
set PY=%~dp0..\.venv\Scripts\python.exe
|
||||
if not exist "%PY%" set PY=python
|
||||
"%PY%" host\netdesk_host.py --uninstall
|
||||
pause
|
||||
Reference in new issue
Block a user