mirror of
https://github.com/community-scripts/ProxmoxVE.git
synced 2026-10-11 13:15:16 +00:00
Compare commits
5
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
33f516930b | ||
|
|
bbcea041e7 | ||
|
|
386bb80e1e | ||
|
|
61336cd55e | ||
|
|
6b8698fe87 |
+7
-1
@@ -564,10 +564,15 @@ Exercise vigilance regarding copycat or coat-tailing sites that seek to exploit
|
||||
|
||||
## 2026-10-11
|
||||
|
||||
### 🆕 New Scripts
|
||||
|
||||
- Cinephage ([#17852](https://github.com/community-scripts/ProxmoxVE/pull/17852))
|
||||
|
||||
### 🚀 Updated Scripts
|
||||
|
||||
- #### 🐞 Bug Fixes
|
||||
|
||||
- hermesagent: match the relaunched root gateway regardless of interpreter [@MickLesk](https://github.com/MickLesk) ([#17847](https://github.com/community-scripts/ProxmoxVE/pull/17847))
|
||||
- Radicale: install the bcrypt and argon2 extras [@MickLesk](https://github.com/MickLesk) ([#17813](https://github.com/community-scripts/ProxmoxVE/pull/17813))
|
||||
- fix(zigbee2mqtt): preserve backup stream and prevent filename collisions [@petermnt](https://github.com/petermnt) ([#17751](https://github.com/community-scripts/ProxmoxVE/pull/17751))
|
||||
|
||||
@@ -577,7 +582,8 @@ Exercise vigilance regarding copycat or coat-tailing sites that seek to exploit
|
||||
|
||||
### 💾 Core
|
||||
|
||||
- setup_docker: make LXC resource limits visible to nested containers [@andrebrait](https://github.com/andrebrait) ([core#9](https://github.com/community-scripts/core/pull/9))
|
||||
- Add confirm_external_installer [@MickLesk](https://github.com/MickLesk) ([core#130](https://github.com/community-scripts/core/pull/130))
|
||||
- setup_docker: make LXC resource limits visible to nested containers [@andrebrait](https://github.com/andrebrait) ([core#9](https://github.com/community-scripts/core/pull/9))
|
||||
- Incus: fix ENABLE_FUSE / TUN vars [@MickLesk](https://github.com/MickLesk) ([core#127](https://github.com/community-scripts/core/pull/127))
|
||||
- Resolve a uv required-version range to the newest release inside it [@MickLesk](https://github.com/MickLesk) ([core#126](https://github.com/community-scripts/core/pull/126))
|
||||
- Upgrade MongoDB in place when an app package depends on it [@MickLesk](https://github.com/MickLesk) ([core#128](https://github.com/community-scripts/core/pull/128))
|
||||
|
||||
@@ -0,0 +1,69 @@
|
||||
#!/usr/bin/env bash
|
||||
_cs_boot="${COMMUNITY_SCRIPTS_CORE_DIR:-$(dirname "${BASH_SOURCE[0]}")/../../core}/core/build.func"
|
||||
source "$_cs_boot" 2>/dev/null || source <(curl -fsSL "${COMMUNITY_SCRIPTS_CORE_URL:-https://raw.githubusercontent.com/community-scripts/core/main}/core/build.func")
|
||||
# Copyright (c) 2021-2026 community-scripts ORG
|
||||
# Author: MickLesk (CanbiZ)
|
||||
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
|
||||
# Source: https://github.com/MoldyTaint/Cinephage
|
||||
|
||||
APP="Cinephage"
|
||||
var_tags="${var_tags:-arr;media;torrent;usenet}"
|
||||
var_cpu="${var_cpu:-2}"
|
||||
var_ram="${var_ram:-4096}"
|
||||
var_disk="${var_disk:-10}"
|
||||
var_os="${var_os:-debian}"
|
||||
var_version="${var_version:-13}"
|
||||
var_arm64="${var_arm64:-yes}"
|
||||
var_unprivileged="${var_unprivileged:-1}"
|
||||
|
||||
header_info "$APP"
|
||||
variables
|
||||
color
|
||||
catch_errors
|
||||
|
||||
function update_script() {
|
||||
header_info
|
||||
check_container_storage
|
||||
check_container_resources
|
||||
|
||||
if [[ ! -d /opt/cinephage ]]; then
|
||||
msg_error "No ${APP} Installation Found!"
|
||||
exit
|
||||
fi
|
||||
|
||||
if check_for_gh_release "cinephage" "MoldyTaint/Cinephage"; then
|
||||
msg_info "Stopping Cinephage"
|
||||
systemctl stop cinephage
|
||||
msg_ok "Stopped Cinephage"
|
||||
|
||||
NODE_VERSION="24" setup_nodejs
|
||||
CLEAN_INSTALL=1 fetch_and_deploy_gh_release "cinephage" "MoldyTaint/Cinephage" "tarball"
|
||||
|
||||
msg_info "Building Cinephage"
|
||||
cd /opt/cinephage
|
||||
$STD npm ci
|
||||
$STD npm run build
|
||||
$STD npm prune --omit=dev
|
||||
sed -i "s/^APP_VERSION=.*/APP_VERSION=$(cat ~/.cinephage)/" /opt/cinephage_data/.env
|
||||
msg_ok "Built Cinephage"
|
||||
|
||||
msg_info "Updating Camoufox"
|
||||
$STD /opt/cinephage/node_modules/.bin/camoufox-js fetch
|
||||
msg_ok "Updated Camoufox"
|
||||
|
||||
msg_info "Starting Cinephage"
|
||||
systemctl start cinephage
|
||||
msg_ok "Started Cinephage"
|
||||
msg_ok "Updated successfully!"
|
||||
fi
|
||||
exit
|
||||
}
|
||||
|
||||
start
|
||||
build_container
|
||||
description
|
||||
|
||||
msg_ok "Completed Successfully!\n"
|
||||
echo -e "${CREATING}${GN}${APP} setup has been successfully initialized!${CL}"
|
||||
echo -e "${INFO}${YW}Access it using the following URL:${CL}"
|
||||
echo -e "${GATEWAY}${BGN}http://${IP}:3000${CL}"
|
||||
+9
-3
@@ -51,8 +51,7 @@ function update_script() {
|
||||
set -a; source /etc/default/hermes; set +a
|
||||
/home/hermes/.local/bin/hermes update --yes
|
||||
'
|
||||
# See https://github.com/community-scripts/ProxmoxVE/issues/17123
|
||||
mapfile -t root_gateway_pids < <(ps -eo user=,pid=,args= | awk '$1 == "root" && $0 ~ /\/home\/hermes\/\.hermes\/hermes-agent\/venv\/bin\/python -m hermes_cli\.main gateway run --replace$/ { print $2 }')
|
||||
mapfile -t root_gateway_pids < <(ps -eo user=,pid=,args= | awk '$1 == "root" && /\/home\/hermes\/\.hermes\// && /hermes_cli[.]main/ && / gateway run --replace$/ { print $2 }')
|
||||
if ((${#root_gateway_pids[@]})); then
|
||||
kill -TERM "${root_gateway_pids[@]}"
|
||||
for pid in "${root_gateway_pids[@]}"; do
|
||||
@@ -61,7 +60,14 @@ function update_script() {
|
||||
done
|
||||
done
|
||||
fi
|
||||
chown -R hermes:hermes /home/hermes
|
||||
if ps -eo user=,args= | awk '$1 == "root" && /\/home\/hermes\/\.hermes\// { found = 1 } END { exit !found }'; then
|
||||
msg_warn "A root-owned Hermes process is still running; it may keep writing root-owned files"
|
||||
fi
|
||||
# A writer racing chown makes files vanish between readdir and chown; one retry covers it.
|
||||
if ! chown -R hermes:hermes /home/hermes 2>/dev/null; then
|
||||
sleep 1
|
||||
chown -R hermes:hermes /home/hermes || msg_warn "Could not take ownership of everything under /home/hermes"
|
||||
fi
|
||||
msg_ok "Updated Hermes Agent"
|
||||
|
||||
msg_info "Starting Services"
|
||||
|
||||
+23
-38
@@ -11,7 +11,6 @@ var_tags="${var_tags:-remote-desktop}"
|
||||
var_cpu="${var_cpu:-1}"
|
||||
var_arm64="${var_arm64:-yes}"
|
||||
var_unprivileged="${var_unprivileged:-1}"
|
||||
export var_rustdesk_api="${var_rustdesk_api:-}"
|
||||
if [[ -z "${var_os:-}" ]] && command -v pveversion >/dev/null 2>&1; then
|
||||
var_os=$(msg_menu "Choose the container OS" \
|
||||
"debian" "Debian 13" \
|
||||
@@ -39,32 +38,25 @@ update_deb_based() {
|
||||
exit
|
||||
fi
|
||||
|
||||
if check_for_gh_release "rustdesk-hbbs" "rustdesk/rustdesk-server"; then
|
||||
msg_info "Stopping RustDesk Server"
|
||||
systemctl stop rustdesk-hbbr rustdesk-hbbs
|
||||
msg_ok "Stopped RustDesk Server"
|
||||
|
||||
fetch_and_deploy_gh_release "rustdesk-hbbr" "rustdesk/rustdesk-server" "binary" "latest" "/opt/rustdesk" "rustdesk-server-hbbr*$(arch_resolve).deb"
|
||||
fetch_and_deploy_gh_release "rustdesk-hbbs" "rustdesk/rustdesk-server" "binary" "latest" "/opt/rustdesk" "rustdesk-server-hbbs*$(arch_resolve).deb"
|
||||
fetch_and_deploy_gh_release "rustdesk-utils" "rustdesk/rustdesk-server" "binary" "latest" "/opt/rustdesk" "rustdesk-server-utils*$(arch_resolve).deb"
|
||||
|
||||
msg_info "Starting RustDesk Server"
|
||||
systemctl start rustdesk-hbbs rustdesk-hbbr
|
||||
msg_ok "Started RustDesk Server"
|
||||
msg_ok "Updated RustDesk Server"
|
||||
fi
|
||||
|
||||
if [[ -f /lib/systemd/system/rustdesk-api.service ]] && check_for_gh_release "rustdesk-api" "lejianwen/rustdesk-api"; then
|
||||
msg_info "Stopping RustDesk API"
|
||||
systemctl stop rustdesk-api
|
||||
msg_ok "Stopped RustDesk API"
|
||||
if check_for_gh_release "rustdesk-hbbs" "lejianwen/rustdesk-server"; then
|
||||
msg_info "Stopping Service"
|
||||
systemctl stop rustdesk-hbbr
|
||||
systemctl stop rustdesk-hbbs
|
||||
if [[ -f /lib/systemd/system/rustdesk-api.service ]]; then
|
||||
systemctl stop rustdesk-api
|
||||
fi
|
||||
msg_ok "Stopped Service"
|
||||
|
||||
fetch_and_deploy_gh_release "rustdesk-hbbr" "lejianwen/rustdesk-server" "binary" "latest" "/opt/rustdesk" "rustdesk-server-hbbr*$(arch_resolve).deb"
|
||||
fetch_and_deploy_gh_release "rustdesk-hbbs" "lejianwen/rustdesk-server" "binary" "latest" "/opt/rustdesk" "rustdesk-server-hbbs*$(arch_resolve).deb"
|
||||
fetch_and_deploy_gh_release "rustdesk-utils" "lejianwen/rustdesk-server" "binary" "latest" "/opt/rustdesk" "rustdesk-server-utils*$(arch_resolve).deb"
|
||||
fetch_and_deploy_gh_release "rustdesk-api" "lejianwen/rustdesk-api" "binary" "latest" "/opt/rustdesk" "rustdesk-api-server*$(arch_resolve).deb"
|
||||
|
||||
msg_info "Starting RustDesk API"
|
||||
systemctl start rustdesk-api
|
||||
msg_ok "Started RustDesk API"
|
||||
msg_ok "Updated RustDesk API"
|
||||
msg_info "Starting services"
|
||||
systemctl start -q rustdesk-*
|
||||
msg_ok "Services started"
|
||||
|
||||
msg_ok "Updated successfully!"
|
||||
fi
|
||||
}
|
||||
|
||||
@@ -74,26 +66,21 @@ update_alpine() {
|
||||
exit
|
||||
fi
|
||||
|
||||
msg_info "Updating Alpine Packages"
|
||||
$STD apk -U upgrade
|
||||
msg_ok "Updated Alpine Packages"
|
||||
|
||||
if check_for_gh_release "rustdesk-server" "rustdesk/rustdesk-server"; then
|
||||
if check_for_gh_release "rustdesk-server" "lejianwen/rustdesk-server"; then
|
||||
msg_info "Stopping RustDesk Server"
|
||||
$STD apk -U upgrade
|
||||
$STD service rustdesk-server-hbbs stop
|
||||
$STD service rustdesk-server-hbbr stop
|
||||
msg_ok "Stopped RustDesk Server"
|
||||
|
||||
fetch_and_deploy_gh_release "rustdesk-server" "rustdesk/rustdesk-server" "prebuild" "latest" "/opt/rustdesk-server" "rustdesk-server-linux-$(arch_resolve "amd64" "arm64v8").zip"
|
||||
fetch_and_deploy_gh_release "rustdesk-server" "lejianwen/rustdesk-server" "prebuild" "latest" "/opt/rustdesk-server" "rustdesk-server-linux-$(arch_resolve "amd64" "arm64v8").zip"
|
||||
|
||||
msg_info "Starting RustDesk Server"
|
||||
$STD service rustdesk-server-hbbs start
|
||||
$STD service rustdesk-server-hbbr start
|
||||
msg_ok "Started RustDesk Server"
|
||||
msg_ok "Updated RustDesk Server"
|
||||
fi
|
||||
|
||||
if [[ -x /opt/rustdesk-api/apimain ]] && check_for_gh_release "rustdesk-api" "lejianwen/rustdesk-api"; then
|
||||
if check_for_gh_release "rustdesk-api" "lejianwen/rustdesk-api"; then
|
||||
msg_info "Stopping RustDesk API"
|
||||
$STD service rustdesk-api stop
|
||||
msg_ok "Stopped RustDesk API"
|
||||
@@ -103,8 +90,8 @@ update_alpine() {
|
||||
msg_info "Starting RustDesk API"
|
||||
$STD service rustdesk-api start
|
||||
msg_ok "Started RustDesk API"
|
||||
msg_ok "Updated RustDesk API"
|
||||
fi
|
||||
msg_ok "Updated successfully!"
|
||||
}
|
||||
|
||||
function update_script() {
|
||||
@@ -120,7 +107,5 @@ description
|
||||
|
||||
msg_ok "Completed successfully!\n"
|
||||
echo -e "${CREATING}${GN}${APP} setup has been successfully initialized!${CL}"
|
||||
echo -e "${INFO}${YW}Set this as ID server in the RustDesk client, the key is in ~/rustdesk.creds:${CL}"
|
||||
echo -e "${GATEWAY}${BGN}${IP}${CL}"
|
||||
echo -e "${INFO}${YW}Web UI, if selected during setup:${CL}"
|
||||
echo -e "${GATEWAY}${BGN}http://${IP}:21114/_admin/${CL}"
|
||||
echo -e "${INFO}${YW}Access it using the following URL:${CL}"
|
||||
echo -e "${GATEWAY}${BGN}http://${IP}:21114${CL}"
|
||||
|
||||
@@ -0,0 +1,84 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# Copyright (c) 2021-2026 community-scripts ORG
|
||||
# Author: MickLesk (CanbiZ)
|
||||
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
|
||||
# Source: https://github.com/MoldyTaint/Cinephage
|
||||
|
||||
source /dev/stdin <<<"$FUNCTIONS_FILE_PATH"
|
||||
color
|
||||
verb_ip6
|
||||
catch_errors
|
||||
setting_up_container
|
||||
network_check
|
||||
update_os
|
||||
|
||||
msg_info "Installing Dependencies"
|
||||
$STD apt install -y \
|
||||
build-essential \
|
||||
python3 \
|
||||
libasound2t64 \
|
||||
libgtk-3-0t64 \
|
||||
libx11-xcb1 \
|
||||
xvfb
|
||||
msg_ok "Installed Dependencies"
|
||||
|
||||
setup_ffmpeg
|
||||
NODE_VERSION="24" setup_nodejs
|
||||
fetch_and_deploy_gh_release "cinephage" "MoldyTaint/Cinephage" "tarball"
|
||||
|
||||
msg_info "Building Cinephage"
|
||||
cd /opt/cinephage
|
||||
$STD npm ci
|
||||
$STD npm run build
|
||||
$STD npm prune --omit=dev
|
||||
msg_ok "Built Cinephage"
|
||||
|
||||
msg_info "Installing Camoufox"
|
||||
$STD /opt/cinephage/node_modules/.bin/camoufox-js fetch
|
||||
msg_ok "Installed Camoufox"
|
||||
|
||||
msg_info "Configuring Cinephage"
|
||||
mkdir -p /opt/cinephage_data/indexers/custom /opt/cinephage_data/external-lists/custom
|
||||
cat <<EOF >/opt/cinephage_data/.env
|
||||
NODE_ENV=production
|
||||
HOST=0.0.0.0
|
||||
PORT=3000
|
||||
APP_VERSION=$(cat ~/.cinephage)
|
||||
BETTER_AUTH_SECRET=$(openssl rand -base64 32)
|
||||
DATA_DIR=/opt/cinephage_data
|
||||
INDEXER_DEFINITIONS_PATH=/opt/cinephage/data/indexers/definitions
|
||||
INDEXER_CUSTOM_DEFINITIONS_PATH=/opt/cinephage_data/indexers/custom
|
||||
EXTERNAL_LISTS_PRESETS_PATH=/opt/cinephage/data/external-lists/presets
|
||||
EXTERNAL_LISTS_CUSTOM_PRESETS_PATH=/opt/cinephage_data/external-lists/custom
|
||||
CAPTCHA_ADDON_PATH=/opt/cinephage/src/lib/server/captcha/browser/addon
|
||||
FFPROBE_PATH=/usr/bin/ffprobe
|
||||
EOF
|
||||
chmod 600 /opt/cinephage_data/.env
|
||||
msg_ok "Configured Cinephage"
|
||||
|
||||
msg_info "Creating Service"
|
||||
cat <<EOF >/etc/systemd/system/cinephage.service
|
||||
[Unit]
|
||||
Description=Cinephage
|
||||
After=network.target
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
User=root
|
||||
WorkingDirectory=/opt/cinephage
|
||||
EnvironmentFile=/opt/cinephage_data/.env
|
||||
Environment=NODE_OPTIONS=--max-old-space-size=2048
|
||||
ExecStart=/usr/bin/node server.js
|
||||
Restart=on-failure
|
||||
RestartSec=10
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
EOF
|
||||
systemctl enable -q --now cinephage
|
||||
msg_ok "Created Service"
|
||||
|
||||
motd_ssh
|
||||
customize
|
||||
cleanup_lxc
|
||||
@@ -13,124 +13,108 @@ setting_up_container
|
||||
network_check
|
||||
update_os
|
||||
|
||||
if [[ -n "${var_rustdesk_api:-}" ]]; then
|
||||
prompt="$var_rustdesk_api"
|
||||
else
|
||||
read -r -p "${TAB3}Would you like to add the RustDesk API web UI (lejianwen/rustdesk-api, unmaintained since 09/2025)? <y/N> " prompt
|
||||
fi
|
||||
INSTALL_API=0
|
||||
[[ "${prompt,,}" =~ ^(y|yes|true)$ ]] && INSTALL_API=1
|
||||
API_PASS="$(random_password 16)"
|
||||
|
||||
# rustdesk-api hands these to clients; its shipped defaults point at 192.168.1.66
|
||||
api_env() {
|
||||
printf '%s\n' \
|
||||
"RUSTDESK_API_RUSTDESK_ID_SERVER=${LOCAL_IP}:21116" \
|
||||
"RUSTDESK_API_RUSTDESK_RELAY_SERVER=${LOCAL_IP}:21117" \
|
||||
"RUSTDESK_API_RUSTDESK_API_SERVER=http://${LOCAL_IP}:21114" \
|
||||
"RUSTDESK_API_RUSTDESK_KEY_FILE=$1"
|
||||
}
|
||||
|
||||
# hbbs creates its key pair in its working directory on first start
|
||||
write_creds() {
|
||||
local key_file="$1"
|
||||
for _ in $(seq 1 30); do
|
||||
[[ -s "$key_file" ]] && break
|
||||
sleep 1
|
||||
done
|
||||
if [[ ! -s "$key_file" ]]; then
|
||||
msg_error "hbbs did not create ${key_file}"
|
||||
exit 1
|
||||
fi
|
||||
{
|
||||
echo "RustDesk Server"
|
||||
echo "ID Server: ${LOCAL_IP}"
|
||||
echo "Key: $(<"$key_file")"
|
||||
if ((INSTALL_API)); then
|
||||
echo ""
|
||||
echo "RustDesk API Web UI: http://${LOCAL_IP}:21114/_admin/"
|
||||
echo "Username: admin"
|
||||
echo "Password: ${API_PASS}"
|
||||
fi
|
||||
} >~/rustdesk.creds
|
||||
}
|
||||
|
||||
setup_deb_based() {
|
||||
fetch_and_deploy_gh_release "rustdesk-hbbr" "rustdesk/rustdesk-server" "binary" "latest" "/opt/rustdesk" "rustdesk-server-hbbr*$(arch_resolve).deb"
|
||||
fetch_and_deploy_gh_release "rustdesk-hbbs" "rustdesk/rustdesk-server" "binary" "latest" "/opt/rustdesk" "rustdesk-server-hbbs*$(arch_resolve).deb"
|
||||
fetch_and_deploy_gh_release "rustdesk-utils" "rustdesk/rustdesk-server" "binary" "latest" "/opt/rustdesk" "rustdesk-server-utils*$(arch_resolve).deb"
|
||||
systemctl enable -q --now rustdesk-hbbs rustdesk-hbbr
|
||||
write_creds /var/lib/rustdesk-server/id_ed25519.pub
|
||||
|
||||
if ((INSTALL_API)); then
|
||||
fetch_and_deploy_gh_release "rustdesk-api" "lejianwen/rustdesk-api" "binary" "latest" "/opt/rustdesk" "rustdesk-api-server*$(arch_resolve).deb"
|
||||
msg_info "Configuring RustDesk API"
|
||||
mkdir -p /etc/systemd/system/rustdesk-api.service.d
|
||||
{
|
||||
echo "[Service]"
|
||||
api_env /var/lib/rustdesk-server/id_ed25519.pub | sed 's/^/Environment=/'
|
||||
} >/etc/systemd/system/rustdesk-api.service.d/override.conf
|
||||
systemctl daemon-reload
|
||||
systemctl stop rustdesk-api
|
||||
cd /var/lib/rustdesk-api
|
||||
$STD rustdesk-api reset-admin-pwd "$API_PASS"
|
||||
systemctl enable -q --now rustdesk-api
|
||||
msg_ok "Configured RustDesk API"
|
||||
fi
|
||||
fetch_and_deploy_gh_release "rustdesk-hbbr" "lejianwen/rustdesk-server" "binary" "latest" "/opt/rustdesk" "rustdesk-server-hbbr*$(arch_resolve).deb"
|
||||
fetch_and_deploy_gh_release "rustdesk-hbbs" "lejianwen/rustdesk-server" "binary" "latest" "/opt/rustdesk" "rustdesk-server-hbbs*$(arch_resolve).deb"
|
||||
fetch_and_deploy_gh_release "rustdesk-utils" "lejianwen/rustdesk-server" "binary" "latest" "/opt/rustdesk" "rustdesk-server-utils*$(arch_resolve).deb"
|
||||
fetch_and_deploy_gh_release "rustdesk-api" "lejianwen/rustdesk-api" "binary" "latest" "/opt/rustdesk" "rustdesk-api-server*$(arch_resolve).deb"
|
||||
systemctl enable -q --now rustdesk-hbbr
|
||||
systemctl enable -q --now rustdesk-hbbs
|
||||
systemctl enable -q --now rustdesk-api
|
||||
}
|
||||
|
||||
setup_alpine() {
|
||||
fetch_and_deploy_gh_release "rustdesk-server" "rustdesk/rustdesk-server" "prebuild" "latest" "/opt/rustdesk-server" "rustdesk-server-linux-$(arch_resolve "amd64" "arm64v8").zip"
|
||||
fetch_and_deploy_gh_release "rustdesk-server" "lejianwen/rustdesk-server" "prebuild" "latest" "/opt/rustdesk-server" "rustdesk-server-linux-$(arch_resolve "amd64" "arm64v8").zip"
|
||||
|
||||
msg_info "Creating RustDesk Server Services"
|
||||
for svc in hbbs hbbr; do
|
||||
cat <<EOF >"/etc/init.d/rustdesk-server-${svc}"
|
||||
msg_info "Configuring RustDesk Server"
|
||||
mkdir -p /root/.config/rustdesk
|
||||
cd /opt/rustdesk-server
|
||||
./rustdesk-utils genkeypair >/tmp/rustdesk_keys.txt
|
||||
grep "Public Key" /tmp/rustdesk_keys.txt | awk '{print $3}' >/root/.config/rustdesk/id_ed25519.pub
|
||||
grep "Secret Key" /tmp/rustdesk_keys.txt | awk '{print $3}' >/root/.config/rustdesk/id_ed25519
|
||||
chmod 600 /root/.config/rustdesk/id_ed25519
|
||||
chmod 644 /root/.config/rustdesk/id_ed25519.pub
|
||||
rm /tmp/rustdesk_keys.txt
|
||||
msg_ok "Configured RustDesk Server"
|
||||
|
||||
fetch_and_deploy_gh_release "rustdesk-api" "lejianwen/rustdesk-api" "prebuild" "latest" "/opt/rustdesk-api" "linux-$(arch_resolve).tar.gz"
|
||||
|
||||
msg_info "Configuring RustDesk API"
|
||||
cd /opt/rustdesk-api
|
||||
ADMINPASS=$(head -c 16 /dev/urandom | xxd -p -c 16)
|
||||
$STD ./apimain reset-admin-pwd "$ADMINPASS"
|
||||
cat <<EOF >~/rustdesk.creds
|
||||
RustDesk WebUI
|
||||
|
||||
Username: admin
|
||||
Password: $ADMINPASS
|
||||
EOF
|
||||
msg_ok "Configured RustDesk API"
|
||||
|
||||
msg_info "Enabling RustDesk Server Services"
|
||||
cat <<EOF >/etc/init.d/rustdesk-server-hbbs
|
||||
#!/sbin/openrc-run
|
||||
description="RustDesk ${svc^^} Service"
|
||||
description="RustDesk HBBS Service"
|
||||
directory="/opt/rustdesk-server"
|
||||
command="/opt/rustdesk-server/${svc}"
|
||||
command="/opt/rustdesk-server/hbbs"
|
||||
command_args=""
|
||||
command_background="true"
|
||||
pidfile="/var/run/rustdesk-server-${svc}.pid"
|
||||
output_log="/var/log/rustdesk-${svc}.log"
|
||||
error_log="/var/log/rustdesk-${svc}.err"
|
||||
command_user="root"
|
||||
pidfile="/var/run/rustdesk-server-hbbs.pid"
|
||||
output_log="/var/log/rustdesk-hbbs.log"
|
||||
error_log="/var/log/rustdesk-hbbs.err"
|
||||
|
||||
depend() {
|
||||
use net
|
||||
}
|
||||
EOF
|
||||
chmod +x "/etc/init.d/rustdesk-server-${svc}"
|
||||
$STD rc-update add "rustdesk-server-${svc}" default
|
||||
$STD service "rustdesk-server-${svc}" start
|
||||
done
|
||||
msg_ok "Created RustDesk Server Services"
|
||||
write_creds /opt/rustdesk-server/id_ed25519.pub
|
||||
|
||||
if ((INSTALL_API)); then
|
||||
fetch_and_deploy_gh_release "rustdesk-api" "lejianwen/rustdesk-api" "prebuild" "latest" "/opt/rustdesk-api" "linux-$(arch_resolve).tar.gz"
|
||||
msg_info "Configuring RustDesk API"
|
||||
api_env /opt/rustdesk-server/id_ed25519.pub | sed 's/^/export /' >/etc/conf.d/rustdesk-api
|
||||
cd /opt/rustdesk-api
|
||||
$STD ./apimain reset-admin-pwd "$API_PASS"
|
||||
cat <<EOF >/etc/init.d/rustdesk-api
|
||||
cat <<EOF >/etc/init.d/rustdesk-server-hbbr
|
||||
#!/sbin/openrc-run
|
||||
description="RustDesk HBBR Service"
|
||||
directory="/opt/rustdesk-server"
|
||||
command="/opt/rustdesk-server/hbbr"
|
||||
command_args=""
|
||||
command_background="true"
|
||||
command_user="root"
|
||||
pidfile="/var/run/rustdesk-server-hbbr.pid"
|
||||
output_log="/var/log/rustdesk-hbbr.log"
|
||||
error_log="/var/log/rustdesk-hbbr.err"
|
||||
|
||||
depend() {
|
||||
use net
|
||||
}
|
||||
EOF
|
||||
|
||||
cat <<EOF >/etc/init.d/rustdesk-api
|
||||
#!/sbin/openrc-run
|
||||
description="RustDesk API Service"
|
||||
directory="/opt/rustdesk-api"
|
||||
command="/opt/rustdesk-api/apimain"
|
||||
command_args=""
|
||||
command_background="true"
|
||||
command_user="root"
|
||||
pidfile="/var/run/rustdesk-api.pid"
|
||||
output_log="/var/log/rustdesk-api.log"
|
||||
error_log="/var/log/rustdesk-api.err"
|
||||
|
||||
depend() {
|
||||
use net
|
||||
after rustdesk-server-hbbs
|
||||
}
|
||||
EOF
|
||||
chmod +x /etc/init.d/rustdesk-api
|
||||
$STD rc-update add rustdesk-api default
|
||||
$STD service rustdesk-api start
|
||||
msg_ok "Configured RustDesk API"
|
||||
fi
|
||||
chmod +x /etc/init.d/rustdesk-server-hbbs
|
||||
chmod +x /etc/init.d/rustdesk-server-hbbr
|
||||
chmod +x /etc/init.d/rustdesk-api
|
||||
$STD rc-update add rustdesk-server-hbbs default
|
||||
$STD rc-update add rustdesk-server-hbbr default
|
||||
$STD rc-update add rustdesk-api default
|
||||
msg_ok "Enabled RustDesk Server Services"
|
||||
|
||||
msg_info "Starting RustDesk Server"
|
||||
$STD service rustdesk-server-hbbs start
|
||||
$STD service rustdesk-server-hbbr start
|
||||
$STD service rustdesk-api start
|
||||
msg_ok "Started RustDesk Server"
|
||||
}
|
||||
|
||||
run_os_setup
|
||||
|
||||
Reference in New Issue
Block a user