Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 1 addition & 5 deletions crates/defguard/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@ async fn main() -> Result<(), anyhow::Error> {
let wizard = Wizard::init(&pool, has_auto_adopt_flags).await?;
let mut ini_server_config = true;

Settings::initialize_runtime_defaults(&pool).await?;
if !wizard.completed {
match wizard.active_wizard {
ActiveWizard::None => {}
Expand All @@ -136,9 +137,6 @@ async fn main() -> Result<(), anyhow::Error> {
ActiveWizard::Migration => {
let mut settings = Settings::get_current_settings();
settings.update_from_config(&pool, &config).await?;

Settings::initialize_runtime_defaults(&pool).await?;

config.initialize_post_settings();
SERVER_CONFIG
.set(config.clone())
Expand All @@ -159,8 +157,6 @@ async fn main() -> Result<(), anyhow::Error> {
}
}

Settings::initialize_runtime_defaults(&pool).await?;

if ini_server_config {
config.initialize_post_settings();

Expand Down
2 changes: 1 addition & 1 deletion crates/defguard_common/src/db/models/settings.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ pub async fn update_current_settings<'e, E: sqlx::PgExecutor<'e>>(
pub enum SettingsValidationError {
#[error("Cannot enable gateway disconnect notifications. SMTP is not configured")]
CannotEnableGatewayNotifications,
#[error("Invalid defguard_url `{0}`")]
#[error("Invalid defguard_url `{0}`, url has to be a domain, not IP")]
InvalidDefguardUrl(String),
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,15 @@ use defguard_common::db::{
},
};
use defguard_core::grpc::GatewayEvent;
use defguard_proto::enterprise::firewall::{
FirewallConfig, FirewallPolicy, FirewallRule, IpAddress, IpVersion, Port, Protocol,
SnatBinding, ip_address::Address, port::Port as PortInner,
};
use defguard_proto::gateway::{
CoreResponse, Update, UpdateType, core_response,
update::{self},
use defguard_proto::{
enterprise::firewall::{
FirewallConfig, FirewallPolicy, FirewallRule, IpAddress, IpVersion, Port, Protocol,
SnatBinding, ip_address::Address, port::Port as PortInner,
},
gateway::{
CoreResponse, Update, UpdateType, core_response,
update::{self},
},
};
use sqlx::postgres::PgConnectOptions;

Expand Down
Loading