From 16b941e37f2257fdf9705b49e5cfbdb934af0b95 Mon Sep 17 00:00:00 2001 From: Plynksiy Nikita <39155883+trofen@users.noreply.github.com> Date: Wed, 9 Jul 2025 04:43:56 +0300 Subject: [PATCH] docs: add note about requiring conf and resources directories (or specifying paths via -c and RUSTDESK_API_GIN_RESOURCES_PATH) when running without docker (#311) --- README.md | 6 ++++++ README_EN.md | 15 +++++++++++---- 2 files changed, 17 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 25d1c0d..cb8ac97 100644 --- a/README.md +++ b/README.md @@ -255,6 +255,12 @@ #或者使用generate_api.go生成api并运行 go generate generate_api.go ``` + > 注意:使用 `go run` 或编译后的二进制时,当前目录下必须存在 `conf` 和 `resources` + > 目录。如果在其他目录运行,可通过 `-c` 和环境变量 + > `RUSTDESK_API_GIN_RESOURCES_PATH` 指定绝对路径,例如: + > ```bash + > RUSTDESK_API_GIN_RESOURCES_PATH=/opt/rustdesk-api/resources ./apimain -c /opt/rustdesk-api/conf/config.yaml + > ``` 5. 编译,如果想自己编译,先cd到项目根目录,然后windows下直接运行`build.bat`,linux下运行`build.sh`,编译后会在`release` 目录下生成对应的可执行文件。直接运行编译后的可执行文件即可。 diff --git a/README_EN.md b/README_EN.md index 2ca78c6..a8446ed 100644 --- a/README_EN.md +++ b/README_EN.md @@ -252,10 +252,17 @@ Download the release from [release](https://github.com/lejianwen/rustdesk-api/re 4. Run: ```bash # Run directly - go run cmd/apimain.go - # Or generate and run the API using generate_api.go - go generate generate_api.go - ``` + go run cmd/apimain.go + # Or generate and run the API using generate_api.go + go generate generate_api.go + ``` + > **Note:** When using `go run` or the compiled binary, the `conf` and `resources` + > directories must exist relative to the current working directory. If you run + > the program from another location, specify absolute paths with `-c` and the + > `RUSTDESK_API_GIN_RESOURCES_PATH` environment variable. Example: + > ```bash + > RUSTDESK_API_GIN_RESOURCES_PATH=/opt/rustdesk-api/resources ./apimain -c /opt/rustdesk-api/conf/config.yaml + > ``` 5. To compile, change to the project root directory. For Windows, run `build.bat`, and for Linux, run `build.sh`. After compiling, the corresponding executables will be generated in the `release` directory. Run the compiled executables