Re-exports§
pub use db::Database;pub use metrics::Metrics;pub use premade::PremadeManager;pub use rate_limiter::RateLimiter;
Modules§
- bootstrap
- cert
- cli
- db
- editor
- http
- The snip-sync health and metrics HTTP control surface.
- metrics
- orchestration
- Server shutdown orchestration.
- paths
- premade
- process
- Process helpers used by stop/restart and the croncheck maintenance lock.
- rate_
limiter - server_
lock - Kernel-backed singleton lock for the
snip-syncserver. - startup
- Cross-platform startup registration for the foreground
snip-syncserver. - toml_
escapes - TOML escape sequence handling for premade libraries.
Structs§
- AppState
- Config
- Config
File - Cors
Config - Database
Config - Limits
Config - Metrics
Config - Premade
Config - Rate
Limit Config - Server
Config - Snip
Sync Service
Enums§
Constants§
- DEFAULT_
DB_ MAX_ CONNECTIONS - DEFAULT_
GRPC_ MAX_ MESSAGE_ SIZE - DEFAULT_
MAX_ API_ KEY_ LENGTH - DEFAULT_
MAX_ COMMAND_ LENGTH - DEFAULT_
MAX_ DESCRIPTION_ LENGTH - DEFAULT_
MAX_ DEVICE_ ID_ LENGTH - DEFAULT_
MAX_ ENCRYPTED_ PAYLOAD_ LENGTH - DEFAULT_
MAX_ ID_ LENGTH - DEFAULT_
MAX_ SYNC_ SNIPPETS - DEFAULT_
MAX_ TAGS - DEFAULT_
MAX_ TAG_ LENGTH - DEFAULT_
METRICS_ AUTH_ FAILURES_ PER_ MINUTE - Global ceiling on failed
/metricsauthentications per minute. Correct credentials never consume it, so an attacker cannot deny the operator their own scrape by burning the budget. - DEFAULT_
RATE_ LIMIT_ PER_ MINUTE - DEFAULT_
REGISTER_ PER_ MINUTE - Global ceiling on successful account creations per minute, independent of
the caller’s address. The per-peer
register:<peer>budget alone lets an attacker with many addresses grow the user table without bound. - DEFAULT_
REQUEST_ TIMEOUT_ SECS - MAX_
REQUEST_ LIMIT - Hard upper bound for any single request’s page size. Endpoints choose
their own default page size when the client omits one (
sync→ 1000,get_snippets→ 100,list_libraries→ 50); all are clamped here. - PRE_
AUTH_ RATE_ LIMIT_ MULTIPLIER - Multiplier applied to the per-peer budget for requests that have not yet authenticated. The pre-authentication budget only has to bound the cost of an API-key lookup, so it is generous by design: an unauthenticated caller must not be able to exhaust the budget that legitimate callers spend on the authenticated surface.
Functions§
- extract_
api_ key - Extract the API key from a gRPC request’s
authorizationmetadata. Falls back to the bodyapi_keyfield for backward compatibility. - parse_
bool_ env - Parse an optional boolean environment variable.
- parse_
env - Parse an optional environment variable, returning the typed value if present and valid.