Published
Listed in the public directory index and served to anyone at its direct URL. Perfect for downloads, docs and assets.
- ✓ Listed in the index
- ✓ Direct URL works
- ✓ Cached for five minutes
Vela is a self-hosted file store with a REST API, a scriptable CLI, expiring signed links, scoped API keys, symlinks, a recoverable trash and a public directory index. One Go binary. One data directory. Local disk or Cloudflare R2.
go install go.xchunk.org/vela/cmd/vela@latest
Pick a visibility per file and change it at any time — the change takes effect on the very next request. Private files never reveal that they exist.
Listed in the public directory index and served to anyone at its direct URL. Perfect for downloads, docs and assets.
Served at its direct URL but never listed, and marked noindex for crawlers. Not access control — just out of sight.
Readable only with an API key, a signed link or a browser signed in with a key. Its public URL answers 404, exactly like a file that does not exist.
No database server, no compose file, no web dashboard to secure. Just a careful server and a CLI built for humans and scripts alike.
Uploads stream to disk or multipart S3, are hashed on the fly, verified against your SHA-256 and published atomically. No half-written files, ever.
HMAC-signed URLs with a lifetime baked in. Revoke them anytime, rotate signing keys, and keep them working across renames.
Read-only, read/write or admin keys, optionally locked to a path prefix. Give CI a key for ci/ and nothing else.
Deleting moves files to the trash for 14 days. Restore them with the same ID — and their signed links come back to life.
A fast, JavaScript-free directory listing with light and dark modes and hidden entrances. Sign in with your key to see private and hidden files too, read-only.
Symlinks serve a file from as many paths as you like without copying it, and survive renames. Link everything with a tag — and keep the view in sync.
Keep blobs on local disk, or in a private Cloudflare R2 or S3-compatible bucket. Migrate between them with one verified command.
Stable --json output, documented exit codes, retries, progress bars and dynamic completion of remote paths.
Constant-time secret checks, 404 instead of 403, keys never in URLs, query-free logs and explicit file permissions.
Every request — API, direct URL or signed link — is authorized by velad. Metadata lives in SQLite; contents are immutable blobs with random IDs, so renames are instant and never touch the bytes.
The CLI is a thin layer over a documented HTTP API and a public Go client — anything you can do in one, you can automate in the others.
# upload a whole directory, publicly
vela put -r ./site docs/site/ --public
# a private backup that deletes itself after a week
pg_dump app | vela put - backups/app.sql --private --expires 7d
# give someone two hours of access to a private file
vela share backups/app.sql --ttl 2h --note "for Dana" --copy
# hide a folder from the index but keep it reachable by URL
vela dir hide docs/drafts/
# stream an upload; metadata travels in headers
curl -X PUT https://store.example.com/api/v1/content/docs/q3/report.pdf \
-H "Authorization: Bearer $VELA_KEY" \
-H "X-Vela-Visibility: public" \
-H "X-Vela-SHA256: $(sha256sum report.pdf | cut -d' ' -f1)" \
-H "If-None-Match: *" \
--data-binary @report.pdf
# issue a signed link that expires in 2 hours
curl https://store.example.com/api/v1/links \
-H "Authorization: Bearer $VELA_KEY" \
-d '{"path": "docs/q3/report.pdf", "ttl": "2h"}'
c, err := client.New("https://store.example.com", os.Getenv("VELA_KEY"))
if err != nil {
return err
}
f, _ := os.Open("report.pdf")
defer f.Close()
st, _ := f.Stat()
obj, created, err := c.Upload(ctx, "docs/q3/report.pdf", f, client.UploadOptions{
Size: st.Size(),
Visibility: api.Public,
CreateOnly: true, // never overwrite; safe to retry
})
if api.IsCode(err, api.CodeAlreadyExists) {
log.Println("already uploaded")
} else if err == nil {
log.Println(created, *obj.URL)
}
# data directory owned by the container's nonroot user
sudo install -d -o 65532 -g 65532 /srv/vela
docker run -d --name vela --restart unless-stopped \
-p 127.0.0.1:8080:8080 \
--mount type=bind,src=/srv/vela,dst=/data \
--env-file /etc/vela/vela.env \
xchunk/vela:0.9.0
# keys are managed locally, never over HTTP
docker exec vela velad key create --name laptop --scope admin
# with VELA_WEB_AUTH=on: end every browser session at once
docker exec vela velad session revoke-all
Three supported starting points ship with the repository: an env file, a Docker script and a proxy configuration for each.
Go streams files from the local disk. Works with any reverse proxy, or none at all.
Go authorizes, then nginx serves the immutable blob itself with sendfile. For heavy download traffic.
Only metadata stays on the server. Contents live in a private bucket, proxied or redirected.
Vela's security rules are written down, enforced in one place and checked by tests — including a real nginx in Docker.
Private, expired, trashed and missing files look identical from the outside. Existence is never disclosed.
API keys travel in Authorization: Bearer — or once, in the body of the optional sign-in form. The cookie holds a random session ID, never the key.
Key hashes, link signatures and upload checksums are compared in constant time.
The expiry in a signed URL must match the stored one. Editing exp gets you a 404.
Access logs omit query strings, so signatures never land on disk — in velad, nginx and Caddy.
API keys are created and revoked only with velad key on the server. There is no escalation path.
Clone, run make dev, paste the printed key into vela login — and you have a working store on localhost.