Skip to content

Commit

Permalink
Merge pull request #15148 from rgacogne/ddist-unbreak-console
Browse files Browse the repository at this point in the history
dnsdist: Fix console ("client mode") on non-default address or port
  • Loading branch information
rgacogne authored Feb 13, 2025
2 parents f400ec7 + b3bb422 commit 9245a0a
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions pdns/dnsdistdist/dnsdist-lua.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1171,14 +1171,15 @@ static void setupLuaConfig(LuaContext& luaCtx, bool client, bool configCheck)
setLuaSideEffect();
ComboAddress local(str, 5199);

if (client || configCheck) {
return;
}

dnsdist::configuration::updateRuntimeConfiguration([local](dnsdist::configuration::RuntimeConfiguration& config) {
config.d_consoleServerAddress = local;
config.d_consoleEnabled = true;
});

if (client || configCheck) {
return;
}

#if defined(HAVE_LIBSODIUM) || defined(HAVE_LIBCRYPTO)
if (dnsdist::configuration::isImmutableConfigurationDone() && dnsdist::configuration::getCurrentRuntimeConfiguration().d_consoleKey.empty()) {
warnlog("Warning, the console has been enabled via 'controlSocket()' but no key has been set with 'setKey()' so all connections will fail until a key has been set");
Expand Down

0 comments on commit 9245a0a

Please sign in to comment.