server: Create schema command

This commit is contained in:
Austin Alvarado
2023-03-21 07:16:19 -06:00
committed by GitHub
parent 80dfeb1293
commit 05dbe6818d
4 changed files with 104 additions and 26 deletions

View File

@@ -26,6 +26,9 @@ pub enum Command {
/// Send a test email.
#[clap(name = "send_test_email")]
SendTestEmail(TestEmailOpts),
/// Create database schema.
#[clap(name = "create_schema")]
CreateSchema(RunOpts),
}
#[derive(Debug, Parser, Clone)]
@@ -74,6 +77,10 @@ pub struct RunOpts {
#[clap(long, env = "LLDAP_HTTP_URL")]
pub http_url: Option<String>,
/// Database connection URL
#[clap(short, long, env = "LLDAP_DATABASE_URL")]
pub database_url: Option<String>,
#[clap(flatten)]
pub smtp_opts: SmtpOpts,

View File

@@ -209,6 +209,10 @@ impl ConfigOverrider for RunOpts {
if let Some(url) = self.http_url.as_ref() {
config.http_url = url.to_string();
}
if let Some(database_url) = self.database_url.as_ref() {
config.database_url = database_url.to_string();
}
self.smtp_opts.override_config(config);
self.ldaps_opts.override_config(config);
}