mirror of https://github.com/oxen-io/lokinet
Fix Context::Configure()
This commit is contained in:
parent
343252c48d
commit
ec20d94c6b
|
@ -99,7 +99,7 @@ run_main_context(const fs::path confFile, const llarp::RuntimeOptions opts)
|
|||
conf.Load(confFile, opts.isRouter, confFile.parent_path());
|
||||
|
||||
ctx = std::make_shared<llarp::Context>();
|
||||
ctx->Configure(opts, {});
|
||||
ctx->Configure(opts, {}, confFile);
|
||||
|
||||
signal(SIGINT, handle_signal);
|
||||
signal(SIGTERM, handle_signal);
|
||||
|
|
|
@ -60,7 +60,8 @@ namespace llarp
|
|||
HandleSignal(int sig);
|
||||
|
||||
bool
|
||||
Configure(const RuntimeOptions& opts, std::optional<fs::path> dataDir);
|
||||
Configure(
|
||||
const RuntimeOptions& opts, std::optional<fs::path> dataDir, const fs::path& configfile);
|
||||
|
||||
bool
|
||||
IsUp() const;
|
||||
|
@ -94,7 +95,6 @@ namespace llarp
|
|||
void
|
||||
SigINT();
|
||||
|
||||
std::string configfile;
|
||||
std::unique_ptr<std::promise<void>> closeWaiter;
|
||||
};
|
||||
|
||||
|
|
|
@ -28,14 +28,17 @@ namespace llarp
|
|||
}
|
||||
|
||||
bool
|
||||
Context::Configure(const RuntimeOptions& opts, std::optional<fs::path> dataDir)
|
||||
Context::Configure(
|
||||
const RuntimeOptions& opts, std::optional<fs::path> dataDir, const fs::path& configfile)
|
||||
{
|
||||
LogWarn("Context::Configure()");
|
||||
|
||||
if (nullptr == config.get())
|
||||
config = std::make_unique<Config>();
|
||||
|
||||
fs::path defaultDataDir = dataDir ? *dataDir : GetDefaultDataDir();
|
||||
|
||||
if (configfile.size())
|
||||
if (not configfile.empty())
|
||||
{
|
||||
if (!config->Load(configfile.c_str(), opts.isRouter, defaultDataDir))
|
||||
{
|
||||
|
|
|
@ -23,7 +23,7 @@ namespace tooling
|
|||
|
||||
Context_ptr context = std::make_shared<HiveContext>(this);
|
||||
context->config = std::make_unique<llarp::Config>(*config.get());
|
||||
context->Configure(opts, {});
|
||||
context->Configure(opts, {}, {});
|
||||
context->Setup(opts);
|
||||
|
||||
auto routerId = llarp::RouterID(context->router->pubkey());
|
||||
|
|
|
@ -12,7 +12,7 @@ static std::shared_ptr<llarp::Context>
|
|||
make_context(std::optional<fs::path> keyfile)
|
||||
{
|
||||
auto context = std::make_shared<llarp::Context>();
|
||||
context->Configure(opts, {});
|
||||
context->Configure(opts, {}, {});
|
||||
|
||||
context->config->network.m_endpointType = "null";
|
||||
context->config->network.m_keyfile = keyfile;
|
||||
|
|
Loading…
Reference in New Issue