UX: Remove dummy examples and emojis from CLI output to enforce professional strict templates

This commit is contained in:
ospab 2026-05-15 00:15:54 +03:00
parent a773422495
commit f1b8bfac42
1 changed files with 18 additions and 35 deletions

View File

@ -149,25 +149,14 @@ async fn main() -> Result<()> {
mode: AppMode::Server(ServerConfig { mode: AppMode::Server(ServerConfig {
listen: "0.0.0.0:50000".to_string(), listen: "0.0.0.0:50000".to_string(),
access_keys: vec![generate_secure_key("hex")], access_keys: vec![generate_secure_key("hex")],
turn_server: Some("turn.example.com:3478".to_string()), turn_server: None,
debug: Some(false), debug: Some(false),
outbound: Some(OutboundConfig { outbound: Some(OutboundConfig {
enabled: false, enabled: false,
protocol: "socks5".to_string(), protocol: "".to_string(),
address: "127.0.0.1".to_string(), address: "".to_string(),
port: 1080, port: 0,
rules: vec![ rules: Vec::new(),
OutboundRule {
domain_suffix: Some(vec!["google.com".to_string(), "github.com".to_string()]),
ip_cidr: Some(vec!["8.8.8.8/32".to_string()]),
action: Some("proxy".to_string()),
},
OutboundRule {
domain_suffix: Some(vec!["lan".to_string(), "local".to_string()]),
ip_cidr: Some(vec!["192.168.0.0/16".to_string()]),
action: Some("direct".to_string()),
}
],
default_action: Some("direct".to_string()), default_action: Some("direct".to_string()),
}), }),
}), }),
@ -176,48 +165,42 @@ async fn main() -> Result<()> {
UnifiedConfig { UnifiedConfig {
log_level: Some("info".to_string()), log_level: Some("info".to_string()),
mode: AppMode::Client(ClientConfig { mode: AppMode::Client(ClientConfig {
server: "YOUR_SERVER_IP_HERE:50000".to_string(), server: "127.0.0.1:50000".to_string(),
access_key: generate_secure_key("hex"), access_key: generate_secure_key("hex"),
socks5_bind: Some("127.0.0.1:1088".to_string()), socks5_bind: Some("127.0.0.1:1088".to_string()),
tun: Some(TunConfig { tun: Some(TunConfig {
enable: false, enable: false,
wintun_path: Some("./wintun.dll".to_string()), wintun_path: None,
ipv4_address: Some("10.1.0.2/24".to_string()), ipv4_address: None,
}),
turn: Some(TurnConfigRaw {
enabled: false,
server_addr: "turn.example.com:3478".to_string(),
username: Some("demo_user".to_string()),
access_key: Some("demo_pass".to_string()),
}), }),
turn: None,
debug: Some(false), debug: Some(false),
exclude: Some(ExcludeConfig { exclude: Some(ExcludeConfig {
domains: Some(vec!["localhost".to_string(), "lan".to_string()]), domains: Some(Vec::new()),
ips: Some(vec!["127.0.0.1/32".to_string(), "192.168.0.0/16".to_string()]), ips: Some(Vec::new()),
processes: Some(vec!["chrome.exe".to_string()]), processes: Some(Vec::new()),
}), }),
mux: Some(MuxConfig { mux: Some(MuxConfig {
enabled: Some(true), enabled: Some(false),
sessions: Some(4), sessions: Some(1),
}), }),
}), }),
} }
}; };
fs::write(&args.config, serde_json::to_string_pretty(&dummy)?)?; fs::write(&args.config, serde_json::to_string_pretty(&dummy)?)?;
println!("🚀 Successfully initialized MODERN configuration schema at {:?}", args.config); println!("Successfully initialized configuration at {:?}", args.config);
println!("💡 Open the file to customize outbound rules, exclusions, and credentials.");
return Ok(()); return Ok(());
} }
// Validate config file existence // Validate config file existence
if !args.config.exists() { if !args.config.exists() {
anyhow::bail!( anyhow::bail!(
"Configuration file {:?} not found.\n\n\ "Configuration file {:?} not found.\n\n\
👉 To generate a complete production configuration template, run:\n\ To generate a default configuration template, run:\n\
\t./ostp --init server\n\ \t./ostp --init server\n\
\tor\n\ \tor\n\
\t./ostp --init client\n\n\ \t./ostp --init client\n\n\
👉 Or specify a custom configuration file path using:\n\ Or specify a custom configuration file path using:\n\
\t./ostp --config /path/to/your_config.json", \t./ostp --config /path/to/your_config.json",
args.config args.config
); );