summaryrefslogtreecommitdiff
path: root/gui/main.cpp
diff options
context:
space:
mode:
authorkali kaneko (leap communications) <kali@leap.se>2020-06-23 19:12:08 +0200
committerkali kaneko (leap communications) <kali@leap.se>2020-08-11 20:59:52 +0200
commit0f8eab4e1157e83f39cd7298378bb5cc9ddb913a (patch)
treee5e4d80aad90ba1cb1f34b32723c220064753760 /gui/main.cpp
parent3e0764caa84a21a60f971ec3693429a9981c5921 (diff)
[feat] first simplistic implementation of a rest api
It lacks authentication, and I need to debug a segfault/abort when quitting. But kind of useful for demonstration purposes.
Diffstat (limited to 'gui/main.cpp')
-rw-r--r--gui/main.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/gui/main.cpp b/gui/main.cpp
index 8033dba..6d01d49 100644
--- a/gui/main.cpp
+++ b/gui/main.cpp
@@ -66,6 +66,12 @@ int main(int argc, char **argv) {
"extension, or to control VPN by other means)."),
},
{
+ {"w", "web-api"},
+ QApplication::translate(
+ "main",
+ "Enable web api (on port 8080)."),
+ },
+ {
{"i", "install-helpers"},
QApplication::translate(
"main",
@@ -76,6 +82,7 @@ int main(int argc, char **argv) {
bool hideSystray = parser.isSet("no-systray");
bool installHelpers = parser.isSet("install-helpers");
+ bool webAPI = parser.isSet("web-api");
if (hideSystray) {
qDebug() << "Not showing systray icon because --no-systray option is set.";
@@ -132,6 +139,9 @@ int main(int argc, char **argv) {
/* let the Go side initialize its internal state */
InitializeBitmaskContext();
+ /* if requested, enable web api for controlling the VPN */
+ if (webAPI) { EnableWebAPI(); };
+
/* kick off your shoes, put your feet up */
return app.exec();
}