发布 RustDesk-API

Signed-off-by: Meng Sen <qyg2297248353@gmail.com>
This commit is contained in:
Meng Sen
2025-04-27 11:14:31 +08:00
parent 8e567a9310
commit b973db78e2
12 changed files with 312 additions and 0 deletions

View File

@@ -0,0 +1,5 @@
#!/command/with-contenv sh
cd /data || exit
PARAMS=
[ "${ENCRYPTED_ONLY}" = "1" ] && PARAMS="-k ${KEY}"
/usr/bin/hbbr $PARAMS

View File

@@ -0,0 +1,6 @@
#!/command/with-contenv sh
sleep 2
cd /data
PARAMS=
[ "${ENCRYPTED_ONLY}" = "1" ] && PARAMS="-k ${KEY}"
/usr/bin/hbbs -r $RELAY $PARAMS

View File

@@ -0,0 +1,154 @@
additionalProperties:
formFields:
- default: "/home/rustdesk-api"
edit: true
envKey: RUSTDESK_API_ROOT_PATH
labelZh: 数据持久化路径
labelEn: Data persistence path
required: true
type: text
- default: 21114
edit: true
envKey: PANEL_APP_PORT_HTTP
labelZh: WebUI 端口
labelEn: WebUI port
required: true
rule: paramPort
type: number
- default: "http://127.0.0.1"
edit: true
envKey: RUSTDESK_SERVER_URL
labelZh: RustDesk 服务地址
labelEn: RustDesk server address
required: true
type: text
- default: "RustDesk API Admin"
edit: true
envKey: RUSTDESK_API_ADMIN_TITLE
labelZh: 后台页面标题
labelEn: Admin page title
required: true
type: text
- default: ""
edit: true
envKey: RUSTDESK_API_RUSTDESK_KEY
labelZh: RustDesk API 密钥
labelEn: RustDesk API key
required: true
type: text
- default: "168h"
edit: true
envKey: RUSTDESK_API_APP_TOKEN_EXPIRE
labelZh: 登录有效期
labelEn: Login validity period
required: true
type: text
- default: "1"
edit: true
envKey: RUSTDESK_API_APP_WEB_CLIENT
labelZh: 启用 Web Client
labelEn: Enable Web Client
required: true
type: select
values:
- label: 启用
value: "1"
- label: 禁用
value: "0"
- default: "1"
edit: true
envKey: RUSTDESK_API_APP_REGISTER
labelZh: 开启 Swagger 文档
labelEn: Enable Swagger docs
required: true
type: select
values:
- label: 启用
value: "1"
- label: 禁用
value: "0"
- default: "false"
edit: true
envKey: RUSTDESK_API_APP_REGISTER
labelZh: 启用注册
labelEn: Enable register
required: true
type: select
values:
- label: 启用
value: "true"
- label: 禁用
value: "false"
- default: "false"
edit: true
envKey: RUSTDESK_API_APP_DISABLE_PWD_LOGIN
labelZh: 登录策略
labelEn: Login strategy
required: true
type: select
values:
- label: 禁用密码登录
value: "true"
- label: 允许密码登录
value: "false"
- default: "false"
edit: true
envKey: RUSTDESK_API_PROXY_ENABLE
labelZh: 启用代理
labelEn: Enable proxy
required: true
type: select
values:
- label: 启用
value: "true"
- label: 禁用
value: "false"
- default: ""
edit: true
envKey: RUSTDESK_API_PROXY_HOST
labelZh: 代理地址
labelEn: Proxy address
required: false
type: text
- default: "sqlite"
edit: true
envKey: RUSTDESK_API_GORM_TYPE
labelZh: 数据库类型
labelEn: Database type
required: true
type: select
values:
- label: sqlite
value: "sqlite"
- label: MySQL
value: "false"
- default: "127.0.0.1:3306"
edit: true
envKey: RUSTDESK_API_MYSQL_ADDR
labelZh: 数据库地址
labelEn: Database Host
required: false
type: text
- default: "rustdesk"
edit: true
envKey: RUSTDESK_API_MYSQL_DBNAME
labelZh: 数据库 名称
labelEn: Database Name
required: false
rule: paramCommon
type: text
- default: "rustdesk"
edit: true
envKey: RUSTDESK_API_MYSQL_USERNAME
labelZh: 数据库 用户名
labelEn: Database Username
required: false
type: text
- default: ""
edit: true
envKey: RUSTDESK_API_MYSQL_PASSWORD
labelZh: 数据库 密码
labelEn: Database Password
required: false
rule: paramComplexity
type: password

View File

@@ -0,0 +1,51 @@
networks:
1panel-network:
external: true
services:
rustdesk-api:
image: lejianwen/rustdesk-api:v2.6.16
container_name: ${CONTAINER_NAME}
labels:
createdBy: "Apps"
restart: always
networks:
- 1panel-network
ports:
- ${PANEL_APP_PORT_HTTP}:21114
env_file:
- ${GLOBAL_ENV_FILE:-/etc/1panel/envs/global.env}
- ${ENV_FILE:-/etc/1panel/envs/default.env}
volumes:
- ${RUSTDESK_API_ROOT_PATH}/data:/data
environment:
- TZ=Asia/Shanghai
- RUSTDESK_API_LANG=zh-CN
- RUSTDESK_API_RUSTDESK_ID_SERVER=${RUSTDESK_SERVER_URL}:21116
- RUSTDESK_API_RUSTDESK_RELAY_SERVER=${RUSTDESK_SERVER_URL}:21117
- RUSTDESK_API_RUSTDESK_API_SERVER=${RUSTDESK_SERVER_URL}:${PANEL_APP_PORT_HTTP:-21114}
rustdesk-server-s6:
image: rustdesk/rustdesk-server-s6:latest
container_name: server-${CONTAINER_NAME}
labels:
createdBy: "Apps"
restart: always
networks:
- 1panel-network
ports:
- 21115:21115
- 21116:21116
- 21116:21116/udp
- 21117:21117
- 21118:21118
- 21119:21119
env_file:
- ${GLOBAL_ENV_FILE:-/etc/1panel/envs/global.env}
- ${ENV_FILE:-/etc/1panel/envs/default.env}
volumes:
- ${RUSTDESK_API_ROOT_PATH}/data:/data
environment:
- TZ=Asia/Shanghai
- RUSTDESK_API_LANG=zh-CN
- RELAY=${RUSTDESK_SERVER_URL}:21117
- ENCRYPTED_ONLY=1

View File

@@ -0,0 +1,2 @@
# copyright© 2024 XinJiang Ms Studio
ENV_FILE=.env

View File

@@ -0,0 +1,2 @@
# copyright© 2024 XinJiang Ms Studio
TZ=Asia/Shanghai

View File

@@ -0,0 +1,17 @@
#!/bin/bash
if [ -f .env ]; then
source .env
# setup-1 add default values
CURRENT_DIR=$(pwd)
sed -i '/^ENV_FILE=/d' .env
sed -i '/^GLOBAL_ENV_FILE=/d' .env
echo "ENV_FILE=${CURRENT_DIR}/.env" >> .env
echo "GLOBAL_ENV_FILE=${CURRENT_DIR}/envs/global.env" >> .env
echo "Check Finish."
else
echo "Error: .env file not found."
fi

View File

@@ -0,0 +1,10 @@
#!/bin/bash
if [ -f .env ]; then
source .env
echo "Check Finish."
else
echo "Error: .env file not found."
fi

View File

@@ -0,0 +1,17 @@
#!/bin/bash
if [ -f .env ]; then
source .env
# setup-1 add default values
CURRENT_DIR=$(pwd)
sed -i '/^ENV_FILE=/d' .env
sed -i '/^GLOBAL_ENV_FILE=/d' .env
echo "ENV_FILE=${CURRENT_DIR}/.env" >> .env
echo "GLOBAL_ENV_FILE=${CURRENT_DIR}/envs/global.env" >> .env
echo "Check Finish."
else
echo "Error: .env file not found."
fi

View File

@@ -0,0 +1,34 @@
# RustDesk API
RustDesk 是一款远程访问和远程控制软件
![RustDesk API](https://file.lifebus.top/imgs/rustdesk-api_cover.png)
![](https://img.shields.io/badge/%E6%96%B0%E7%96%86%E8%90%8C%E6%A3%AE%E8%BD%AF%E4%BB%B6%E5%BC%80%E5%8F%91%E5%B7%A5%E4%BD%9C%E5%AE%A4-%E6%8F%90%E4%BE%9B%E6%8A%80%E6%9C%AF%E6%94%AF%E6%8C%81-blue)
## 简介
本项目使用 Go 实现了 RustDesk 的 API并包含了 Web Admin 和 Web 客户端。RustDesk 是一个远程桌面软件,提供了自托管的解决方案。
## 安装说明
### 端口
RustDesk 服务器自托管所需的端口很大程度上取决于您的环境以及您希望使用 RustDesk 做什么。
核心端口:
| 类型 | 范围 |
|-----|-------------|
| TCP | 21114-21119 |
| UDP | 21116 |
其中 21115-21117 是 RustDesk 工作所需的最低端口,它们处理信号和中继端口以及 NAT 遍历。
TCP 端口 21118 和 21119 是 RustDesk Web 客户端的 WebSocket 端口,您需要一个反向代理才能使其支持 HTTPS。
对于没有 SSL 代理的专业用户,您需要打开 TCP 端口 21114 才能使 API 工作,或者使用 SSL 代理打开 TCP 端口 443 。
---
![Ms Studio](https://file.lifebus.top/imgs/ms_blank_001.png)

View File

@@ -0,0 +1,14 @@
additionalProperties:
key: rustdesk-api
name: RustDesk API
tags:
- WebSite
- Local
shortDescZh: RustDesk 的 API 管理平台
shortDescEn: RustDesk API management platform
type: website
crossVersionUpdate: true
limit: 0
website: https://rustdesk.com/
github: https://github.com/lejianwen/rustdesk-api/
document: https://github.com/lejianwen/rustdesk-api/

BIN
apps/rustdesk-api/logo.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.5 KiB