Skip to content

Settings ​

DDBD reads its settings from <data folder>/ddbd.toml, which ddbd init writes with every setting in it. This page lists every setting, when a change takes effect, and the fixed rules and limits that are not settings.

toml
# <data folder>/ddbd.toml (the first lines)
port = 7070
bind = "0.0.0.0"
tls = false
session_idle_hours = 24

Every setting ​

settingdefaultmeaning
port7070port
bind"0.0.0.0"listen address (an IP address; 127.0.0.1 = this machine only)
tlsfalse (true after init --tls)TLS on or off. On: DDBD serves HTTPS itself. Off: plain HTTP, for localhost or behind a proxy or load balancer that handles HTTPS and forwards plain HTTP (with TLS on, DDBD refuses plain HTTP (see Operations)
tls_cert, tls_keythe files made by init --tlsPEM certificate and key. init --tls writes the full paths of <data folder>/tls/cert.pem and key.pem; when a value is missing, those files are used. Any certificate (for example from a public certificate authority) can be used
session_idle_hours24session ends after this many hours without use (at least 1)
notify_keep"1d"keep missed notifications this long (--notify-keep)
private_key_ttl"1h"private access key lifetime (--private-key-ttl)
login_free_attempts5failed logins before the slowdown starts
login_max_delay"15m"longest wait between attempts
max_indexes0indexes per record, 0 = unlimited (--max-indexes)
max_tags0tags per record, 0 = unlimited (--max-tags)
admin_session_idle_minutes60web admin sessions end after this many minutes without use (at least 1)
log"stdout"not used; the log always goes to standard output
[rocksdb] block_cache_mb256memory in MB for cached data blocks (at least 8)
[rocksdb] blob_min_kb4record bodies of this many KB or more are kept in separate blob files (at least 1)

Durations (notify_keep, private_key_ttl, login_max_delay) are a number followed by ms, s, m, h, d or w; a bare number is seconds. The four settings with a flag in brackets can also be overridden for one run on the start command line.

The Web Admin's Settings page checks values before it saves them: durations must be above zero, port, login_free_attempts, session_idle_hours and admin_session_idle_minutes at least 1, bind an IP address, and tls_cert and tls_key files that exist on the server (an empty value means the files made by init). Turning tls on when the certificate file is missing makes a new self-signed certificate in <data folder>/tls/.

Where each setting is explained in use:

settingpage
session_idle_hours, login_free_attempts, login_max_delayLogin and Sessions
admin_session_idle_minutesWeb Admin
tls, tls_cert, tls_key, port, bindOperations

Live or next start ​

Edits to ddbd.toml take effect on the next start. The Web Admin's Settings page saves to the same file (rewriting it, so comments in it are lost), and applies what it can at once:

applies at once (from the Web Admin)applies on the next start
session_idle_hoursport
notify_keepbind
private_key_ttltls
login_free_attemptstls_cert, tls_key
login_max_delay[rocksdb] block_cache_mb
max_indexes[rocksdb] blob_min_kb
max_tags
admin_session_idle_minutes

Every way to change a setting, and when it applies:

waywhat it changeswhen it applies
edit <data folder>/ddbd.toml, then restart (stop + start)every settingon the next start
ddbd start --notify-keep <duration> --private-key-ttl <duration> --max-indexes <number> --max-tags <number>those four, for this run only (the file is not changed)now, until the next start without them
Web Admin, Settings pageevery setting; saved to ddbd.tomlthe left column above at once; the right column on the next start, and the page says which are waiting
ddbd admin --data <folder> settings(shows) every setting in force, and marks each one whose saved value differs
ddbd admin --data <folder> user ..., web-password, secret rotateusers and levels, the web admin password, the private-key secretat once

TIP

ddbd admin --data <folder> settings is the way to check: it prints what the running server uses, and marks any setting whose saved value differs with (saved <value>, applies on next start).

Saving replaces command-line overrides

A save on the Settings page sets every live setting to its value in the file. A value given on the start command line (--notify-keep, --private-key-ttl, --max-indexes, --max-tags) is then replaced by the saved one.

WARNING

A setting the server cannot use (a bad duration, a busy port, missing certificate files) stops start with a message saying which one; nothing is half-started. Fix the file and start again.

How to restart, move ports, and swap certificates is on the Operations page.

Rules and limits ​

These are fixed by the server and are not settings. The only adjustable ones are max_indexes and max_tags above.

itemrule
collection names, tags, index names1 to 256 characters, no control characters
index namescannot start with $ or end with .
string index values0 to 256 characters, no control characters
number index valuesany finite number; whole numbers are exact up to ±2^53
unique_id1 to 1000 bytes, no control characters
usernames1 to 256 characters, no whitespace or control characters
index names per recordeach name once
indexes per recordunlimited, or max_indexes
tags per recordunlimited, or max_tags
record dataany JSON, no size limit
grants per call1 to 100 users
page size1 to 1000 (default 50)
textnames, tags, unique ids and string values are stored in Unicode NFC form, so visually identical text always matches

A request that breaks one of these answers 400 INVALID_REQUEST, 400 INDEX_LIMIT or 400 TAG_LIMIT with a message naming the field. Request bodies themselves have no size limit.

When to set max_indexes and max_tags

Each tag copies every index key of a record, so a record with many string indexes and many tags writes many small keys. The two limits keep a careless client from making every write expensive. Both are 0 (unlimited) by default and apply at once from the Web Admin.

Released under the Apache License 2.0.