40 lines
904 B
Rust
40 lines
904 B
Rust
use std::collections::HashMap;
|
|
|
|
#[derive(Debug, Serialize, Deserialize)]
|
|
pub struct Config {
|
|
pub service: HashMap<String, ServiceConfig>,
|
|
}
|
|
|
|
#[derive(Debug, Serialize, Deserialize)]
|
|
pub struct ServiceConfig {
|
|
pub source: SourceConfig,
|
|
#[serde(default)]
|
|
pub domains: HashMap<String, DomainConfig>,
|
|
#[serde(default)]
|
|
pub auto_secrets: Vec<String>,
|
|
#[serde(default)]
|
|
pub environment: HashMap<String, String>,
|
|
#[serde(default)]
|
|
pub depends_on: Vec<String>,
|
|
#[serde(default)]
|
|
pub entry: Option<String>,
|
|
}
|
|
|
|
#[derive(Debug, Serialize, Deserialize)]
|
|
pub struct DomainConfig {
|
|
// The left-most component of the domain (must not collide with any other domains)
|
|
pub port: u16,
|
|
#[serde(default = "default_true")]
|
|
pub https: bool,
|
|
}
|
|
|
|
fn default_true() -> bool {
|
|
true
|
|
}
|
|
|
|
#[derive(Debug, Serialize, Deserialize)]
|
|
#[serde(untagged)]
|
|
pub enum SourceConfig {
|
|
Image { image: String },
|
|
}
|