mirror of
https://github.com/telemt/telemt.git
synced 2026-10-30 04:20:31 +03:00
Runtime Ownership hardened
Co-Authored-By: brekotis <93345790+brekotis@users.noreply.github.com>
This commit is contained in:
@@ -161,6 +161,7 @@ const GENERAL_CONFIG_KEYS: &[&str] = &[
|
||||
"proxy_secret_auto_reload_secs",
|
||||
"proxy_config_auto_reload_secs",
|
||||
"me_reinit_singleflight",
|
||||
"me_reinit_max_concurrency",
|
||||
"me_reinit_trigger_channel",
|
||||
"me_reinit_coalesce_window_ms",
|
||||
"me_deterministic_writer_sort",
|
||||
|
||||
@@ -143,9 +143,15 @@ pub(super) fn validate(config: &mut ProxyConfig) -> Result<()> {
|
||||
));
|
||||
}
|
||||
|
||||
if config.general.me_reinit_trigger_channel == 0 {
|
||||
if !(1..=8).contains(&config.general.me_reinit_max_concurrency) {
|
||||
return Err(ProxyError::Config(
|
||||
"general.me_reinit_trigger_channel must be > 0".to_string(),
|
||||
"general.me_reinit_max_concurrency must be within [1, 8]".to_string(),
|
||||
));
|
||||
}
|
||||
|
||||
if !(1..=4096).contains(&config.general.me_reinit_trigger_channel) {
|
||||
return Err(ProxyError::Config(
|
||||
"general.me_reinit_trigger_channel must be within [1, 4096]".to_string(),
|
||||
));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user