Signed Links

A signed link gives anyone who holds it access to one file until it expires — no key, no account. Links are HMAC-signed, carry their expiry in the URL, can be revoked at any time, and keep working when the file is renamed or moved.

Creating a link

vela share PATH [--ttl 2h] [--note TEXT] [--copy]
$ vela share private/report.md --ttl 2h --note 'for the reviewer' --copy
https://store.example.com/s/01m4tsckgbtmyv138s621gqfrv/report.md?exp=1791907605&sig=Cya5rfe7e1leFOi6g6vzIQ
Expires 2026-10-13 21:06 (in 2h 0m). Revoke with: vela links revoke 01m4tsckgbtmyv138s621gqfrv
--ttl DURATIONdefault server default, 24h

Lifetime such as 90m, 2h, 7d. Must not exceed VELA_LINK_MAX_TTL (30 days by default); longer requests are rejected, not shortened.

--note TEXT

Free-text note shown in vela links ls — who the link was for, why it exists.

--copy

Copies the URL to the clipboard using the first available tool: wl-copy (Wayland), pbcopy, clip.exe, xclip or xsel. If none is found you get a warning; the URL is still printed.

Links can be created for files of any visibility. For public files they are redundant but harmless — useful when you want the stricter caching and referrer behavior. Creating a link requires an rw key that covers the file's path.

With -q only the URL is printed, which makes capturing it easy: url=$(vela -q share file.pdf --ttl 1h).

Anatomy of a link

https://store.example.com/s/01m4tsckgbtmyv138s621gqfrv/report.md?exp=1791907605&sig=Cya5rfe7e1leFOi6g6vzIQ
                          │ │                          │         │              └ HMAC-SHA256 signature, base64url
                          │ │                          │         └ expiry, Unix seconds
                          │ │                          └ cosmetic file name (not verified)
                          │ └ link ID (ULID)
                          └ signed-link route
  • The file name is the object's name when the link was created. It makes the link readable and gives browsers a sensible download name, but it is not part of the verification.
  • The signature is HMAC-SHA256(signing key, "vela-link-v1\n" + link ID + "\n" + exp), truncated to 128 bits and base64url-encoded.
  • The server stores a record of each link (object ID, signing key, expiry, note, creator), which is what makes listing and revocation possible.

How a request is checked

  1. Expiry

    If exp is in the past, the answer is 410 Gone with a “link expired” page — decided without touching the database.

  2. Record

    The link ID is looked up. No record → 404.

  3. Signature

    The signature is verified in constant time with the link's signing key, and exp must equal the stored expiry. Any mismatch → 404. You cannot extend a link by editing exp.

  4. Revocation

    A revoked link → 404.

  5. Object

    If the object no longer exists, is in the trash, or has itself expired → 404.

  6. Delivery

    The file is served with Cache-Control: private, no-store, Referrer-Policy: no-referrer and X-Robots-Tag: noindex, nofollow. HEAD and Range requests work as usual.

Lifecycle

EventEffect on the link
File renamed or movedKeeps working — links follow the object ID
File overwritten (put --force)Keeps working and serves the new content
File visibility changedNo effect — links work for any visibility
File moved to the trashStops working (404)
File restored from the trashWorks again, if not expired
File purgedLink records are deleted
Link revokedStops working immediately
Expiry reached410 Gone; the record is kept for VELA_LINK_RETENTION (7 days), then deleted

There are no permanent links by design. For indefinite access by URL, use an unlisted file.

A link to a symlink works like a link to a file: visibility does not matter, but both the symlink and its file must be alive and not expired. When the symlink is retargeted with vela ln -f, its links follow the new file.

To share many files at once, vela share --by-tag review --ttl 7d creates one link per tagged file after showing them, and vela links revoke --by-tag review revokes their active links. See Tag Selection.

Listing links

$ vela links ls
ID                          EXPIRES IN  PATH               NOTE
01m4tsckgbtmyv138s621gqfrv  1h 53m      private/report.md  for the reviewer

$ vela links ls private/report.md --all
ID                          EXPIRES IN  PATH               NOTE
01m4tsd3mrjd500nwq82y1na91  expired     private/report.md
01m4tsckgbtmyv138s621gqfrv  1h 53m      private/report.md  for the reviewer

By default only active links are listed; --all adds expired and revoked ones. --json includes each link's working URL. Because listing returns usable URLs, it requires an rw key.

In the JSON, path is empty while the object is in the trash or deleted, and url is null if the link's signing key was destroyed with --revoke-all.

Revoking links

vela links revoke 01m4tsckgbtmyv138s621gqfrv
vela links revoke ID1 ID2 ID3

Revocation is immediate. Under R2 redirect delivery, a bucket grant that was already issued remains valid until its short TTL (5 minutes by default).

Signing key rotation

Links are signed with a server-side signing key stored in the database and generated automatically on first start. Rotate it on the server:

$ docker exec vela velad signing rotate
New signing key: 01m4tsqfh7x7aptmyx6sq529yw
Retired 1 key(s); their links keep working until they expire.
  • velad signing rotate — new links use a fresh key. Retired keys keep verifying the links they signed until those expire; the janitor deletes retired keys once no live links depend on them.
  • velad signing rotate --revoke-all — emergency button. Every older key is destroyed at once and all existing links stop working. Use it if the database or many links leaked.

Signing keys are independent of API keys: revoking an API key does not affect links it created, and rotating signing keys does not affect API keys.

  • A signed URL is a credential. Don't paste it into tickets, logs or public chats.
  • Prefer short TTLs and add a --note so you know what to revoke later.
  • Make sure your proxy logs omit query strings — the supplied nginx and Caddy configurations do.

Links over HTTP

curl https://store.example.com/api/v1/links \
  -H "Authorization: Bearer $VELA_KEY" \
  -d '{"path": "private/report.md", "ttl": "2h", "note": "for the reviewer"}'

Instead of ttl you can pass an absolute expires_at. See Links endpoints.