@ -106,14 +106,14 @@ namespace llarp
}
}
if ( key = = " default-protocol " )
if ( key = = " default-protocol " )
{
{
m_DefaultLinkProto = val;
m_DefaultLinkProto = str( val) ;
LogInfo ( " overriding default link protocol to ' " , val , " ' " ) ;
LogInfo ( " overriding default link protocol to ' " , val , " ' " ) ;
}
}
if ( key = = " netid " )
if ( key = = " netid " )
{
{
if ( val . size ( ) < = NetID : : size ( ) )
if ( val . size ( ) < = NetID : : size ( ) )
{
{
m_netId = val;
m_netId = str( val) ;
LogInfo ( " setting netid to ' " , val , " ' " ) ;
LogInfo ( " setting netid to ' " , val , " ' " ) ;
}
}
else
else
@ -141,29 +141,29 @@ namespace llarp
}
}
if ( key = = " nickname " )
if ( key = = " nickname " )
{
{
m_nickname = val;
m_nickname = str( val) ;
// set logger name here
// set logger name here
LogContext : : Instance ( ) . nodeName = nickname ( ) ;
LogContext : : Instance ( ) . nodeName = nickname ( ) ;
LogInfo ( " nickname set " ) ;
LogInfo ( " nickname set " ) ;
}
}
if ( key = = " encryption-privkey " )
if ( key = = " encryption-privkey " )
{
{
m_encryptionKeyfile = val;
m_encryptionKeyfile = str( val) ;
LogDebug ( " encryption key set to " , m_encryptionKeyfile ) ;
LogDebug ( " encryption key set to " , m_encryptionKeyfile ) ;
}
}
if ( key = = " contact-file " )
if ( key = = " contact-file " )
{
{
m_ourRcFile = val;
m_ourRcFile = str( val) ;
LogDebug ( " rc file set to " , m_ourRcFile ) ;
LogDebug ( " rc file set to " , m_ourRcFile ) ;
}
}
if ( key = = " transport-privkey " )
if ( key = = " transport-privkey " )
{
{
m_transportKeyfile = val;
m_transportKeyfile = str( val) ;
LogDebug ( " transport key set to " , m_transportKeyfile ) ;
LogDebug ( " transport key set to " , m_transportKeyfile ) ;
}
}
if ( ( key = = " identity-privkey " | | key = = " ident-privkey " ) )
if ( ( key = = " identity-privkey " | | key = = " ident-privkey " ) )
{
{
m_identKeyfile = val;
m_identKeyfile = str( val) ;
LogDebug ( " identity key set to " , m_identKeyfile ) ;
LogDebug ( " identity key set to " , m_identKeyfile ) ;
}
}
if ( key = = " public-address " | | key = = " public-ip " )
if ( key = = " public-address " | | key = = " public-ip " )
@ -229,12 +229,12 @@ namespace llarp
}
}
else if ( key = = " profiles " )
else if ( key = = " profiles " )
{
{
m_routerProfilesFile = val;
m_routerProfilesFile = str( val) ;
llarp : : LogInfo ( " setting profiles to " , routerProfilesFile ( ) ) ;
llarp : : LogInfo ( " setting profiles to " , routerProfilesFile ( ) ) ;
}
}
else if ( key = = " strict-connect " )
else if ( key = = " strict-connect " )
{
{
m_strictConnect = val;
m_strictConnect = str( val) ;
}
}
else
else
{
{
@ -247,7 +247,7 @@ namespace llarp
{
{
if ( key = = " dir " )
if ( key = = " dir " )
{
{
m_nodedbDir = val;
m_nodedbDir = str( val) ;
}
}
}
}
@ -279,12 +279,12 @@ namespace llarp
idx = val . find_first_of ( delimiter ) ;
idx = val . find_first_of ( delimiter ) ;
if ( idx ! = string_view : : npos )
if ( idx ! = string_view : : npos )
{
{
parsed_opts . insert ( TrimWhitespace ( val . substr ( 0 , idx ) ) ) ;
parsed_opts . emplace ( TrimWhitespace ( val . substr ( 0 , idx ) ) ) ;
val . remove_prefix ( idx + 1 ) ;
val . remove_prefix ( idx + 1 ) ;
}
}
else
else
{
{
parsed_opts . insert ( TrimWhitespace ( val ) ) ;
parsed_opts . emplace ( TrimWhitespace ( val ) ) ;
}
}
} while ( idx ! = string_view : : npos ) ;
} while ( idx ! = string_view : : npos ) ;
std : : unordered_set < std : : string > opts ;
std : : unordered_set < std : : string > opts ;
@ -335,7 +335,7 @@ namespace llarp
{
{
if ( key = = " pidfile " )
if ( key = = " pidfile " )
{
{
pidfile = val;
pidfile = str( val) ;
}
}
}
}
@ -348,7 +348,7 @@ namespace llarp
}
}
if ( key = = " bind " )
if ( key = = " bind " )
{
{
m_rpcBindAddr = val;
m_rpcBindAddr = str( val) ;
}
}
if ( key = = " authkey " )
if ( key = = " authkey " )
{
{
@ -370,15 +370,15 @@ namespace llarp
}
}
if ( key = = " jsonrpc " | | key = = " addr " )
if ( key = = " jsonrpc " | | key = = " addr " )
{
{
lokidRPCAddr = val;
lokidRPCAddr = str( val) ;
}
}
if ( key = = " username " )
if ( key = = " username " )
{
{
lokidRPCUser = val;
lokidRPCUser = str( val) ;
}
}
if ( key = = " password " )
if ( key = = " password " )
{
{
lokidRPCPassword = val;
lokidRPCPassword = str( val) ;
}
}
}
}
@ -406,7 +406,7 @@ namespace llarp
}
}
if ( key = = " level " )
if ( key = = " level " )
{
{
const auto maybe = LogLevelFromString ( val) ;
const auto maybe = LogLevelFromString ( str( val) ) ;
if ( not maybe . has_value ( ) )
if ( not maybe . has_value ( ) )
{
{
LogError ( " bad log level: " , val ) ;
LogError ( " bad log level: " , val ) ;
@ -423,7 +423,7 @@ namespace llarp
if ( key = = " file " )
if ( key = = " file " )
{
{
LogInfo ( " open log file: " , val ) ;
LogInfo ( " open log file: " , val ) ;
std : : string fname = val ;
std : : string fname { val } ;
FILE * const logfile = : : fopen ( fname . c_str ( ) , " a " ) ;
FILE * const logfile = : : fopen ( fname . c_str ( ) , " a " ) ;
if ( logfile )
if ( logfile )
{
{