|
|
@ -1,16 +1,15 @@ |
|
|
|
|
|
|
|
#[derive(Debug, PartialEq, Serialize, Deserialize)]
|
|
|
|
pub struct ServerConfig {
|
|
|
|
pub host: Option<String>,
|
|
|
|
pub port: Option<i32>,
|
|
|
|
pub workers: Option<usize>
|
|
|
|
pub workers: Option<usize>,
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
#[derive(Debug, PartialEq, Serialize, Deserialize)]
|
|
|
|
pub struct CloudflareDomainConfig {
|
|
|
|
pub domain: String,
|
|
|
|
pub zone_id: String |
|
|
|
pub zone_id: String,
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -18,14 +17,14 @@ pub struct CloudflareDomainConfig { |
|
|
|
pub struct CloudflareConfig {
|
|
|
|
pub domains: Vec<CloudflareDomainConfig>,
|
|
|
|
pub key: String,
|
|
|
|
pub email: String |
|
|
|
pub email: String,
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
#[derive(Debug, PartialEq, Serialize, Deserialize)]
|
|
|
|
pub struct DDNSDomain {
|
|
|
|
pub domain: String,
|
|
|
|
pub subdomains: Vec<String>
|
|
|
|
pub subdomains: Vec<String>,
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -38,14 +37,14 @@ pub struct DDNSConfig { |
|
|
|
#[derive(Debug, PartialEq, Serialize, Deserialize)]
|
|
|
|
pub struct UserSubdomainConfig {
|
|
|
|
pub subdomain: String,
|
|
|
|
pub targets: Vec<String>
|
|
|
|
pub targets: Vec<String>,
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
#[derive(Debug, PartialEq, Serialize, Deserialize)]
|
|
|
|
pub struct UserDomainConfig {
|
|
|
|
pub domain: String,
|
|
|
|
pub subdomains: Vec<UserSubdomainConfig>
|
|
|
|
pub subdomains: Vec<UserSubdomainConfig>,
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -53,7 +52,7 @@ pub struct UserDomainConfig { |
|
|
|
pub struct UserConfig {
|
|
|
|
pub username: String,
|
|
|
|
pub token: String,
|
|
|
|
pub domains: Vec<UserDomainConfig>
|
|
|
|
pub domains: Vec<UserDomainConfig>,
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -62,5 +61,5 @@ pub struct Config { |
|
|
|
pub server: ServerConfig,
|
|
|
|
pub cloudflare: CloudflareConfig,
|
|
|
|
pub ddns: DDNSConfig,
|
|
|
|
pub users: Vec<UserConfig>
|
|
|
|
pub users: Vec<UserConfig>,
|
|
|
|
}
|