allow user to supply his own Tor executable

This commit is contained in:
csoler 2022-11-07 21:10:55 +01:00
parent d6aa58d52c
commit 03a576589e
2 changed files with 15 additions and 14 deletions

View File

@ -239,7 +239,8 @@ feenableexcept(FE_INVALID | FE_DIVBYZERO);
>> parameter('d',"debug-level" ,conf.debugLevel ,"level" ,"Set debug level." ,false)
>> parameter('i',"ip-address" ,conf.forcedInetAddress,"nnn.nnn.nnn.nnn", "Force IP address to use (if cannot be detected)." ,false)
>> parameter('p',"port" ,conf.forcedPort ,"port" ,"Set listenning port to use." ,false)
>> parameter('o',"opmode" ,conf.opModeStr ,"opmode" ,"Set Operating mode (Full, NoTurtle, Gaming, Minimal)." ,false);
>> parameter('o',"opmode" ,conf.opModeStr ,"opmode" ,"Set Operating mode (Full, NoTurtle, Gaming, Minimal)." ,false)
>> parameter('t',"opmode" ,conf.userSuppliedTorExecutable,"tor" ,"supply full tor eecutable path." ,false);
#ifdef RS_JSONAPI
as >> parameter('J', "jsonApiPort", conf.jsonApiPort, "jsonApiPort", "Enable JSON API on the specified port", false )
>> parameter('P', "jsonApiBindAddress", conf.jsonApiBindAddress, "jsonApiBindAddress", "JSON API Bind Address.", false);
@ -393,6 +394,9 @@ feenableexcept(FE_INVALID | FE_DIVBYZERO);
if(is_auto_tor)
{
if(!conf.userSuppliedTorExecutable.empty())
RsTor::setTorExecutablePath(conf.userSuppliedTorExecutable);
// Now that we know the Tor service running, and we know the SSL id, we can make sure it provides a viable hidden service
std::string tor_hidden_service_dir = RsAccounts::AccountDirectory() + "/hidden_service/" ;

View File

@ -126,19 +126,13 @@ int main(int argc, char* argv[])
"output to stderr instead of log file." )
>> option( 'u',"udp", conf.udpListenerOnly,
"Only listen to UDP." )
>> parameter( 'c',"base-dir", conf.optBaseDir, "directory",
"Set base directory.", false )
>> parameter( 'l', "log-file", conf.logfname, "logfile",
"Set Log filename.", false )
>> parameter( 'd', "debug-level", conf.debugLevel, "level",
"Set debug level.", false )
>> parameter( 'i', "ip-address", conf.forcedInetAddress, "IP",
"Force IP address to use (if cannot be detected).", false )
>> parameter( 'o', "opmode", conf.opModeStr, "opmode",
"Set Operating mode (Full, NoTurtle, Gaming, Minimal).",
false )
>> parameter( 'p', "port", conf.forcedPort, "port",
"Set listenning port to use.", false );
>> parameter( 'c',"base-dir", conf.optBaseDir, "directory", "Set base directory.", false )
>> parameter( 'l', "log-file", conf.logfname, "logfile", "Set Log filename.", false )
>> parameter( 'd', "debug-level", conf.debugLevel, "level", "Set debug level.", false )
>> parameter( 'i', "ip-address", conf.forcedInetAddress, "IP", "Force IP address to use (if cannot be detected).", false )
>> parameter( 'o', "opmode", conf.opModeStr, "opmode", "Set Operating mode (Full, NoTurtle, Gaming, Minimal).", false )
>> parameter( 'p', "port", conf.forcedPort, "port", "Set listenning port to use.", false )
>> parameter( 't', "tor", conf.userSuppliedTorExecutable, "tor", "Set Tor executable full path.", false );
#ifdef RS_SERVICE_TERMINAL_LOGIN
as >> parameter( 'U', "user-id", prefUserString, "ID",
@ -176,6 +170,9 @@ int main(int argc, char* argv[])
as >> help( 'h', "help", "Display this Help" );
as.defaultErrorHandling(true, true);
if(!conf.userSuppliedTorExecutable.empty())
RsTor::setTorExecutablePath(conf.userSuppliedTorExecutable);
#if (defined(RS_JSONAPI) && defined(RS_WEBUI)) && defined(RS_SERVICE_TERMINAL_WEBUI_PASSWORD)
std::string webui_pass1;
if(askWebUiPassword)