From 58da228f620fe7f4ab191306d287c41d8c410707 Mon Sep 17 00:00:00 2001 From: Jason Rhinelander Date: Thu, 26 Aug 2021 11:33:46 -0300 Subject: [PATCH] Generate a default client lokinet.ini on startup if it doesn't exist Thus when a user goes looking for it they'll find the (commented out) default in the right place and can edit it. (That right place is: ~/Library/Containers/com.loki-project.lokinet.network-extension/Data/lokinet.ini) --- llarp/apple/context_wrapper.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/llarp/apple/context_wrapper.cpp b/llarp/apple/context_wrapper.cpp index bd781fa89..3d1eb2a37 100644 --- a/llarp/apple/context_wrapper.cpp +++ b/llarp/apple/context_wrapper.cpp @@ -40,9 +40,9 @@ llarp_apple_init( { auto config_dir = fs::u8path(config_dir_); auto config = std::make_shared(config_dir); - std::optional config_path = config_dir / "lokinet.ini"; - if (!fs::exists(*config_path)) - config_path.reset(); + fs::path config_path = config_dir / "lokinet.ini"; + if (!fs::exists(config_path)) + llarp::ensureConfig(config_dir, config_path, /*overwrite=*/ false, /*router=*/ false); config->Load(config_path); // If no range is specified then go look for a free one, set that in the config, and then return