First minimal commit

This commit is contained in:
namilsk 2026-03-14 19:15:14 +03:00
parent 7019867411
commit bc8bc0c2e4
No known key found for this signature in database
GPG key ID: 2B2F0A4D870B4F9F
10 changed files with 1051 additions and 1 deletions

33
src/config.rs Normal file
View file

@ -0,0 +1,33 @@
use serde::{Deserialize, Serialize};
#[derive(Deserialize, Serialize, Default)]
pub enum RunTypes {
#[default]
Tor,
I2P,
}
#[derive(Serialize, Deserialize)]
pub struct NSCConfig {
/// 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 NSCConfig {
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,
}
}
}