Phase 4 of PLAN.md. - New non-default feature `remote = ["ureq"]` (ureq is already a dep of `cloudflare`, so no new crates). - Blocking GET with connect and overall timeouts from timeout_secs, an optional `Authorization: Bearer` read from the env var named by token_env, non-2xx treated as failure, and the body capped at max_bytes. - declare logs whether the token is present (never its value). An http(s) url in a build without the feature fails at startup. - Tests run against a local TcpListener: 200, 500 and timeout keep the last good copy, oversize is rejected, bearer header sent only when configured. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
40 lines
1.4 KiB
TOML
40 lines
1.4 KiB
TOML
[package]
|
|
name = "noteguard"
|
|
version = "0.1.0"
|
|
edition = "2021"
|
|
|
|
[features]
|
|
forwarder = ["tokio-tungstenite", "tokio", "futures-util"]
|
|
# nscript: run user-submitted WASM note filters (Phase 0 spike)
|
|
nscript = ["wasmtime"]
|
|
# cloudflare: escalate BanTracker IP-bans to a Cloudflare WAF IP list (edge block)
|
|
cloudflare = ["ureq"]
|
|
# remote: fetch [sources] lists (premium members, blacklists) over http(s)
|
|
remote = ["ureq"]
|
|
|
|
[dependencies]
|
|
serde = { version = "1.0", features = ["derive"] }
|
|
serde_json = { version = "1.0", features = ["raw_value"] }
|
|
toml = "0.5"
|
|
ipnetwork = "0.20.0"
|
|
unicode-security = "0.1.2"
|
|
|
|
# shared-memory per-IP read-bandwidth buckets: one mmap'd MAP_SHARED file shared
|
|
# by every `noteguard read` plugin process on the host (memmap2), timestamped
|
|
# against the system-wide CLOCK_MONOTONIC (libc clock_gettime).
|
|
memmap2 = "0.9"
|
|
libc = "0.2"
|
|
|
|
# forwarder deps
|
|
tokio-tungstenite = { version = "0.23.1", optional = true, features = ["native-tls"] }
|
|
tokio = { version = "1.38.0", features = ["macros", "time", "sync", "rt-multi-thread"], optional = true }
|
|
futures-util = { version = "0.3.30", optional = true }
|
|
log = "0.4.22"
|
|
env_logger = "0.11.3"
|
|
|
|
# nscript deps
|
|
wasmtime = { version = "48", optional = true, default-features = false, features = ["cranelift", "runtime", "std"] }
|
|
|
|
# cloudflare deps — blocking HTTP client for the edge-ban worker
|
|
ureq = { version = "2", optional = true, features = ["json"] }
|