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:
Charles Hall 2024-09-27 15:22:20 -07:00
parent 43018e5793
commit ea5605bbc3
No known key found for this signature in database
GPG key ID: 7B8E0645816E07CF
4 changed files with 72 additions and 2 deletions

View file

@ -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