Skip to content

Commit 7912841

Browse files
committed
docs: add whiteDownloadDirs doc
1 parent 2c1a5ba commit 7912841

File tree

3 files changed

+30
-27
lines changed

3 files changed

+30
-27
lines changed

docs/install.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,8 @@ It also supports configuration through configuration files. Create a `config.jso
104104
"username": "", // HTTP Basic Auth Username (default "gopeed")
105105
"password": "", // HTTP Basic Auth Password
106106
"apiToken": "", // HTTP API token, it must be configured when using HTTP API in the case of enabling basic authentication
107-
"storageDir": "" // Storage directory
107+
"storageDir": "", // Storage directory
108+
"whiteDownloadDirs": ["/root/downloads", "/root/dir/*", "/root/dir?abc"] // Download directory whitelist, when this option is configured, all tasks downloaded to non-whitelisted folders will fail, support wildcard, rules refer to https://pkg.go.dev/path/filepath#Match
108109
}
109110
```
110111
@@ -119,7 +120,7 @@ If you need to set the default download configuration when the server starts for
119120
"address": "127.0.0.1",
120121
"port": 9999,
121122
"downloadConfig": {
122-
"downloadDir": "d:/test" // Set the default download directory
123+
"downloadDir": "d:/test" // Set the default download directory
123124
}
124125
}
125126
```

docs/zh-TW/install.md

Lines changed: 23 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,15 @@ Macos 版本提供了`.dmg`文件,雙擊即可安裝,安裝套件支援`inte
1919

2020
- Flatpak
2121

22-
```sh
23-
flatpak install flathub com.gopeed.Gopeed
24-
```
22+
```sh
23+
flatpak install flathub com.gopeed.Gopeed
24+
```
2525

2626
- Snap
2727

28-
```sh
29-
sudo snap install gopeed
30-
```
28+
```sh
29+
sudo snap install gopeed
30+
```
3131

3232
除此之外,還提供了`.deb``.AppImage`兩種安裝包,可以自行選擇下載安裝。
3333

@@ -58,16 +58,16 @@ Android 版本提供了`.apk`文件,可以直接下載安裝,支援所有的
5858
1. 下載 Web 版本,解壓縮後會得到一個資料夾,將其放到你想要的位置。
5959
2. 在資料夾根目錄中開啟終端,執行`./gopeed.exe`,如果執行成功會看到下列輸出:
6060

61-
```bash
61+
```bash
6262

63-
_______ ______ .______ _______ _______ _______
64-
/ _____| / __ \ | _ \ | ____|| ____|| \
65-
| | __ | | | | | |_) | | |__ | |__ | .--. |
66-
| | |_ | | | | | | ___/ | __| | __| | | | |
67-
| |__| | | `--' | | | | |____ | |____ | '--' |
68-
\______| \______/ | _| |_______||_______||_______/
63+
_______ ______ .______ _______ _______ _______
64+
/ _____| / __ \ | _ \ | ____|| ____|| \
65+
| | __ | | | | | |_) | | |__ | |__ | .--. |
66+
| | |_ | | | | | | ___/ | __| | __| | | | |
67+
| |__| | | `--' | | | | |____ | |____ | '--' |
68+
\______| \______/ | _| |_______||_______||_______/
6969
70-
Server start success on http://[::]:9999
70+
Server start success on http://[::]:9999
7171
```
7272
7373
3. 開啟瀏覽器,造訪`http://localhost:9999` 即可。
@@ -99,12 +99,13 @@ Usage of C:\Users\levi\Downloads\gopeed-web-v1.3.13-windows-amd64\gopeed.exe:
9999
100100
```json
101101
{
102-
"address": "", // 綁定的IP位址(預設:0.0.0.0)
103-
"port": 0, // 綁定的連接埠(預設:9999)
104-
"username": "", // 服務身分認證使用者名,為空時不啟用身分認證
105-
"password": "", // 服務認證密碼(預設:gopeed)
106-
"apiToken": "", // HTTP API 令牌,在啟用身分認證的情況下使用 HTTP API 時,必須設定令牌
107-
"storageDir": "" // 存储目錄
102+
"address": "", // 綁定的IP位址(預設:0.0.0.0)
103+
"port": 0, // 綁定的連接埠(預設:9999)
104+
"username": "", // 服務身分認證使用者名,為空時不啟用身分認證
105+
"password": "", // 服務認證密碼(預設:gopeed)
106+
"apiToken": "", // HTTP API 令牌,在啟用身分認證的情況下使用 HTTP API 時,必須設定令牌
107+
"storageDir": "", // 存储目錄
108+
"whiteDownloadDirs": ["/root/downloads", "/root/dir/*", "/root/dir?abc"] // 下載目錄白名單,當配置了此選項時,所有下載到非白名單資料夾的任務都會失敗,支援通配符,規則參考 https://pkg.go.dev/path/filepath#Match
108109
}
109110
```
110111
@@ -119,7 +120,7 @@ Usage of C:\Users\levi\Downloads\gopeed-web-v1.3.13-windows-amd64\gopeed.exe:
119120
"address": "127.0.0.1",
120121
"port": 9999,
121122
"downloadConfig": {
122-
"downloadDir": "d:/test" // 設定預設下載目錄
123+
"downloadDir": "d:/test" // 設定預設下載目錄
123124
}
124125
}
125126
```
@@ -189,4 +190,4 @@ gopeed D:/Downloads/file.torrent
189190
190191
```sh
191192
gopeed magnet:?xt=urn:btih:xxxx
192-
```
193+
```

docs/zh/install.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -104,11 +104,12 @@ Usage of C:\Users\levi\Downloads\gopeed-web-v1.3.13-windows-amd64\gopeed.exe:
104104
"username": "", // 服务身份认证用户名,为空时不启用身份认证
105105
"password": "", // 服务身份认证密码(默认:gopeed)
106106
"apiToken": "", // HTTP API 令牌,在启用身份认证的情况下使用 HTTP API 时,必须配置令牌
107-
"storageDir": "" // 存储目录
107+
"storageDir": "", // 存储目录
108+
"whiteDownloadDirs": ["/root/downloads", "/root/dir/*", "/root/dir?abc"] // 下载目录白名单,当配置了此选项时,所有下载到非白名单文件夹的任务都会失败,支持通配符,规则参考 https://pkg.go.dev/path/filepath#Match
108109
}
109110
```
110111
111-
> 注:如果你是在公网 ip 上进行部署,建议启用身份认证,否则会有安全风险。
112+
> 注:如果在公网 ip 上进行部署,建议启用身份认证,否则会有安全风险。
112113
113114
#### 默认下载配置
114115
@@ -119,7 +120,7 @@ Usage of C:\Users\levi\Downloads\gopeed-web-v1.3.13-windows-amd64\gopeed.exe:
119120
"address": "127.0.0.1",
120121
"port": 9999,
121122
"downloadConfig": {
122-
"downloadDir": "d:/test" // 设置默认下载目录
123+
"downloadDir": "d:/test" // 设置默认下载目录
123124
}
124125
}
125126
```

0 commit comments

Comments
 (0)