initial commit - laid out stuff

This commit is contained in:
askiiart 2025-05-13 23:31:29 -05:00
commit 0d0cb945a1
Signed by untrusted user who does not match committer: askiiart
GPG key ID: 6A32977DAF31746A
6 changed files with 463 additions and 0 deletions

46
src/main.rs Normal file
View file

@ -0,0 +1,46 @@
use clap::Parser;
use serde::{Deserialize, Serialize};
use std::{collections::HashMap, path::PathBuf};
mod build;
mod cli;
#[derive(Serialize, Deserialize, Debug, PartialEq)]
struct SiteInfo {
name: String,
subdomain: String,
///
socket_address_or_port: String,
/// What auth file to use
auth: u8,
conf_file: PathBuf,
}
#[derive(Serialize, Deserialize, Debug, PartialEq)]
struct Config {
output_dir: String,
domain: String,
/// Subdomains/services in the format `subdomain: SiteInfo`
subdomains: HashMap<String, SiteInfo>,
/// Paths to the htpasswd file for each auth number - starts at 0, goes to 255; see [`SiteInfo`]
htpasswd_files: Vec<PathBuf>,
/// Default IP for if it's not specified in `socket_address_or_port` in [`SiteInfo`]. Defaults to localhost if not specified.
#[serde(default = "default_default_ip")]
default_ip: String
}
fn main() {
build::completion_builder().unwrap();
let args = cli::Cli::parse();
let config = args.config;
println!("Config: {}", config.to_str().unwrap())
}
// ---------------------------------------------------------------------------------
fn default_default_ip() -> String {
return "localhost".to_string();
}