dl

module
v0.0.0-...-63c78a4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 20, 2026 License: MIT

README

Download server

It provides download functions for:

  • OCI artifact files
  • GCS bucket objects

For opt-in, expiring anonymous OCI file links, see secure delivery setup and rollout. Separate management and public-only server modes preserve the default internal download endpoints.

How to design

The Goa design lives in the design package, one file per service: design.go holds the oci and gcs download services, shares.go holds the shares delivery-grant management service. Edit the matching file, then regenerate code:

go generate ./...

How to run locally

go run ./cmd/server

How to build container image

Build with Skaffold + Ko:

skaffold build

The build config (base image, entrypoint, platforms) is in skaffold.yaml.

Configuration

Three services each use a separate config file:

Service Flag Default Description
OCI --oci-config oci.yaml OCI registry credentials
GCS --gcs-config (none) Optional, uses ADC by default

For GCS, the config file is optional. If omitted, the GCS client uses Application Default Credentials (supports GKE Workload Identity, GCE default SA, or GOOGLE_APPLICATION_CREDENTIALS env var).

Target allowlists

The download proxy only talks to explicitly allowlisted targets. An empty allowlist denies every request.

Flag Description
--oci-allowed-registries Comma-separated OCI registry hosts. IP literals, localhost, *.svc, *.local and cloud metadata hosts are always rejected.
--gcs-allowed-buckets Comma-separated GCS bucket names.
--gcs-allowed-prefixes Optional comma-separated object key prefixes. When set, keys outside every prefix are rejected.

Example:

dl \
  --domain=0.0.0.0:80 \
  --oci-config=/etc/dl/oci.yaml \
  --oci-allowed-registries=us-docker.pkg.dev,hub.pingcap.net,hub-zot.pingcap.net \
  --gcs-allowed-buckets=hotfix-binaries

The OCI allowlist is checked before any DNS lookup or registry request. Rejected targets return a generic 4xx response; upstream host names, TLS errors and service-account identities are never included in the response body.

Directories

Path Synopsis
cmd
server command
server-cli command
gen
gcs
oci
internal
service/delivery
Package delivery supplies isolated, token-safe HTTP surfaces.
Package delivery supplies isolated, token-safe HTTP surfaces.
share
Package share implements durable delivery grants.
Package share implements durable delivery grants.
pkg
gcs
oci

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL