Directory Policies

Directory policies decide how directories appear to anonymous visitors: whether an index page exists, whether a directory is listed in its parent, what search engines are told, and which title and description it shows. They are stored independently of files and never change who can download a file.

Navigation, not access controlA hidden directory's index can still be opened by anyone who knows or guesses its URL, and public and unlisted files stay reachable at their URLs even when indexes are disabled. Use private files and signed links for anything sensitive.

The settings

SettingValuesInherited?Effect
indexon, off, inheritYes, from the nearest ancestor rule, then VELA_ROOT_INDEXWhether the directory's index page exists. off → 404.
hiddentrue, falseNo — own rule onlyNot listed in the parent's index. Its own index still works.
noindexon, off, inheritYes; defaults to on below any hidden directoryCrawler exclusion for index pages and public files below.
titleplain textNoIndex page heading and parent-row title.
descriptionplain textNoShown under the heading and in the parent row.

A policy can exist before any files do, and a rule at a/ is valid even if a file named a exists. Titles and descriptions have the same limits as object metadata (256 and 4096 characters). The root cannot be hidden.

How settings resolve

For any directory, Vela computes an effective policy:

  • index — the nearest rule (this directory or an ancestor) that says on or off; otherwise VELA_ROOT_INDEX (default on). A stored root rule overrides the configuration.
  • hidden — this directory's own rule; default false.
  • noindex — the nearest on/off rule; otherwise on if any ancestor (or the directory itself) is hidden, else off. An explicit setting wins over the hidden-derived default.

An index page exists only when index resolves to on and — except for the root — the subtree contains at least one live public file. A parent lists a child directory only if the child is not hidden, its index is on and it has visible entries.

Inspecting: vela dir show

dir show explains what an anonymous visitor sees and where each setting comes from — even for directories without a rule:

$ vela dir show docs/handbook/
Prefix:       docs/handbook/
Index:        on (source: docs/handbook/)
Hidden:       true
Noindex:      on (source: hidden:docs/handbook/)
Title:        -
Description:  -
Exists:       true
Index page: https://store.example.com/docs/handbook/ (not listed in parent, hidden from search engines)

Sources are a prefix (docs/), / for a root rule, config for VELA_ROOT_INDEX, default, or hidden:PREFIX when noindex derives from a hidden directory.

Changing settings: vela dir set

vela dir set PREFIX [--index on|off|inherit] [--noindex on|off|inherit]
                    [--hidden | --no-hidden] [--title TEXT] [--description TEXT]
vela dir set docs/ --title 'Documentation' --description 'Public handbooks'
vela dir set docs/raw/ --index off
vela dir set archive/ --noindex on
vela dir set docs/drafts/ --no-hidden

set patches only the flags you pass, creating a rule with defaults if none exists. Prefixes accept an optional trailing slash; / is the root.

Shortcuts

vela dir hide PREFIX

Sets hidden=true and index=on: a hidden entrance. The directory disappears from its parent but its own page — and everything listed inside it — works for anyone who has the URL.

vela dir private-root

Stores index=off at the root, overriding VELA_ROOT_INDEX. The home page answers 404; public file URLs keep working. Requires an unrestricted admin key. Prints a reminder that this is not access control.

vela dir rm PREFIX [-y]

Deletes the rule and restores inheritance. Files and descendant rules are untouched. Removing the root rule asks for confirmation because it may re-enable the configured root index.

Listing rules: vela dir ls

$ vela dir ls
PREFIX          INDEX      HIDDEN  NOINDEX    TITLE          EXISTS
docs/           (inherit)  false   (inherit)  Documentation  true
docs/handbook/  on         true    (inherit)                 true

$ vela dir ls --orphaned

EXISTS tells you whether live public files remain below the rule. --orphaned shows only rules whose public content is gone — candidates for cleanup. Pass a prefix to list a subtree.

Recipe: a hidden entrance

Turn the root listing off, give an event its own entrance with normal browsable subfolders, and keep the raw-files folder from being listed:

vela dir private-root
vela dir hide event-2026/
vela dir set event-2026/ --title 'Event 2026' --description 'Slides and recordings'
vela dir set event-2026/raw/ --index off
vela dir show event-2026/
  • / returns 404 — there is nothing to browse from the home page.
  • /event-2026/ opens directly and lists its public subdirectories, which carry noindex by default because their ancestor is hidden.
  • /event-2026/raw/ returns 404, but each public file inside opens by its URL.

Public behavior in detail

  • Identical 404s. A disabled index and a directory that does not exist return the same themed 404 with the same headers, decided by a bounded lookup that never builds the subtree.
  • Slashless URLs (/docs) redirect with 301 to /docs/ only when that index exists and is enabled.
  • Counts and dates: once any rule exists, a directory row's count is its visible entries — files plus listed child directories — and its date covers only reachable visible entries. With no rules stored at all, the original counts (all public files below) and HTML are preserved.
  • Breadcrumbs render disabled ancestors as plain text, and the “up” link is omitted when the parent index is disabled.
  • JSON: ?format=json on an index applies exactly the same filtering as HTML.
  • Crawlers: under noindex, index pages carry X-Robots-Tag: noindex, nofollow and a robots meta tag, and public files carry the header too. robots.txt never lists hidden prefixes and otherwise follows VELA_ROBOTS.
  • Caching is unchanged; browsers and CDNs may keep an earlier page until it expires.

Authenticated API operations on objects are never affected by directory policies.

Policies and moves

Recursive moves carry policies with them atomically (vela mv docs/ archive/docs/ moves both files and rules and reports the number of policies moved). A target that already has rules conflicts unless you pass --force, which replaces the target's whole policy set. Trash, restore and the janitor never delete policies, and backups include them automatically.

Permissions

ActionRequires
Read rules and effective policiesro; collection reads narrow to the key's prefix, individual reads outside it are 403
Create, change or delete a rulerw within the key's prefix (including the prefix itself)
Change the root ruleUnrestricted admin

Compatibility

Directory policies arrived in v0.2. With an older server, the 0.2 CLI's existing commands keep their previous behavior; the vela dir commands report that the server lacks support. Custom themes need small updates before the first rule is created — see Theming. The HTTP API is documented under Directory policies endpoints.