mirror of
https://github.com/lennart-k/rustical.git
synced 2025-12-13 19:22:26 +00:00
32 lines
916 B
Rust
32 lines
916 B
Rust
use crate::config::{
|
|
Config, DataStoreConfig, DavPushConfig, HttpConfig, SqliteDataStoreConfig, TracingConfig,
|
|
};
|
|
use clap::Parser;
|
|
use rustical_frontend::FrontendConfig;
|
|
|
|
mod membership;
|
|
pub mod principals;
|
|
|
|
#[derive(Debug, Parser)]
|
|
pub struct GenConfigArgs {}
|
|
|
|
pub fn cmd_gen_config(_args: GenConfigArgs) -> anyhow::Result<()> {
|
|
let config = Config {
|
|
http: HttpConfig::default(),
|
|
data_store: DataStoreConfig::Sqlite(SqliteDataStoreConfig {
|
|
db_url: "/var/lib/rustical/db.sqlite3".to_owned(),
|
|
}),
|
|
tracing: TracingConfig::default(),
|
|
frontend: FrontendConfig {
|
|
enabled: true,
|
|
allow_password_login: true,
|
|
},
|
|
oidc: None,
|
|
dav_push: DavPushConfig::default(),
|
|
nextcloud_login: Default::default(),
|
|
};
|
|
let generated_config = toml::to_string(&config)?;
|
|
println!("{generated_config}");
|
|
Ok(())
|
|
}
|