Initial work on a RetroShare cross-platform service

This doesn't need any interacion of the user at startup, unlike
retroshare-nogui which requires the user to login on the shell this doesn't
even need a TTY.
At startup this just parse command line, read the PGP keyring, look for
available locations, and start listening for JSON API requests.
Another difference with retroshare-nogui is that this is capable to
generate/import PGP identities, generate locations, and in general anything
possible through the RetroShare API.
retroshare-service is suitable also to run it as a system service, even
in very constrained systems such as Android ot a Docker container.
retroshare-service drop support for libresapi so only the new JSON API
is exposed, it will completely obsolete retroshare-android-service once
retroshare-qml-app is ported to the new JSON API.
This commit is contained in:
Gioacchino Mazzurco 2018-09-29 00:15:10 +02:00
parent 359e11433b
commit 0078501dba
No known key found for this signature in database
GPG key ID: A1FBCA3872E87051
18 changed files with 894 additions and 17 deletions

View file

@ -862,16 +862,19 @@ rs_gxs_trans {
rs_jsonapi {
JSONAPI_GENERATOR_SRC=$$clean_path($${RS_SRC_PATH}/jsonapi-generator/src/)
JSONAPI_GENERATOR_OUT=$$clean_path($${RS_BUILD_PATH}/jsonapi-generator/src/)
win32 {
CONFIG(release, debug|release) {
JSONAPI_GENERATOR_EXE=$$clean_path($${JSONAPI_GENERATOR_OUT}/release/jsonapi-generator.exe)
isEmpty(JSONAPI_GENERATOR_EXE) {
win32 {
CONFIG(release, debug|release) {
JSONAPI_GENERATOR_EXE=$$clean_path($${JSONAPI_GENERATOR_OUT}/release/jsonapi-generator.exe)
}
CONFIG(debug, debug|release) {
JSONAPI_GENERATOR_EXE=$$clean_path($${JSONAPI_GENERATOR_OUT}/debug/jsonapi-generator.exe)
}
} else {
JSONAPI_GENERATOR_EXE=$$clean_path($${JSONAPI_GENERATOR_OUT}/jsonapi-generator)
}
CONFIG(debug, debug|release) {
JSONAPI_GENERATOR_EXE=$$clean_path($${JSONAPI_GENERATOR_OUT}/debug/jsonapi-generator.exe)
}
} else {
JSONAPI_GENERATOR_EXE=$$clean_path($${JSONAPI_GENERATOR_OUT}/jsonapi-generator)
}
DOXIGEN_INPUT_DIRECTORY=$$clean_path($${PWD})
DOXIGEN_CONFIG_SRC=$$clean_path($${RS_SRC_PATH}/jsonapi-generator/src/jsonapi-generator-doxygen.conf)
DOXIGEN_CONFIG_OUT=$$clean_path($${JSONAPI_GENERATOR_OUT}/jsonapi-generator-doxygen-final.conf)
@ -899,6 +902,7 @@ rs_jsonapi {
jsonwrappersincl.target = $${WRAPPERS_INCL_FILE}
jsonwrappersincl.commands = \
mkdir -p $${JSONAPI_GENERATOR_OUT}; \
cp $${DOXIGEN_CONFIG_SRC} $${DOXIGEN_CONFIG_OUT}; \
echo OUTPUT_DIRECTORY=$$shell_path($${JSONAPI_GENERATOR_OUT}) >> $${DOXIGEN_CONFIG_OUT};\
echo INPUT=$$shell_path($${DOXIGEN_INPUT_DIRECTORY}) >> $${DOXIGEN_CONFIG_OUT}; \

View file

@ -57,9 +57,7 @@ rs_jsonapi {
QMAKE_LIBDIR *= $$clean_path($${RESTBED_BUILD_PATH}/library/)
# Using sLibs would fail as librestbed.a is generated at compile-time
LIBS *= -L$$clean_path($${RESTBED_BUILD_PATH}/library/) -lrestbed
win32-g++ {
LIBS += -lwsock32
}
win32-g++:LIBS += -lwsock32
}
linux-* {

View file

@ -16,7 +16,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
//#include "util/rsurl.h"
#include "rsurl.h"
#include <cstdio>
@ -245,7 +245,7 @@ RsUrl& RsUrl::setFragment(const std::string& fragment)
if(str[i] == '%' && i < boundary)
{
decoded << static_cast<char>(stoi(str.substr(++i, 2), 0, 16));
decoded << static_cast<char>(std::stoi(str.substr(++i, 2), 0, 16));
++i;
}
else decoded << str[i];