mirror of
https://codeberg.org/Toasterson/ips.git
synced 2026-04-10 21:30:41 +00:00
- Added initial implementation of the `pkg6depotd` server with modular components for CLI parsing, configuration management, HTTP handling, repository access, and daemonization. - Implemented basic server startup logic with a default router and placeholder handlers. - Integrated telemetry initialization and configuration fallback mechanism for ease of development. - Updated `Cargo.toml` and `Cargo.lock` to include dependencies necessary for server functionality.
45 lines
910 B
Rust
45 lines
910 B
Rust
use clap::{Parser, Subcommand};
|
|
use std::path::PathBuf;
|
|
|
|
#[derive(Parser)]
|
|
#[command(name = "pkg6depotd")]
|
|
#[command(about = "IPS Package Depot Server", long_about = None)]
|
|
pub struct Cli {
|
|
#[arg(short, long, value_name = "FILE")]
|
|
pub config: Option<PathBuf>,
|
|
|
|
#[arg(long)]
|
|
pub no_daemon: bool,
|
|
|
|
#[arg(long, value_name = "FILE")]
|
|
pub pid_file: Option<PathBuf>,
|
|
|
|
#[command(subcommand)]
|
|
pub command: Option<Commands>,
|
|
}
|
|
|
|
#[derive(Subcommand)]
|
|
pub enum Commands {
|
|
/// Start the server (default)
|
|
Start,
|
|
/// Stop the running server
|
|
Stop,
|
|
/// Check server status
|
|
Status,
|
|
/// Reload configuration
|
|
Reload,
|
|
/// Test configuration
|
|
ConfigTest,
|
|
/// Check health
|
|
Health,
|
|
/// Admin commands
|
|
Admin {
|
|
#[command(subcommand)]
|
|
cmd: AdminCommands,
|
|
},
|
|
}
|
|
|
|
#[derive(Subcommand)]
|
|
pub enum AdminCommands {
|
|
AuthCheck,
|
|
}
|