Skip to main content

tuwunel_admin/server/
mod.rs

1mod commands;
2
3use std::path::PathBuf;
4
5use clap::Subcommand;
6use tuwunel_core::Result;
7
8use crate::admin_command_dispatch;
9
10#[admin_command_dispatch]
11#[derive(Debug, Subcommand)]
12pub(super) enum ServerCommand {
13	/// - Time elapsed since startup
14	Uptime,
15
16	/// - Show configuration values
17	ShowConfig,
18
19	/// - Reload configuration values
20	ReloadConfig {
21		path: Option<PathBuf>,
22	},
23
24	/// - List the features built into the server
25	ListFeatures {
26		#[arg(short, long)]
27		available: bool,
28
29		#[arg(short, long)]
30		enabled: bool,
31
32		#[arg(short, long)]
33		comma: bool,
34	},
35
36	/// - Print database memory usage statistics
37	MemoryUsage,
38
39	/// - Clears all of Tuwunel's caches
40	ClearCaches,
41
42	/// - Performs an online backup of the database (only available for RocksDB
43	///   at the moment)
44	BackupDatabase,
45
46	/// - List database backups
47	ListBackups,
48
49	/// - Send a message to the admin room.
50	AdminNotice {
51		message: Vec<String>,
52	},
53
54	/// - Hot-reload the server
55	#[clap(alias = "reload")]
56	ReloadMods,
57
58	#[cfg(unix)]
59	/// - Restart the server
60	Restart {
61		#[arg(short, long)]
62		force: bool,
63	},
64
65	/// - Shutdown the server
66	Shutdown,
67}