aboutsummaryrefslogtreecommitdiff
path: root/src/config.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/config.rs')
-rw-r--r--src/config.rs12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/config.rs b/src/config.rs
index ccdb042..08db0eb 100644
--- a/src/config.rs
+++ b/src/config.rs
@@ -20,11 +20,20 @@ pub struct Source {
#[serde(deny_unknown_fields)]
#[derive(serde_derive::Serialize, serde_derive::Deserialize, Clone, PartialEq, Eq, Debug)]
+pub struct Peer {
+ pub source: Option<String>,
+ pub psk: Option<Key>,
+}
+
+#[serde(deny_unknown_fields)]
+#[derive(serde_derive::Serialize, serde_derive::Deserialize, Clone, PartialEq, Eq, Debug)]
pub struct GlobalConfig {
#[serde(default = "default_min_keepalive")]
pub min_keepalive: u32,
#[serde(default = "default_max_keepalive")]
pub max_keepalive: u32,
+ #[serde(rename = "peer")]
+ pub peers: HashMap<Key, Peer>,
}
impl Default for GlobalConfig {
@@ -33,6 +42,7 @@ impl Default for GlobalConfig {
Self {
min_keepalive: default_min_keepalive(),
max_keepalive: default_max_keepalive(),
+ peers: HashMap::new(),
}
}
}
@@ -72,7 +82,7 @@ impl Default for UpdaterConfig {
#[serde(deny_unknown_fields)]
#[derive(serde_derive::Serialize, serde_derive::Deserialize, Default, Clone, Debug)]
pub struct Config {
- pub runtime_directory: Option<PathBuf>,
+ pub state_directory: Option<PathBuf>,
#[serde(flatten)]
pub global: GlobalConfig,