Commit Graph
348 Commits
Author SHA1 Message Date
Nils Andreas Svee be6546b443 Merge pull request #68 from Lochnair/feature/config
feat(config): migrate configuration loading to config-rs
2026-08-07 16:10:13 +07:00
Nils Andreas Svee 605ec6ef81 refactor(main): simplify interface stats direction logic
Remove the ifb/veth interface prefix detection from
interface_stats_directions. The function now unconditionally returns
RX for download and TX for upload, as the previous heuristic was
unreliable and the simplified behavior matches actual usage.
2026-08-07 16:05:00 +07:00
Nils Andreas Svee 7e0f434251 refactor: replace legacy Config with Settings
Remove legacy src/config.rs and migrate all application consumers to
the nested Settings model. Baseliner, metrics, pingers, ratecontroller,
reflector selector, and main now use Settings. Derived min rates become
methods on NetworkSettings rather than stored legacy fields.
MeasurementType and ObservabilityProtocol move into the settings module.
2026-08-07 16:04:59 +07:00
Nils Andreas Svee 3c688089a1 feat(settings): add validation and flexible boolean parsing
Add settings validation with Warning and Error severity levels.
Warnings print to stderr without preventing startup; errors are
aggregated and prevent startup. Percentage validation accepts 1..=100
rather than silently clamping. Add UCI-compatible flexible boolean
parsing through Serde, accepting 1/true/yes/y/on/enabled for true and
0/false/no/n/off/disabled for false, while native booleans continue to
deserialize correctly.
2026-08-07 16:04:59 +07:00
Nils Andreas Svee a6478c9bd4 feat(uci): derive UCI schema from settings
Add uci-derive proc-macro crate with UciConfig and UciSection derive
macros that generate UCI schema metadata from Settings structs. The
schema maps UCI section types and option names to config-rs field
paths. UciSource::from_schema() creates a source from the derived
schema, mapping known UCI options to their Settings fields while
preserving unknown options under raw UCI-derived paths.
2026-08-07 16:04:59 +07:00
Nils Andreas Svee f51d90bff6 feat(settings): parse reflector lists with CSV
Add CSV-based reflector list parsing with Serde reflector records.
The load_reflectors method reads a CSV file with reflector_ip,
ip_version, and description columns, validating IP version
consistency for each entry.
2026-08-07 16:04:59 +07:00
Nils Andreas Svee a653bcf279 ci: support static cross-compilation with vendored UCI
Add Dockerfile.ci with pkg-config for vendored UCI builds. Switch
Jenkinsfile from pre-built Docker images to Dockerfile-based agents
for full control over the build environment. Add static CRT linking
via RUSTFLAGS for standalone static binaries across the CI matrix.
2026-08-07 16:04:59 +07:00
Nils Andreas Svee af07915441 build(uci): enable vendored UCI builds and Unix development support
Switch rust-uci dependency to the Lochnair fork with vendored UCI
feature for self-contained builds without system libuci. Add
uci-vendored feature flag (enabled by default) that pulls in the
vendored C library. UCI support on non-Linux Unix is intended for
development and testing.
2026-08-07 16:04:59 +07:00
Nils Andreas Svee 39add2b2e0 feat(uci): add generalized UCI configuration source
Introduce the UciSource abstraction as a config-rs Source that reads
UCI packages and maps them into the configuration tree. Supports
package selection, required/optional behavior, and custom config/save
directories. Move rust-uci dependency to cfg(unix) to enable UCI
support on all Unix systems for development and testing, while
Linux/OpenWrt remains the production-supported platform.
2026-08-07 16:04:59 +07:00
Nils Andreas Svee c0a50c68f9 feat(config): add config-rs settings support
Introduce config-rs and Serde support with a nested Settings model.
Add config and serde dependencies with toml feature for file-based
configuration loading. The Settings struct provides typed configuration
with sensible defaults for network, output, observability, and advanced
settings sections. Environment variable override via SQMA__ prefix is
supported. The legacy Config remains in use; migration follows later.
2026-08-07 16:04:58 +07:00
renovate[bot] 8bacb102b7 chore(deps): update google/osv-scanner-action action to v2.5.0 2026-08-07 08:37:03 +00:00
renovate[bot] bc86a2cd53 fix(deps): update rust crate icmp-socket2 to 0.6.0 2026-07-29 10:04:32 +00:00
renovate[bot] c6338b596e chore(deps): update rust crate libc to v0.2.189 2026-07-24 00:05:41 +07:00
Nils Andreas Svee 7f557f26d4 style(reflector): remove redundant comment in reflector selector
Eliminate an outdated comment to improve code readability and maintain a clean codebase.
2026-07-24 00:05:41 +07:00
Nils Andreas Svee c1bcb22b23 refactor(baseliner): Replace shared Mutex state with thread-safe control snapshots
Eliminate lock contention between the baseliner, ratecontroller, and selector by moving to a message-passing architecture using immutable snapshots of reflector state. This improves data consistency and simplifies cross-thread communication.
2026-07-24 00:05:41 +07:00
Nils Andreas Svee 51377f947f refactor(baseliner): extract reflector statistics logic and add unit tests 2026-07-24 00:05:41 +07:00
Nils Andreas Svee dc4ce1159f chore(deps): update rust crate dependencies 2026-07-24 00:05:41 +07:00
Nils Andreas Svee 288d1afdb9 chore(deps): switch netlink dependencies from git to crates.io 2026-07-24 00:05:41 +07:00
renovate[bot] bf0027a0b3 chore(deps): update rust crate thiserror to v2.0.19 2026-07-24 00:05:40 +07:00
renovate[bot] 49b700d4b2 chore(deps): update rust crate libc to v0.2.187 2026-07-24 00:05:40 +07:00
renovate[bot] f6fa7b8814 fix(deps): update netlink-socket2 digest to 928e9ca 2026-07-24 00:05:40 +07:00
renovate[bot] cd160e67fe fix(deps): update netlink-bindings digest to 928e9ca 2026-07-24 00:05:40 +07:00
renovate[bot] bab8278bdd chore(deps): update rust crate fastrand to v2.5.0 2026-07-24 00:05:40 +07:00
renovate[bot] c9cecb6945 chore(deps): update rust crate anyhow to v1.0.104 2026-07-24 00:05:40 +07:00
Nils Andreas Svee b45ae4b6d6 build: update development and cross-compilation tools 2026-07-24 00:05:40 +07:00
Nils Andreas Svee b762901470 feat(platform): add support for FreeBSD interface statistics 2026-07-24 00:05:19 +07:00
Nils Andreas Svee cd6d631afa refactor(config): remove unimplemented measurement types
Remove NTP and TCP timestamp variants from the measurement type configuration since they are currently unimplemented and lead to runtime panics.
2026-07-20 23:06:23 +07:00
Nils Andreas Svee b07dc99bf5 fix(deps): update rust crate icmp-socket2 to 0.5.1 2026-07-17 13:07:30 +07:00
Nils Andreas Svee ae9193580c refactor(platform): restructure platform-specific abstractions and add synthetic backends 2026-07-17 13:02:17 +07:00
Nils Andreas Svee 50f0dcb4dd perf(baseliner): bound the reselection channel to prevent memory buildup
Change the reselection channel from unbounded to a size of 1 and use non-blocking sends to avoid unnecessary queuing of reselection triggers.
2026-07-17 11:39:07 +07:00
Nils Andreas Svee 9811592f13 feat(platform): introduce abstractions for cross-platform interface statistics and traffic control
Decouple the rate controller from Linux-specific Netlink calls to support other operating systems. This adds a macOS backend for interface statistics and an "observe-only" mode for platforms where traffic shaping is not yet implemented.
2026-07-17 11:35:43 +07:00
Nils Andreas Svee c5d673fcb8 build(uci): restrict UCI dependency and feature to Linux targets
Ensure the UCI integration is only compiled on Linux, as the underlying native dependency is platform-specific. Added a build script to warn users when the feature is enabled on unsupported platforms.
2026-07-17 01:43:10 +07:00
Nils Andreas Svee b56c8b72cc refactor(main): modularize main loop and improve resource cleanup logic 2026-07-14 22:53:01 +07:00
Nils Andreas Svee 8b0c37bc83 refactor: simplify control flow and error handling in metrics and netlink 2026-07-05 12:44:44 +07:00
Nils Andreas Svee 694cad1fac chore(deps): update wasm and web-related dependencies 2026-07-03 00:50:00 +07:00
Nils Andreas Svee 908fbfdf04 refactor(deps): cleanup netlink-bindings and shlex dependencies 2026-07-03 00:50:00 +07:00
Nils Andreas Svee 2dacde8a3f chore(deps): update cargo dependencies 2026-07-03 00:50:00 +07:00
renovate[bot] 371b3efcdc chore(deps): update rust crate anyhow to v1.0.103 2026-07-03 00:47:45 +07:00
renovate[bot] 81d6ebe3a8 chore(deps): update rust crate log to v0.4.33 2026-07-03 00:47:45 +07:00
renovate[bot] 8ccbd30582 chore(deps): update actions/checkout action to v7 2026-07-03 00:47:45 +07:00
renovate[bot] ae3cd96313 fix(deps): update netlink-socket2 digest to 0b609e9 2026-07-03 00:47:45 +07:00
renovate[bot] 3d1c14d312 fix(deps): update netlink-bindings digest to 0b609e9 2026-07-03 00:46:39 +07:00
renovate[bot] 7955046426 fix(deps): update rust-uci digest to 3e7b615 2026-07-03 00:46:39 +07:00
renovate[bot] 30e3281178 chore(deps): update google/osv-scanner-action action to v2.3.8 2026-07-03 00:46:39 +07:00
renovate[bot] f3f033cf0f chore(deps): update rust crate libc to v0.2.186 2026-07-03 00:46:39 +07:00
Nils Andreas Svee 4aaf8fa100 chore: add SPDX license identifiers and copyright headers to source files
Apply the MPL-2.0 license to all source files and include the full license text to ensure legal compliance and proper attribution.
2026-04-23 12:39:52 +07:00
Nils Andreas Svee dfa11be236 chore: add MPLv2.0 license
The original Lua sqm-autorate project is licensed under the MPLv2.0, and this project started life as a pure port of that. Thus our code should also be licensed under the MPL
2026-04-23 12:19:49 +07:00
Nils Andreas Svee 58d536bb22 refactor(pinger): replace hashlru with standard HashMap and manual TTL cleanup
Remove the hashlru dependency to reduce bloat, replacing it with a Mutex-wrapped HashMap and manual entry expiration logic.
2026-04-23 00:33:07 +07:00
Nils Andreas Svee 6f16f3a93c build(deps): disable default features for hashlru to reduce dependency bloat
Remove unused dependencies including ahash, hashbrown, and zerocopy by disabling default features for hashlru.
2026-04-23 00:19:00 +07:00
Nils Andreas Svee 1b959d52ed feat(main): Initialize and pass InFlightProbeCache to pinger threads 2026-04-23 00:16:19 +07:00