mirror of
https://github.com/mozilla-services/syncstorage-rs.git
synced 2026-01-21 00:12:14 +01:00
This is a breaking change. This commit separates syncstorage and tokenserver settings into separate structs that are contained by a parent `Settings` struct. This means that any env vars that hold settings specific to syncstorage (e.g. `SYNC_DATABASE_URL`) have been renamed to `SYNC_SYNCSTORAGE__DATABASE_URL`. Any settings that were moved from the top-level `Settings` struct to the lower level, syncstorage-specific struct will now have a `SYNC_SYNCSTORAGE__` prefix instead of a `SYNC_` prefix. Closes #1276
46 lines
1.7 KiB
Markdown
46 lines
1.7 KiB
Markdown
# Configuration
|
||
Rust uses environment variables for a number of configuration options. Some of these include:
|
||
|
||
| variable | value | description |
|
||
| --- | --- | --- |
|
||
| **RUST_LOG** | *debug*, *info*, *warn*, *error* | minimum Rust error logging level |
|
||
| **RUST_TEST_THREADS** | 1 | maximum 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:
|
||
```bash
|
||
$ SYNC_HOST=0.0.0.0 SYNC_MASTER_SECRET="SuperSikkr3t" SYNC_SYNCSTORAGE__DATABASE_URL=mysql://scott:tiger@localhost/syncstorage cargo run
|
||
```
|
||
|
||
```bash
|
||
$ 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.
|
||
|
||
| Option | Default value |Description |
|
||
| --- | --- | --- |
|
||
| debug | false | _unused_ |
|
||
| port | 8000 | connection port |
|
||
| host | 127.0.0.1 | host to listen for connections |
|
||
| database_url | mysql://root@127.0.0.1/syncstorage | database DSN |
|
||
| database_pool_max_size | _None_ | Max pool of database connections |
|
||
| master_secret| _None_ | Sync master encryption secret |
|
||
| limits.max_post_bytes | 2,097,152 | Largest record post size |
|
||
| limits.max_post_records | 100 | Largest number of records per post |
|
||
| limits.max_records_payload_bytes | 2,097,152 | Largest ... |
|
||
| limits.max_request_bytes | 2,101,248 | Largest ... |
|
||
| limits.max_total_bytes | 209,715,200 | Largest ... |
|
||
| limits.max_total_records | 100,000 | Largest ... |
|
||
|