1
1
Fork 0
mirror of https://github.com/oxen-io/lokinet synced 2023-12-14 06:53:00 +01:00

add more defaults in config with comments

This commit is contained in:
Jeff Becker 2018-08-09 09:38:44 -04:00
parent d5532e4de4
commit 32d82b5ba5
No known key found for this signature in database
GPG key ID: F357B3B42F6F9B05
4 changed files with 49 additions and 3 deletions

View file

@ -182,10 +182,8 @@ set(LIBTUNTAP_SRC
if (UNIX)
set(LIBTUNTAP_SRC
${TT_ROOT}/tuntap-unix.c
${LIBTUNTAP_SRC}
)
${LIBTUNTAP_SRC})
endif()
else()
set(LIBTUNTAP_SRC "")
endif()

View file

@ -10,6 +10,16 @@
#define uint UINT
#endif
#ifndef DEFAULT_RESOLVER_US
#define DEFAULT_RESOLVER_US "128.52.130.209"
#endif
#ifndef DEFAULT_RESOLVER_EU
#define DEFAULT_RESOLVER_EU "85.208.208.141"
#endif
#ifndef DEFAULT_RESOLVER_AU
#define DEFAULT_RESOLVER_AU "103.236.162.119"
#endif
#ifdef __cplusplus
extern "C"
{

View file

@ -1,5 +1,6 @@
#include "config.hpp"
#include <llarp/config.h>
#include <llarp/dns.h>
#include <llarp/net.hpp>
#include "fs.hpp"
#include "ini.hpp"
@ -103,16 +104,50 @@ extern "C"
llarp::LogError("failed to open ", fname, " for writing");
return false;
}
f << "# this configuration was auto generated with 'sane' defaults"
<< std::endl;
f << "# change these values as desired" << std::endl;
f << std::endl;
f << "# configuration for lokinet network interface" << std::endl;
f << "[network]" << std::endl;
f << "# interface name" << std::endl;
#ifdef _WIN32
// comment out ifname section for windows
f << "# ";
#endif
f << "ifname=lokitun0" << std::endl;
f << "# ip range for interface" << std::endl;
f << "addr=10.0.0.1/16" << std::endl;
f << std::endl;
f << "# dns provider configuration section" << std::endl;
f << "[dns]" << std::endl;
f << "# opennic us resolver" << std::endl;
f << "upstream=" << DEFAULT_RESOLVER_US << std::endl;
f << "# opennic eu resolver" << std::endl;
f << "upstream=" << DEFAULT_RESOLVER_EU << std::endl;
f << "# opennic au resolver" << std::endl;
f << "upstream=" << DEFAULT_RESOLVER_AU << std::endl;
f << "bind=127.3.2.1:53" << std::endl;
f << std::endl;
f << "[netdb]" << std::endl;
f << "dir=netdb" << std::endl;
f << std::endl;
f << "# publish network interfaces for handling inbound traffic"
<< std::endl;
f << "[bind]" << std::endl;
std::string ifname;
if(llarp::GetBestNetIF(ifname, AF_INET))
f << ifname << "=1090" << std::endl;
else
f << "# could not autodetect network interface" << std::endl
<< "# eth0=1090" << std::endl;
f << std::endl;
llarp::LogInfo("Generated new config ", fname);
return true;
}

View file

@ -1175,6 +1175,9 @@ namespace llarp
{
self->connect[key] = val;
}
else if(StrEq(section, "network"))
{
}
else if(StrEq(section, "router"))
{
if(StrEq(key, "nickname"))