First minimal commit
This commit is contained in:
parent
7019867411
commit
bc8bc0c2e4
10 changed files with 1051 additions and 1 deletions
33
src/config.rs
Normal file
33
src/config.rs
Normal 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,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue