RustDesk Server: Add WebUI (#4590)

* Add WebUI

* Update

* Update port

* Update
This commit is contained in:
Slaviša Arežina 2025-05-19 18:52:54 +02:00 committed by GitHub
parent 37cd6a6620
commit 2c2e602eb1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 103 additions and 76 deletions

View File

@ -28,11 +28,17 @@ function update_script() {
msg_error "No ${APP} Installation Found!" msg_error "No ${APP} Installation Found!"
exit exit
fi fi
if [[ ! -f /opt/rustdeskapi_version.txt ]]; then
touch /opt/rustdeskapi_version.txt
exit
fi
RELEASE=$(curl -fsSL https://api.github.com/repos/rustdesk/rustdesk-server/releases/latest | grep "tag_name" | awk '{print substr($2, 2, length($2)-3) }') RELEASE=$(curl -fsSL https://api.github.com/repos/rustdesk/rustdesk-server/releases/latest | grep "tag_name" | awk '{print substr($2, 2, length($2)-3) }')
if [[ "${RELEASE}" != "$(cat /opt/rustdesk_version.txt)" ]] || [[ ! -f /opt/rustdesk_version.txt ]]; then APIRELEASE=$(curl -fsSL https://api.github.com/repos/lejianwen/rustdesk-api/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-4) }')
if [[ "${RELEASE}" != "$(cat /opt/rustdesk_version.txt)" ]] || [[ "${APIRELEASE}" != "$(cat /opt/rustdesk-api.txt)" ]] || [[ ! -f /opt/rustdesk_version.txt ]] || [[ ! -f /opt/rustdesk-api.txt ]]; then
msg_info "Stopping $APP" msg_info "Stopping $APP"
systemctl stop rustdesk-hbbr systemctl stop rustdesk-hbbr
systemctl stop rustdesk-hbbs systemctl stop rustdesk-hbbs
systemctl stop rustdesk-api
msg_ok "Stopped $APP" msg_ok "Stopped $APP"
msg_info "Updating $APP to v${RELEASE}" msg_info "Updating $APP to v${RELEASE}"
@ -43,14 +49,20 @@ function update_script() {
-o "${TEMPDIR}/rustdesk-server-hbbs_${RELEASE}_amd64.deb" -o "${TEMPDIR}/rustdesk-server-hbbs_${RELEASE}_amd64.deb"
curl -fsSL "https://github.com/rustdesk/rustdesk-server/releases/download/${RELEASE}/rustdesk-server-utils_${RELEASE}_amd64.deb" \ curl -fsSL "https://github.com/rustdesk/rustdesk-server/releases/download/${RELEASE}/rustdesk-server-utils_${RELEASE}_amd64.deb" \
-o "${TEMPDIR}/rustdesk-server-utils_${RELEASE}_amd64.deb" -o "${TEMPDIR}/rustdesk-server-utils_${RELEASE}_amd64.deb"
curl -fsSL "https://github.com/lejianwen/rustdesk-api/releases/download/v${APIRELEASE}/rustdesk-api-server_${APIRELEASE}_amd64.deb" \
-o "${TEMPDIR}/rustdesk-api-server_${APIRELEASE}_amd64.deb"
$STD dpkg -i $TEMPDIR/*.deb $STD dpkg -i $TEMPDIR/*.deb
echo "${RELEASE}" >/opt/rustdesk_version.txt
echo "${APIRELEASE}" >/opt/rustdeskapi_version.txt
msg_ok "Updated $APP to v${RELEASE}" msg_ok "Updated $APP to v${RELEASE}"
msg_info "Cleaning Up" msg_info "Cleaning Up"
rm -rf $TEMPDIR rm -rf $TEMPDIR
msg_ok "Cleanup Completed" msg_ok "Cleanup Completed"
echo "${RELEASE}" >/opt/rustdesk_version.txt msg_info "Starting services"
systemctl start -q rustdesk-* --all
msg_ok "Services started"
msg_ok "Update Successful" msg_ok "Update Successful"
else else
msg_ok "No update required. ${APP} is already at v${RELEASE}" msg_ok "No update required. ${APP} is already at v${RELEASE}"
@ -65,4 +77,4 @@ description
msg_ok "Completed Successfully!\n" msg_ok "Completed Successfully!\n"
echo -e "${CREATING}${GN}${APP} setup has been successfully initialized!${CL}" echo -e "${CREATING}${GN}${APP} setup has been successfully initialized!${CL}"
echo -e "${INFO}${YW} Access it using the following URL:${CL}" echo -e "${INFO}${YW} Access it using the following URL:${CL}"
echo -e "${TAB}${GATEWAY}${BGN}${IP}${CL}" echo -e "${TAB}${GATEWAY}${BGN}${IP}:21114${CL}"

View File

@ -8,10 +8,10 @@
"type": "ct", "type": "ct",
"updateable": true, "updateable": true,
"privileged": false, "privileged": false,
"interface_port": null, "interface_port": 21114,
"documentation": "https://rustdesk.com/docs/en/", "documentation": "https://rustdesk.com/docs/en/",
"website": "https://rustdesk.com/", "website": "https://rustdesk.com/",
"logo": "https://rustdesk.com/_astro/logo.BKb61-he.svg", "logo": "https://cdn.jsdelivr.net/gh/selfhst/icons/webp/rustdesk.webp",
"config_path": "", "config_path": "",
"description": "RustDesk is a full-featured open source remote control alternative for self-hosting and security with minimal configuration.", "description": "RustDesk is a full-featured open source remote control alternative for self-hosting and security with minimal configuration.",
"install_methods": [ "install_methods": [
@ -35,7 +35,10 @@
{ {
"text": "Check our configuration guide for help: `https://github.com/community-scripts/ProxmoxVE/discussions/2388`", "text": "Check our configuration guide for help: `https://github.com/community-scripts/ProxmoxVE/discussions/2388`",
"type": "info" "type": "info"
},
{
"text": "Login credentials: `cat ~/rustdesk.creds`",
"type": "info"
} }
] ]
} }

View File

@ -16,6 +16,7 @@ update_os
msg_info "Setup RustDesk" msg_info "Setup RustDesk"
RELEASE=$(curl -fsSL https://api.github.com/repos/rustdesk/rustdesk-server/releases/latest | grep "tag_name" | awk -F '"' '{print $4}') RELEASE=$(curl -fsSL https://api.github.com/repos/rustdesk/rustdesk-server/releases/latest | grep "tag_name" | awk -F '"' '{print $4}')
APIRELEASE=$(curl -fsSL https://api.github.com/repos/lejianwen/rustdesk-api/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-4) }')
TEMPDIR=$(mktemp -d) TEMPDIR=$(mktemp -d)
curl -fsSL "https://github.com/rustdesk/rustdesk-server/releases/download/${RELEASE}/rustdesk-server-hbbr_${RELEASE}_amd64.deb" \ curl -fsSL "https://github.com/rustdesk/rustdesk-server/releases/download/${RELEASE}/rustdesk-server-hbbr_${RELEASE}_amd64.deb" \
@ -24,7 +25,18 @@ curl -fsSL "https://github.com/rustdesk/rustdesk-server/releases/download/${RELE
-o "${TEMPDIR}/rustdesk-server-hbbs_${RELEASE}_amd64.deb" -o "${TEMPDIR}/rustdesk-server-hbbs_${RELEASE}_amd64.deb"
curl -fsSL "https://github.com/rustdesk/rustdesk-server/releases/download/${RELEASE}/rustdesk-server-utils_${RELEASE}_amd64.deb" \ curl -fsSL "https://github.com/rustdesk/rustdesk-server/releases/download/${RELEASE}/rustdesk-server-utils_${RELEASE}_amd64.deb" \
-o "${TEMPDIR}/rustdesk-server-utils_${RELEASE}_amd64.deb" -o "${TEMPDIR}/rustdesk-server-utils_${RELEASE}_amd64.deb"
curl -fsSL "https://github.com/lejianwen/rustdesk-api/releases/download/v${APIRELEASE}/rustdesk-api-server_${APIRELEASE}_amd64.deb" \
-o "${TEMPDIR}/rustdesk-api-server_${APIRELEASE}_amd64.deb"
$STD dpkg -i "${TEMPDIR}"/*.deb $STD dpkg -i "${TEMPDIR}"/*.deb
ADMINPASS=$(openssl rand -base64 18 | tr -dc 'a-zA-Z0-9' | head -c13)
cd /var/lib/rustdesk-api
$STD rustdesk-api reset-admin-pwd $ADMINPASS
{
echo "RustDesk WebUI"
echo ""
echo "Username: admin"
echo "Password: $ADMINPASS"
} >>~/rustdesk.creds
echo "${RELEASE}" >/opt/rustdesk_version.txt echo "${RELEASE}" >/opt/rustdesk_version.txt
msg_ok "Setup RustDesk" msg_ok "Setup RustDesk"