Bootstrap fixes
This commit is contained in:
@@ -47,13 +47,13 @@ impl BootstrapDefaults for Bootstrap {
|
||||
}
|
||||
|
||||
async fn insert_safe_defaults(bp: &mut Bootstrap) -> trc::Result<()> {
|
||||
if bp.registry.is_recovery_mode() {
|
||||
return Ok(());
|
||||
}
|
||||
let is_recovery_mode = bp.registry.is_recovery_mode();
|
||||
let is_bootstrap_mode = bp.registry.is_bootstrap_mode();
|
||||
|
||||
#[cfg(not(feature = "test_mode"))]
|
||||
if bp.registry.count_object(ObjectType::Application).await? == 0 {
|
||||
bp.registry
|
||||
if !is_recovery_mode || is_bootstrap_mode {
|
||||
if bp.registry.count_object(ObjectType::Application).await? == 0 {
|
||||
bp.registry
|
||||
.write(RegistryWrite::insert(
|
||||
&Application {
|
||||
auto_update_frequency: Duration::from_millis(30 * 24 * 60 * 60 * 1000),
|
||||
@@ -71,9 +71,10 @@ async fn insert_safe_defaults(bp: &mut Bootstrap) -> trc::Result<()> {
|
||||
.into(),
|
||||
))
|
||||
.await?;
|
||||
}
|
||||
}
|
||||
|
||||
if bp.registry.is_bootstrap_mode() {
|
||||
if is_bootstrap_mode {
|
||||
#[cfg(not(any(feature = "dev_mode", feature = "test_mode")))]
|
||||
if bp.registry.count_object(ObjectType::SystemSettings).await? == 0 {
|
||||
bp.registry
|
||||
@@ -90,6 +91,10 @@ async fn insert_safe_defaults(bp: &mut Bootstrap) -> trc::Result<()> {
|
||||
return Ok(());
|
||||
}
|
||||
|
||||
if is_recovery_mode {
|
||||
return Ok(());
|
||||
}
|
||||
|
||||
if bp.registry.count_object(ObjectType::MtaQueueQuota).await? == 0 {
|
||||
bp.registry
|
||||
.write(RegistryWrite::insert(
|
||||
|
||||
@@ -5,10 +5,13 @@
|
||||
*/
|
||||
|
||||
use crate::registry::{
|
||||
mapping::{RegistryGetResponse, RegistrySetResponse},
|
||||
mapping::{RegistryGetResponse, RegistrySetResponse, map_bootstrap_error},
|
||||
set::map_write_error,
|
||||
};
|
||||
use common::{DATABASE_SCHEMA_VERSION, Server, network::acme::account::acme_create_account, psl};
|
||||
use common::{
|
||||
DATABASE_SCHEMA_VERSION, Server, config::storage::Storage,
|
||||
network::acme::account::acme_create_account, psl,
|
||||
};
|
||||
use directory::core::secret::hash_secret;
|
||||
use jmap_proto::error::set::{SetError, SetErrorType};
|
||||
use jmap_tools::{JsonPointer, JsonPointerItem, Key};
|
||||
@@ -244,6 +247,15 @@ pub(crate) async fn bootstrap_set(
|
||||
}
|
||||
}
|
||||
}
|
||||
let mut bp_check =
|
||||
store::registry::bootstrap::Bootstrap::new_uninitialized(tmp_registry.clone());
|
||||
let _ = Storage::parse(&mut bp_check).await;
|
||||
if !bp_check.errors.is_empty() {
|
||||
set.response
|
||||
.not_updated
|
||||
.append(id, map_bootstrap_error(bp_check.errors));
|
||||
break 'outer;
|
||||
}
|
||||
|
||||
// Create inner store
|
||||
let registry =
|
||||
|
||||
@@ -37939,7 +37939,7 @@ impl Default for TracerLog {
|
||||
path: Default::default(),
|
||||
prefix: "stalwart".to_string(),
|
||||
rotate: LogRotateFrequency::Daily,
|
||||
ansi: false,
|
||||
ansi: true,
|
||||
multiline: false,
|
||||
enable: true,
|
||||
level: TracingLevel::Info,
|
||||
|
||||
Reference in New Issue
Block a user