added cli parameter to toggle registraion, and split the monorepo: now this is only the backend

This commit is contained in:
2026-01-13 16:04:58 +01:00
parent 0e8ef49cfd
commit 86d86473af
11 changed files with 184 additions and 146 deletions

View File

@@ -25,6 +25,7 @@ mod routes;
pub struct AppConfig {
pub avatar_dir: PathBuf,
pub prohibit_registration: bool,
}
#[derive(clap::Parser, Debug)]
@@ -39,9 +40,13 @@ pub struct Cli {
database: String,
/// Data directory path
#[arg(short = 'D', long, default_value = "/var/lib/chatapp")]
#[arg(short = 'D', long, default_value = "/var/lib/frangipane")]
data_dir: String,
/// Whether to disable user registration
#[arg(short, long)]
no_registration: bool,
/// Verbose mode
#[arg(short, long)]
verbose: bool,
@@ -86,6 +91,7 @@ async fn main() -> anyhow::Result<()> {
let data_dir = PathBuf::from(cli.data_dir);
let config = Arc::new(AppConfig {
avatar_dir: data_dir.join("avatars"),
prohibit_registration: cli.no_registration,
});
let mut app = Router::new()