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

Configuration

Rust uses environment variables for a number of configuration options. Some of these include:

variablevaluedescription
RUST_LOGdebug, info, warn, errorminimum Rust error logging level
RUST_TEST_THREADS1maximum number of concurrent threads for testing.

In addition, durable sync configuration options can either be specified as environment variables (prefixed with SYNC_*) or in a configuration file using the --config option.

For example the following are equivalent:

$ SYNC_HOST=0.0.0.0 SYNC_MASTER_SECRET="SuperSikkr3t" SYNC_SYNCSTORAGE__DATABASE_URL=mysql://scott:tiger@localhost/syncstorage cargo run
$ cat sync.ini
HOST=0.0.0.0
MASTER_SECRET=SuperSikkr3t

[syncstorage]
DATABASE_URL=mysql://scott:tiger@localhost/syncstorage
$ cargo run -- --config sync.ini

Options can be mixed between environment and configuration.

Options

The following configuration options are available.

OptionDefault valueDescription
debugfalseunused
port8000connection port
host127.0.0.1host to listen for connections
database_urlmysql://root@127.0.0.1/syncstoragedatabase DSN
database_pool_max_sizeNoneMax pool of database connections
master_secretNoneSync master encryption secret
limits.max_post_bytes2,097,152‬Largest record post size
limits.max_post_records100Largest number of records per post
limits.max_records_payload_bytes2,097,152‬Largest …
limits.max_request_bytes2,101,248Largest …
limits.max_total_bytes209,715,200Largest …
limits.max_total_records100,000Largest …