Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Application and Server

Configuration is layered: one build runs across environments without code changes. This page covers the layers, [app] and [server].

Layer the files

Later layers override earlier ones.

LayerSource
1default.toml. Required.
2<APP_ENV>.toml. Optional. APP_ENV defaults to development.
3local.toml. Optional; keep it out of version control.
4<PREFIX>__SECTION__KEY environment variables, e.g. LAT__DATABASE__URL. The prefix is LAT unless app.env_prefix names another.
SectionPage
[database]Database
[backend]Admin
[auth]Authentication

Set [app] and [server]

[app]
name = "Acme Blog"               # baseline admin brand
env_prefix = "LAT"               # prefix of the overriding environment variables
locale = "en"                    # default admin language
debug = false                    # error pages show the cause
# url = "https://acme.example"   # public base URL; derived from listen when unset

[server]
listen = "127.0.0.1:8080"
KeyDescription
app.nameThe application name, the baseline admin brand. Branding overrides it. Default Laterite.
app.urlThe public base URL absolute links build on, scheme and host with any port. Derived from server.listen when unset.
app.localeDefault admin UI language, a BCP 47 tag. Default en. See Localization.
app.debugError pages include the cause. Off by default. See Errors and Logging.
app.env_prefixThe prefix of the overriding environment variables. Default LAT.
app.keyThe application key, id:<base64 of 32 bytes>; lat key generate writes one. See Encryption and Signing.
app.previous_keysKeys retired by a rotation, each id:<base64>, read but never written with.
server.listenThe host:port to bind. Default 127.0.0.1:8080. lat serve --host, --port and --listen override it.

Set [cache]

[cache]
store = "auto"            # auto | null | memory | redis
memory_mib = 64
poll_seconds = 2
# url = "redis://127.0.0.1:6379/0"
KeyDescription
cache.storeauto is null while app.debug is on and memory otherwise. See Cache.
cache.memory_mibThe memory store’s capacity. Default 64.
cache.poll_secondsHow often a process reads the other processes’ invalidations; 0 for a single process. Default 2.
cache.urlThe Redis URL for the redis store.
cache.prefixThe prefix of every Redis key. Default laterite.

Set [queue]

[queue]
store = "auto"            # auto | database | redis
mode = "worker"           # worker | external | inline
workers = 2
queues = ["default"]
retry_after_seconds = 90
KeyDescription
queue.storeWhere jobs wait; auto is database. See Queue.
queue.modeworker in the application process, external for queue work alone, inline to run a job as it is pushed.
queue.workersWorkers per process in worker mode. Default 2.
queue.queuesThe queues taken from, in priority order. Default ["default"].
queue.retry_after_secondsWhen a claimed job counts as abandoned. Default 90.
queue.poll_secondsAn idle worker’s wait. Default 1.

Set [schedule]

[schedule]
mode = "ticker"           # ticker | external | off
KeyDescription
schedule.modeticker in the application process, external for schedule run alone, off for none. See Scheduler.

Set [mail]

[mail]
driver = "smtp"            # smtp | log | stub
from = "Acme <no-reply@acme.example>"

[mail.smtp]
host = "smtp.acme.example"
port = 587
encryption = "starttls"
username = ""
password = ""
KeyDescription
mail.driversmtp, log or stub; the Mail settings screen lays over it. See Mail.
mail.fromThe sender, Name <address>.
mail.toA development override for every recipient.
mail.smtp.*host, port, encryption (starttls, tls, none), username, password, timeout_seconds.

Set [theme]

[theme]
folder = "themes/acme"
copy = ["static:static"]
KeyDefaultMeaning
foldernoneA static website’s theme folder, relative to the project. Set, lat serve previews it and lat theme build renders it. See Static Website.
copy[]Directories copied into the build output, <src>:<dest>, relative to the project; one absent on this machine is skipped with a note.
sourcedatabaseWhere the theme lives: database, folder, git (feature theme-git), or a code a module registered.
git.remote, git.branchorigin, mainWhere the git source pushes on publish.
publish.hooknoneA build hook URL publish posts to.

Mount a module’s screens

A module’s screens namespace under its identity: acme.places contributing /nodes serves /admin/acme/places/nodes. A module may declare a shorter base; backend.paths has the last word.

Locate the application from lat

lat walks up from the current directory to the nearest config/default.toml and reads the application’s prefix from it. lat admin takes the database URL from --database-url, then DATABASE_URL, then database.url.

Find what is not configured here

SettingWhere
Branding: name, colour-mode default, logoBranding
Preferences: a user’s own timezonePreferences. See Dates and Timezones.