Quick fixes from the first boot: recovery admin, upsell, warnings
- The recovery administrator (INBUXA_RECOVERY_ADMIN, or STALWART_RECOVERY_ADMIN) is honored only in bootstrap and recovery mode. On a configured server it's ignored with a startup warning. Before, it was a standing full-admin login for as long as the variable stayed set. - The Enterprise upsell error is replaced by "This feature isn't available in INBUXA yet" for the features still to be rebuilt. - Workspace warnings: 25 to 0. cargo fix removed the unused imports. The seven places where Enterprise code used to plug in keep their parameters, each with an inbuxa: comment naming the rebuild that uses it again. The antispam test's mock-server imports are back behind pending-rebuild.
This commit is contained in:
@@ -18,7 +18,21 @@ impl RegistryStore {
|
||||
|
||||
// Build store
|
||||
inner.store = match inner.read_data_store().await {
|
||||
RegistryInit::Ok(data_store) => Store::build(data_store).await?,
|
||||
RegistryInit::Ok(data_store) => {
|
||||
// The recovery administrator exists for first-boot setup and
|
||||
// for recovery mode. On a configured server running normally
|
||||
// it would be a standing full-admin login for whoever knows the
|
||||
// variable, so it's ignored there, and loudly.
|
||||
if !inner.env_recovery_mode && inner.env_recovery_admin.take().is_some() {
|
||||
eprintln!();
|
||||
eprintln!("⚠️ INBUXA_RECOVERY_ADMIN (or STALWART_RECOVERY_ADMIN) is set, but the");
|
||||
eprintln!(" server is configured and not in recovery mode, so it is ignored.");
|
||||
eprintln!(" Remove it from the environment. To use it for recovery, also set");
|
||||
eprintln!(" INBUXA_RECOVERY_MODE=1.");
|
||||
eprintln!();
|
||||
}
|
||||
Store::build(data_store).await?
|
||||
}
|
||||
RegistryInit::Err(err) => return Err(err),
|
||||
RegistryInit::Bootstrap => {
|
||||
inner.env_recovery_mode = true;
|
||||
|
||||
Reference in New Issue
Block a user