Support [dns] no-resolvconf option (ignored by lokinet) for deb compatibility (#1362)

* Add ignored [dns]no-resolvconf option for deb backwards compat

The debs hack a `#no-resolvconf=1` into the config file in 0.7 to allow
a user to disable resolvconf setup during startup by uncommenting it.
That doesn't work anymore since 0.8 errors on invalid config options, so
add it as an ignored option so that 0.7 deb config files can still be
compatible.

* Fix `[dns]upstream` comment not being produced in generated conf file

* fix test

Co-authored-by: Jeff <jeff@i2p.rocks>
pull/1360/head
Jason Rhinelander 4 years ago committed by GitHub
parent 63a876cc78
commit d03066ee05
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -353,6 +353,9 @@ namespace llarp
conf.defineOption<std::string>("dns", "bind", false, "127.3.2.1:53", [=](std::string arg) {
m_bind = parseDNSAddr(std::move(arg));
});
// Ignored option (used by the systemd service file to disable resolvconf configuration).
conf.defineOption<bool>("dns", "no-resolvconf", false, false);
}
LinksConfig::LinkInfo
@ -827,7 +830,7 @@ namespace llarp
def.addOptionComments(
"dns",
"upstream-dns",
"upstream",
{
"Upstream resolver(s) to use as fallback for non-loki addresses.",
"Multiple values accepted.",
@ -841,6 +844,15 @@ namespace llarp
"Multiple values accepted.",
});
def.addOptionComments(
"dns",
"no-resolvconf",
{
"Can be uncommented and set to 1 to disable resolvconf configuration of lokinet DNS.",
"(This is not used directly by lokinet itself, but by the lokinet init scripts",
"on systems which use resolveconf)",
});
// bootstrap
def.addSectionComments(
"bootstrap",

@ -1,7 +1,6 @@
#include <crypto/crypto.hpp>
#include <crypto/crypto_libsodium.hpp>
#include <sodium/crypto_scalarmult_ed25519.h>
#include <llarp_test.hpp>
#include <path/path.hpp>
#include <service/address.hpp>
#include <service/identity.hpp>

Loading…
Cancel
Save