add service management CLI, log path in dashboard footer
- numa service start/stop/status commands (launchd + systemd) - Dashboard footer shows log paths (macOS + Linux) and GitHub link - Help text updated with all service commands Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -838,5 +838,11 @@ async function allowDomain(domain) {
|
|||||||
refresh();
|
refresh();
|
||||||
setInterval(refresh, 2000);
|
setInterval(refresh, 2000);
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
<div style="text-align:center;padding:0.8rem;font-family:var(--font-mono);font-size:0.68rem;color:var(--text-dim);">
|
||||||
|
Logs: <span id="logPath" style="user-select:all;">macOS: /usr/local/var/log/numa.log · Linux: journalctl -u numa -f</span>
|
||||||
|
· <a href="https://github.com/razvandimescu/numa" target="_blank" rel="noopener" style="color:var(--amber);text-decoration:none;">GitHub</a>
|
||||||
|
</div>
|
||||||
|
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|||||||
21
src/main.rs
21
src/main.rs
@@ -13,7 +13,10 @@ use numa::ctx::{handle_query, ServerCtx};
|
|||||||
use numa::override_store::OverrideStore;
|
use numa::override_store::OverrideStore;
|
||||||
use numa::query_log::QueryLog;
|
use numa::query_log::QueryLog;
|
||||||
use numa::stats::ServerStats;
|
use numa::stats::ServerStats;
|
||||||
use numa::system_dns::{discover_forwarding_rules, install_system_dns, uninstall_system_dns};
|
use numa::system_dns::{
|
||||||
|
discover_forwarding_rules, install_service, install_system_dns, service_status,
|
||||||
|
uninstall_service, uninstall_system_dns,
|
||||||
|
};
|
||||||
|
|
||||||
#[tokio::main]
|
#[tokio::main]
|
||||||
async fn main() -> numa::Result<()> {
|
async fn main() -> numa::Result<()> {
|
||||||
@@ -32,6 +35,19 @@ async fn main() -> numa::Result<()> {
|
|||||||
eprintln!("\x1b[1;38;2;192;98;58mNuma\x1b[0m — restoring system DNS\n");
|
eprintln!("\x1b[1;38;2;192;98;58mNuma\x1b[0m — restoring system DNS\n");
|
||||||
return uninstall_system_dns().map_err(|e| e.into());
|
return uninstall_system_dns().map_err(|e| e.into());
|
||||||
}
|
}
|
||||||
|
"service" => {
|
||||||
|
let sub = std::env::args().nth(2).unwrap_or_default();
|
||||||
|
eprintln!("\x1b[1;38;2;192;98;58mNuma\x1b[0m — service management\n");
|
||||||
|
return match sub.as_str() {
|
||||||
|
"start" => install_service().map_err(|e| e.into()),
|
||||||
|
"stop" => uninstall_service().map_err(|e| e.into()),
|
||||||
|
"status" => service_status().map_err(|e| e.into()),
|
||||||
|
_ => {
|
||||||
|
eprintln!("Usage: numa service <start|stop|status>");
|
||||||
|
Ok(())
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
"help" | "--help" | "-h" => {
|
"help" | "--help" | "-h" => {
|
||||||
eprintln!("Usage: numa [command] [config-path]");
|
eprintln!("Usage: numa [command] [config-path]");
|
||||||
eprintln!();
|
eprintln!();
|
||||||
@@ -39,6 +55,9 @@ async fn main() -> numa::Result<()> {
|
|||||||
eprintln!(" (none) Start the DNS server (default)");
|
eprintln!(" (none) Start the DNS server (default)");
|
||||||
eprintln!(" install Set system DNS to 127.0.0.1 (requires sudo)");
|
eprintln!(" install Set system DNS to 127.0.0.1 (requires sudo)");
|
||||||
eprintln!(" uninstall Restore original system DNS settings");
|
eprintln!(" uninstall Restore original system DNS settings");
|
||||||
|
eprintln!(" service start Install as system service (auto-start on boot)");
|
||||||
|
eprintln!(" service stop Uninstall the system service");
|
||||||
|
eprintln!(" service status Check if the service is running");
|
||||||
eprintln!(" help Show this help");
|
eprintln!(" help Show this help");
|
||||||
eprintln!();
|
eprintln!();
|
||||||
eprintln!("Config path defaults to numa.toml");
|
eprintln!("Config path defaults to numa.toml");
|
||||||
|
|||||||
Reference in New Issue
Block a user