Compare commits

...
Author SHA1 Message Date
MickLesk 3bc994cad0 RustDesk Server: answer the web UI prompt with var_rustdesk_api
yes or no skips the question, so unattended installs can choose; unset still asks.
2026-10-11 14:36:35 +02:00
MickLesk a9ebfb729c RustDesk Server: run the official server, make the web UI optional
lejianwen/rustdesk-server has had no commit since 2025-09-01 and is 45
commits behind upstream, missing the UDP reflection/amplification and
mio security fixes. hbbs, hbbr and utils now come from
rustdesk/rustdesk-server; the packages and units are the same, so
existing installs upgrade in place and keep their keys.

lejianwen/rustdesk-api is unmaintained as well and becomes an opt-in
prompt. When chosen it is configured with this server's IP and key
instead of its 192.168.1.66 defaults, and Debian gets an admin password
like Alpine did. ~/rustdesk.creds now always holds the server key, and
the API is only updated where it is installed.
2026-10-11 14:07:06 +02:00
community-scripts-pr-app[bot]andgithub-actions[bot] 548e855118 Update CHANGELOG.md (#17853)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2026-10-11 12:03:34 +00:00
CanbiZ (MickLesk) de19f51761 Radicale: install the bcrypt and argon2 extras (#17813)
* Radicale: install the bcrypt and argon2 extras

The update replaces pyproject.toml and the venv, so a bcrypt or argon2
module added by hand was gone afterwards and Radicale refused to start
with htpasswd_encryption = bcrypt, argon2 or autodetect. The service now
runs uv with --extra bcrypt --extra argon2, which upstream already
defines. The update patches existing units and restarts the service.

* Radicale: enable the extras only once the code defines them

argon2 is an extra since v3.5.4 and uv refuses unknown extras, so patching
before the release update broke older installs. Patch after it instead,
and only when pyproject.toml defines the extra.
2026-10-11 14:03:06 +02:00
community-scripts-pr-app[bot]andgithub-actions[bot] ad700e9691 Update CHANGELOG.md (#17851)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2026-10-11 11:24:54 +00:00
CanbiZ (MickLesk) 91bc5b3835 docker: take the lxcfs toggle, TCP socket and Compose choice from app variables (#17850)
* docker: take the lxcfs toggle, TCP socket and Compose choice from app variables

var_docker_lxcfs is exported for the core helper; var_docker_tcp_socket
(no/local/all) and var_docker_compose replace the prompts when set, so
the website generator can offer them. Alpine wrote daemon.json through
silent(), which captured the output and left the file empty.

* docker: use var_docker_socket, the name the catalog record already carries
2026-10-11 13:24:31 +02:00
community-scripts-pr-app[bot]andgithub-actions[bot] 701268bff4 Update CHANGELOG.md (#17849)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2026-10-11 08:28:49 +00:00
community-scripts-pr-app[bot]andgithub-actions[bot] c1c7437ddc Update CHANGELOG.md (#17848)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2026-10-11 07:16:36 +00:00
community-scripts-pr-app[bot]andgithub-actions[bot] 9c11f496c7 Update CHANGELOG.md (#17846)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2026-10-11 07:12:28 +00:00
community-scripts-pr-app[bot]andgithub-actions[bot] 46196d179e Update CHANGELOG.md (#17844)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2026-10-11 06:50:36 +00:00
petermnt 3035f9216e fix(zigbee2mqtt): preserve backup stream and prevent filename collisions (#17751)
* fix(zigbee2mqtt): preserve backup tar stream in quiet mode

* fix(zigbee2mqtt): avoid backup collisions on repeated updates
2026-10-11 08:50:08 +02:00
8 changed files with 196 additions and 113 deletions
+18
View File
@@ -564,6 +564,24 @@ Exercise vigilance regarding copycat or coat-tailing sites that seek to exploit
## 2026-10-11
### 🚀 Updated Scripts
- #### 🐞 Bug Fixes
- 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))
- #### ✨ New Features
- docker: take the lxcfs toggle, TCP socket and Compose choice from app variables [@MickLesk](https://github.com/MickLesk) ([#17850](https://github.com/community-scripts/ProxmoxVE/pull/17850))
### 💾 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))
- 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))
## 2026-10-10
### 🆕 New Scripts
+4
View File
@@ -27,6 +27,10 @@ else
var_disk="${var_disk:-4}"
var_version="${var_version:-13}"
fi
# Only exported variables reach the install through lxc-attach.
export var_docker_socket="${var_docker_socket:-}"
export var_docker_compose="${var_docker_compose:-}"
export var_docker_lxcfs="${var_docker_lxcfs:-}"
header_info "$APP"
variables
+9 -1
View File
@@ -41,7 +41,7 @@ function update_script() {
if grep -q 'start.sh' /etc/systemd/system/radicale.service; then
sed -i -e '/^Description/i[Unit]' \
-e '\|^ExecStart|iWorkingDirectory=/opt/radicale' \
-e 's|^ExecStart=.*|ExecStart=/usr/local/bin/uv run -m radicale --config /etc/radicale/config|' /etc/systemd/system/radicale.service
-e 's|^ExecStart=.*|ExecStart=/usr/local/bin/uv run --extra bcrypt --extra argon2 -m radicale --config /etc/radicale/config|' /etc/systemd/system/radicale.service
systemctl daemon-reload
fi
if [[ ! -f /etc/radicale/config ]]; then
@@ -70,6 +70,14 @@ EOF
msg_ok "Started service"
msg_ok "Updated Successfully!"
fi
if grep -q 'uv run -m radicale' /etc/systemd/system/radicale.service && grep -q '^argon2 *=' /opt/radicale/pyproject.toml; then
msg_info "Enabling bcrypt/argon2 support"
sed -i 's|uv run -m radicale|uv run --extra bcrypt --extra argon2 -m radicale|' /etc/systemd/system/radicale.service
systemctl daemon-reload
systemctl restart radicale
msg_ok "Enabled bcrypt/argon2 support"
fi
exit
}
+38 -23
View File
@@ -11,6 +11,7 @@ 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" \
@@ -38,25 +39,32 @@ update_deb_based() {
exit
fi
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"
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"
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 services"
systemctl start -q rustdesk-*
msg_ok "Services started"
msg_ok "Updated successfully!"
msg_info "Starting RustDesk API"
systemctl start rustdesk-api
msg_ok "Started RustDesk API"
msg_ok "Updated RustDesk API"
fi
}
@@ -66,21 +74,26 @@ update_alpine() {
exit
fi
if check_for_gh_release "rustdesk-server" "lejianwen/rustdesk-server"; then
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
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" "lejianwen/rustdesk-server" "prebuild" "latest" "/opt/rustdesk-server" "rustdesk-server-linux-$(arch_resolve "amd64" "arm64v8").zip"
fetch_and_deploy_gh_release "rustdesk-server" "rustdesk/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 check_for_gh_release "rustdesk-api" "lejianwen/rustdesk-api"; then
if [[ -x /opt/rustdesk-api/apimain ]] && 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"
@@ -90,8 +103,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() {
@@ -107,5 +120,7 @@ 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}:21114${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}"
+6 -2
View File
@@ -49,8 +49,12 @@ update_deb_based() {
ensure_dependencies zstd
mkdir -p /opt/backups
BACKUP_VERSION="$(<"$HOME/.zigbee2mqtt")"
BACKUP_FILE="/opt/backups/${APP}_backup_${BACKUP_VERSION}.tar.zst"
$STD tar -cf - -C /opt zigbee2mqtt | zstd -q -o "$BACKUP_FILE"
BACKUP_FILE="$(mktemp "/opt/backups/${APP}_backup_${BACKUP_VERSION}_XXXXXX.tar.zst")"
tar -cf - -C /opt zigbee2mqtt | $STD zstd -q -f -o "$BACKUP_FILE" || {
local backup_exit_code=$?
rm -f "$BACKUP_FILE"
return "$backup_exit_code"
}
ls -t /opt/backups/${APP}_backup_*.tar.zst 2>/dev/null | tail -n +6 | xargs -r rm -f
msg_ok "Backup Created (${BACKUP_VERSION})"
+29 -11
View File
@@ -15,12 +15,16 @@ update_os
setup_deb_based() {
setup_docker
read -r -p "${TAB3}Expose Docker TCP socket (insecure) ? [n = No, l = Local only (127.0.0.1), a = All interfaces (0.0.0.0)] <n/l/a>: " socket_choice
if [[ -n "${var_docker_socket:-}" ]]; then
socket_choice="$var_docker_socket"
else
read -r -p "${TAB3}Expose Docker TCP socket (insecure) ? [n = No, l = Local only (127.0.0.1), a = All interfaces (0.0.0.0)] <n/l/a>: " socket_choice
fi
case "${socket_choice,,}" in
l)
l | local)
socket="tcp://127.0.0.1:2375"
;;
a)
a | all)
socket="tcp://0.0.0.0:2375"
;;
*)
@@ -66,8 +70,12 @@ setup_alpine() {
msg_ok "Installed Docker"
DOCKER_COMPOSE_LATEST_VERSION=$(get_latest_github_release "docker/compose" false)
read -r -p "${TAB3}Would you like to add Docker Compose? <y/N> " prompt
if [[ "${prompt,,}" =~ ^(y|yes)$ ]]; then
if [[ -n "${var_docker_compose:-}" ]]; then
prompt="$var_docker_compose"
else
read -r -p "${TAB3}Would you like to add Docker Compose? <y/N> " prompt
fi
if [[ "${prompt,,}" =~ ^(y|yes|true)$ ]]; then
msg_info "Installing Docker Compose $DOCKER_COMPOSE_LATEST_VERSION"
DOCKER_CONFIG=${DOCKER_CONFIG:-$HOME/.docker}
mkdir -p "$DOCKER_CONFIG"/cli-plugins
@@ -75,13 +83,23 @@ setup_alpine() {
chmod +x "$DOCKER_CONFIG"/cli-plugins/docker-compose
msg_ok "Installed Docker Compose $DOCKER_COMPOSE_LATEST_VERSION"
fi
read -r -p "${TAB3}Would you like to expose the Docker TCP socket? <y/N> " prompt
if [[ "${prompt,,}" =~ ^(y|yes)$ ]]; then
msg_info "Exposing Docker TCP socket"
$STD mkdir -p /etc/docker
$STD echo '{ "hosts": ["unix:///var/run/docker.sock", "tcp://0.0.0.0:2375"] }' >/etc/docker/daemon.json
if [[ -n "${var_docker_socket:-}" ]]; then
prompt="$var_docker_socket"
else
read -r -p "${TAB3}Would you like to expose the Docker TCP socket? <y/N> " prompt
fi
case "${prompt,,}" in
y | yes | a | all) socket="tcp://0.0.0.0:2375" ;;
l | local) socket="tcp://127.0.0.1:2375" ;;
*) socket="" ;;
esac
if [[ -n "$socket" ]]; then
msg_info "Exposing Docker TCP socket on $socket"
mkdir -p /etc/docker
# No $STD here: silent() captures stdout, which left daemon.json empty.
printf '{ "hosts": ["unix:///var/run/docker.sock", "%s"] }\n' "$socket" >/etc/docker/daemon.json
$STD rc-service docker restart
msg_ok "Exposed Docker TCP socket at tcp://+:2375"
msg_ok "Exposed Docker TCP socket on $socket"
fi
}
+1 -1
View File
@@ -58,7 +58,7 @@ Requires=network.target
[Service]
WorkingDirectory=/opt/radicale
ExecStart=/usr/local/bin/uv run -m radicale --config /etc/radicale/config
ExecStart=/usr/local/bin/uv run --extra bcrypt --extra argon2 -m radicale --config /etc/radicale/config
Restart=on-failure
# User=radicale
# Deny other users access to the calendar data
+91 -75
View File
@@ -13,108 +13,124 @@ 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" "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
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
}
setup_alpine() {
fetch_and_deploy_gh_release "rustdesk-server" "lejianwen/rustdesk-server" "prebuild" "latest" "/opt/rustdesk-server" "rustdesk-server-linux-$(arch_resolve "amd64" "arm64v8").zip"
fetch_and_deploy_gh_release "rustdesk-server" "rustdesk/rustdesk-server" "prebuild" "latest" "/opt/rustdesk-server" "rustdesk-server-linux-$(arch_resolve "amd64" "arm64v8").zip"
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
msg_info "Creating RustDesk Server Services"
for svc in hbbs hbbr; do
cat <<EOF >"/etc/init.d/rustdesk-server-${svc}"
#!/sbin/openrc-run
description="RustDesk HBBS Service"
description="RustDesk ${svc^^} Service"
directory="/opt/rustdesk-server"
command="/opt/rustdesk-server/hbbs"
command_args=""
command="/opt/rustdesk-server/${svc}"
command_background="true"
command_user="root"
pidfile="/var/run/rustdesk-server-hbbs.pid"
output_log="/var/log/rustdesk-hbbs.log"
error_log="/var/log/rustdesk-hbbs.err"
pidfile="/var/run/rustdesk-server-${svc}.pid"
output_log="/var/log/rustdesk-${svc}.log"
error_log="/var/log/rustdesk-${svc}.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
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
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
#!/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-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"
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
}
run_os_setup