.gitignore
Initial commitAGENTS.md
Initial commitcdn-upload.example.toml
feat: support individual prefixes in bucketsconfig.go
feat: support individual prefixes in bucketsgo.mod
Initial commitgo.sum
Initial commitlist.go
Initial commitmain.go
Initial commitREADME.md
feat: support individual prefixes in bucketss3client.go
Initial commitsync_test.go
feat: support individual prefixes in bucketssync.go
feat: support individual prefixes in bucketscdn-upload
Small CLI to recursively upload a local directory to one or more S3-compatible buckets in parallel.
Features
sync <dir>uploads all files recursively from<dir>to every configured bucket.listprints object contents for all configured buckets as trees.- Path-style S3 endpoint support (
https://endpoint/<bucket>/<key>). - Per-bucket progress bars during sync.
- Existing remote objects are overwritten by default (
PutObjectsemantics). - Uploads set
Content-Typefrom MIME detection and setContent-Encoding: brfor.brfiles.
Install
go build -o cdn-upload .Config
Create cdn-upload.toml:
[[bucket]]
name = "wasm-us-west"
endpoint = "https://t3.storageapi.dev"
region = "auto" # optional, defaults to "auto"
bucket = "bucket-wasm-us-west-xxxxxx"
prefix = "releases/2026-02" # optional, upload under this bucket subdirectory
key_id = "tid_xxx"
secret = "tsec_xxx"
[[bucket]]
name = "wasm-us-east"
endpoint = "https://t3.storageapi.dev"
bucket = "bucket-wasm-us-east-xxxxxx"
key_id = "tid_yyy"
secret = "tsec_yyy"You can also copy and edit cdn-upload.example.toml.
Usage
./cdn-upload sync ./containersGiven:
containers/
├── microterm/
│ └── metadata.json
└── microterm-ios/
└── metadata.jsonThe uploaded key is relative to containers/, for example:
s3://<bucket>/microterm/metadata.jsonIf prefix is set for a bucket, uploads are written under that directory instead of bucket root:
s3://<bucket>/<prefix>/microterm/metadata.jsonprefix is optional. When omitted (or set to /), uploads go to bucket root. Leading and trailing / are ignored.
Other commands:
./cdn-upload -config ./cdn-upload.toml -threads 4 sync ./containers
./cdn-upload -config ./cdn-upload.toml list