From a33be66504bb7bf219fc094cdb940353366cd59a Mon Sep 17 00:00:00 2001 From: lejianwen <84855512@qq.com> Date: Wed, 15 Jan 2025 20:09:08 +0800 Subject: [PATCH] docs: Up readme --- README.md | 9 +++++- README_EN.md | 75 ++++++++++++++++++++++++++---------------------- conf/config.yaml | 2 +- 3 files changed, 50 insertions(+), 36 deletions(-) diff --git a/README.md b/README.md index 298c195..fc7f9ca 100644 --- a/README.md +++ b/README.md @@ -176,6 +176,9 @@ logger: proxy: enable: false host: "" +jwt: + key: "" + expire-duration: 360000 ``` ### 环境变量 @@ -214,6 +217,9 @@ proxy: | ----PROXY配置----- | --------------- | ---------- | | RUSTDESK_API_PROXY_ENABLE | 是否启用代理:`false`, `true` | `false` | | RUSTDESK_API_PROXY_HOST | 代理地址 | `http://127.0.0.1:1080` | +| ----JWT配置---- | -------- | -------- | +| RUSTDESK_API_JWT_KEY | 自定义JWT KEY,为空则不启用JWT | | +| RUSTDESK_API_JWT_EXPIRE_DURATION | JWT有效时间 | 360000 | ### 运行 @@ -307,10 +313,11 @@ proxy: - RUSTDESK_API_RUSTDESK_ID_SERVER= - RUSTDESK_API_RUSTDESK_RELAY_SERVER= - RUSTDESK_API_RUSTDESK_API_SERVER=http:// + - RUSTDESK_API_KEY_FILE=/data/id_ed25519.pub + - RUSTDESK_API_JWT_KEY=xxxxxx # jwt key volumes: - /data/rustdesk/server:/data - /data/rustdesk/api:/app/data #将数据库挂载 - - /data/rustdesk/server:/app/conf/data #挂载key文件到api容器,可以不用使用 RUSTDESK_API_RUSTDESK_KEY networks: - rustdesk-net restart: unless-stopped diff --git a/README_EN.md b/README_EN.md index c137b22..6a9b70c 100644 --- a/README_EN.md +++ b/README_EN.md @@ -179,44 +179,50 @@ logger: proxy: enable: false host: "" +jwt: + key: "" + expire-duration: 360000 ``` ### Environment Variables The prefix for variable names is `RUSTDESK_API`. If environment variables exist, they will override the configurations in the configuration file. -| Variable Name | Description | Example | -|-----------------------------------------------------|--------------------------------------------------------------------------------------------------------------|-------------------------------| -| TZ | timezone | Asia/Shanghai | -| RUSTDESK_API_LANG | Language | `en`,`zh-CN` | -| RUSTDESK_API_APP_WEB_CLIENT | web client on/off; 1: on, 0 off, default: 1 | 1 | -| RUSTDESK_API_APP_REGISTER | register enable; `true`, `false`; default:`false` | `false` | -| RUSTDESK_API_APP_SHOW_SWAGGER | swagger visible; 1: yes, 0: no; default: 0 | `0` | -| ----- ADMIN Configuration----- | ---------- | ---------- | -| RUSTDESK_API_ADMIN_TITLE | Admin Title | `RustDesk Api Admin` | -| RUSTDESK_API_ADMIN_HELLO | Admin welcome message, you can use `html` | | -| RUSTDESK_API_ADMIN_HELLO_FILE | Admin welcome message file,
will override `RUSTDESK_API_ADMIN_HELLO` | `./conf/admin/hello.html` | -| ----- GIN Configuration ----- | --------------------------------------- | ----------------------------- | -| RUSTDESK_API_GIN_TRUST_PROXY | Trusted proxy IPs, separated by commas. | 192.168.1.2,192.168.1.3 | -| ----- GORM Configuration ----- | --------------------------------------- | ----------------------------- | -| RUSTDESK_API_GORM_TYPE | Database type (`sqlite` or `mysql`). Default is `sqlite`. | sqlite | -| RUSTDESK_API_GORM_MAX_IDLE_CONNS | Maximum idle connections | 10 | -| RUSTDESK_API_GORM_MAX_OPEN_CONNS | Maximum open connections | 100 | -| RUSTDESK_API_RUSTDESK_PERSONAL | Open Personal Api 1:Enable,0:Disable | 1 | -| ----- MYSQL Configuration ----- | --------------------------------------- | ----------------------------- | -| RUSTDESK_API_MYSQL_USERNAME | MySQL username | root | -| RUSTDESK_API_MYSQL_PASSWORD | MySQL password | 111111 | -| RUSTDESK_API_MYSQL_ADDR | MySQL address | 192.168.1.66:3306 | -| RUSTDESK_API_MYSQL_DBNAME | MySQL database name | rustdesk | -| ----- RUSTDESK Configuration ----- | --------------------------------------- | ----------------------------- | -| RUSTDESK_API_RUSTDESK_ID_SERVER | Rustdesk ID server address | 192.168.1.66:21116 | -| RUSTDESK_API_RUSTDESK_RELAY_SERVER | Rustdesk relay server address | 192.168.1.66:21117 | -| RUSTDESK_API_RUSTDESK_API_SERVER | Rustdesk API server address | http://192.168.1.66:21114 | -| RUSTDESK_API_RUSTDESK_KEY | Rustdesk key | 123456789 | -| RUSTDESK_API_RUSTDESK_KEY_FILE | Rustdesk key file | `./conf/data/id_ed25519.pub` | -| RUSTDESK_API_RUSTDESK_WEBCLIENT_MAGIC_QUERYONLINE | New online query method is enabled in the web client v2; '1': Enabled, '0': Disabled, not enabled by default | `0` | -| ---- PROXY ----- | --------------- | ---------- | -| RUSTDESK_API_PROXY_ENABLE | proxy_enable :`false`, `true` | `false` | -| RUSTDESK_API_PROXY_HOST | proxy_host | `http://127.0.0.1:1080` | +| Variable Name | Description | Example | +|---------------------------------------------------|--------------------------------------------------------------------------------------------------------------|-------------------------------| +| TZ | timezone | Asia/Shanghai | +| RUSTDESK_API_LANG | Language | `en`,`zh-CN` | +| RUSTDESK_API_APP_WEB_CLIENT | web client on/off; 1: on, 0 off, default: 1 | 1 | +| RUSTDESK_API_APP_REGISTER | register enable; `true`, `false`; default:`false` | `false` | +| RUSTDESK_API_APP_SHOW_SWAGGER | swagger visible; 1: yes, 0: no; default: 0 | `0` | +| ----- ADMIN Configuration----- | ---------- | ---------- | +| RUSTDESK_API_ADMIN_TITLE | Admin Title | `RustDesk Api Admin` | +| RUSTDESK_API_ADMIN_HELLO | Admin welcome message, you can use `html` | | +| RUSTDESK_API_ADMIN_HELLO_FILE | Admin welcome message file,
will override `RUSTDESK_API_ADMIN_HELLO` | `./conf/admin/hello.html` | +| ----- GIN Configuration ----- | --------------------------------------- | ----------------------------- | +| RUSTDESK_API_GIN_TRUST_PROXY | Trusted proxy IPs, separated by commas. | 192.168.1.2,192.168.1.3 | +| ----- GORM Configuration ----- | --------------------------------------- | ----------------------------- | +| RUSTDESK_API_GORM_TYPE | Database type (`sqlite` or `mysql`). Default is `sqlite`. | sqlite | +| RUSTDESK_API_GORM_MAX_IDLE_CONNS | Maximum idle connections | 10 | +| RUSTDESK_API_GORM_MAX_OPEN_CONNS | Maximum open connections | 100 | +| RUSTDESK_API_RUSTDESK_PERSONAL | Open Personal Api 1:Enable,0:Disable | 1 | +| ----- MYSQL Configuration ----- | --------------------------------------- | ----------------------------- | +| RUSTDESK_API_MYSQL_USERNAME | MySQL username | root | +| RUSTDESK_API_MYSQL_PASSWORD | MySQL password | 111111 | +| RUSTDESK_API_MYSQL_ADDR | MySQL address | 192.168.1.66:3306 | +| RUSTDESK_API_MYSQL_DBNAME | MySQL database name | rustdesk | +| ----- RUSTDESK Configuration ----- | --------------------------------------- | ----------------------------- | +| RUSTDESK_API_RUSTDESK_ID_SERVER | Rustdesk ID server address | 192.168.1.66:21116 | +| RUSTDESK_API_RUSTDESK_RELAY_SERVER | Rustdesk relay server address | 192.168.1.66:21117 | +| RUSTDESK_API_RUSTDESK_API_SERVER | Rustdesk API server address | http://192.168.1.66:21114 | +| RUSTDESK_API_RUSTDESK_KEY | Rustdesk key | 123456789 | +| RUSTDESK_API_RUSTDESK_KEY_FILE | Rustdesk key file | `./conf/data/id_ed25519.pub` | +| RUSTDESK_API_RUSTDESK_WEBCLIENT_MAGIC_QUERYONLINE | New online query method is enabled in the web client v2; '1': Enabled, '0': Disabled, not enabled by default | `0` | +| ---- PROXY ----- | --------------- | ---------- | +| RUSTDESK_API_PROXY_ENABLE | proxy_enable :`false`, `true` | `false` | +| RUSTDESK_API_PROXY_HOST | proxy_host | `http://127.0.0.1:1080` | +| ----JWT---- | -------- | -------- | +| RUSTDESK_API_JWT_KEY | JWT KEY. Set empty to disable jwt | | +| RUSTDESK_API_JWT_EXPIRE_DURATION | JWT expire duration | 360000 | ### Installation Steps @@ -313,10 +319,11 @@ Download the release from [release](https://github.com/lejianwen/rustdesk-api/re - RUSTDESK_API_RUSTDESK_ID_SERVER= - RUSTDESK_API_RUSTDESK_RELAY_SERVER= - RUSTDESK_API_RUSTDESK_API_SERVER=http:// + - RUSTDESK_API_KEY_FILE=/data/id_ed25519.pub + - RUSTDESK_API_JWT_KEY=xxxxxx # jwt key volumes: - /data/rustdesk/server:/data - /data/rustdesk/api:/app/data #将数据库挂载 - - /data/rustdesk/server:/app/conf/data #挂载key文件到api容器,可以不用使用 RUSTDESK_API_RUSTDESK_KEY networks: - rustdesk-net restart: unless-stopped diff --git a/conf/config.yaml b/conf/config.yaml index ad88382..2ccba1d 100644 --- a/conf/config.yaml +++ b/conf/config.yaml @@ -26,7 +26,7 @@ rustdesk: relay-server: "192.168.1.66:21117" api-server: "http://127.0.0.1:21114" key: "" - key-file: "./conf/data/id_ed25519.pub" + key-file: "/data/id_ed25519.pub" personal: 1 webclient-magic-queryonline: 0 logger: