dragonflyoss / Dragonfly2

Dragonfly is an open source P2P-based file distribution and image acceleration system. It is hosted by the Cloud Native Computing Foundation (CNCF) as an Incubating Level Project.
https://d7y.io
Apache License 2.0
2.29k stars 292 forks source link

dfdaemon registryMirror with header #1953

Open supakornbabe opened 1 year ago

supakornbabe commented 1 year ago

Feature request:

As we are using dragonfly to cache our harbor registry and after we upgrade harbor to v2.3.0 we faced the issue https://github.com/goharbor/harbor/issues/15178 so we have to do the workaround by having the proxy service that use to add the header Authorization: none so it should be great to have this function directly from dragonfly so we can deprecate our workaround

Use case:

dfdaemon config is added with registryMirror.header config

dfdaemon:
  config:
    proxy:
      registryMirror:
        url: https://harbor.test.io
        header: "Authorization: none"

UI Example:

gaius-qi commented 1 year ago

You can add headers on the client. For example, if you are using containerd, you can refer to document https://d7y.io/docs/setup/runtime/containerd/mirror/#option-1-generate-hoststoml-manually to add a custom header. The dragonfly proxy will pass through your header to the registry.