domain.env
The one file that names your Otto server: its domain and every name derived from it. Read by the deploy, which hands each name to the services that need it. Used by Self-host Otto on your own domain.
The file
The path is /etc/otto-deploy/domain.env on the server, written by root and kept out of git. It holds KEY=VALUE lines, one per key. The file is read as data, so nothing in it is run. It follows these rules:
- Blank lines and
#comments are fine. - Optional quotes around a value are removed.
- A repeated key takes its last line.
OTTO_DOMAIN=example.org
That one line is enough. Every other key has a default built from OTTO_DOMAIN.
Keys
| Key | Default | Meaning |
|---|---|---|
OTTO_DOMAIN | Required | Your domain, such as example.org. The other defaults are built from it. |
OTTO_APP_HOST | my.$OTTO_DOMAIN | The host name of the Otto web app, where you sign in. |
OTTO_PREVIEW_DOMAIN | preview.$OTTO_DOMAIN | The parent domain of phone previews. Each repo gets a name under it, such as myrepo.preview.example.org. |
OTTO_SITE_HOSTS | $OTTO_DOMAIN, www.$OTTO_DOMAIN | The host names that serve the public website, comma-separated. |
OTTO_PUSH_SUBJECT | mailto:push@$OTTO_DOMAIN | The contact that push notifications identify your server with, as a mailto: or https: address. |
OTTO_PASSKEY_USER | owner | The display name a new passkey is saved under, as your device's passkey list shows it. |
Set an optional key only when your layout differs from the default. For example, OTTO_APP_HOST=otto.example.org moves the app off my.. Give OTTO_SITE_HOSTS a different list, or point OTTO_PUSH_SUBJECT at a mailbox you read.
What each key names
OTTO_APP_HOSTnames the following. Caddy, auth, gateway, vault API, host operations and push read it.- The web app's address and its TLS certificate.
- The passkey relying-party ID and sign-in origin (
https://<app host>). - The
connect-srcof the Content-Security-Policy, which allows the app's own WebSocket. - The origin each service accepts for the app: gateway, vault API, host operations and push.
OTTO_PREVIEW_DOMAINnames the following. Caddy, auth and the preview relay read it.- The wildcard
*.<preview domain>that serves phone previews, with one certificate issued per name on its first visit. - The domain of the preview sign-in cookie.
- The Host pattern for the
otto.preview name.
- The wildcard
OTTO_SITE_HOSTSnames the public website's addresses and their certificates. Caddy reads it.OTTO_PUSH_SUBJECTnames the contact sent to push services with each notification. Push reads it.OTTO_PASSKEY_USERnames the user on passkeys enrolled from now on. Auth reads it; enrolled passkeys keep their name.
The deploy also derives the preview domain with its dots escaped, for the one pattern Caddy matches against. You do not set it.
No image holds a name. Each service takes its names from its environment when its container is created, and a service started without them stops with a message that names the missing variable.
When the file is missing
A deploy with no file, an unreadable one, or one without OTTO_DOMAIN stops at once and says which. It stops before it builds anything or restarts a service, so the running server is untouched.
Changing it
A change needs a full redeploy. Each service reads its names only when its container is created, so editing the file alone changes nothing. Run yarn deploy:vps all after you edit it.
A change to OTTO_APP_HOST also changes the passkey relying-party ID. A passkey enrolled under the old host no longer signs in, so enroll again with yarn vps:auth enroll.
Your DNS records must match the names. The how-to lists them. server-move.sh carries the file to a new server, so a moved server keeps its names.