Merge pull request #2783 from csoler/v0.6-BugFixing_30

cleaning up webui/jsonapi interaction code
This commit is contained in:
csoler 2023-11-07 22:10:39 +01:00 committed by GitHub
commit b30b575955
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 33 additions and 10 deletions

View file

@ -247,7 +247,7 @@ int main(int argc, char* argv[])
}
}
#ifdef RS_SERVICE_TERMINAL_WEBUI_PASSWORD
if(!webui_pass1.empty())
if(askWebUiPassword && !webui_pass1.empty())
{
rsWebUi->setHtmlFilesDirectory(webui_base_directory);
conf.webUIPasswd = webui_pass1; // cannot be set using rsWebUI methods because it calls the still non-existent rsJsonApi
@ -263,6 +263,11 @@ int main(int argc, char* argv[])
int initResult = RsInit::InitRetroShare(conf);
#ifdef RS_JSONAPI
RsInit::startupWebServices(conf);
rstime::rs_usleep(1000000); // waits for jas->restart to print stuff
#endif
if(initResult != RS_INIT_OK)
{
RsFatal() << "Retroshare core initalization failed with: " << initResult
@ -296,10 +301,11 @@ int main(int argc, char* argv[])
<< colored(COLOR_PURPLE,locations[i].mPgpName + " (" + locations[i].mLocationName + ")" )
<< std::endl;
uint32_t nacc = 0;
std::cout << std::endl;
uint32_t nacc = 0;
while(keepRunning && (nacc < 1 || nacc >= locations.size()))
{
std::cout << colored(COLOR_GREEN,"Please enter account number:\n");
std::cout << colored(COLOR_GREEN,"Please enter account number: ");
std::cout.flush();
std::string inputStr;