You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/src/config.md
+2Lines changed: 2 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -95,6 +95,8 @@ The following configuration options are available.
95
95
96
96
| Env Var | Default Value | Description |
97
97
| --- | --- | --- |
98
+
| <spanid="SYNC_TOKENSERVER__INIT_NODE_URL"></span>SYNC_TOKENSERVER__INIT_NODE_URL | None | The storage node URL, protocol + host, to insert into the `nodes` table on startup. This is the origin where the service is hosted, e.g. "http://localhost:8000".|
99
+
| <spanid="SYNC_TOKENSERVER__INIT_NODE_CAPACITY"></span>SYNC_TOKENSERVER__INIT_NODE_CAPACITY | 100000 | The storage node capacity of the server specified by `SYNC_TOKENSERVER__INIT_NODE_URL`. Only used if `SYNC_TOKENSERVER__INIT_NODE_URL` is set. |
98
100
| <spanid="SYNC_TOKENSERVER__ENABLED"></span>SYNC_TOKENSERVER__ENABLED | false | Enable tokenserver service |
99
101
| <spanid="SYNC_TOKENSERVER__RUN_MIGRATIONS"></span>SYNC_TOKENSERVER__RUN_MIGRATIONS | false | Run DB migrations on startup |
100
102
| <spanid="SYNC_TOKENSERVER__NODE_TYPE"></span>SYNC_TOKENSERVER__NODE_TYPE | spanner | Storage backend type reported in token response for telemetry. Valid values: "mysql", "postgres", "spanner" |
Note that multiple values will be read from the environment:
59
-
- `SYNC_MASTER_SECRET`: a secret used in cryptographic operationsk a passphrase or random character string, e.g. `use_your_own_secret_4d3d3d3d`
60
-
- `SYNC_SYNCSTORAGE__DATABASE_URL`: database URL for syncstorage, e.g. `mysql://sync:test@example.io/syncstorage` or `postgres://testo:@localhost/syncdb`
61
-
- `SYNC_TOKENSERVER__DATABASE_URL`: database URL for tokenserver, e.g. `mysql://sync:test@example.io/tokenserver` or `postgres://testo:@localhost/syncdb`
60
+
- [`SYNC_MASTER_SECRET`](../config.md#SYNC_MASTER_SECRET): a secret used in cryptographic operations, a passphrase or random character string, e.g. `use_your_own_secret_4d3d3d3d`
61
+
- [`SYNC_SYNCSTORAGE__DATABASE_URL`](../config.md#SYNC_SYNCSTORAGE__DATABASE_URL): database URL for syncstorage, e.g. `mysql://sync:test@example.io/syncstorage` or `postgres://testo:@localhost/syncdb`
62
+
- [`SYNC_TOKENSERVER__DATABASE_URL`](../config.md#SYNC_TOKENSERVER__DATABASE_URL): database URL for tokenserver, e.g. `mysql://sync:test@example.io/tokenserver` or `postgres://testo:@localhost/syncdb`
63
+
- [`SYNC_TOKENSERVER__INIT_NODE_URL`](../config.md#SYNC_TOKENSERVER__INIT_NODE_URL): the storage node URL (defaults to `http://localhost:8000`). Replace with the actual URL where clients will access the sync server.
62
64
63
65
The values can be directly written into the yaml as well.
64
66
@@ -68,46 +70,13 @@ Next, start the service with `docker compose`:
After starting the service on a clean, uninitialized database, some bootstrapping records need to be inserted.
77
-
78
-
For MySQL, run
79
-
```sql
80
-
INSERT INTO tokenserver.services (service, pattern) VALUES ('sync-1.5', '{node}/1.5/{uid}');
81
-
82
-
INSERT INTO tokenserver.nodes (service, node, available, current_load, capacity, downed, backoff)
83
-
VALUES (
84
-
(SELECT id FROM services WHERE service = 'sync-1.5'),
85
-
'http://localhost:8000',
86
-
1, 0, 1000, 0, 0
87
-
);
88
-
```
89
-
90
-
For PostgreSQL, run
91
-
```sql
92
-
INSERT INTO nodes (service, node, available, current_load, capacity, downed, backoff)
93
-
VALUES (
94
-
(SELECT id FROM services WHERE service = 'sync-1.5'),
95
-
'http://localhost:8000',
96
-
1, 0, 1000, 0, 0
97
-
);
98
-
```
99
-
100
-
Note that `http://localhost:8000` above needs to be replaced with the actual
101
-
service URL.
102
-
103
-
Restart the service with
104
-
```sh
105
-
docker compose -f docker-compose.yaml restart
106
-
```
107
-
108
77
## Docker Compose, One-Shot with PostgreSQL
109
78
110
-
Alternatively, the database can be started through `docker compose` as well. The real service URL can be set with the `NODE_URL` environment variable.
79
+
Alternatively, the database can be started through `docker compose` as well. The real service URL can be set with the `INIT_NODE_URL` environment variable.
111
80
112
81
Save the yaml below into a file, e.g. `docker-compose.one-shot.yaml`.
0 commit comments