From 95afabc513cb5ce92310c5091ac7764e9a31a6a6 Mon Sep 17 00:00:00 2001 From: Gaius Date: Tue, 10 Sep 2024 15:38:31 +0800 Subject: [PATCH] feat: add X-Dragonfly-Use-P2P comment for proxy rules in dfdaemon (#319) Signed-off-by: Gaius --- charts/dragonfly/Chart.yaml | 4 ++-- charts/dragonfly/README.md | 4 ++-- charts/dragonfly/values.yaml | 6 ++++++ 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/charts/dragonfly/Chart.yaml b/charts/dragonfly/Chart.yaml index 182519b3..1e2d9cb9 100644 --- a/charts/dragonfly/Chart.yaml +++ b/charts/dragonfly/Chart.yaml @@ -3,7 +3,7 @@ name: dragonfly description: Dragonfly is an intelligent P2P based image and file distribution system icon: https://raw.githubusercontent.com/dragonflyoss/Dragonfly2/main/docs/images/logo/dragonfly.svg type: application -version: 1.2.8 +version: 1.2.9 appVersion: 2.1.56 keywords: - dragonfly @@ -27,7 +27,7 @@ sources: annotations: artifacthub.io/changes: | - - Add skipVerify and ca config for dfinit. + - Add X-Dragonfly-Use-P2P comment for proxy rules in dfdaemon. artifacthub.io/links: | - name: Chart Source diff --git a/charts/dragonfly/README.md b/charts/dragonfly/README.md index 1304ad09..6125ae4a 100644 --- a/charts/dragonfly/README.md +++ b/charts/dragonfly/README.md @@ -146,7 +146,7 @@ helm delete dragonfly --namespace dragonfly-system | client.config.proxy.prefetch | bool | `false` | prefetch pre-downloads full of the task when download with range request. | | client.config.proxy.readBufferSize | int | `32768` | readBufferSize is the buffer size for reading piece from disk, default is 32KB. | | client.config.proxy.registryMirror.addr | string | `"https://index.docker.io"` | addr is the default address of the registry mirror. Proxy will start a registry mirror service for the client to pull the image. The client can use the default address of the registry mirror in configuration to pull the image. The `X-Dragonfly-Registry` header can instead of the default address of registry mirror. | -| client.config.proxy.rules | list | `[{"regex":"blobs/sha256.*"}]` | rules is the list of rules for the proxy server. regex is the regex of the request url. useTLS indicates whether use tls for the proxy backend. redirect is the redirect url. filteredQueryParams is the filtered query params to generate the task id. When filter is ["Signature", "Expires", "ns"], for example: http://example.com/xyz?Expires=e1&Signature=s1&ns=docker.io and http://example.com/xyz?Expires=e2&Signature=s2&ns=docker.io will generate the same task id. Default value includes the filtered query params of s3, gcs, oss, obs, cos. | +| client.config.proxy.rules | list | `[{"regex":"blobs/sha256.*"}]` | rules is the list of rules for the proxy server. regex is the regex of the request url. useTLS indicates whether use tls for the proxy backend. redirect is the redirect url. filteredQueryParams is the filtered query params to generate the task id. When filter is ["Signature", "Expires", "ns"], for example: http://example.com/xyz?Expires=e1&Signature=s1&ns=docker.io and http://example.com/xyz?Expires=e2&Signature=s2&ns=docker.io will generate the same task id. Default value includes the filtered query params of s3, gcs, oss, obs, cos. `X-Dragonfly-Use-P2P` header can instead of the regular expression of the rule. If the value is "true", the request will use P2P technology to distribute the content. If the value is "false", but url matches the regular expression in rules. The request will also use P2P technology to distribute the content. | | client.config.proxy.server.port | int | `4001` | port is the port to the proxy server. | | client.config.scheduler.announceInterval | string | `"5m"` | announceInterval is the interval to announce peer to the scheduler. Announcer will provide the scheduler with peer information for scheduling, peer information includes cpu, memory, etc. | | client.config.scheduler.enableBackToSource | bool | `true` | enableBackToSource indicates whether enable back-to-source download, when the scheduling failed. | @@ -469,7 +469,7 @@ helm delete dragonfly --namespace dragonfly-system | seedClient.config.proxy.prefetch | bool | `false` | prefetch pre-downloads full of the task when download with range request. | | seedClient.config.proxy.readBufferSize | int | `32768` | readBufferSize is the buffer size for reading piece from disk, default is 32KB. | | seedClient.config.proxy.registryMirror.addr | string | `"https://index.docker.io"` | addr is the default address of the registry mirror. Proxy will start a registry mirror service for the client to pull the image. The client can use the default address of the registry mirror in configuration to pull the image. The `X-Dragonfly-Registry` header can instead of the default address of registry mirror. | -| seedClient.config.proxy.rules | list | `[{"regex":"blobs/sha256.*"}]` | rules is the list of rules for the proxy server. regex is the regex of the request url. useTLS indicates whether use tls for the proxy backend. redirect is the redirect url. filteredQueryParams is the filtered query params to generate the task id. When filter is ["Signature", "Expires", "ns"], for example: http://example.com/xyz?Expires=e1&Signature=s1&ns=docker.io and http://example.com/xyz?Expires=e2&Signature=s2&ns=docker.io will generate the same task id. Default value includes the filtered query params of s3, gcs, oss, obs, cos. | +| seedClient.config.proxy.rules | list | `[{"regex":"blobs/sha256.*"}]` | rules is the list of rules for the proxy server. regex is the regex of the request url. useTLS indicates whether use tls for the proxy backend. redirect is the redirect url. filteredQueryParams is the filtered query params to generate the task id. When filter is ["Signature", "Expires", "ns"], for example: http://example.com/xyz?Expires=e1&Signature=s1&ns=docker.io and http://example.com/xyz?Expires=e2&Signature=s2&ns=docker.io will generate the same task id. Default value includes the filtered query params of s3, gcs, oss, obs, cos. `X-Dragonfly-Use-P2P` header can instead of the regular expression of the rule. If the value is "true", the request will use P2P technology to distribute the content. If the value is "false", but url matches the regular expression in rules. The request will also use P2P technology to distribute the content. | | seedClient.config.proxy.server.port | int | `4001` | port is the port to the proxy server. | | seedClient.config.scheduler.announceInterval | string | `"1m"` | announceInterval is the interval to announce peer to the scheduler. Announcer will provide the scheduler with peer information for scheduling, peer information includes cpu, memory, etc. | | seedClient.config.scheduler.maxScheduleCount | int | `5` | maxScheduleCount is the max count of schedule. | diff --git a/charts/dragonfly/values.yaml b/charts/dragonfly/values.yaml index edbc6558..4ba60daf 100644 --- a/charts/dragonfly/values.yaml +++ b/charts/dragonfly/values.yaml @@ -952,6 +952,9 @@ seedClient: # http://example.com/xyz?Expires=e1&Signature=s1&ns=docker.io and http://example.com/xyz?Expires=e2&Signature=s2&ns=docker.io # will generate the same task id. # Default value includes the filtered query params of s3, gcs, oss, obs, cos. + # `X-Dragonfly-Use-P2P` header can instead of the regular expression of the rule. If the value is "true", + # the request will use P2P technology to distribute the content. If the value is "false", + # but url matches the regular expression in rules. The request will also use P2P technology to distribute the content. rules: - regex: "blobs/sha256.*" # useTLS: false @@ -1318,6 +1321,9 @@ client: # http://example.com/xyz?Expires=e1&Signature=s1&ns=docker.io and http://example.com/xyz?Expires=e2&Signature=s2&ns=docker.io # will generate the same task id. # Default value includes the filtered query params of s3, gcs, oss, obs, cos. + # `X-Dragonfly-Use-P2P` header can instead of the regular expression of the rule. If the value is "true", + # the request will use P2P technology to distribute the content. If the value is "false", + # but url matches the regular expression in rules. The request will also use P2P technology to distribute the content. rules: - regex: "blobs/sha256.*" # useTLS: false