feat: add desktop connector distributions

This commit is contained in:
2026-08-07 17:01:30 +01:00
parent f8b1724add
commit 84db4b766c
12 changed files with 356 additions and 14 deletions
+21
View File
@@ -0,0 +1,21 @@
# Cleanflix Connector Desktop Packages
Each desktop package contains the connector source plus a bundled Node 22 runtime.
Set `MEDIA_ROOT`, `PAIRING_PASSWORD_HASH`, and `PUBLIC_BASE_URL` in the generated
configuration before starting it. `PUBLIC_BASE_URL` must be an HTTPS address your TV
and phone can reach on the same LAN.
## macOS
Copy `macos/Cleanflix Connector.app` to Applications, open it once, then edit:
`~/Library/Application Support/Cleanflix Connector/config.env`.
## Windows
Run `windows/install.ps1` in PowerShell. It installs a per-user Scheduled Task and
opens `%APPDATA%\Cleanflix Connector\config.env`.
## Linux
Run `linux/install.sh`. It installs a user systemd service and creates:
`~/.config/cleanflix-connector/config.env`.
+6
View File
@@ -0,0 +1,6 @@
PORT=8787
MEDIA_ROOT=/absolute/path/to/your/media
PUBLIC_BASE_URL=https://connector.example.home
APPROVAL_BASE_URL=https://connector.example.home
# Generate with: node hash-password.js "a-long-private-password"
PAIRING_PASSWORD_HASH=
+18
View File
@@ -0,0 +1,18 @@
#!/usr/bin/env sh
set -eu
CONFIG_PATH=${CLEANFLIX_CONFIG_PATH:?CLEANFLIX_CONFIG_PATH is required}
APP_ROOT=${CLEANFLIX_APP_ROOT:?CLEANFLIX_APP_ROOT is required}
[ -f "$CONFIG_PATH" ] || { printf '%s\n' "Missing configuration: $CONFIG_PATH" >&2; exit 1; }
set -a
. "$CONFIG_PATH"
set +a
: "${MEDIA_ROOT:?Set MEDIA_ROOT in config.env}"
: "${PAIRING_PASSWORD_HASH:?Set PAIRING_PASSWORD_HASH in config.env}"
: "${PUBLIC_BASE_URL:?Set PUBLIC_BASE_URL in config.env}"
export TOKEN_STORE_PATH="${TOKEN_STORE_PATH:-$(dirname "$CONFIG_PATH")/data/tokens.json}"
export LIBRARY_INDEX_PATH="${LIBRARY_INDEX_PATH:-$(dirname "$CONFIG_PATH")/data/library-index.json}"
exec "$CLEANFLIX_NODE" "$APP_ROOT/server.js"
@@ -0,0 +1,14 @@
[Unit]
Description=Cleanflix personal media connector
After=network-online.target
[Service]
Type=simple
Environment=CLEANFLIX_APP_ROOT=%h/.local/lib/cleanflix-connector
Environment=CLEANFLIX_CONFIG_PATH=%h/.config/cleanflix-connector/config.env
Environment=CLEANFLIX_NODE=%h/.local/lib/cleanflix-connector/node/bin/node
ExecStart=%h/.local/lib/cleanflix-connector/distribution/common/start-connector.sh
Restart=on-failure
[Install]
WantedBy=default.target
+10
View File
@@ -0,0 +1,10 @@
#!/usr/bin/env sh
set -eu
ROOT="${CLEANFLIX_INSTALL_ROOT:-$HOME/.local/lib/cleanflix-connector}"
CONFIG="$HOME/.config/cleanflix-connector"
mkdir -p "$CONFIG" "$HOME/.config/systemd/user"
cp distribution/common/config.env.example "$CONFIG/config.env"
sed "s#%h#$HOME#g" distribution/linux/cleanflix-connector.service > "$HOME/.config/systemd/user/cleanflix-connector.service"
systemctl --user daemon-reload
systemctl --user enable --now cleanflix-connector.service
printf '%s\n' "Edit $CONFIG/config.env, then run: systemctl --user restart cleanflix-connector"
@@ -0,0 +1,3 @@
<?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.cleanflix.connector</string><key>ProgramArguments</key><array><string>/bin/sh</string><string>-lc</string><string>export CLEANFLIX_APP_ROOT="$HOME/Library/Application Support/Cleanflix Connector" CLEANFLIX_CONFIG_PATH="$HOME/Library/Application Support/Cleanflix Connector/config.env" CLEANFLIX_NODE="$HOME/Library/Application Support/Cleanflix Connector/node/bin/node"; exec "$CLEANFLIX_APP_ROOT/distribution/common/start-connector.sh"</string></array><key>RunAtLoad</key><true/><key>KeepAlive</key><true/></dict></plist>
+9
View File
@@ -0,0 +1,9 @@
$Root = Join-Path $env:LOCALAPPDATA 'Cleanflix Connector'
$Config = Join-Path $env:APPDATA 'Cleanflix Connector'
New-Item -ItemType Directory -Force -Path $Config | Out-Null
Copy-Item "$PSScriptRoot\..\common\config.env.example" "$Config\config.env" -Force
$Action = New-ScheduledTaskAction -Execute "$Root\node\node.exe" -Argument "`"$Root\server.js`""
$Trigger = New-ScheduledTaskTrigger -AtLogOn
Register-ScheduledTask -TaskName 'Cleanflix Connector' -Action $Action -Trigger $Trigger -Force | Out-Null
Start-Process notepad.exe "$Config\config.env"
Write-Host "Edit config.env, then start the Cleanflix Connector scheduled task."