mirror of
https://github.com/YGGverse/aquatic.git
synced 2026-03-31 17:55:36 +00:00
aquatic_ws: use PrivilegeConfig from aquatic_common
This commit is contained in:
parent
d6d5cc78b7
commit
30fa96a7f4
1 changed files with 1 additions and 22 deletions
|
|
@ -1,6 +1,6 @@
|
||||||
use std::net::SocketAddr;
|
use std::net::SocketAddr;
|
||||||
|
|
||||||
use aquatic_common::access_list::AccessListConfig;
|
use aquatic_common::{access_list::AccessListConfig, privileges::PrivilegeConfig};
|
||||||
use serde::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
|
|
||||||
use aquatic_cli_helpers::LogLevel;
|
use aquatic_cli_helpers::LogLevel;
|
||||||
|
|
@ -84,17 +84,6 @@ pub struct StatisticsConfig {
|
||||||
pub interval: u64,
|
pub interval: u64,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Clone, Debug, Serialize, Deserialize)]
|
|
||||||
#[serde(default)]
|
|
||||||
pub struct PrivilegeConfig {
|
|
||||||
/// Chroot and switch user after binding to sockets
|
|
||||||
pub drop_privileges: bool,
|
|
||||||
/// Chroot to this path
|
|
||||||
pub chroot_path: String,
|
|
||||||
/// User to switch to after chrooting
|
|
||||||
pub user: String,
|
|
||||||
}
|
|
||||||
|
|
||||||
impl Default for Config {
|
impl Default for Config {
|
||||||
fn default() -> Self {
|
fn default() -> Self {
|
||||||
Self {
|
Self {
|
||||||
|
|
@ -162,13 +151,3 @@ impl Default for StatisticsConfig {
|
||||||
Self { interval: 0 }
|
Self { interval: 0 }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Default for PrivilegeConfig {
|
|
||||||
fn default() -> Self {
|
|
||||||
Self {
|
|
||||||
drop_privileges: false,
|
|
||||||
chroot_path: ".".to_string(),
|
|
||||||
user: "nobody".to_string(),
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue