Commit Graph

1794 Commits

Author SHA1 Message Date
Alexey 79dc87894b Merge pull request #861 from ali-rajabpour/main
perf/deploy: optimize hot-path allocs (cut per-session ad_tag allocat…
2026-08-12 19:52:40 +03:00
ali_rajabpour 721b75c687 perf/deploy: optimize hot-path allocs (cut per-session ad_tag allocations), split metrics module, and add ENV config support
Three independent changes bundled here — performance, maintainability, and
deployment DX.

1. Hot-path Allocations (ad_tag caching):
Every middle-relay session was doing a hex::decode of the user's ad_tag (plus a fallback to the global one) on every single connection. That's two string allocations and two hex decodes per session for data that only changes on config reload. Moved the decoding into ProxyConfig load/hot-reload into a precomputed runtime_ad_tags cache (same #[serde(skip)] pattern as runtime_user_auth). The session path now does a single O(1) lookup via config.effective_ad_tag(&user). Falls back to on-demand decode if the cache isn't built (e.g. in tests), so existing behavior is preserved. This eliminates two useless allocations and hex decodes per connection.

2. Metrics Monolith Split(structural refactor):
Broke up the massive 4,200-line `metrics.rs` into a proper `metrics/` directory module (`mod.rs`, `tls_front.rs`, `tests.rs`). I isolated the giant `render_metrics` function into its own `render.rs` file. This was a purely structural move—no locks or function bodies were changed, keeping things build-safe while making the crate significantly easier to navigate. The /metrics endpoint output is byte-identical.

3. GitOps / Dokploy Auto-Deployment Support (deployment DX):
Added `figment` to `Cargo.toml` to seamlessly merge TOML config files with Environment Variables. You can now configure the proxy entirely using `TELEMT_` prefixed ENV variables (e.g., `TELEMT_GENERAL__PORT=443`) without needing to manually mount a physical `config.toml` via Docker volumes. The Dockerfile and compose setups now gracefully handle missing config files by generating an empty placeholder, making stateless auto-deployments on platforms like Dokploy frictionless.
2026-08-03 18:41:24 +04:00
Alexey d851200e47 Merge pull request #883 from telemt/flow/3.4.25
Flow/3.4.25
3.4.25
2026-07-20 10:36:20 +03:00
Alexey a5216d77fb Rustfmt 2026-07-19 18:41:23 +03:00
Alexey 5b5cd952c8 Bump -> 3.4.25 2026-07-19 18:36:04 +03:00
Alexey a40578b278 Merge pull request #882 from telemt/flow-runtime-reload
In-Runtime Reload
2026-07-19 17:26:43 +03:00
Alexey bd99493622 Merge pull request #881 from astronaut808/feature/handshake-stage-accounting
add handshake failure stage accounting
2026-07-19 17:20:28 +03:00
Alexey d862deebb2 Fix handshake stage attribution and bound counters
Co-Authored-By: brekotis <93345790+brekotis@users.noreply.github.com>
2026-07-19 17:20:18 +03:00
Alexey 0d869d716c Merge branch 'flow-runtime-reload' into feature/handshake-stage-accounting 2026-07-19 17:18:18 +03:00
Alexey 1e85b91ad3 LCOV artifact for pull request + manual start
Co-Authored-By: brekotis <93345790+brekotis@users.noreply.github.com>
2026-07-19 16:11:31 +03:00
Alexey 4679bdcfd5 Atomic Maestro Sessions + Shutdown gate
Co-Authored-By: brekotis <93345790+brekotis@users.noreply.github.com>
2026-07-19 16:10:42 +03:00
astronaut808 7291c3192c docs handshake failure stage diagnostics 2026-07-18 21:25:40 +05:00
astronaut808 4a5dc0b21b add handshake failure stage accounting 2026-07-18 20:46:00 +05:00
Alexey fabd98ce89 Cfg Test for handle_bad_client 2026-07-18 14:31:43 +03:00
Alexey 7df3dab5e8 Update API.md
Co-Authored-By: brekotis <93345790+brekotis@users.noreply.github.com>
2026-07-18 14:30:03 +03:00
Alexey c6f40e3717 Harden Maestro reload lifecycle and readiness barriers
Co-Authored-By: brekotis <93345790+brekotis@users.noreply.github.com>
2026-07-18 14:27:24 +03:00
Alexey 91e05265be Docs for API In-Proccess Reload
Co-Authored-By: brekotis <93345790+brekotis@users.noreply.github.com>
2026-07-17 23:56:42 +03:00
Alexey 991d5b2c38 Maestro: add in-process runtime generation reload
Co-Authored-By: brekotis <93345790+brekotis@users.noreply.github.com>
2026-07-17 23:56:00 +03:00
Alexey 1f9c82c924 Merge pull request #875 from telemt/flow-aescr
Bound ME writer queues by resident payload bytes + Enable expanded AES key schedule zeroization
3.4.24
2026-07-14 22:31:27 +03:00
Alexey 73afeccae1 Rustfmt 2026-07-13 12:20:24 +03:00
Alexey feb51cbf57 Fix RustCrypto zeroize feature wiring 2026-07-12 09:27:15 +03:00
Alexey 8c65cd868c Enable expanded AES key schedule zeroization
Co-Authored-By: brekotis <93345790+brekotis@users.noreply.github.com>
2026-07-11 21:43:01 +03:00
Alexey ea296bbdc8 Replace per-session pool trimming with pressure hysteresis
Co-Authored-By: brekotis <93345790+brekotis@users.noreply.github.com>
2026-07-11 21:36:01 +03:00
Alexey fb042f826e Optimize crypto and Fake-TLS buffer residency
Co-Authored-By: brekotis <93345790+brekotis@users.noreply.github.com>
2026-07-11 21:22:17 +03:00
Alexey 96425f15c8 Bound Direct relay buffers with an adaptive global memory envelope
Co-Authored-By: brekotis <93345790+brekotis@users.noreply.github.com>
2026-07-11 20:56:54 +03:00
Alexey d4c4980e5a Bound ME writer queues by resident payload bytes
Co-Authored-By: brekotis <93345790+brekotis@users.noreply.github.com>
2026-07-11 18:43:42 +03:00
Alexey 893ce0cf36 Hold C2ME byte permits through ME writer completion
Co-Authored-By: brekotis <93345790+brekotis@users.noreply.github.com>
2026-07-10 16:35:39 +03:00
Alexey 2ac93c6d49 Update Cargo.lock 3.4.23 2026-07-10 11:47:09 +03:00
Alexey a51e58009b Update Cargo.toml 2026-07-10 11:46:33 +03:00
Alexey d523406c0a Merge pull request #869 from telemt/flow
Regression coverage + Synlimit netfilter rules per-target + CidrRateLimitKey with IpNetwork + Telemt-Referenz der Konfigurationsparameter
2026-07-10 11:39:22 +03:00
Alexey 5b3ad0096b Create CONFIG_PARAMS.de.md 2026-07-09 22:42:07 +03:00
Alexey b587fdbf94 Update CONFIG_PARAMS.ru.md 2026-07-08 20:52:26 +03:00
Alexey 77a45e509a Update CONFIG_PARAMS.en.md 2026-07-07 22:46:03 +03:00
Alexey b8be805aed Rustfmt 2026-07-06 20:12:36 +03:00
Alexey a1ebd44cee Update load_basic_tests.rs 2026-07-05 19:58:37 +03:00
Alexey 25d02a8e0e Update traffic_limiter.rs 2026-07-04 15:45:51 +03:00
Alexey 3375017460 Add the new key to the hot-reload snapshot type 2026-07-04 13:11:08 +03:00
Alexey 25e0abae8a Validate duplicate normalized auto-templates 2026-07-04 12:35:22 +03:00
Alexey 50538d234e CidrRateLimitKey with IpNetwork parsing and serialization added 2026-07-04 10:54:55 +03:00
Alexey e3a7be6786 Update CONTRIBUTING.md 2026-07-03 23:39:46 +03:00
Alexey 3fc2877205 Reset ports configuration in merge docker-compose file: merge pull request #866 from dvrass/patch-1
Reset ports configuration in merge docker-compose file
2026-07-03 23:34:04 +03:00
Alexey cd1dc2f4c9 Update docker-compose.host-netfilter.yml 2026-07-03 23:32:30 +03:00
Alexey 451227da60 Namespace synlimit netfilter rules per target set
Co-Authored-By: brekotis <93345790+brekotis@users.noreply.github.com>
2026-07-01 01:47:14 +03:00
dvrass f55d8479e3 Reset ports configuration in merge docker-compose file
Reset ports configuration in docker-compose file for network_mode:host
2026-06-30 13:23:56 +03:00
Alexey 81ae483201 Add regression coverage for ME routing, D2C padding, synlimit, and MSS bulk validation
Co-Authored-By: brekotis <93345790+brekotis@users.noreply.github.com>
2026-06-30 13:13:11 +03:00
Alexey ed1895d6df Merge pull request #865 from telemt/flow
Secure + VersionD Outbound Paddings Fix
3.4.22
2026-06-29 17:37:13 +03:00
Alexey 88d161a5e9 Bump -> 3.4.22 2026-06-29 16:38:09 +03:00
Alexey a0ac108807 Secure + VersionD Outbound Paddings Fix 2026-06-29 13:56:16 +03:00
Alexey 809352fac5 Merge pull request #864 from telemt/flow
Restore ME writer source IP for initial proxy request binding
3.4.21
2026-06-29 12:51:04 +03:00
Alexey 22627b498d Bump -> 3.4.21 2026-06-29 12:44:03 +03:00