initial commit

This commit is contained in:
yggverse 2025-02-20 05:45:19 +02:00
parent c6f6ec7ba4
commit 86e07f08c7
7 changed files with 408 additions and 0 deletions

34
src/argument.rs Normal file
View file

@ -0,0 +1,34 @@
use clap::Parser;
#[derive(Parser, Debug)]
#[command(version, about, long_about = None)]
pub struct Argument {
/// Bind server `host:port` to listen incoming connections on it
#[arg(short, long)]
pub bind: String,
/// Filepath to server identity in PKCS (PFX) format
#[arg(short, long)]
pub identity: String,
/// Passphrase to unlock encrypted identity
#[arg(short, long, default_value_t = String::new())]
pub password: String,
/// Uploads directory (e.g. `public` directory)
#[arg(short, long, default_value_t = String::from("public"))]
pub directory: String,
/// Uploads max size limit in bytes (unlimited by default)
#[arg(short, long)]
pub size: Option<usize>,
/// Uploads MIME type allowed (comma separated, all by default)
/// * based on headers
#[arg(short, long)]
pub mime: Option<String>,
/// Redirection URL on request handle complete (e.g. `gemini://localhost`)
#[arg(short, long)]
pub redirect: Option<String>,
}