mirror of
https://gitlab.computer.surgery/matrix/grapevine.git
synced 2025-12-18 00:01:24 +01:00
save server_name separately in the database
And use it to assert that the configured `server_name` doesn't change after creating the database. This prevents us from relying on the admin bot for this.
This commit is contained in:
parent
43018e5793
commit
ea5605bbc3
4 changed files with 72 additions and 2 deletions
|
|
@ -75,6 +75,9 @@ pub(crate) enum ServeCommand {
|
|||
#[allow(missing_docs)]
|
||||
#[derive(Error, Debug)]
|
||||
pub(crate) enum ServerNameChanged {
|
||||
#[error("failed to read saved server_name")]
|
||||
ReadSavedServerName(#[source] crate::utils::error::Error),
|
||||
|
||||
#[error("failed to check if there are any users")]
|
||||
NonZeroUsers(#[source] crate::utils::error::Error),
|
||||
|
||||
|
|
@ -83,6 +86,9 @@ pub(crate) enum ServerNameChanged {
|
|||
|
||||
#[error("`server_name` in the database and config file differ")]
|
||||
Renamed,
|
||||
|
||||
#[error("failed to save the configured server_name")]
|
||||
SaveServerName(#[source] crate::utils::error::Error),
|
||||
}
|
||||
|
||||
/// Observability initialization errors
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue