Skip to content

Commit df38b72

Browse files
committed
Trim matrix secret
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
1 parent 3e72459 commit df38b72

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

crates/config/src/sections/matrix.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,10 +130,12 @@ impl MatrixConfig {
130130
///
131131
/// Returns an error when the shared secret could not be read from file.
132132
pub async fn secret(&self) -> anyhow::Result<String> {
133-
Ok(match &self.secret {
133+
let raw = match &self.secret {
134134
Secret::File(path) => tokio::fs::read_to_string(path).await?,
135135
Secret::Value(secret) => secret.clone(),
136-
})
136+
};
137+
138+
Ok(raw.trim().to_string())
137139
}
138140

139141
pub(crate) fn generate<R>(mut rng: R) -> Self

0 commit comments

Comments
 (0)