diff --git a/docs/reference/commands/client/dfdaemon.md b/docs/reference/commands/client/dfdaemon.md index 66d7e1c..0e486b8 100644 --- a/docs/reference/commands/client/dfdaemon.md +++ b/docs/reference/commands/client/dfdaemon.md @@ -56,8 +56,21 @@ Meanwhile, it will act as an uploader to support other peers to download pieces #### Download with HTTP protocol +Configure Dfdaemon yaml file, The default path in Linux is `/etc/dragonfly/dfdaemon.yaml` in linux, +refer to [Dfdaemon](../../configuration/client/dfdaemon.md). + +> Notice: set `cproxy.rules.regex` to match the download path. + +```yaml +proxy: + server: + port: 4001 + rules: + - regex: '.*example.*' +``` + ```shell -curl -v -x 127.0.0.1:4001 http://:/ --output /tmp/file.txt +curl -v -x 127.0.0.1:4001 http://:/ --output /path/to/example ``` #### Download with HTTPS protocol @@ -70,39 +83,17 @@ refer to [Dfdaemon](../../configuration/client/dfdaemon.md). > Notice: set `cproxy.rules.regex` to match the download path. ```yaml -manager: - addrs: - - http://dragonfly-manager:65003 - -upload: - server: - port: 4000 - -metrics: - server: - port: 4002 - proxy: server: port: 4001 rules: - - regex: 'blobs/sha256.*' -``` - -Run Dfdaemon as Seed Peer: - -```bash -# View Dfdaemon cli help docs. -dfdaemon --help - -# Setup Dfdaemon, it is recommended to start Dfdaemon via systemd. -dfdaemon + - regex: '.*example.*' ``` Download with Insecure HTTPS protocol: ```shell -curl -v -x 127.0.0.1:4001 https://:/ --insecure --output /tmp/file.txt +curl -v -x 127.0.0.1:4001 https://:/ --insecure --output /path/to/example ``` ##### Download with using custom CA certificates HTTPS protocol @@ -113,52 +104,41 @@ Generate a CA certificates: openssl req -x509 -sha256 -days 36500 -nodes -newkey rsa:4096 -keyout ca.key -out ca.crt ``` -Configure Dfdaemon yaml file, The default path in Linux is `/etc/dragonfly/dfdaemon.yaml` in linux, -refer to [Dfdaemon](../../configuration/client/dfdaemon.md). +Trust the certificate at the OS level. -> Notice: set `cproxy.rules.regex` to match the download path. +- Ubuntu: -```yaml -manager: - addrs: - - http://dragonfly-manager:65003 +```shell +cp ca.crt /usr/local/share/ca-certificates/ca.crt +update-ca-certificates +``` -dynconfig: - refreshInterval: 30s -scheduler: - announceInterval: 30s +- Red Hat (CentOS etc): -upload: - server: - port: 4000 +```shell +cp ca.crt /etc/pki/ca-trust/source/anchors/ca.crt +update-ca-trust +``` -metrics: - server: - port: 4002 +Configure Dfdaemon yaml file, The default path in Linux is `/etc/dragonfly/dfdaemon.yaml` in linux, +refer to [Dfdaemon](../../configuration/client/dfdaemon.md). + +> Notice: set `cproxy.rules.regex` to match the download path. +```yaml proxy: server: port: 4001 caCert: ca.crt caKey: ca.key rules: - - regex: 'blobs/sha256.*' -``` - -Run Dfdaemon as Seed Peer: - -```bash -# View Dfdaemon cli help docs. -dfdaemon --help - -# Setup Dfdaemon, it is recommended to start Dfdaemon via systemd. -dfdaemon + - regex: '.*example.*' ``` Download with HTTPS protocol: ```shell -curl -v -x 127.0.0.1:4001 https://:/ --output /tmp/file.txt +curl -v -x 127.0.0.1:4001 https://:/ --output /path/to/example ``` ## Log {#log} diff --git a/i18n/zh/docusaurus-plugin-content-docs/current/reference/commands/client/dfdaemon.md b/i18n/zh/docusaurus-plugin-content-docs/current/reference/commands/client/dfdaemon.md index 7d3f00e..54fac83 100644 --- a/i18n/zh/docusaurus-plugin-content-docs/current/reference/commands/client/dfdaemon.md +++ b/i18n/zh/docusaurus-plugin-content-docs/current/reference/commands/client/dfdaemon.md @@ -55,8 +55,21 @@ dfdaemon 将从其他 peer 下载文件片段。同时,它将充当上传者 #### 使用 HTTP 协议下载 +编辑配置文件 Linux 环境下默认 Dfdaemon 配置路径为 `/etc/dragonfly/dfdaemon.yaml`, +参考文档 [Dfdaemon](../../configuration/client/dfdaemon.md)。 + +> 注意:可以根据下载路径修改 `proxy.rules.regex` 来调整路由匹配规则。 + +```yaml +proxy: + server: + port: 4001 + rules: + - regex: '.*example.*' +``` + ```shell -curl -v -x 127.0.0.1:4001 http://:/ --output /tmp/file.txt +curl -v -x 127.0.0.1:4001 http://:/ --output /path/to/example ``` #### 使用 HTTPS 协议下载 @@ -69,39 +82,17 @@ curl -v -x 127.0.0.1:4001 http://:/ --output /tmp/file.txt > 注意:可以根据下载路径修改 `proxy.rules.regex` 来调整路由匹配规则。 ```yaml -manager: - addrs: - - http://dragonfly-manager:65003 - -upload: - server: - port: 4000 - -metrics: - server: - port: 4002 - proxy: server: port: 4001 rules: - - regex: 'blobs/sha256.*' -``` - -运行 Dfdaemon: - -```bash -# 查看 Dfdaemon cli 帮助。 -dfdaemon --help - -# 启动 Dfdaemon 模式,推荐使用 systemd 启动 Dfdaemon。 -dfdaemon + - regex: '.*example.*' ``` 使用 Insecure HTTPS 请求下载文件 ```shell -curl -v -x 127.0.0.1:4001 https://:/ --insecure --output /tmp/file.txt +curl -v -x 127.0.0.1:4001 https://:/ --insecure --output /path/to/example ``` ##### 使用自签 CA 证书进行 HTTPS 协议下载 @@ -112,47 +103,40 @@ curl -v -x 127.0.0.1:4001 https://:/ --insecure --output /tmp/ openssl req -x509 -sha256 -days 36500 -nodes -newkey rsa:4096 -keyout ca.key -out ca.crt ``` -编辑配置文件 Linux 环境下默认 Dfdaemon 配置路径为 `/etc/dragonfly/dfdaemon.yaml`, -参考文档 [Dfdaemon](../../configuration/client/dfdaemon.md)。 - -> 注意:可以根据下载路径修改 `proxy.rules.regex` 来调整路由匹配规则。 +信任自签名证书。 -```yaml -manager: - addrs: - - http://dragonfly-manager:65003 +- Ubuntu: -upload: - server: - port: 4000 +```shell +cp ca.crt /usr/local/share/ca-certificates/ca.crt +update-ca-certificates +``` -metrics: - server: - port: 4002 +- Red Hat (CentOS etc): -proxy: - server: - port: 4001 - caCert: ca.crt - caKey: ca.key - rules: - - regex: 'blobs/sha256.*' +```shell +cp ca.crt /etc/pki/ca-trust/source/anchors/ca.crt +update-ca-trust ``` -运行 Dfdaemon: +编辑配置文件 Linux 环境下默认 Dfdaemon 配置路径为 `/etc/dragonfly/dfdaemon.yaml`, +参考文档 [Dfdaemon](../../configuration/client/dfdaemon.md)。 -```bash -# 查看 Dfdaemon cli 帮助。 -dfdaemon --help +> 注意:可以根据下载路径修改 `proxy.rules.regex` 来调整路由匹配规则。 -# 启动 Dfdaemon 模式,推荐使用 systemd 启动 Dfdaemon。 -dfdaemon +```yaml +server: + port: 4001 + caCert: ca.crt + caKey: ca.key +rules: + - regex: '.*example.*' ``` 使用 HTTPS 请求下载文件 ```shell -curl -v -x 127.0.0.1:4001 https://:/ --output /tmp/file.txt +curl -v -x 127.0.0.1:4001 https://:/ --output /path/to/example ``` ## Dfdaemon 日志