33 lines
728 B
Rust
33 lines
728 B
Rust
use serde::{Deserialize, Serialize};
|
|
|
|
#[derive(Deserialize, Serialize, Default)]
|
|
pub enum RunTypes {
|
|
#[default]
|
|
Tor,
|
|
I2P,
|
|
}
|
|
|
|
#[derive(Serialize, Deserialize)]
|
|
pub struct Config {
|
|
/// Paths to v2ray `geosite.dat', `geoip.dat`
|
|
pub geo_files: [String; 2],
|
|
/// Routing settings similar to v2ray
|
|
pub routing: String,
|
|
/// TOR/I2P Proxies
|
|
pub mode: RunTypes,
|
|
}
|
|
|
|
impl Default for Config {
|
|
fn default() -> Self {
|
|
Self {
|
|
geo_files: [
|
|
String::from("/etc/nsc/data/geoip.dat"),
|
|
String::from("/etc/nsc/data/geosite.dat"),
|
|
],
|
|
routing: String::from("/etc/nsc/routing.toml"),
|
|
mode: RunTypes::Tor,
|
|
}
|
|
}
|
|
}
|
|
|
|
|