Skip to content

Storage and email

Media are stored, encrypted, in an S3-compatible object store. Browsers upload to it and download from it directly, through short-lived presigned links; the application never carries the bytes. Which store is a setting of the admin console, Server → Object store. A saved setting waits beside the one in use until it passes its check, and then applies at once, without a restart — so a mistyped key never reaches your media (ADR 0089). How to set it and its check: First-run setup.

Until a store is set and has passed its check, the instance runs and answers, refuses uploads with a reason, and refuses to create a tenant. Once the first file is stored, the store’s type, endpoint and bucket are fixed; moving an instance’s media to another store is not supported.

The bundled store. A recipe that brings a Garage hands the application a hint to it: its addresses and its admin token (GARAGE_ADMIN_TOKEN / secrets.garageAdminToken). With no store saved, the application then sets the bundled store itself after its start and checks it, so a fresh instance needs no step of yours; the console’s Use the bundled store returns to it from a store of your own. Either way the setting is a reference to that hint, not a copy of its secrets; the store’s access keys are derived from the token. On Compose it is the default: the browser reaches it under a path of each tenant’s own domain, so no CORS rule is needed, and an instance leaves it out with its compose.override.yml (Set up a new instance). On Kubernetes it is opt-in (garage.enabled): one node on one claim, with no replication or versioning, on a host of its own (storeDomain), where the application writes a CORS rule that allows any origin (Kubernetes). Where no hint is passed the console offers only a store of your own. The same-origin route to the bundled store on Compose exists only while it is the store in use or a saved setting waiting for its check, whose test upload travels that route.

The bundled store’s blocks on a network share. Garage keeps two things apart: its metadata (veyq-garage-meta, an LMDB database) and the blocks of the objects (veyq-garage-data). The blocks may sit on a network share, an SMB or NFS export such as a storage box; the metadata may not — LMDB’s own documentation rules out remote filesystems, so it stays on the server’s local disk. What the share holds is ciphertext only, so it decides the store’s availability, never its confidentiality.

  • On Compose, declare veyq-garage-data in your compose.override.yml as a volume of Docker’s local driver with the share’s driver_opts (type: cifs or nfs), and leave the other two alone. Never bind-mount a host directory that is itself the share’s mount point: should the share be missing at boot, the store writes into the empty directory beneath it, while a volume that cannot be mounted keeps the store from starting at all. Mount it as the store’s user, uid and gid 1000 (for SMB the uid=1000,gid=1000 mount options): the recipe’s volume-ownership step chowns each volume’s root to that user before the store starts, and a share that does not already present it as owned by 1000 can refuse the chown, which stops that step and the store with it.
  • On Kubernetes, give the data claim a class of its own, garage.persistence.data.storageClass (Kubernetes).

Choose this before the store’s first start: the volume is created once, and moving its blocks later is a copy with the store stopped. A share that holds the blocks is no backup of them — Backup and restore.

A store of your own. An S3-compatible service, or a Garage you run:

  • S3-compatible: the bucket must exist; veyq never creates a bucket or writes a CORS rule on a store you bring. Give it a Public endpoint when browsers reach the store at another address than the server does. The bucket’s CORS rule must allow PUT and GET from the instance’s origin with the Content-Type header, and expose ETag. The check tests the instance’s own domain only; a tenant on a domain of its own is a further origin the rule must allow, which the check does not see. While links made here may be shown on other servers (Links shown on other servers, core.public-shares.embeddable, on by default, Capabilities), a member of another instance reads and adds to a link from that instance’s origin, so the rule must allow any origin (*) for GET and PUT; without it their browsers cannot read or add the link’s files. No credentials are involved: the store’s URLs are presigned. The access key must also be allowed to list the bucket: the application compares the store with its database in the background, and without the list right the console reports that the store refused it and counts nothing (Operations). Give veyq a bucket of its own — another server or tool writing into the same bucket is why the reconcile deletes nothing until you confirm the bucket is this server’s alone.
  • Garage: veyq sets it up — layout, bucket, access key, grant and CORS rule — from the admin endpoint and token you enter (ADR 0067).

Setting a Garage up. For a Garage store (the bundled one included) the application sets the store up in the background at every start, with a few retries over about two minutes; it never holds the start back. The console’s Object store panel shows the state: in progress, ready, or failed, and the server log names the step that failed. A passing Check store runs the set-up again.

Quotas. A tenant’s quota and what counts towards it: Plan your instance.

A tenant’s mail is never yours to configure: each tenant’s owner sets up that tenant’s own relay in the app (Settings → Email): host, port, sender, username, password and STARTTLS (uc.admin.tenant-mail-settings). Two things veyq mails have no substitute, because they are addressed to the person concerned: an invitation to join the tenant by email, and a password-reset link. A tenant owner may instead share an invitation as a link, but that too needs the tenant’s mail, because the account it creates is sent its address confirmation at once. A tenant without working mail refuses all three, and says so.

What is yours:

  • Let the application send mail out: outbound SMTP to the hosts the tenant owners choose (and yours, below), usually port 587. Both recipes leave the application’s outbound traffic open for this; a firewall of yours must too.
  • The first owner’s invitation of a new tenant is never mailed: the console gives you a link to pass on (First-run setup).
  • The key that seals the relays’ passwords (below).

The one relay that is yours is optional: the instance’s mail, for what the host itself announces. Set it on the console’s Server → Mail — the same fields as a tenant’s relay. It sends only these, each to an address the server already holds:

  • to you, at the address of your Server Owner account: the notices about new releases (Operations);
  • to the moderators and the instance contact: moderation’s notices; to a reporter and the people a decision concerns: the receipt and the statement of reasons, at an address their client sent (Moderation);
  • to the people an erasure concerns: an account being erased, every member of a tenant you delete, and every member of a tenant where an application was switched off while the tenant holds something of it — a notice naming the day its content there is erased, and a reminder seven days before (Capabilities).

It never sends a tenant’s mail, nor stands in for a tenant without one (ADR 0097). Without it none of the above is mailed; a switched-off application’s day is then on its banner alone.

  1. Enter the relay and save. The instance mails an eight-digit code to your account’s address.
  2. Type the code into Server → Mail within an hour. A wrong code counts; five spend it, and a save sends a new one.
  3. From then on each notice is mailed once, with the link to Upgrade; one with a date carries it as a calendar entry (.ics).

Every save asks for a code again, and so does a changed address on your account. Its password is sealed under the same key as the tenants’ (below); while that key cannot open it, nothing is mailed and the panel says why. Without this relay the notices are shown on the console and that is all.

The application seals the secrets it must keep — each tenant’s SMTP password, the instance mail’s password, and the secret key and Garage token of a store of your own — under a key file it generates on its first start (ADR 0050). The bundled store needs nothing sealed. The key defends a leaked database backup: the dump alone opens no secret. It does not defend a compromised host.

Docker Compose Kubernetes
Where it lives the veyq-config-secret volume, /var/lib/veyq/config-secret.key the veyq-config-secret claim, kept when the release is uninstalled
Owned by the application’s user, uid 10001, mode 0600 the same

Without that volume every recreated container would generate a new key, and every secret sealed under the old one would stop opening. scripts/validate_config_secret_persistence.py keeps the image, the backend and the compose file agreeing on the path.

Its state is on the console’s Server → Config-secret key, or veyq-admin config-secret:

  • OK — the key is in place, and it is the one the stored secrets were sealed with (or nothing has been sealed yet).
  • ABSENT — no key is available: it could not be created, or the application cannot read the file (after a restore, the file must belong to uid 10001). Nothing can be sealed.
  • MISMATCH — the key is not the one some stored secret was sealed with: lost, replaced or not restored.

A secret that cannot be opened degrades only what needs it: a tenant whose relay needs a password refuses invitations and password resets until its owner re-enters the password; a store of your own is unreachable until you re-enter its credentials, in the console. Content is never affected. Putting the original key file back and restarting opens everything again.

Back the key up apart from the database and the store, on a medium of its own (Backup and restore).

Your own key. The application generates one only where it finds none, so you can give it yours: 32 random bytes, base64 (head -c 32 /dev/urandom | base64 > config-secret.key), or the key a backup kept apart. Do it before first-run setup, while nothing is sealed yet — a key replaced later leaves every secret sealed under the old one MISMATCH.

  • Kubernetes: make it a Secret and name it in app.configSecret.existingSecret (Configuration): kubectl -n veyq create secret generic veyq-config-secret-key --from-file=config-secret.key. The chart mounts it read-only and the application only reads it; the claim stays, for the erasure ledger. A GitOps tool or a secret operator can own the Secret.

  • Docker Compose: put it into the volume with the application image’s own place-key, as a restore does, which makes it the application’s (uid 10001, 0600); the image has no shell, so this is its one way in:

    Terminal window
    ./veyqctl stop # or: docker compose … stop app
    docker compose -f "releases/<release>/docker-compose.prod.yml" --env-file .env run --rm --no-deps -T \
    --entrypoint java app -jar /opt/veyq/image-commands.jar place-key /var/lib/veyq/config-secret.key < config-secret.key
    ./veyqctl start

    A Compose secrets: file mounted over the path would serve the application too, but veyqctl restore puts a restored key into the volume, so keep it there.

The store setting, its check and the bundled hint are covered by the backend’s tests; the backup rehearsal restores an instance onto a fresh install that sets its bundled store up from the hint. No S3 service other than Garage is recorded as tried, and no mail relay is exercised beyond a test mailbox — the instance mail’s code, notices and calendar entry included, which the backend’s tests send through an SMTP server inside the test run.