mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-06-23 05:44:45 -04:00
fixed retroshare_service with embedded webui
This commit is contained in:
parent
2123ad7645
commit
997501a24d
8 changed files with 66 additions and 35 deletions
|
@ -518,6 +518,14 @@ bool JsonApiServer::revokeAuthToken(const std::string& token)
|
|||
return false;
|
||||
}
|
||||
|
||||
void JsonApiServer::connectToConfigManager(p3ConfigMgr *cfgmgr)
|
||||
{
|
||||
cfgmgr->addConfiguration("jsonapi.cfg",this);
|
||||
|
||||
RsFileHash hash;
|
||||
loadConfiguration(hash);
|
||||
}
|
||||
|
||||
bool JsonApiServer::authorizeUser(const std::string& user,const std::string& passwd)
|
||||
{
|
||||
if(!is_alphanumeric(user) || !is_alphanumeric(passwd))
|
||||
|
|
|
@ -58,6 +58,8 @@ public:
|
|||
virtual void setBindingAddress(const std::string& address) override { RestbedService::setBindAddress(address); }
|
||||
virtual int status() const override;
|
||||
|
||||
virtual void connectToConfigManager(p3ConfigMgr *cfgmgr);
|
||||
|
||||
virtual bool authorizeUser(const std::string& alphanumeric_user,const std::string& alphanumeric_passwd) override;
|
||||
virtual std::map<std::string,std::string> getAuthorizedTokens() override;
|
||||
bool revokeAuthToken(const std::string& user) override;
|
||||
|
|
|
@ -31,6 +31,7 @@ public:
|
|||
{
|
||||
_service = std::make_shared<restbed::Service>(); // this is a place holder, in case we request some internal values.
|
||||
_listening_port = 1984;
|
||||
_binding_address = "127.0.0.1";
|
||||
}
|
||||
|
||||
void runloop() override
|
||||
|
@ -58,7 +59,7 @@ public:
|
|||
|
||||
try
|
||||
{
|
||||
std::cerr << "(II) Starting restbed service on port " << std::dec << _listening_port << std::endl;
|
||||
std::cerr << "(II) Starting restbed service on port " << std::dec << _listening_port << " and binding address \"" << _binding_address << "\"" << std::endl;
|
||||
_service->start( settings );
|
||||
}
|
||||
catch(std::exception& e)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue