Skip to content

Commit d502d60

Browse files
author
messica
committed
feat: 🎸 adapt clash config file
1 parent c418618 commit d502d60

File tree

2 files changed

+18
-18
lines changed

2 files changed

+18
-18
lines changed

src/clash/dns.rs

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,20 +3,20 @@ use serde::{Deserialize, Serialize};
33
#[derive(Serialize, Deserialize, Debug)]
44
#[serde(rename_all = "kebab-case")]
55
pub struct DNS {
6-
pub enable: bool,
7-
pub ipv6: bool,
8-
pub default_nameserver: Vec<String>,
9-
pub enhanced_mode: String,
10-
pub fake_ip_range: String,
11-
pub use_hosts: bool,
12-
pub nameserver: Vec<String>,
13-
pub fallback: Vec<String>,
14-
pub fallback_filter: FallbackFilter,
6+
pub enable: Option<bool>,
7+
pub ipv6: Option<bool>,
8+
pub default_nameserver: Option<Vec<String>>,
9+
pub enhanced_mode: Option<String>,
10+
pub fake_ip_range: Option<String>,
11+
pub use_hosts: Option<bool>,
12+
pub nameserver: Option<Vec<String>>,
13+
pub fallback: Option<Vec<String>>,
14+
pub fallback_filter: Option<FallbackFilter>,
1515
}
1616

1717
#[derive(Serialize, Deserialize, Debug)]
1818
pub struct FallbackFilter {
19-
pub geoip: bool,
19+
pub geoip: Option<bool>,
2020
#[serde(rename = "ipcidr")]
21-
pub ip_cidr: Vec<String>,
21+
pub ip_cidr: Option<Vec<String>>,
2222
}

src/clash/mod.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,13 @@ use serde::{Deserialize, Serialize};
77
#[derive(Serialize, Deserialize, Debug)]
88
#[serde(rename_all = "kebab-case")]
99
pub struct Config {
10-
pub mixed_port: u16,
11-
pub allow_lan: bool,
12-
pub bind_address: String,
13-
pub mode: Mode,
14-
pub log_level: LogLevel,
15-
pub external_controller: String,
16-
pub dns: dns::DNS,
10+
pub mixed_port: Option<u16>,
11+
pub allow_lan: Option<bool>,
12+
pub bind_address: Option<String>,
13+
pub mode: Option<Mode>,
14+
pub log_level: Option<LogLevel>,
15+
pub external_controller: Option<String>,
16+
pub dns: Option<dns::DNS>,
1717
pub proxies: Vec<proxy::Proxy>,
1818
pub proxy_groups: Vec<proxy_group::ProxyGroup>,
1919
pub rules: Vec<String>,

0 commit comments

Comments
 (0)