runbound 0.4.2

RFC-compliant DNS resolver — drop-in Unbound with REST API, ACME auto-TLS, HMAC audit log, and master/slave HA
1
2
3
4
5
6
7
8
9
10
11
12
13
// SPDX-License-Identifier: AGPL-3.0-or-later
// Copyright (C) 2024-2026 RedLemonBe — https://github.com/redlemonbe/Runbound
// Global runtime state initialized once at startup.
// BASE_DIR is derived from the config file's parent directory.

use std::path::{Path, PathBuf};
use std::sync::OnceLock;

pub static BASE_DIR: OnceLock<PathBuf> = OnceLock::new();

pub fn base_dir() -> &'static Path {
    BASE_DIR.get().expect("BASE_DIR not initialized before use")
}