Intermediate commit fo DNS Challenge

This commit is contained in:
Ara Sadoyan
2026-10-03 10:56:47 +02:00
parent 91d2d414a3
commit 3bc398610b
16 changed files with 238 additions and 28 deletions
+2 -1
View File
@@ -1,8 +1,8 @@
use dashmap::DashMap;
use moka::sync::Cache;
use pingora_cache::MemCache;
use pingora_cache::eviction::simple_lru::Manager;
use pingora_cache::lock::CacheLock;
use pingora_cache::MemCache;
use pingora_limits::rate::Rate;
use std::collections::HashMap;
use std::net::IpAddr;
@@ -19,3 +19,4 @@ pub static CACHE_LOCK: LazyLock<CacheLock> = LazyLock::new(|| CacheLock::new(Dur
pub static EVICTION: OnceLock<Manager> = OnceLock::new();
pub static CACHE_TTL: OnceLock<u64> = OnceLock::new();
pub static CHALLENGES: LazyLock<RwLock<HashMap<String, String>>> = LazyLock::new(|| RwLock::new(HashMap::new()));
pub static DOMAINS: LazyLock<DashMap<String, bool>> = LazyLock::new(DashMap::new);
+2 -4
View File
@@ -1,5 +1,5 @@
use crate::utils::healthcheck;
use crate::utils::lazylock::REVERSE_STORE;
use crate::utils::lazylock::{DOMAINS, REVERSE_STORE};
use crate::utils::state::{is_first_run, mark_not_first_run};
use crate::utils::tools::{clone_dashmap, clone_dashmap_into, print_upstreams};
use crate::utils::types::*;
@@ -7,12 +7,10 @@ use dashmap::DashMap;
use log::{error, info, warn};
use std::collections::HashMap;
use std::path::Path;
use std::sync::Arc;
use std::sync::atomic::AtomicUsize;
use std::sync::{Arc, LazyLock};
use std::{env, fs};
pub static DOMAINS: LazyLock<DashMap<String, bool>> = LazyLock::new(DashMap::new);
pub async fn load_configuration(d: &str, kind: &str) -> (Option<Configuration>, String) {
let mut conf_files = Vec::new();
let yaml_data = match kind {
+1
View File
@@ -134,6 +134,7 @@ pub struct AppConfig {
pub log_file: Option<String>,
pub log_pattern: Option<String>,
pub log_structured: Option<String>,
pub acme_dns_provider: Option<String>,
pub tcp_keepalive_idle: Option<u64>,
pub tcp_keepalive_interval: Option<u64>,
pub tcp_keepalive_count: Option<usize>,