Step 1 — Unify preset logic (eliminate dual implementation)
- src/cli/preset.rs: add missing fields (chunk_limit, multi_thread_streams,
multi_thread_cutoff), fix Office buffer_size 64M→128M, implement FromStr
- src/web/api.rs: post_preset() now calls Preset::apply() — no more inlined
params; Office write_back unified to 5s (was 3s in API)
Step 2 — Fix setup.rs connection test: warn→bail
- All 4 "Warning: Could not connect/resolve" prints replaced with anyhow::bail!
matching deploy/setup.rs behavior
Step 3 — Web UI: add [web] and [notifications] edit sections
- templates/web/tabs/config.html: new collapsible Web UI (password) and
Notifications (webhook_url, cache_threshold_pct, nas_offline_minutes,
writeback_depth) sections, both tagged "No restart"
- Also adds [log] section (file path + level select, "Full restart")
Step 4 — Full cron expression support in warmup scheduler
- Cargo.toml: add cron = "0.12", chrono = "0.4"
- supervisor.rs: normalize_cron_schedule() converts 5-field standard cron to
7-field cron crate format; replaces naive hour-only matching
Step 5 — Adaptive bandwidth algorithm
- supervisor.rs: extract compute_adaptive_limit() pure function; sliding
window of 6 samples, cv>0.3→congested (−25%, floor 1MiB/s), stable
near-limit→maintain, under-utilizing→+10% (capped at limit_up)
Step 6 — warpgate update command
- src/cli/update.rs: query GitHub Releases API, compare with CARGO_PKG_VERSION
- src/main.rs: add Update{apply}, SetupWifi, CloneMac{interface} commands
- src/cli/wifi.rs: TODO stub for WiFi AP setup
Unit tests (+35, total 188→223)
- cli/preset.rs: 10 tests — FromStr, all fields for each preset, idempotency,
connection/share isolation, write_back consistency regression
- supervisor.rs: 14 tests — normalize_cron_schedule (5 cases),
compute_adaptive_limit (9 cases: congestion, floor, stable, under-utilizing,
cap, zero-current, zero-max, empty window)
- config.rs: 11 tests — WebConfig (3), NotificationsConfig (4), LogConfig (4)
Shell tests (+4 scripts)
- tests/09-cli/test-preset-cli.sh: preset CLI without daemon; checks all
three presets write correct values including unified buffer_size/write_back
- tests/09-cli/test-update-command.sh: update command; skips on no-network
- tests/10-scheduled/test-cron-warmup-schedule.sh: "* * * * *" fires in <90s
- tests/10-scheduled/test-adaptive-bandwidth.sh: adaptive loop stability
- tests/harness/config-gen.sh: add warmup.warmup_schedule override support
- tests/run-all.sh: add 10-scheduled category
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
26 lines
731 B
TOML
26 lines
731 B
TOML
[package]
|
|
name = "warpgate"
|
|
version = "0.1.0"
|
|
edition = "2024"
|
|
|
|
[dependencies]
|
|
anyhow = "1.0.101"
|
|
clap = { version = "4.5.59", features = ["derive"] }
|
|
serde = { version = "1.0.228", features = ["derive"] }
|
|
serde_json = "1.0.149"
|
|
thiserror = "2.0.18"
|
|
toml = "1.0.2"
|
|
ctrlc = "3.4"
|
|
libc = "0.2"
|
|
ureq = { version = "3.2.0", features = ["json"] }
|
|
tokio = { version = "1", features = ["rt-multi-thread", "macros", "sync"] }
|
|
tokio-stream = { version = "0.1", features = ["sync"] }
|
|
axum = "0.8"
|
|
askama = "0.15"
|
|
tower-http = { version = "0.6", features = ["cors"] }
|
|
tracing = "0.1"
|
|
tracing-subscriber = { version = "0.3", features = ["env-filter"] }
|
|
tracing-appender = "0.2"
|
|
cron = "0.12"
|
|
chrono = { version = "0.4", features = ["clock"] }
|