mirror of
https://github.com/Dasemu/Synapse.git
synced 2026-11-26 15:26:17 +00:00
Adds synapse-sync (protocol types, Remote transport and read API, SyncClient with background loop, SSE realtime, resumable blobs) and synapse-server (multi-graph, bearer auth, blob streaming, read API, authenticated update endpoint), with e2e tests, docs/sync.md, docs/server.md, systemd unit and update script. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
26 lines
781 B
Rust
26 lines
781 B
Rust
use synapse_server::Config;
|
|
use tracing_subscriber::EnvFilter;
|
|
|
|
#[tokio::main]
|
|
async fn main() {
|
|
let filter = EnvFilter::try_from_default_env()
|
|
.unwrap_or_else(|_| EnvFilter::new("info,tower_http=info"));
|
|
let builder = tracing_subscriber::fmt().with_env_filter(filter);
|
|
if std::env::var("SYNAPSE_LOG_FORMAT").is_ok_and(|v| v.eq_ignore_ascii_case("json")) {
|
|
builder.json().init();
|
|
} else {
|
|
builder.init();
|
|
}
|
|
let cfg = match Config::from_env() {
|
|
Ok(c) => c,
|
|
Err(e) => {
|
|
tracing::error!("configuration error: {e}");
|
|
std::process::exit(2);
|
|
}
|
|
};
|
|
if let Err(e) = synapse_server::serve(cfg).await {
|
|
tracing::error!("server error: {e}");
|
|
std::process::exit(1);
|
|
}
|
|
}
|