mirror of
https://github.com/yuezk/GlobalProtect-openconnect.git
synced 2025-05-20 07:26:58 -04:00
Compare commits
11 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
38a1eded19 | ||
|
3e23e7eaae | ||
|
cf46848e63 | ||
|
2e826201d2 | ||
|
adba408dc3 | ||
|
5d613369ee | ||
|
ebd3de6f63 | ||
|
266ab65892 | ||
|
ccaf93ec31 | ||
|
e08d7d7c4d | ||
|
c14a6ad1d2 |
30
.github/workflows/main.yml
vendored
Normal file
30
.github/workflows/main.yml
vendored
Normal file
@@ -0,0 +1,30 @@
|
||||
name: CI
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ master ]
|
||||
pull_request:
|
||||
branches: [ master ]
|
||||
workflow_dispatch:
|
||||
|
||||
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Install Qt
|
||||
uses: jurplel/install-qt-action@v2
|
||||
with:
|
||||
version: '5.15.2'
|
||||
modules: 'qtwebengine qtwebsockets'
|
||||
|
||||
# Checkout repository and submodules
|
||||
- uses: actions/checkout@v2
|
||||
with:
|
||||
submodules: recursive
|
||||
|
||||
- name: Build
|
||||
run: |
|
||||
qmake CONFIG+=release
|
||||
make
|
60
.github/workflows/publish.yml
vendored
Normal file
60
.github/workflows/publish.yml
vendored
Normal file
@@ -0,0 +1,60 @@
|
||||
name: Publish
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Install Qt
|
||||
uses: jurplel/install-qt-action@v2
|
||||
with:
|
||||
version: '5.15.2'
|
||||
modules: 'qtwebengine qtwebsockets'
|
||||
|
||||
# Checkout repository and submodules
|
||||
- uses: actions/checkout@v2
|
||||
with:
|
||||
submodules: recursive
|
||||
|
||||
- name: Build
|
||||
run: |
|
||||
qmake CONFIG+=release
|
||||
make
|
||||
|
||||
|
||||
aur-publish:
|
||||
needs:
|
||||
- build
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
|
||||
- name: Get latest version
|
||||
id: get-version
|
||||
run: |
|
||||
echo ::set-output name=VERSION::$(git tag --sort=-v:refname --list "v[0-9]*" | head -n 1 | cut -c 2-)
|
||||
|
||||
- name: Get the sha256sum
|
||||
id: get-sha256sum
|
||||
run: |
|
||||
echo ::set-output name=SHA::$(curl -L https://github.com/yuezk/GlobalProtect-openconnect/archive/refs/tags/v${{ steps.get-version.outputs.VERSION }}.tar.gz | sha256sum)
|
||||
|
||||
- name: Generate PKGBUILD
|
||||
run: |
|
||||
sed "s/{PKG_VERSION}/${{ steps.get-version.outputs.VERSION }}/g;s/{SOURCE_SHA}/${{ steps.get-sha256sum.outputs.SHA }}/g" PKGBUILD.template > PKGBUILD
|
||||
|
||||
- name: Publish AUR package
|
||||
uses: KSXGitHub/github-actions-deploy-aur@v2.2.3
|
||||
with:
|
||||
pkgname: globalprotect-openconnect
|
||||
pkgbuild: ./PKGBUILD
|
||||
commit_username: ${{ secrets.AUR_USERNAME }}
|
||||
commit_email: ${{ secrets.AUR_EMAIL }}
|
||||
ssh_private_key: ${{ secrets.AUR_SSH_PRIVATE_KEY }}
|
||||
commit_message: 'Release v${{ steps.get-version.outputs.VERSION }}'
|
||||
force_push: true
|
@@ -8,3 +8,4 @@ Exec=/usr/bin/gpclient
|
||||
Icon=com.yuezk.qt.GPClient
|
||||
Categories=Network;VPN;Utility;Qt;
|
||||
Keywords=GlobalProtect;Openconnect;SAML;connection;VPN;
|
||||
StartupWMClass=gpclient
|
||||
|
@@ -69,7 +69,7 @@ void GPClient::initSystemTrayIcon()
|
||||
connect(systemTrayIcon, &QSystemTrayIcon::activated, this, &GPClient::onSystemTrayActivated);
|
||||
connect(gatewaySwitchMenu, &QMenu::triggered, this, &GPClient::onGatewayChanged);
|
||||
|
||||
openAction = contextMenu->addAction(QIcon::fromTheme("window-new"), "Open", this, &GPClient::activiate);
|
||||
openAction = contextMenu->addAction(QIcon::fromTheme("window-new"), "Open", this, &GPClient::activate);
|
||||
connectAction = contextMenu->addAction(QIcon::fromTheme("preferences-system-network"), "Connect", this, &GPClient::doConnect);
|
||||
contextMenu->addMenu(gatewaySwitchMenu);
|
||||
contextMenu->addSeparator();
|
||||
@@ -167,7 +167,7 @@ void GPClient::onSystemTrayActivated(QSystemTrayIcon::ActivationReason reason)
|
||||
switch (reason) {
|
||||
case QSystemTrayIcon::Trigger:
|
||||
case QSystemTrayIcon::DoubleClick:
|
||||
this->activiate();
|
||||
this->activate();
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
@@ -209,7 +209,7 @@ void GPClient::doConnect()
|
||||
|
||||
// Display the main window if portal is empty
|
||||
if (portal.isEmpty()) {
|
||||
activiate();
|
||||
activate();
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -351,7 +351,7 @@ void GPClient::onGatewayFail(const QString &msg)
|
||||
updateConnectionStatus(VpnStatus::disconnected);
|
||||
}
|
||||
|
||||
void GPClient::activiate()
|
||||
void GPClient::activate()
|
||||
{
|
||||
activateWindow();
|
||||
showNormal();
|
||||
|
@@ -20,7 +20,7 @@ public:
|
||||
GPClient(QWidget *parent = nullptr);
|
||||
~GPClient();
|
||||
|
||||
void activiate();
|
||||
void activate();
|
||||
|
||||
private slots:
|
||||
void on_connectButton_clicked();
|
||||
|
@@ -6,7 +6,7 @@
|
||||
#include <plog/Log.h>
|
||||
#include <plog/Appenders/ColorConsoleAppender.h>
|
||||
|
||||
static const QString version = "v1.2.5";
|
||||
static const QString version = "v1.2.8";
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
@@ -28,10 +28,12 @@ int main(int argc, char *argv[])
|
||||
}
|
||||
|
||||
SingleApplication app(argc, argv);
|
||||
app.setQuitOnLastWindowClosed(false);
|
||||
|
||||
GPClient w;
|
||||
w.show();
|
||||
|
||||
QObject::connect(&app, &SingleApplication::instanceStarted, &w, &GPClient::activiate);
|
||||
QObject::connect(&app, &SingleApplication::instanceStarted, &w, &GPClient::activate);
|
||||
|
||||
return app.exec();
|
||||
}
|
||||
|
@@ -65,6 +65,14 @@ QList<GPGateway> PortalConfigResponse::parseGateways(QXmlStreamReader &xmlReader
|
||||
|
||||
QList<GPGateway> gateways;
|
||||
|
||||
while (xmlReader.name() != "external"){
|
||||
xmlReader.readNext();
|
||||
}
|
||||
|
||||
while (xmlReader.name() != "list"){
|
||||
xmlReader.readNext();
|
||||
}
|
||||
|
||||
while (xmlReader.name() != xmlGateways || !xmlReader.isEndElement()) {
|
||||
xmlReader.readNext();
|
||||
// Parse the gateways -> external -> list -> entry
|
||||
@@ -89,13 +97,15 @@ QMap<QString, int> PortalConfigResponse::parsePriorityRules(QXmlStreamReader &xm
|
||||
|
||||
QMap<QString, int> priorityRules;
|
||||
|
||||
while (xmlReader.name() != "priority-rule" || !xmlReader.isEndElement()) {
|
||||
while ((xmlReader.name() != "priority-rule" || !xmlReader.isEndElement()) && !xmlReader.hasError()) {
|
||||
xmlReader.readNext();
|
||||
|
||||
if (xmlReader.name() == "entry" && xmlReader.isStartElement()) {
|
||||
QString ruleName = xmlReader.attributes().value("name").toString();
|
||||
// Read the priority tag
|
||||
xmlReader.readNextStartElement();
|
||||
while (xmlReader.name() != "priority"){
|
||||
xmlReader.readNext();
|
||||
}
|
||||
int ruleValue = xmlReader.readElementText().toUInt();
|
||||
priorityRules.insert(ruleName, ruleValue);
|
||||
}
|
||||
|
39
PKGBUILD.template
Normal file
39
PKGBUILD.template
Normal file
@@ -0,0 +1,39 @@
|
||||
# Maintainer: Keinv Yue <yuezk001@gmail.com>
|
||||
|
||||
pkgname=globalprotect-openconnect
|
||||
_gitname=GlobalProtect-openconnect
|
||||
pkgver={PKG_VERSION}
|
||||
pkgrel=1
|
||||
pkgdesc="A GlobalProtect VPN client (GUI) for Linux based on Openconnect and built with Qt5, supports SAML auth mode."
|
||||
arch=(x86_64)
|
||||
url="https://github.com/yuezk/${_gitname}"
|
||||
license=('GPL3')
|
||||
depends=('openconnect>=8.0.0' qt5-base qt5-webengine qt5-websockets)
|
||||
makedepends=()
|
||||
source=(
|
||||
"${_gitname}-${pkgver}.tar.gz::${url}/archive/v${pkgver}.tar.gz"
|
||||
"https://github.com/itay-grudev/SingleApplication/archive/v3.0.19.tar.gz"
|
||||
"https://github.com/SergiusTheBest/plog/archive/1.1.5.tar.gz"
|
||||
)
|
||||
|
||||
sha256sums=(
|
||||
'{SOURCE_SHA}'
|
||||
'9405fd259288b2a862e91e5135bccee936f0438e1b32c13603277132309d15e0'
|
||||
'6c80b4701183d2415bec927e1f5ca9b1761b3b5c65d3e09fb29c743e016d5609'
|
||||
);
|
||||
|
||||
prepare() {
|
||||
mv "$srcdir/SingleApplication-3.0.19" -T "$srcdir/${_gitname}-${pkgver}/singleapplication"
|
||||
mv "$srcdir/plog-1.1.5" -T "$srcdir/${_gitname}-${pkgver}/plog"
|
||||
}
|
||||
|
||||
build() {
|
||||
cd "$srcdir/${_gitname}-${pkgver}"
|
||||
qmake CONFIG+=release "${srcdir}/${_gitname}-${pkgver}/GlobalProtect-openconnect.pro"
|
||||
make
|
||||
}
|
||||
|
||||
package() {
|
||||
cd "$srcdir/${_gitname}-${pkgver}"
|
||||
make INSTALL_ROOT="$pkgdir/" install
|
||||
}
|
@@ -24,7 +24,7 @@ A GlobalProtect VPN client (GUI) for Linux based on Openconnect and built with Q
|
||||
|
||||
2. Install the Qt dependencies
|
||||
```sh
|
||||
sudo apt install qt5-default libqt5websockets5-dev qtwebengine5-dev
|
||||
sudo apt install qt5-default libqt5websockets5-dev qtwebengine5-dev qttools5-dev
|
||||
```
|
||||
### OpenSUSE
|
||||
Install the Qt dependencies
|
||||
|
Reference in New Issue
Block a user