mirror of
https://github.com/telemt/telemt.git
synced 2026-04-18 19:14:09 +03:00
Rustfmt + Bump
This commit is contained in:
2
Cargo.lock
generated
2
Cargo.lock
generated
@@ -2780,7 +2780,7 @@ checksum = "7b2093cf4c8eb1e67749a6762251bc9cd836b6fc171623bd0a9d324d37af2417"
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "telemt"
|
name = "telemt"
|
||||||
version = "3.4.2"
|
version = "3.4.3"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"aes",
|
"aes",
|
||||||
"anyhow",
|
"anyhow",
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "telemt"
|
name = "telemt"
|
||||||
version = "3.4.2"
|
version = "3.4.3"
|
||||||
edition = "2024"
|
edition = "2024"
|
||||||
|
|
||||||
[features]
|
[features]
|
||||||
|
|||||||
@@ -41,8 +41,8 @@ use config_store::{current_revision, load_config_from_disk, parse_if_match};
|
|||||||
use events::ApiEventStore;
|
use events::ApiEventStore;
|
||||||
use http_utils::{error_response, read_json, read_optional_json, success_response};
|
use http_utils::{error_response, read_json, read_optional_json, success_response};
|
||||||
use model::{
|
use model::{
|
||||||
ApiFailure, CreateUserRequest, DeleteUserResponse, HealthData, HealthReadyData, PatchUserRequest,
|
ApiFailure, CreateUserRequest, DeleteUserResponse, HealthData, HealthReadyData,
|
||||||
RotateSecretRequest, SummaryData, UserActiveIps,
|
PatchUserRequest, RotateSecretRequest, SummaryData, UserActiveIps,
|
||||||
};
|
};
|
||||||
use runtime_edge::{
|
use runtime_edge::{
|
||||||
EdgeConnectionsCacheEntry, build_runtime_connections_summary_data,
|
EdgeConnectionsCacheEntry, build_runtime_connections_summary_data,
|
||||||
|
|||||||
@@ -1903,7 +1903,11 @@ mod tests {
|
|||||||
[access]
|
[access]
|
||||||
"#,
|
"#,
|
||||||
);
|
);
|
||||||
assert!(!cfg.server.conntrack_control.inline_conntrack_control_explicit);
|
assert!(
|
||||||
|
!cfg.server
|
||||||
|
.conntrack_control
|
||||||
|
.inline_conntrack_control_explicit
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
@@ -1918,7 +1922,11 @@ mod tests {
|
|||||||
[access]
|
[access]
|
||||||
"#,
|
"#,
|
||||||
);
|
);
|
||||||
assert!(cfg.server.conntrack_control.inline_conntrack_control_explicit);
|
assert!(
|
||||||
|
cfg.server
|
||||||
|
.conntrack_control
|
||||||
|
.inline_conntrack_control_explicit
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
|
|||||||
@@ -72,7 +72,12 @@ pub(crate) fn spawn_conntrack_controller(
|
|||||||
stats.set_conntrack_rule_apply_ok(false);
|
stats.set_conntrack_rule_apply_ok(false);
|
||||||
shared.disable_conntrack_close_sender();
|
shared.disable_conntrack_close_sender();
|
||||||
shared.set_conntrack_pressure_active(false);
|
shared.set_conntrack_pressure_active(false);
|
||||||
if enabled && cfg.server.conntrack_control.inline_conntrack_control_explicit {
|
if enabled
|
||||||
|
&& cfg
|
||||||
|
.server
|
||||||
|
.conntrack_control
|
||||||
|
.inline_conntrack_control_explicit
|
||||||
|
{
|
||||||
warn!(
|
warn!(
|
||||||
"conntrack control explicitly enabled but unsupported on this OS; disabling runtime worker"
|
"conntrack control explicitly enabled but unsupported on this OS; disabling runtime worker"
|
||||||
);
|
);
|
||||||
@@ -187,7 +192,13 @@ fn apply_runtime_state(
|
|||||||
) {
|
) {
|
||||||
let enabled = cfg.server.conntrack_control.inline_conntrack_control;
|
let enabled = cfg.server.conntrack_control.inline_conntrack_control;
|
||||||
let available = effective_conntrack_enabled(cfg, runtime_support);
|
let available = effective_conntrack_enabled(cfg, runtime_support);
|
||||||
if enabled && !available && cfg.server.conntrack_control.inline_conntrack_control_explicit {
|
if enabled
|
||||||
|
&& !available
|
||||||
|
&& cfg
|
||||||
|
.server
|
||||||
|
.conntrack_control
|
||||||
|
.inline_conntrack_control_explicit
|
||||||
|
{
|
||||||
warn!(
|
warn!(
|
||||||
has_cap_net_admin = runtime_support.has_cap_net_admin,
|
has_cap_net_admin = runtime_support.has_cap_net_admin,
|
||||||
backend_available = runtime_support.netfilter_backend.is_some(),
|
backend_available = runtime_support.netfilter_backend.is_some(),
|
||||||
@@ -297,7 +308,11 @@ fn update_pressure_state(
|
|||||||
state.low_streak = 0;
|
state.low_streak = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
async fn reconcile_rules(cfg: &ProxyConfig, runtime_support: ConntrackRuntimeSupport, stats: &Stats) {
|
async fn reconcile_rules(
|
||||||
|
cfg: &ProxyConfig,
|
||||||
|
runtime_support: ConntrackRuntimeSupport,
|
||||||
|
stats: &Stats,
|
||||||
|
) {
|
||||||
if !cfg.server.conntrack_control.inline_conntrack_control {
|
if !cfg.server.conntrack_control.inline_conntrack_control {
|
||||||
clear_notrack_rules_all_backends().await;
|
clear_notrack_rules_all_backends().await;
|
||||||
stats.set_conntrack_rule_apply_ok(true);
|
stats.set_conntrack_rule_apply_ok(true);
|
||||||
@@ -335,7 +350,10 @@ fn probe_runtime_support(configured_backend: ConntrackBackend) -> ConntrackRunti
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn effective_conntrack_enabled(cfg: &ProxyConfig, runtime_support: ConntrackRuntimeSupport) -> bool {
|
fn effective_conntrack_enabled(
|
||||||
|
cfg: &ProxyConfig,
|
||||||
|
runtime_support: ConntrackRuntimeSupport,
|
||||||
|
) -> bool {
|
||||||
cfg.server.conntrack_control.inline_conntrack_control
|
cfg.server.conntrack_control.inline_conntrack_control
|
||||||
&& runtime_support.has_cap_net_admin
|
&& runtime_support.has_cap_net_admin
|
||||||
&& runtime_support.netfilter_backend.is_some()
|
&& runtime_support.netfilter_backend.is_some()
|
||||||
@@ -758,7 +776,14 @@ mod tests {
|
|||||||
accept_timeout_delta: 0,
|
accept_timeout_delta: 0,
|
||||||
me_queue_pressure_delta: 0,
|
me_queue_pressure_delta: 0,
|
||||||
};
|
};
|
||||||
update_pressure_state(&stats, shared.as_ref(), &cfg, true, &high_sample, &mut state);
|
update_pressure_state(
|
||||||
|
&stats,
|
||||||
|
shared.as_ref(),
|
||||||
|
&cfg,
|
||||||
|
true,
|
||||||
|
&high_sample,
|
||||||
|
&mut state,
|
||||||
|
);
|
||||||
assert!(state.active);
|
assert!(state.active);
|
||||||
|
|
||||||
let low_sample = PressureSample {
|
let low_sample = PressureSample {
|
||||||
|
|||||||
@@ -111,7 +111,10 @@ fn probe_target(listen: SocketAddr) -> SocketAddr {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fn build_request(target: SocketAddr, path: &str, auth_header: &str) -> String {
|
fn build_request(target: SocketAddr, path: &str, auth_header: &str) -> String {
|
||||||
let mut request = format!("GET {path} HTTP/1.1\r\nHost: {}\r\nConnection: close\r\n", target);
|
let mut request = format!(
|
||||||
|
"GET {path} HTTP/1.1\r\nHost: {}\r\nConnection: close\r\n",
|
||||||
|
target
|
||||||
|
);
|
||||||
if !auth_header.is_empty() {
|
if !auth_header.is_empty() {
|
||||||
request.push_str("Authorization: ");
|
request.push_str("Authorization: ");
|
||||||
request.push_str(auth_header);
|
request.push_str(auth_header);
|
||||||
|
|||||||
Reference in New Issue
Block a user