janisslsmandcodex 28826af88d Port Brave Sync server to Rust
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]>
2026-06-04 23:57:44 +03:00
2026-06-04 23:57:44 +03:00
2026-06-04 23:57:44 +03:00
2026-06-04 23:57:44 +03:00
2026-06-04 23:57:44 +03:00
2026-06-04 23:57:44 +03:00
2026-06-04 23:57:44 +03:00
2026-06-04 23:57:44 +03:00
2026-06-04 23:57:44 +03:00

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

cargo test
cargo run

Docker

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.

S
Description
No description provided
Readme
170 KiB
0 Stars 1 Watchers 0 Forks
Languages
Rust 98.4%
Dockerfile 1.3%
Shell 0.3%