]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
Do no start old webserver
authorOtto Moerbeek <otto.moerbeek@open-xchange.com>
Fri, 22 Nov 2024 12:26:50 +0000 (13:26 +0100)
committerOtto Moerbeek <otto.moerbeek@open-xchange.com>
Tue, 11 Feb 2025 15:28:22 +0000 (16:28 +0100)
pdns/recursordist/rec-main.cc
pdns/recursordist/ws-recursor.cc

index b25481c64eb2642dbf7b5f8192a4b38d6996e83b..f554811583d1481f9653e68fbe018d15db9547c2 100644 (file)
@@ -2919,7 +2919,7 @@ static void recursorThread()
     t_fdm->addReadFD(threadInfo.getPipes().readToThread, handlePipeRequest);
 
     if (threadInfo.isHandler()) {
-      if (::arg().mustDo("webserver")) {
+      if (false && ::arg().mustDo("webserver")) {
         SLOG(g_log << Logger::Warning << "Enabling web server" << endl,
              log->info(Logr::Info, "Enabling web server"));
         try {
@@ -3320,8 +3320,10 @@ int main(int argc, char** argv)
       g_packetCache = std::make_unique<RecursorPacketCache>(g_maxPacketCacheEntries, ::arg().asNum("packetcache-shards"));
     }
 
-    extern void serveRustWeb();
-    serveRustWeb();
+    if (::arg().mustDo("webserver")) {
+      extern void serveRustWeb();
+      serveRustWeb();
+    }
     ret = serviceMain(startupLog);
   }
   catch (const PDNSException& ae) {
index afee7d1827069840807b743c664f1960e006fc19..a2ad5e7c0c2534c02ae8e708c82f188b475e9892 100644 (file)
@@ -961,7 +961,8 @@ void serveRustWeb()
   for (const auto& [url, _]  : g_urlmap) {
     urls.emplace_back(url);
   }
-  pdns::rust::web::rec::serveweb({"127.0.0.1:3000", "[::1]:3000"}, ::rust::Slice<const ::rust::String>{urls.data(), urls.size()});
+  auto address = ComboAddress(arg()["webserver-address"], arg().asNum("webserver-port"));
+  pdns::rust::web::rec::serveweb({::rust::String(address.toStringWithPort())}, ::rust::Slice<const ::rust::String>{urls.data(), urls.size()});
 }
 
 static void fromCxxToRust(const HttpResponse& cxxresp, pdns::rust::web::rec::Response& rustResponse)