summaryrefslogtreecommitdiff
path: root/src/config.rs
blob: 846a1b52b6454a5bb94f2f169f7d41805e9c4801 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
use serde::{Deserialize, Serialize};

#[derive(Deserialize, Serialize, Default)]
pub enum RunTypes {
    #[default]
    Tor,
    I2P,
}

#[derive(Serialize, Deserialize)]
pub struct Config {
    /// Paths to `geosite.dat', `geolite2.mmdb`
    pub geo_files: [String; 2],
    /// Routing settings similar to v2ray
    pub routing: String,
    /// TOR/I2P Proxies
    pub mode: RunTypes,
}

// TODO: Think how to add other anonymisers 
// Like VPN on localhost:10808 
// it can be like: 
// ```toml 
// [[proxy]]
// name = "VPN" 
// addr = "127.0.0.1:10808" 
// type = "SOCKS5" # ... 
// ```

impl Default for Config {
    fn default() -> Self {
        Self {
            geo_files: [
                String::from("/etc/nsc/data/geolite2.mmdb"),
                String::from("/etc/nsc/data/geosite.dat"),
            ],
            routing: String::from("/etc/nsc/routing.toml"),
            mode: RunTypes::Tor,
        }
    }
}