diff --git a/GPClient/com.yuezk.qt.gpclient.metainfo.xml b/GPClient/com.yuezk.qt.gpclient.metainfo.xml new file mode 100644 index 0000000..37bed44 --- /dev/null +++ b/GPClient/com.yuezk.qt.gpclient.metainfo.xml @@ -0,0 +1,43 @@ + + + com.yuezk.qt.gpclient + + globalprotect-openconnect + A GlobalProtect VPN client powered by OpenConnect + + CC0-1.0 + AGPL-3.0-or-later + + +

A GlobalProtect VPN client (GUI) for Linux based on OpenConnect and built with Qt5, supports the SAML auth mode.

+
+ + + Network + + + k3vinyue_AT_gmail.com + Kevin Yue + + https://github.com/yuezk/GlobalProtect-openconnect + https://github.com/yuezk/GlobalProtect-openconnect/issues + https://github.com/yuezk/GlobalProtect-openconnect/issues + + + globalprotect + openconnect + vpn + saml + + + com.yuezk.qt.gpclient.desktop + + + https://raw.githubusercontent.com/yuezk/GlobalProtect-openconnect/master/screenshot.png + + + + /usr/bin/gpclient + com.yuezk.qt.GPService + +
\ No newline at end of file diff --git a/GPClient/main.cpp b/GPClient/main.cpp index 59fde3e..0b0f6ef 100644 --- a/GPClient/main.cpp +++ b/GPClient/main.cpp @@ -20,6 +20,7 @@ int main(int argc, char *argv[]) plog::init(plog::debug, logFile.toUtf8()).addAppender(&consoleAppender); PLOGI << "GlobalProtect started, version: " << version; + PLOGI << "PATH: " << qgetenv("PATH"); QString port = QString::fromLocal8Bit(qgetenv(ENV_CDP_PORT)); diff --git a/GPService/gpservice.cpp b/GPService/gpservice.cpp index 04d018f..2d6f214 100644 --- a/GPService/gpservice.cpp +++ b/GPService/gpservice.cpp @@ -92,17 +92,24 @@ void GPService::quit() void GPService::connect(QString server, QString username, QString passwd, QString extraArgs) { + log("VPN status is: " + QVariant::fromValue(vpnStatus).toString()); + if (vpnStatus != GPService::VpnNotConnected) { log("VPN status is: " + QVariant::fromValue(vpnStatus).toString()); return; } - QString bin = findBinary(); - if (bin == nullptr) { - log("Could not find openconnect binary, make sure openconnect is installed, exiting."); - emit error("The OpenConect CLI was not found, make sure it has been installed!"); - return; - } + log("Before findBinary"); + +// QString bin = findBinary(); + +// log("After findBinary"); + +// if (bin == nullptr) { +// log("Could not find openconnect binary, make sure openconnect is installed, exiting."); +// emit error("The OpenConect CLI was not found, make sure it has been installed!"); +// return; +// } QStringList args; args << QCoreApplication::arguments().mid(1) @@ -114,7 +121,7 @@ void GPService::connect(QString server, QString username, QString passwd, QStrin log("Start process with arugments: " + args.join(" ")); - openconnect->start(bin, args); + openconnect->start("openconnect", args); } void GPService::disconnect() diff --git a/packaging/snap/snapcraft.yaml b/snap/snapcraft.yaml similarity index 69% rename from packaging/snap/snapcraft.yaml rename to snap/snapcraft.yaml index 9071bb5..c48c23a 100644 --- a/packaging/snap/snapcraft.yaml +++ b/snap/snapcraft.yaml @@ -11,32 +11,56 @@ confinement: devmode # use 'strict' once you have the right plugs and slots package-repositories: - type: apt ppa: beineri/opt-qt-5.12.10-bionic + - type: apt + ppa: dominik-stadler/dsta-bionic-ppa + +slots: + gpservice-slot: + interface: dbus + bus: system + name: com.yuezk.qt.GPService + +plugs: + gpservice-plug: + interface: dbus + bus: system + name: com.yuezk.qt.GPService apps: + gpservice: + daemon: simple + command: usr/bin/gpservice + environment: + LANG: en_US.utf8 + plugs: + - network + # slots: + # - gpservice-slot + gpclient: common-id: com.yuezk.qt.gpclient.desktop - command: desktop-launch gpclient + command: usr/bin/gpclient desktop: usr/share/applications/com.yuezk.qt.gpclient.desktop environment: - QT_DEBUG_PLUGINS: 1 + QT_PLUGIN_PATH: $SNAP/opt/qt512/plugins plugs: - desktop - desktop-legacy - - opengl - wayland + - unity7 - x11 - network - # extensions: - # - kde-neon + - gpservice-plug parts: application: plugin: nil - source: snap/local/globalprotect-openconnect.tar.gz + source: . build-packages: - g++ - make + - libgl1-mesa-dev - qt512base - qt512websockets - qt512webengine @@ -46,22 +70,6 @@ parts: - qt512websockets - qt512webengine - # build-packages: - # - g++ - # - make - # - qt5-qmake - # - qtwebengine5-dev - # - libqt5websockets5-dev - - # build-snaps: - # - kde-frameworks-5-qt-5-14-core18-sdk - - # stage-packages: - # - libqt5widgets5 - # - libqt5webengine5 - # - libqt5webenginewidgets5 - # - libqt5websockets5 - override-build: | QT_BASE_DIR=/opt/qt512