Use SQLite for persistence and generate Rust protobuf bindings at build time. Add Docker image support for containerized deployment. Co-Authored-By: codex <[email protected]>
44 lines
1.1 KiB
Markdown
44 lines
1.1 KiB
Markdown
# Brave Sync Server v2 Rust Port
|
|
|
|
Rust port of the Brave Sync v2 command server from `/home/user/go-sync`.
|
|
|
|
The server exposes:
|
|
|
|
- `GET /`
|
|
- `GET /health-check`
|
|
- `POST /v2/command/`
|
|
- `GET /metrics`
|
|
|
|
## Storage
|
|
|
|
This port uses SQLite instead of DynamoDB. On startup it creates the required
|
|
tables automatically.
|
|
|
|
Environment variables:
|
|
|
|
- `SQLITE_PATH`: SQLite database path. Defaults to `brave-sync.sqlite3`.
|
|
- `LISTEN_ADDR`: HTTP listen address. Defaults to `0.0.0.0:8295`.
|
|
- `BLOCKED_CLIENT_IDS`: comma-separated lowercase or uppercase client public key hex values.
|
|
- `HIGH_DEVICE_LIMIT_CLIENT_IDS`: comma-separated client IDs allowed up to 100 active devices.
|
|
|
|
## Build and Test
|
|
|
|
```sh
|
|
cargo test
|
|
cargo run
|
|
```
|
|
|
|
## Docker
|
|
|
|
```sh
|
|
docker build -t brave-sync-rs .
|
|
docker run --rm -p 8295:8295 -v brave-sync-data:/var/lib/brave-sync brave-sync-rs
|
|
```
|
|
|
|
For bind mounts, the container starts as root only long enough to create/chown
|
|
the SQLite directory, then runs the server as the `brave-sync` user.
|
|
|
|
The protobuf Rust bindings are generated at build time from
|
|
`schema/protobuf/sync_pb`. A vendored `protoc` binary is used, so a system
|
|
`protoc` install is not required.
|