Skip to content

Commit 1bc89e1

Browse files
authored
Merge branch 'master' into chore/update-gar-img-tagging-STOR-451
2 parents 14ebf79 + b9ea119 commit 1bc89e1

2 files changed

Lines changed: 116 additions & 22 deletions

File tree

docs/src/config.md

Lines changed: 102 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -6,40 +6,121 @@ Rust uses environment variables for a number of configuration options. Some of t
66
| **RUST_LOG** | *debug*, *info*, *warn*, *error* | minimum Rust error logging level |
77
| **RUST_TEST_THREADS** | 1 | maximum number of concurrent threads for testing. |
88

9-
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.
9+
In addition, Sync server configuration options can either be specified as environment variables (prefixed with **SYNC_***) or in a configuration file using the `--config` option.
1010

1111
For example the following are equivalent:
1212
```bash
1313
$ SYNC_HOST=0.0.0.0 SYNC_MASTER_SECRET="SuperSikkr3t" SYNC_SYNCSTORAGE__DATABASE_URL=mysql://scott:tiger@localhost/syncstorage cargo run
1414
```
1515

1616
```bash
17-
$ cat sync.ini
18-
HOST=0.0.0.0
19-
MASTER_SECRET=SuperSikkr3t
17+
$ cat syncstorage.local.toml
18+
host = "0.0.0.0"
19+
master_secret = "SuperSikkr3t"
2020

2121
[syncstorage]
22-
DATABASE_URL=mysql://scott:tiger@localhost/syncstorage
23-
$ cargo run -- --config sync.ini
22+
database_url = "mysql://scott:tiger@localhost/syncstorage"
23+
$ cargo run -- --config syncstorage.local.toml
2424
```
2525

26-
Options can be mixed between environment and configuration.
26+
Options can be mixed between environment variables and configuration. Environment variables have higher precedence.
2727

2828
## Options
2929
The following configuration options are available.
3030

31-
| Option | Default value |Description |
32-
| --- | --- | --- |
33-
| debug | false | _unused_ |
34-
| port | 8000 | connection port |
35-
| host | 127.0.0.1 | host to listen for connections |
36-
| database_url | mysql://root@127.0.0.1/syncstorage | database DSN |
37-
| database_pool_max_size | _None_ | Max pool of database connections |
38-
| master_secret| _None_ | Sync master encryption secret |
39-
| limits.max_post_bytes | 2,097,152‬ | Largest record post size |
40-
| limits.max_post_records | 100 | Largest number of records per post |
41-
| limits.max_records_payload_bytes | 2,097,152‬ | Largest ... |
42-
| limits.max_request_bytes | 2,101,248 | Largest ... |
43-
| limits.max_total_bytes | 209,715,200 | Largest ... |
44-
| limits.max_total_records | 100,000 | Largest ... |
31+
### Server Settings
32+
33+
| Env Var | Default Value | Description |
34+
| --- | --- | --- |
35+
| <span id="SYNC_HOST"></span>SYNC_HOST | 127.0.0.1 | Host address to bind the server to |
36+
| <span id="SYNC_PORT"></span>SYNC_PORT | 8000 | Server port to bind to |
37+
| <span id="SYNC_MASTER_SECRET"></span>SYNC_MASTER_SECRET | None, required | Secret used to derive auth secrets |
38+
| <span id="SYNC_ENVIRONMENT"></span>SYNC_ENVIRONMENT | dev | Environment name ("dev", "stage", "prod") |
39+
| <span id="SYNC_HUMAN_LOGS"></span>SYNC_HUMAN_LOGS | false | Enable human-readable logs |
40+
| <span id="SYNC_ACTIX_KEEP_ALIVE"></span>SYNC_ACTIX_KEEP_ALIVE | None | HTTP keep-alive header value in seconds |
41+
| <span id="SYNC_WORKER_MAX_BLOCKING_THREADS"></span>SYNC_WORKER_MAX_BLOCKING_THREADS | 512 | The maximum number of blocking threads in the worker threadpool. This threadpool is used by Actix-web to handle blocking operations. |
42+
43+
### CORS
44+
45+
| Env Var | Default Value | Description |
46+
| --- | --- | --- |
47+
| <span id="SYNC_CORS_ALLOWED_ORIGIN"></span>SYNC_CORS_ALLOWED_ORIGIN | * | Allowed origins for CORS requests |
48+
| <span id="SYNC_CORS_MAX_AGE"></span>SYNC_CORS_MAX_AGE | 1728000 | CORS preflight cache seconds (20 days) |
49+
| <span id="SYNC_CORS_ALLOWED_METHODS"></span>SYNC_CORS_ALLOWED_METHODS | ["DELETE", "GET", "POST", "PUT"] | Allowed methods |
50+
51+
### Syncstorage Database
52+
53+
| Env Var | Default Value | Description |
54+
| --- | --- | --- |
55+
| <span id="SYNC_SYNCSTORAGE__DATABASE_URL"></span>SYNC_SYNCSTORAGE__DATABASE_URL | mysql://root@127.0.0.1/syncstorage | Database connection URL |
56+
| <span id="SYNC_SYNCSTORAGE__DATABASE_POOL_MAX_SIZE"></span>SYNC_SYNCSTORAGE__DATABASE_POOL_MAX_SIZE | 10 | Max database connections |
57+
| <span id="SYNC_SYNCSTORAGE__DATABASE_POOL_CONNECTION_TIMEOUT"></span>SYNC_SYNCSTORAGE__DATABASE_POOL_CONNECTION_TIMEOUT | 30 | Pool timeout in seconds |
58+
| <span id="SYNC_SYNCSTORAGE__DATABASE_POOL_CONNECTION_LIFESPAN"></span>SYNC_SYNCSTORAGE__DATABASE_POOL_CONNECTION_LIFESPAN | None | Max connection age in seconds |
59+
| <span id="SYNC_SYNCSTORAGE__DATABASE_POOL_CONNECTION_MAX_IDLE"></span>SYNC_SYNCSTORAGE__DATABASE_POOL_CONNECTION_MAX_IDLE | None | Max idle time in seconds |
60+
| <span id="SYNC_SYNCSTORAGE__DATABASE_POOL_SWEEPER_TASK_INTERVAL"></span>SYNC_SYNCSTORAGE__DATABASE_POOL_SWEEPER_TASK_INTERVAL | 30 | How often, in seconds, a background task runs to evict idle database connections (Spanner only) |
61+
| <span id="SYNC_SYNCSTORAGE__DATABASE_SPANNER_ROUTE_TO_LEADER"></span>SYNC_SYNCSTORAGE__DATABASE_SPANNER_ROUTE_TO_LEADER | false | Send leader-aware headers to Spanner |
62+
| <span id="SYNC_SYNCSTORAGE__SPANNER_EMULATOR_HOST"></span>SYNC_SYNCSTORAGE__SPANNER_EMULATOR_HOST | None | Spanner emulator host (e.g., localhost:9010) |
63+
64+
### Syncstorage Limits
65+
66+
| Env Var | Default Value | Description |
67+
| --- | --- | --- |
68+
| <span id="SYNC_SYNCSTORAGE__LIMITS__MAX_POST_BYTES"></span>SYNC_SYNCSTORAGE__LIMITS__MAX_POST_BYTES | 2,621,440 | Max BSO payload size per request |
69+
| <span id="SYNC_SYNCSTORAGE__LIMITS__MAX_POST_RECORDS"></span>SYNC_SYNCSTORAGE__LIMITS__MAX_POST_RECORDS | 100 | Max BSO count per request |
70+
| <span id="SYNC_SYNCSTORAGE__LIMITS__MAX_RECORD_PAYLOAD_BYTES"></span>SYNC_SYNCSTORAGE__LIMITS__MAX_RECORD_PAYLOAD_BYTES | 2,621,440 | Max individual BSO payload size |
71+
| <span id="SYNC_SYNCSTORAGE__LIMITS__MAX_REQUEST_BYTES"></span>SYNC_SYNCSTORAGE__LIMITS__MAX_REQUEST_BYTES | 2,625,536 | Max Content-Length for requests |
72+
| <span id="SYNC_SYNCSTORAGE__LIMITS__MAX_TOTAL_BYTES"></span>SYNC_SYNCSTORAGE__LIMITS__MAX_TOTAL_BYTES | 262,144,000 | Max BSO payload size per batch |
73+
| <span id="SYNC_SYNCSTORAGE__LIMITS__MAX_TOTAL_RECORDS"></span>SYNC_SYNCSTORAGE__LIMITS__MAX_TOTAL_RECORDS | 10,000 | Max BSO count per batch |
74+
| <span id="SYNC_SYNCSTORAGE__LIMITS__MAX_QUOTA_LIMIT"></span>SYNC_SYNCSTORAGE__LIMITS__MAX_QUOTA_LIMIT | 2,147,483,648 | Max storage quota per user (2 GB) |
75+
76+
### Syncstorage Features
77+
78+
| Env Var | Default Value | Description |
79+
| --- | --- | --- |
80+
| <span id="SYNC_SYNCSTORAGE__ENABLED"></span>SYNC_SYNCSTORAGE__ENABLED | true | Enable syncstorage service |
81+
| <span id="SYNC_SYNCSTORAGE__ENABLE_QUOTA"></span>SYNC_SYNCSTORAGE__ENABLE_QUOTA | false | Enable quota tracking (Spanner only) |
82+
| <span id="SYNC_SYNCSTORAGE__ENFORCE_QUOTA"></span>SYNC_SYNCSTORAGE__ENFORCE_QUOTA | false | Enforce quota limits (Spanner only) |
83+
| <span id="SYNC_SYNCSTORAGE__GLEAN_ENABLED"></span>SYNC_SYNCSTORAGE__GLEAN_ENABLED | true | Enable Glean telemetry |
84+
| <span id="SYNC_SYNCSTORAGE__STATSD_LABEL"></span>SYNC_SYNCSTORAGE__STATSD_LABEL | syncstorage | StatsD metrics label prefix |
85+
86+
### Tokenserver Database
87+
88+
| Env Var | Default Value | Description |
89+
| --- | --- | --- |
90+
| <span id="SYNC_TOKENSERVER__DATABASE_URL"></span>SYNC_TOKENSERVER__DATABASE_URL | mysql://root@127.0.0.1/tokenserver | Tokenserver database URL |
91+
| <span id="SYNC_TOKENSERVER__DATABASE_POOL_MAX_SIZE"></span>SYNC_TOKENSERVER__DATABASE_POOL_MAX_SIZE | 10 | Max tokenserver DB connections |
92+
| <span id="SYNC_TOKENSERVER__DATABASE_POOL_CONNECTION_TIMEOUT"></span>SYNC_TOKENSERVER__DATABASE_POOL_CONNECTION_TIMEOUT | 30 | Pool timeout in seconds |
93+
94+
### Tokenserver Features
95+
96+
| Env Var | Default Value | Description |
97+
| --- | --- | --- |
98+
| <span id="SYNC_TOKENSERVER__ENABLED"></span>SYNC_TOKENSERVER__ENABLED | false | Enable tokenserver service |
99+
| <span id="SYNC_TOKENSERVER__RUN_MIGRATIONS"></span>SYNC_TOKENSERVER__RUN_MIGRATIONS | false | Run DB migrations on startup |
100+
| <span id="SYNC_TOKENSERVER__TOKEN_DURATION"></span>SYNC_TOKENSERVER__TOKEN_DURATION | 3600 | Token TTL (1 hour) |
101+
102+
### Tokenserver+FxA Integration
103+
104+
| Env Var | Default Value | Description |
105+
| --- | --- | --- |
106+
| <span id="SYNC_TOKENSERVER__FXA_EMAIL_DOMAIN"></span>SYNC_TOKENSERVER__FXA_EMAIL_DOMAIN | api-accounts.stage.mozaws.net | FxA email domain |
107+
| <span id="SYNC_TOKENSERVER__FXA_OAUTH_SERVER_URL"></span>SYNC_TOKENSERVER__FXA_OAUTH_SERVER_URL | https://oauth.stage.mozaws.net | FxA OAuth server URL |
108+
| <span id="SYNC_TOKENSERVER__FXA_OAUTH_REQUEST_TIMEOUT"></span>SYNC_TOKENSERVER__FXA_OAUTH_REQUEST_TIMEOUT | 10 | OAuth request timeout in seconds |
109+
| <span id="SYNC_TOKENSERVER__FXA_METRICS_HASH_SECRET"></span>SYNC_TOKENSERVER__FXA_METRICS_HASH_SECRET | secret | Secret for hashing metrics to maintain anonymity |
110+
| <span id="SYNC_TOKENSERVER__FXA_OAUTH_PRIMARY_JWK__KTY"></span>SYNC_TOKENSERVER__FXA_OAUTH_PRIMARY_JWK__KTY | None | Primary JWK key type (e.g., "RSA") |
111+
| <span id="SYNC_TOKENSERVER__FXA_OAUTH_PRIMARY_JWK__ALG"></span>SYNC_TOKENSERVER__FXA_OAUTH_PRIMARY_JWK__ALG | None | Primary JWK algorithm (e.g., "RS256") |
112+
| <span id="SYNC_TOKENSERVER__FXA_OAUTH_PRIMARY_JWK__KID"></span>SYNC_TOKENSERVER__FXA_OAUTH_PRIMARY_JWK__KID | None | Primary JWK key ID |
113+
| <span id="SYNC_TOKENSERVER__FXA_OAUTH_PRIMARY_JWK__FXA_CREATED_AT"></span>SYNC_TOKENSERVER__FXA_OAUTH_PRIMARY_JWK__FXA_CREATED_AT | None | Primary JWK creation timestamp |
114+
| <span id="SYNC_TOKENSERVER__FXA_OAUTH_PRIMARY_JWK__USE"></span>SYNC_TOKENSERVER__FXA_OAUTH_PRIMARY_JWK__USE | None | Primary JWK use (e.g., "sig") |
115+
| <span id="SYNC_TOKENSERVER__FXA_OAUTH_PRIMARY_JWK__N"></span>SYNC_TOKENSERVER__FXA_OAUTH_PRIMARY_JWK__N | None | Primary JWK modulus (RSA public key component) |
116+
| <span id="SYNC_TOKENSERVER__FXA_OAUTH_PRIMARY_JWK__E"></span>SYNC_TOKENSERVER__FXA_OAUTH_PRIMARY_JWK__E | None | Primary JWK exponent (RSA public key component) |
117+
| <span id="SYNC_TOKENSERVER__FXA_OAUTH_SECONDARY_JWK"></span>SYNC_TOKENSERVER__FXA_OAUTH_SECONDARY_JWK__* | None | Secondary JWK (same structure as primary) |
118+
119+
### StatsD Metrics
120+
121+
| Env Var | Default Value | Description |
122+
| --- | --- | --- |
123+
| <span id="SYNC_STATSD_HOST"></span>SYNC_STATSD_HOST | localhost | StatsD server hostname |
124+
| <span id="SYNC_STATSD_PORT"></span>SYNC_STATSD_PORT | 8125 | StatsD server port |
125+
| <span id="SYNC_INCLUDE_HOSTNAME_TAG"></span>SYNC_INCLUDE_HOSTNAME_TAG | false | Include hostname in metrics tags |
45126

docs/style.css

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,16 @@
11
h5 {
22
font-weight: bold;
3-
}
3+
}
4+
5+
table {
6+
font-size: 0.85em;
7+
width: 100%;
8+
}
9+
10+
table td, table th {
11+
padding: 0.4em 0.6em;
12+
}
13+
14+
table th {
15+
font-size: 0.9em;
16+
}

0 commit comments

Comments
 (0)