Skip to content

Commit 7c87879

Browse files
coolreader18gefjon
andauthored
Add docs for standalone config.toml (#190)
* Add docs for standalone config.toml * Update docs/cli-reference/standalone-config.md Co-authored-by: Phoebe Goldman <[email protected]> * pre formatting --------- Co-authored-by: Phoebe Goldman <[email protected]>
1 parent 05f6de9 commit 7c87879

File tree

3 files changed

+50
-0
lines changed

3 files changed

+50
-0
lines changed
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
# `spacetimedb-standalone` configuration
2+
3+
A local database instance (as started by `spacetime start`) can be configured in `{data-dir}/config.toml`, where `{data-dir}` is the database's data directory. This directory is printed when you run `spacetime start`:
4+
5+
<!-- FIXME: handle bare <pre> better in markdown renderer -->
6+
<pre class="shiki"><span>spacetimedb-standalone version: 1.0.0
7+
spacetimedb-standalone path: /home/user/.local/share/spacetime/bin/1.0.0/spacetimedb-standalone
8+
database running in data directory <b>/home/user/.local/share/spacetime/data</b></span></pre>
9+
10+
On Linux and macOS, this directory is by default `~/.local/share/spacetime/data`. On Windows, it's `%LOCALAPPDATA%\SpacetimeDB\data`.
11+
12+
## `config.toml`
13+
14+
- [`certificate-authority`](#certificate-authority)
15+
- [`logs`](#logs)
16+
17+
### `certificate-authority`
18+
19+
```toml
20+
[certificate-authority]
21+
jwt-priv-key-path = "/path/to/id_ecdsas"
22+
jwt-pub-key-path = "/path/to/id_ecdsas.pub"
23+
```
24+
25+
The `certificate-authority` table lets you configure the public and private keys used by the database to sign tokens.
26+
27+
### `logs`
28+
29+
```toml
30+
[logs]
31+
level = "error"
32+
directives = [
33+
"spacetimedb=warn",
34+
"spacetimedb_standalone=info",
35+
]
36+
```
37+
38+
#### `logs.level`
39+
40+
Can be one of `"error"`, `"warn"`, `"info"`, `"debug"`, `"trace"`, or `"off"`, case-insensitive. Only log messages of the specified level or higher will be output; e.g. if set to `warn`, only `error` and `warn`-level messages will be logged.
41+
42+
#### `logs.directives`
43+
44+
A list of filtering directives controlling what messages get logged, which overwrite the global [`logs.level`](#logslevel). See [`tracing documentation`](https://docs.rs/tracing-subscriber/0.3/tracing_subscriber/filter/struct.EnvFilter.html#directives) for syntax. Note that this is primarily intended as a debugging tool, and log message fields and targets are not considered stable.

docs/docs/nav.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ const nav = {
1717
page('4 - Moving and Colliding', 'unity/part-4', 'unity/part-4.md'),
1818
section('CLI Reference'),
1919
page('CLI Reference', 'cli-reference', 'cli-reference.md'),
20+
page('SpacetimeDB Standalone Configuration', 'cli-reference/standalone-config', 'cli-reference/standalone-config.md'),
2021
section('Server Module Languages'),
2122
page('Overview', 'modules', 'modules/index.md'),
2223
page('Rust Quickstart', 'modules/rust/quickstart', 'modules/rust/quickstart.md'),

docs/nav.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,11 @@ const nav: Nav = {
4242

4343
section('CLI Reference'),
4444
page('CLI Reference', 'cli-reference', 'cli-reference.md'),
45+
page(
46+
'SpacetimeDB Standalone Configuration',
47+
'cli-reference/standalone-config',
48+
'cli-reference/standalone-config.md'
49+
),
4550

4651
section('Server Module Languages'),
4752
page('Overview', 'modules', 'modules/index.md'),

0 commit comments

Comments
 (0)