1
0
mirror of https://github.com/matrix-org/matrix-authentication-service.git synced 2025-08-09 04:22:45 +03:00

Templates config

This commit is contained in:
Quentin Gliech
2021-09-23 23:51:17 +02:00
parent 7c58bb4c17
commit ff41ae5762
5 changed files with 32 additions and 6 deletions

View File

@@ -68,8 +68,8 @@ impl ServerCommand {
queue.start();
// Load and compile the templates
// TODO: custom template path from the config
let templates = Templates::load(None, true).context("could not load templates")?;
let templates =
Templates::load_from_config(&config.templates).context("could not load templates")?;
// Start the server
let root = mas_core::handlers::root(&pool, &templates, &config);

View File

@@ -41,6 +41,10 @@ enum TemplatesSubcommand {
Check {
/// Path where the templates are
path: String,
/// Skip loading builtin templates
#[clap(long)]
skip_builtin: bool,
},
}
@@ -54,8 +58,8 @@ impl TemplatesCommand {
Ok(())
}
SC::Check { path } => {
Templates::load(Some(path.clone()), false)?;
SC::Check { path, skip_builtin } => {
Templates::load(Some(path), !skip_builtin)?;
Ok(())
}