use serde::{Deserialize, Serialize}; use std::collections::HashMap; use validator::Validate; #[derive(Serialize, Deserialize, Clone, Validate, Default, Debug)] pub struct VPN { pub wireguard: Wireguard, } #[derive(Serialize, Deserialize, Clone, Validate, Default, Debug)] pub struct Wireguard { pub interfaces: HashMap, pub peers: HashMap, } #[derive(Serialize, Deserialize, Clone, Validate, Debug)] pub struct WireguardInterface { pub public_key: String, pub private_key: String, pub listen_port: u64, pub peers: Vec, pub comment: String, } #[derive(Serialize, Deserialize, Clone, Validate, Debug)] pub struct WireguardPeer { pub public_key: String, pub preshared_key: Option, pub allowed_ips: Vec, pub endpoint: Option, pub persistent_keepalive: Option, pub comment: String, }