Skip to content

Commit f633e42

Browse files
committed
Merge branch 'main' into rei/templatecheck_todisk
2 parents e5183f6 + d2309bf commit f633e42

File tree

20 files changed

+169
-119
lines changed

20 files changed

+169
-119
lines changed

.github/CODEOWNERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
* @element-hq/mas-maintainers

Cargo.lock

Lines changed: 28 additions & 28 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 30 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ members = ["crates/*"]
99
resolver = "2"
1010

1111
# Updated in the CI with a `sed` command
12-
package.version = "1.5.0-rc.1"
12+
package.version = "1.5.0"
1313
package.license = "AGPL-3.0-only OR LicenseRef-Element-Commercial"
1414
package.authors = ["Element Backend Team"]
1515
package.edition = "2024"
@@ -34,35 +34,35 @@ broken_intra_doc_links = "deny"
3434
[workspace.dependencies]
3535

3636
# Workspace crates
37-
mas-axum-utils = { path = "./crates/axum-utils/", version = "=1.5.0-rc.1" }
38-
mas-cli = { path = "./crates/cli/", version = "=1.5.0-rc.1" }
39-
mas-config = { path = "./crates/config/", version = "=1.5.0-rc.1" }
40-
mas-context = { path = "./crates/context/", version = "=1.5.0-rc.1" }
41-
mas-data-model = { path = "./crates/data-model/", version = "=1.5.0-rc.1" }
42-
mas-email = { path = "./crates/email/", version = "=1.5.0-rc.1" }
43-
mas-graphql = { path = "./crates/graphql/", version = "=1.5.0-rc.1" }
44-
mas-handlers = { path = "./crates/handlers/", version = "=1.5.0-rc.1" }
45-
mas-http = { path = "./crates/http/", version = "=1.5.0-rc.1" }
46-
mas-i18n = { path = "./crates/i18n/", version = "=1.5.0-rc.1" }
47-
mas-i18n-scan = { path = "./crates/i18n-scan/", version = "=1.5.0-rc.1" }
48-
mas-iana = { path = "./crates/iana/", version = "=1.5.0-rc.1" }
49-
mas-iana-codegen = { path = "./crates/iana-codegen/", version = "=1.5.0-rc.1" }
50-
mas-jose = { path = "./crates/jose/", version = "=1.5.0-rc.1" }
51-
mas-keystore = { path = "./crates/keystore/", version = "=1.5.0-rc.1" }
52-
mas-listener = { path = "./crates/listener/", version = "=1.5.0-rc.1" }
53-
mas-matrix = { path = "./crates/matrix/", version = "=1.5.0-rc.1" }
54-
mas-matrix-synapse = { path = "./crates/matrix-synapse/", version = "=1.5.0-rc.1" }
55-
mas-oidc-client = { path = "./crates/oidc-client/", version = "=1.5.0-rc.1" }
56-
mas-policy = { path = "./crates/policy/", version = "=1.5.0-rc.1" }
57-
mas-router = { path = "./crates/router/", version = "=1.5.0-rc.1" }
58-
mas-spa = { path = "./crates/spa/", version = "=1.5.0-rc.1" }
59-
mas-storage = { path = "./crates/storage/", version = "=1.5.0-rc.1" }
60-
mas-storage-pg = { path = "./crates/storage-pg/", version = "=1.5.0-rc.1" }
61-
mas-tasks = { path = "./crates/tasks/", version = "=1.5.0-rc.1" }
62-
mas-templates = { path = "./crates/templates/", version = "=1.5.0-rc.1" }
63-
mas-tower = { path = "./crates/tower/", version = "=1.5.0-rc.1" }
64-
oauth2-types = { path = "./crates/oauth2-types/", version = "=1.5.0-rc.1" }
65-
syn2mas = { path = "./crates/syn2mas", version = "=1.5.0-rc.1" }
37+
mas-axum-utils = { path = "./crates/axum-utils/", version = "=1.5.0" }
38+
mas-cli = { path = "./crates/cli/", version = "=1.5.0" }
39+
mas-config = { path = "./crates/config/", version = "=1.5.0" }
40+
mas-context = { path = "./crates/context/", version = "=1.5.0" }
41+
mas-data-model = { path = "./crates/data-model/", version = "=1.5.0" }
42+
mas-email = { path = "./crates/email/", version = "=1.5.0" }
43+
mas-graphql = { path = "./crates/graphql/", version = "=1.5.0" }
44+
mas-handlers = { path = "./crates/handlers/", version = "=1.5.0" }
45+
mas-http = { path = "./crates/http/", version = "=1.5.0" }
46+
mas-i18n = { path = "./crates/i18n/", version = "=1.5.0" }
47+
mas-i18n-scan = { path = "./crates/i18n-scan/", version = "=1.5.0" }
48+
mas-iana = { path = "./crates/iana/", version = "=1.5.0" }
49+
mas-iana-codegen = { path = "./crates/iana-codegen/", version = "=1.5.0" }
50+
mas-jose = { path = "./crates/jose/", version = "=1.5.0" }
51+
mas-keystore = { path = "./crates/keystore/", version = "=1.5.0" }
52+
mas-listener = { path = "./crates/listener/", version = "=1.5.0" }
53+
mas-matrix = { path = "./crates/matrix/", version = "=1.5.0" }
54+
mas-matrix-synapse = { path = "./crates/matrix-synapse/", version = "=1.5.0" }
55+
mas-oidc-client = { path = "./crates/oidc-client/", version = "=1.5.0" }
56+
mas-policy = { path = "./crates/policy/", version = "=1.5.0" }
57+
mas-router = { path = "./crates/router/", version = "=1.5.0" }
58+
mas-spa = { path = "./crates/spa/", version = "=1.5.0" }
59+
mas-storage = { path = "./crates/storage/", version = "=1.5.0" }
60+
mas-storage-pg = { path = "./crates/storage-pg/", version = "=1.5.0" }
61+
mas-tasks = { path = "./crates/tasks/", version = "=1.5.0" }
62+
mas-templates = { path = "./crates/templates/", version = "=1.5.0" }
63+
mas-tower = { path = "./crates/tower/", version = "=1.5.0" }
64+
oauth2-types = { path = "./crates/oauth2-types/", version = "=1.5.0" }
65+
syn2mas = { path = "./crates/syn2mas", version = "=1.5.0" }
6666

6767
# OpenAPI schema generation and validation
6868
[workspace.dependencies.aide]

crates/cli/src/commands/server.rs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -160,8 +160,14 @@ impl Options {
160160
)?;
161161

162162
// Load and compile the templates
163-
let templates =
164-
templates_from_config(&config.templates, &site_config, &url_builder).await?;
163+
let templates = templates_from_config(
164+
&config.templates,
165+
&site_config,
166+
&url_builder,
167+
// Don't use strict mode in production yet
168+
false,
169+
)
170+
.await?;
165171
shutdown.register_reloadable(&templates);
166172

167173
let http_client = mas_http::reqwest_client();

crates/cli/src/commands/templates.rs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,13 @@ impl Options {
7272
&account_config,
7373
&captcha_config,
7474
)?;
75-
let templates =
76-
templates_from_config(&template_config, &site_config, &url_builder).await?;
75+
let templates = templates_from_config(
76+
&template_config,
77+
&site_config,
78+
&url_builder, // Use strict mode in template checks
79+
true,
80+
)
81+
.await?;
7782
let all_renders = templates.check_render(clock.now(), &mut rng)?;
7883

7984
if let Some(out_dir) = out_dir {

crates/cli/src/commands/worker.rs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,14 @@ impl Options {
5252
)?;
5353

5454
// Load and compile the templates
55-
let templates =
56-
templates_from_config(&config.templates, &site_config, &url_builder).await?;
55+
let templates = templates_from_config(
56+
&config.templates,
57+
&site_config,
58+
&url_builder,
59+
// Don't use strict mode on task workers for now
60+
false,
61+
)
62+
.await?;
5763

5864
let mailer = mailer_from_config(&config.email, &templates)?;
5965
test_mailer_in_background(&mailer, Duration::from_secs(30));

crates/cli/src/util.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -232,6 +232,7 @@ pub async fn templates_from_config(
232232
config: &TemplatesConfig,
233233
site_config: &SiteConfig,
234234
url_builder: &UrlBuilder,
235+
strict: bool,
235236
) -> Result<Templates, anyhow::Error> {
236237
Templates::load(
237238
config.path.clone(),
@@ -240,6 +241,7 @@ pub async fn templates_from_config(
240241
config.translations_path.clone(),
241242
site_config.templates_branding(),
242243
site_config.templates_features(),
244+
strict,
243245
)
244246
.await
245247
.with_context(|| format!("Failed to load the templates at {}", config.path))

0 commit comments

Comments
 (0)