mirror of
https://github.com/speatzle/nfsense.git
synced 2025-05-14 12:08:22 +00:00
34 lines
916 B
Rust
34 lines
916 B
Rust
use serde::{Deserialize, Serialize};
|
|
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: Vec<WireguardInterface>,
|
|
pub peers: Vec<WireguardPeer>,
|
|
}
|
|
|
|
#[derive(Serialize, Deserialize, Clone, Validate, Debug)]
|
|
pub struct WireguardInterface {
|
|
pub name: String,
|
|
pub public_key: String,
|
|
pub private_key: String,
|
|
pub listen_port: u64,
|
|
pub peers: Vec<String>,
|
|
pub comment: String,
|
|
}
|
|
|
|
#[derive(Serialize, Deserialize, Clone, Validate, Debug)]
|
|
pub struct WireguardPeer {
|
|
pub name: String,
|
|
pub public_key: String,
|
|
pub preshared_key: Option<String>,
|
|
pub allowed_ips: Vec<String>,
|
|
pub endpoint: Option<String>,
|
|
pub persistent_keepalive: Option<u64>,
|
|
pub comment: String,
|
|
}
|