Skip to content

Conversation

mweinelt
Copy link
Contributor

Treat the secret the same as synapse, so the same secret file can be reused between mas and synapse.

https://github.com/element-hq/synapse/blob/v1.137.0/synapse/config/experimental.py#L50

pub async fn secret(&self) -> anyhow::Result<String> {
Ok(match &self.secret {
let raw = match &self.secret {
Secret::File(path) => tokio::fs::read_to_string(path).await?,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should trim only if the secret is being read from a file to match synapse behaviour. It would also be nice to stick in a comment to explicit this behaviour

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated.

@mweinelt mweinelt force-pushed the trim-matrix-secret branch 2 times, most recently from 2fbaebf to 6a0ab03 Compare September 2, 2025 23:36
Treat the secret the same as synapse when read from file a file, so that
the same secret file can be reused between mas and synapse.

https://github.com/element-hq/synapse/blob/v1.137.0/synapse/config/experimental.py#L50
@mweinelt mweinelt changed the title Trim matrix secret Trim matrix secret when read from file Sep 2, 2025
@sandhose sandhose changed the title Trim matrix secret when read from file Trim the matrix.secret_file in the configuration when read from file Sep 12, 2025
@sandhose sandhose changed the title Trim the matrix.secret_file in the configuration when read from file Trim the secret read by matrix.secret_file the configuration option Sep 12, 2025
@sandhose sandhose changed the title Trim the secret read by matrix.secret_file the configuration option Trim the secret read by the matrix.secret_file configuration option Sep 12, 2025
@sandhose sandhose added A-Configuration Related on what is configurable and how it can be configured T-Defect Something isn't working labels Sep 12, 2025
@sandhose sandhose enabled auto-merge September 12, 2025 13:29
@sandhose sandhose merged commit 156c23b into element-hq:main Sep 12, 2025
19 checks passed
@mweinelt mweinelt deleted the trim-matrix-secret branch September 12, 2025 17:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Configuration Related on what is configurable and how it can be configured T-Defect Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants