Symlinks
A symlink is an entry with its own path that serves the content of another file. Keep the originals in one place and sort them into as many others as you like — one photo can sit in sorted/travel/ and sorted/best/ at once — without copying a single byte.
New in v0.4Symlinks need velad 0.4 or later; a newer CLI explains when the server is too old. Upgrading applies a database migration — see the upgrade guide.
How it works
Unlike a POSIX symlink, a Vela symlink refers to its file by object ID, not by path. That decides what survives:
| What happens to the file | Its symlinks |
|---|---|
| Renamed or moved, alone or with its directory | Keep working; vela ls -l shows the new path |
Overwritten with put --force | Serve the new content; the ETag changes with it |
| Metadata or visibility changed | Keep their own metadata; content type and visibility limits follow the file |
| Moved to the trash | Become broken (trashed) and answer 404 publicly |
| Restored from the trash, under any path | Work again — the ID did not change |
| Purged | Stay broken for good (gone) until you remove them |
- A symlink has no blob of its own: size, SHA-256 and content type always come from the file at the time of the request.
- There are no chains and no symlinks to directories. A symlink always points at a regular file; linking a symlink links the file behind it.
- IDs are never reused, so a broken symlink can never come back to life on somebody else's file.
Creating symlinks with vela ln
vela ln SOURCE DEST
vela ln SOURCE... DIR/
vela ln -r SOURCE_DIR/ DEST_DIR/
$ vela ln originals/2026/lisbon.jpg sorted/travel/lisbon.jpg
sorted/travel/lisbon.jpg -> originals/2026/lisbon.jpg
https://store.example.com/sorted/travel/lisbon.jpg
$ vela ln originals/2026/lisbon.jpg originals/2026/porto.jpg sorted/best/
A DEST ending with / is a directory: the symlink gets the source's name. With several sources, DEST must be a directory; each source is a separate request, and a partial failure exits with code 7. Requires an rw key.
Metadata is a snapshot
Every symlink has its own path, visibility, title, description, tags, disposition and expiry. When it is created they are copied once from the source; later changes on either side do not propagate.
--no-copy-metastarts from the server defaults instead (VELA_DEFAULT_VISIBILITYand empty fields).- The usual metadata flags —
--public,--unlisted,--private,--title,--description,--tag,--disposition,--expires— override the copy.--tagreplaces the copied tags rather than adding to them. - The expiry is never copied: it describes the lifetime of an entry, not of its content.
- The content type cannot be set on a symlink; it is always the file's.
- To copy the metadata again later, retarget with
-f --copy-meta, or refresh a whole tag view withln --by-tag … --sync --copy-meta.
Replacing and retargeting
An occupied DEST is an error unless you pass -f:
- If
DESTis a symlink, it is retargeted in place: same ID, same public URL, and its signed links now follow the new file. Its metadata stays;--copy-metacopies the new source's metadata again. - If
DESTis a file, the file goes to the trash and a new symlink takes its place.
# a stable URL that always serves the newest release
vela ln -f releases/app-1.5.0.tar.gz latest.tar.gz
Linking a whole directory
$ vela ln -r originals/2026/ sorted/2026/
Linked sorted/2026/ -> originals/2026/: 3 created, 0 replaced
Files added to originals/2026/ later are not linked automatically.
-r links every file below the source directory in one transaction: if any destination is taken (and -f is not given), nothing is created and up to 100 conflicts are reported. Symlinks inside the source are followed, broken ones are skipped with a warning. It is a snapshot — files added later are not linked; to keep a view current, use tag selection with --sync. Directory policies are not copied, at most 10 000 objects are linked per request, and the destination cannot lie inside the source.
Visibility and access
A symlink cannot publish more than its file allows. Anonymous visitors get the effective visibility: the stricter of the symlink's and the file's.
| Symlink | File | Effective |
|---|---|---|
| public | public | public — listed and served |
| public | unlisted | unlisted — served by URL, not listed |
| public | private | private — 404 |
| any | broken | private — 404 |
The CLI warns when the result is stricter than what you asked for:
$ vela ln originals/2026/home.jpg sorted/best/ --public
sorted/best/home.jpg -> originals/2026/home.jpg
private; create a temporary link with: vela share sorted/best/home.jpg
warning: sorted/best/home.jpg is public, but its effective visibility is private (the target is private)
- The check runs on every request, so making the file private hides all of its symlinks at once.
- Signed links to a symlink work regardless of visibility, as long as the symlink and its file are alive and not expired. After a retarget they follow the new file.
- A prefix-restricted key must cover both the symlink and its file — when the symlink is created and again on every read. Through a symlink, a
pub/key can never publish or read a file insecret/; a file outside the prefix looksgone. vela ls --visibilityand the API'svisibilityfilter match the effective visibility.
On the public side
For anonymous visitors a symlink is indistinguishable from a regular file. Its URL is its own path, and the file's path is never revealed:
- The index lists it like any file — with the file's size and type and the symlink's title, tags and date — only if the effective visibility is
publicand it is not broken. - Downloads carry the symlink's name and disposition in
Content-Disposition, the file'sETag, andCache-Controlby effective visibility. Ranges,HEADand304behave as for files, in every delivery mode. - Directory policies apply by the symlink's path. A hidden directory is not confidentiality: linking a file from a hidden directory into a listed one is a deliberate act.
- With web sign-in, signed-in pages mark symlinks with a
symlinkicon.
Inspecting symlinks
Long listings mark symlinks with l and show where they point:
$ vela ls -l sorted/travel/
l public 2.3 MiB 2026-10-31 08:57 lisbon.jpg -> originals/2026/lisbon.jpg
vela stat on a symlink describes the symlink itself, like lstat, plus its target; on a file it lists up to ten symlinks pointing at it:
$ vela stat sorted/travel/lisbon.jpg
Path: sorted/travel/lisbon.jpg
URL: https://store.example.com/sorted/travel/lisbon.jpg
Visibility: public
…
Kind: symlink
Target: originals/2026/lisbon.jpg
Target vis.: public
Effective: public
$ vela stat originals/2026/lisbon.jpg
…
Symlinks: 1
sorted/travel/lisbon.jpg
Three filters narrow listings:
vela ls -r sorted/ --type symlink # only symlinks (or --type file)
vela ls -r --target originals/2026/lisbon.jpg # everything pointing at this file
vela ls -r --broken sorted/ # only broken symlinks
Broken symlinks
Deleting a file tells you how many symlinks it breaks:
$ vela rm originals/2026/lisbon.jpg
Moved originals/2026/lisbon.jpg to the trash (1 object(s))
warning: 1 symlink(s) now point to a trashed file (list them with: vela ls -r --broken)
Restore with: vela trash restore <path>
$ vela ls -l sorted/travel/
l public 0 B 2026-10-31 08:57 lisbon.jpg -> originals/2026/lisbon.jpg (broken: trashed)
broken: trashed— the file is in the trash.vela statprints thevela trash restorecommand that repairs the symlink, URL and signed links included.broken: gone— the file was purged, or lies outside your key's prefix. Remove the symlink or point it elsewhere withvela ln -f NEW_SOURCE PATH.
Broken symlinks are never removed automatically. Clean them up explicitly:
vela rm --broken sorted/ # broken symlinks directly in sorted/
vela rm --broken -r sorted/ -y # and everything below it
Other commands on symlinks
| Command | Effect on a symlink |
|---|---|
get, cat | Download the file's content under the symlink's name. get -r skips broken symlinks with a warning and exits with code 7. |
meta, vis | Change the symlink's own metadata; the file is untouched. --content-type is refused. |
mv | Move the symlink; recursive moves carry symlinks along with files. |
rm | Trash the symlink, never the file. |
trash restore, trash purge | Restore the symlink with its ID, or delete it for good; purging a symlink frees no content. |
share, url, open | Work on the symlink's own path; a private effective visibility gets the usual hint to use share. |
put, new | Refused: content is never written through a symlink. |
$ vela put report.pdf sorted/travel/lisbon.jpg --force
vela: sorted/travel/lisbon.jpg is a symlink; remove it or retarget it to write content there
hint: content is never written through a symlink; remove it with "vela rm" or retarget it with "vela ln -f"
The API answers such writes with 409 is_symlink. Together with prefix checks this keeps a symlink from becoming a way to write outside your key's reach.
Symlinks over HTTP
POST /api/v1/symlinks creates, retargets and recursively links; listings take kind, broken and target filters, objects carry kind, effective_visibility and target, and deletes report symlinks_affected. See the endpoint reference.