Environment variables
What the server reads when it starts; the CLI in the image reads the same DATABASE_URL and
REDIS_URL. The defaults are the image’s.
| variable | default (image) | |
|---|---|---|
DATABASE_URL |
postgresql://jsmemento:jsmemento@localhost:5432/jsmemento |
The database. Set it. postgresql://user:password@host:5432/db (or postgres://…): PostgreSQL, any number of processes. file:<path> (relative to the working directory) or file:///abs/path.db: SQLite, one server process — see SQLite. :memory:: SQLite in memory, for tests. The server migrates it at start; the CLI uses the same. |
TEST_DATABASE_URL |
postgresql://jsmemento:jsmemento@localhost:5432/jsmemento_test |
The test suites only (the same forms). |
REDIS_URL |
(unset) | Redis for publishing events and cross-process streaming, and for the shared rate-limit and quota counters. Unset: one process, in-memory stream, counters in the process. Optional on both databases; on SQLite it does not allow a second process. |
REDIS_CHANNEL_PREFIX |
memento:events |
Channels are <prefix>:<tenant_slug>. |
HOST |
0.0.0.0 |
Listen address. |
PORT |
3000 |
Listen port (the code default outside the image is 8000). |
LOG_LEVEL |
info |
pino: fatal error warn info debug trace silent. Logs are JSON on stdout. |
MEMENTO_API_PREFIX |
/memento |
Path every route is mounted under. |
MEMENTO_UI_DIR |
/app/ui (image) · unset |
Built web UI (the examples site, apps/examples) served at / and /en/; unset → API only. The service container: /app/ui-service. |
MEMENTO_MENU_PATH |
/app/config/menu.yaml (image) · menu.yaml at the repository root |
The examples site’s sidebar, served as the menu UDC collection. Missing → no menu collection (warning); the site shows its built-in entries. |
MEMENTO_DEMO_API_KEY |
(unset) | Read-only key GET <prefix>/api/demo hands to the examples site (Demo key). Not exactly read, unknown or revoked → the server does not start. Compose: DEMO_API_KEY. |
MEMENTO_DEFAULT_LOCALE |
en |
Locale events are rendered in when a request names none. |
MEMENTO_LOOKUPS_PATH |
/app/config/lookups.yaml |
Vocabulary file. Missing → lookups disabled (warning). |
MEMENTO_TRANSLATIONS_PATH |
<dir of lookups>/i18n/translations.csv |
Label sheet. |
MEMENTO_CANDIDATES_DIR |
/data/candidates |
Where unknown lookup values are recorded. |
MEMENTO_RECORD_CANDIDATES |
true |
false turns recording off. |
MEMENTO_LOOKUPS_STRICT |
false |
true rejects events whose types are not in lookups.yaml (422). |
MEMENTO_WS_HEARTBEAT_MS |
30000 |
WebSocket ping interval (min 1000). |
MEMENTO_WS_MAX_BUFFERED |
1000 |
Unwritten messages per connection before it is closed 4008. |
MEMENTO_ACCOUNTS |
false |
Self-service accounts: the /auth/* routes and the session cookie (Self-service accounts). Off → none of it is reachable. Compose: ACCOUNTS. |
MEMENTO_SERVICE_URL |
(unset) | Public origin of the service site (https://service.memento-service.org): the links in verify / reset / quota mails, and the service the client zips under /clients/*.zip default to (MEMENTO_URL, the keys page) when the process serves the service site. Required with accounts on. Without accounts it turns on the quota mails of that process (Quotas); unset there → the process sends none. Compose: SERVICE_URL. |
MEMENTO_BREVO_API_KEY |
(unset) | Brevo transactional mail key. Unset → mails are logged at info level with their full text (LogMailer). Compose: BREVO_API_KEY. |
MEMENTO_MAIL_FROM |
(unset) | Name <address>, required with the Brevo key; the address must be a sender verified in Brevo. Compose: MAIL_FROM. |
MEMENTO_TRUST_PROXY |
false |
Fastify trustProxy: client IP from X-Forwarded-For (rate limits), https from X-Forwarded-Proto (Secure cookie). true only behind a proxy that sets them. Compose: TRUST_PROXY. |
MEMENTO_SESSION_DAYS |
30 |
Sliding lifetime of a session (and the cookie’s Max-Age). |
MEMENTO_DEFAULT_MAX_KEYS |
10 |
Live (not deleted, not revoked) API keys a tenant without its own max_keys may hold; POST /keys past it is 409 limit_reached. Compose: DEFAULT_MAX_KEYS. |
MEMENTO_DEFAULT_DAILY_LIMIT |
100000 |
Events per UTC day of a limited API key without its own daily_limit (every key with accounts on, a self-service tenant’s key on any process; Quotas): 80 % mails a warning, past 100 % the key’s writes are 429 quota_exceeded until midnight UTC. Compose: DEFAULT_DAILY_LIMIT. |
MEMENTO_MAX_DAILY_LIMIT |
(unset) | Highest daily_limit a user may give a key; unset → none. Compose: MAX_DAILY_LIMIT. |
docker-compose.yaml additionally reads POSTGRES_USER, POSTGRES_PASSWORD, POSTGRES_DB,
MEMENTO_PORT, POSTGRES_PORT, REDIS_PORT, POSTGRES_BIND, REDIS_BIND and
MEMENTO_IMAGE, SERVICE_PORT (the service container’s host port, default 8201), and passes ACCOUNTS, SERVICE_URL, BREVO_API_KEY, MAIL_FROM,
TRUST_PROXY, DEFAULT_MAX_KEYS, DEFAULT_DAILY_LIMIT, MAX_DAILY_LIMIT to the server as the MEMENTO_* variables above (empty by default); the demo profile adds the CPU_MONITOR_* variables
(Demo pusher).
v1.1.0released built 663143e