mirror of
https://github.com/yuezk/GlobalProtect-openconnect.git
synced 2025-05-20 07:26:58 -04:00
Compare commits
36 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
4fada9bd14 | ||
|
b57fb993ca | ||
|
f6d06ed978 | ||
|
cc67de3a2b | ||
|
e2d28c83b2 | ||
|
a489c5881b | ||
|
44fd2f1d3f | ||
|
9c9b42b87f | ||
|
fb2b148b72 | ||
|
64bec9660a | ||
|
0619e91bf5 | ||
|
048aa4799f | ||
|
db0e8b801d | ||
|
d03bbc339e | ||
|
1312d54d08 | ||
|
39f99d9143 | ||
|
7a4eb0def3 | ||
|
d9b2094edd | ||
|
e6118af9f3 | ||
|
108b4be3ec | ||
|
65c59e47ec | ||
|
177da7f3a2 | ||
|
d5cd90373b | ||
|
ffa99d3783 | ||
|
4940830885 | ||
|
ad178fe56c | ||
|
829298bb84 | ||
|
8fe717d844 | ||
|
dffbc64ef5 | ||
|
b99c5a8391 | ||
|
c2f7576d10 | ||
|
4327235093 | ||
|
0699878b92 | ||
|
e3aba11506 | ||
|
ff58258d5c | ||
|
991cf25a7b |
11
.github/workflows/build.yml
vendored
11
.github/workflows/build.yml
vendored
@@ -3,6 +3,7 @@ name: Build
|
|||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
|
- master
|
||||||
- develop
|
- develop
|
||||||
tags:
|
tags:
|
||||||
- "v*.*.*"
|
- "v*.*.*"
|
||||||
@@ -17,7 +18,7 @@ jobs:
|
|||||||
build:
|
build:
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
os: [ubuntu-18.04, ubuntu-20.04]
|
os: [ubuntu-18.04, ubuntu-20.04, ubuntu-22.04]
|
||||||
|
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
|
|
||||||
@@ -51,6 +52,10 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
./scripts/snapshot-archive-all.sh
|
./scripts/snapshot-archive-all.sh
|
||||||
|
|
||||||
|
- name: Verify debian package
|
||||||
|
run: |
|
||||||
|
./scripts/verify-debian-package.sh
|
||||||
|
|
||||||
- uses: actions/upload-artifact@v2
|
- uses: actions/upload-artifact@v2
|
||||||
with:
|
with:
|
||||||
name: snapshot-source-code
|
name: snapshot-source-code
|
||||||
@@ -173,6 +178,10 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
./scripts/release-archive-all.sh
|
./scripts/release-archive-all.sh
|
||||||
|
|
||||||
|
- name: Verify debian package
|
||||||
|
run: |
|
||||||
|
./scripts/verify-debian-package.sh
|
||||||
|
|
||||||
- uses: actions/upload-artifact@v2
|
- uses: actions/upload-artifact@v2
|
||||||
with:
|
with:
|
||||||
name: release-source-code
|
name: release-source-code
|
||||||
|
1
.gitignore
vendored
1
.gitignore
vendored
@@ -8,6 +8,7 @@ build
|
|||||||
artifacts
|
artifacts
|
||||||
|
|
||||||
.cmake
|
.cmake
|
||||||
|
.idea
|
||||||
|
|
||||||
# Auto generated DBus files
|
# Auto generated DBus files
|
||||||
*_adaptor.cpp
|
*_adaptor.cpp
|
||||||
|
@@ -92,7 +92,7 @@ target_link_libraries(gpclient
|
|||||||
QtSignals
|
QtSignals
|
||||||
)
|
)
|
||||||
|
|
||||||
if (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 8.0)
|
if (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 8.0 AND CMAKE_BUILD_TYPE STREQUAL Release)
|
||||||
target_compile_options(gpclient PUBLIC "-ffile-prefix-map=${CMAKE_SOURCE_DIR}=.")
|
target_compile_options(gpclient PUBLIC "-ffile-prefix-map=${CMAKE_SOURCE_DIR}=.")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
@@ -6,7 +6,7 @@ Name=GlobalProtect VPN
|
|||||||
Comment=A GlobalProtect VPN client (GUI) for Linux based on OpenConnect and built with Qt5, supports SAML auth mode.
|
Comment=A GlobalProtect VPN client (GUI) for Linux based on OpenConnect and built with Qt5, supports SAML auth mode.
|
||||||
GenericName=GlobalProtect VPN client, supports SAML auth mode
|
GenericName=GlobalProtect VPN client, supports SAML auth mode
|
||||||
Categories=Network;Dialup;
|
Categories=Network;Dialup;
|
||||||
Exec=@CMAKE_INSTALL_PREFIX@/bin/gpclient
|
Exec=env QT_AUTO_SCREEN_SCALE_FACTOR=1 @CMAKE_INSTALL_PREFIX@/bin/gpclient
|
||||||
Icon=com.yuezk.qt.gpclient
|
Icon=com.yuezk.qt.gpclient
|
||||||
Keywords=GlobalProtect;Openconnect;SAML;connection;VPN;
|
Keywords=GlobalProtect;Openconnect;SAML;connection;VPN;
|
||||||
StartupWMClass=gpclient
|
StartupWMClass=gpclient
|
||||||
|
@@ -162,9 +162,18 @@ void GatewayAuthenticator::samlAuth(QString samlMethod, QString samlRequest, QSt
|
|||||||
|
|
||||||
SAMLLoginWindow *loginWindow = new SAMLLoginWindow;
|
SAMLLoginWindow *loginWindow = new SAMLLoginWindow;
|
||||||
|
|
||||||
connect(loginWindow, &SAMLLoginWindow::success, this, &GatewayAuthenticator::onSAMLLoginSuccess);
|
connect(loginWindow, &SAMLLoginWindow::success, [this, loginWindow](const QMap<QString, QString> &samlResult) {
|
||||||
connect(loginWindow, &SAMLLoginWindow::fail, this, &GatewayAuthenticator::onSAMLLoginFail);
|
this->onSAMLLoginSuccess(samlResult);
|
||||||
connect(loginWindow, &SAMLLoginWindow::rejected, this, &GatewayAuthenticator::onLoginWindowRejected);
|
loginWindow->deleteLater();
|
||||||
|
});
|
||||||
|
connect(loginWindow, &SAMLLoginWindow::fail, [this, loginWindow](const QString &error) {
|
||||||
|
this->onSAMLLoginFail(error);
|
||||||
|
loginWindow->deleteLater();
|
||||||
|
});
|
||||||
|
connect(loginWindow, &SAMLLoginWindow::rejected, [this, loginWindow]() {
|
||||||
|
this->onLoginWindowRejected();
|
||||||
|
loginWindow->deleteLater();
|
||||||
|
});
|
||||||
|
|
||||||
loginWindow->login(samlMethod, samlRequest, preloginUrl);
|
loginWindow->login(samlMethod, samlRequest, preloginUrl);
|
||||||
}
|
}
|
||||||
|
@@ -35,7 +35,7 @@ GPClient::GPClient(QWidget *parent, IVpn *vpn)
|
|||||||
connect(ov, SIGNAL(error(QString)), this, SLOT(onVPNError(QString)));
|
connect(ov, SIGNAL(error(QString)), this, SLOT(onVPNError(QString)));
|
||||||
connect(ov, SIGNAL(logAvailable(QString)), this, SLOT(onVPNLogAvailable(QString)));
|
connect(ov, SIGNAL(logAvailable(QString)), this, SLOT(onVPNLogAvailable(QString)));
|
||||||
|
|
||||||
// Initiallize the context menu of system tray.
|
// Initialize the context menu of system tray.
|
||||||
initSystemTrayIcon();
|
initSystemTrayIcon();
|
||||||
initVpnStatus();
|
initVpnStatus();
|
||||||
}
|
}
|
||||||
@@ -153,7 +153,7 @@ void GPClient::populateGatewayMenu()
|
|||||||
if (g.name() == currentGatewayName) {
|
if (g.name() == currentGatewayName) {
|
||||||
iconImage = ":/images/radio_selected.png";
|
iconImage = ":/images/radio_selected.png";
|
||||||
}
|
}
|
||||||
gatewaySwitchMenu->addAction(QIcon(iconImage), g.name())->setData(i);
|
gatewaySwitchMenu->addAction(QIcon(iconImage), QString("%1 (%2)").arg(g.name(), g.address()))->setData(i);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -279,12 +279,24 @@ void GPClient::portalLogin()
|
|||||||
{
|
{
|
||||||
PortalAuthenticator *portalAuth = new PortalAuthenticator(portal(), settings::get("clientos", "Linux").toString());
|
PortalAuthenticator *portalAuth = new PortalAuthenticator(portal(), settings::get("clientos", "Linux").toString());
|
||||||
|
|
||||||
connect(portalAuth, &PortalAuthenticator::success, this, &GPClient::onPortalSuccess);
|
connect(portalAuth, &PortalAuthenticator::success, [this, portalAuth](const PortalConfigResponse response, const QString region) {
|
||||||
|
this->onPortalSuccess(response, region);
|
||||||
|
portalAuth->deleteLater();
|
||||||
|
});
|
||||||
// Prelogin failed on the portal interface, try to treat the portal as a gateway interface
|
// Prelogin failed on the portal interface, try to treat the portal as a gateway interface
|
||||||
connect(portalAuth, &PortalAuthenticator::preloginFailed, this, &GPClient::onPortalPreloginFail);
|
connect(portalAuth, &PortalAuthenticator::preloginFailed, [this, portalAuth](const QString msg) {
|
||||||
connect(portalAuth, &PortalAuthenticator::portalConfigFailed, this, &GPClient::onPortalConfigFail);
|
this->onPortalPreloginFail(msg);
|
||||||
|
portalAuth->deleteLater();
|
||||||
|
});
|
||||||
|
connect(portalAuth, &PortalAuthenticator::portalConfigFailed, [this, portalAuth](const QString msg) {
|
||||||
|
this->onPortalConfigFail(msg);
|
||||||
|
portalAuth->deleteLater();
|
||||||
|
});
|
||||||
// Portal login failed
|
// Portal login failed
|
||||||
connect(portalAuth, &PortalAuthenticator::fail, this, &GPClient::onPortalFail);
|
connect(portalAuth, &PortalAuthenticator::fail, [this, portalAuth](const QString &msg) {
|
||||||
|
this->onPortalFail(msg);
|
||||||
|
portalAuth->deleteLater();
|
||||||
|
});
|
||||||
|
|
||||||
ui->statusLabel->setText("Authenticating...");
|
ui->statusLabel->setText("Authenticating...");
|
||||||
updateConnectionStatus(VpnStatus::pending);
|
updateConnectionStatus(VpnStatus::pending);
|
||||||
@@ -359,8 +371,14 @@ void GPClient::gatewayLogin()
|
|||||||
|
|
||||||
GatewayAuthenticator *gatewayAuth = new GatewayAuthenticator(currentGateway().address(), params);
|
GatewayAuthenticator *gatewayAuth = new GatewayAuthenticator(currentGateway().address(), params);
|
||||||
|
|
||||||
connect(gatewayAuth, &GatewayAuthenticator::success, this, &GPClient::onGatewaySuccess);
|
connect(gatewayAuth, &GatewayAuthenticator::success, [this, gatewayAuth](const QString &authToken) {
|
||||||
connect(gatewayAuth, &GatewayAuthenticator::fail, this, &GPClient::onGatewayFail);
|
this->onGatewaySuccess(authToken);
|
||||||
|
gatewayAuth->deleteLater();
|
||||||
|
});
|
||||||
|
connect(gatewayAuth, &GatewayAuthenticator::fail, [this, gatewayAuth](const QString &msg) {
|
||||||
|
this->onGatewayFail(msg);
|
||||||
|
gatewayAuth->deleteLater();
|
||||||
|
});
|
||||||
|
|
||||||
ui->statusLabel->setText("Authenticating...");
|
ui->statusLabel->setText("Authenticating...");
|
||||||
updateConnectionStatus(VpnStatus::pending);
|
updateConnectionStatus(VpnStatus::pending);
|
||||||
|
@@ -9,6 +9,7 @@
|
|||||||
#include "portalconfigresponse.h"
|
#include "portalconfigresponse.h"
|
||||||
#include "settingsdialog.h"
|
#include "settingsdialog.h"
|
||||||
#include "vpn.h"
|
#include "vpn.h"
|
||||||
|
#include "gatewayauthenticator.h"
|
||||||
|
|
||||||
QT_BEGIN_NAMESPACE
|
QT_BEGIN_NAMESPACE
|
||||||
namespace Ui { class GPClient; }
|
namespace Ui { class GPClient; }
|
||||||
@@ -80,6 +81,8 @@ private:
|
|||||||
SettingsDialog *settingsDialog;
|
SettingsDialog *settingsDialog;
|
||||||
QPushButton *settingsButton;
|
QPushButton *settingsButton;
|
||||||
|
|
||||||
|
GatewayAuthenticator *gatewayAuthenticator;
|
||||||
|
|
||||||
bool isQuickConnect { false };
|
bool isQuickConnect { false };
|
||||||
bool isSwitchingGateway { false };
|
bool isSwitchingGateway { false };
|
||||||
PortalConfigResponse portalConfig;
|
PortalConfigResponse portalConfig;
|
||||||
|
@@ -1,6 +1,5 @@
|
|||||||
#include <QtCore/QObject>
|
#include <QtCore/QObject>
|
||||||
#include <QtCore/QString>
|
#include <QtCore/QString>
|
||||||
#include <QtCore/QDir>
|
|
||||||
#include <QtCore/QStandardPaths>
|
#include <QtCore/QStandardPaths>
|
||||||
#include <plog/Log.h>
|
#include <plog/Log.h>
|
||||||
#include <plog/Init.h>
|
#include <plog/Init.h>
|
||||||
@@ -15,6 +14,8 @@
|
|||||||
#include "sigwatch.h"
|
#include "sigwatch.h"
|
||||||
#include "version.h"
|
#include "version.h"
|
||||||
|
|
||||||
|
#define QT_AUTO_SCREEN_SCALE_FACTOR "QT_AUTO_SCREEN_SCALE_FACTOR"
|
||||||
|
|
||||||
int main(int argc, char *argv[])
|
int main(int argc, char *argv[])
|
||||||
{
|
{
|
||||||
plog::ColorConsoleAppender<plog::TxtFormatter> consoleAppender(plog::streamStdErr);
|
plog::ColorConsoleAppender<plog::TxtFormatter> consoleAppender(plog::streamStdErr);
|
||||||
@@ -23,11 +24,16 @@ int main(int argc, char *argv[])
|
|||||||
PLOGI << "GlobalProtect started, version: " << VERSION;
|
PLOGI << "GlobalProtect started, version: " << VERSION;
|
||||||
|
|
||||||
QString port = QString::fromLocal8Bit(qgetenv(ENV_CDP_PORT));
|
QString port = QString::fromLocal8Bit(qgetenv(ENV_CDP_PORT));
|
||||||
|
QString hidpiSupport = QString::fromLocal8Bit(qgetenv(QT_AUTO_SCREEN_SCALE_FACTOR));
|
||||||
|
|
||||||
if (port == "") {
|
if (port.isEmpty()) {
|
||||||
qputenv(ENV_CDP_PORT, "12315");
|
qputenv(ENV_CDP_PORT, "12315");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (hidpiSupport.isEmpty()) {
|
||||||
|
qputenv(QT_AUTO_SCREEN_SCALE_FACTOR, "1");
|
||||||
|
}
|
||||||
|
|
||||||
SingleApplication app(argc, argv);
|
SingleApplication app(argc, argv);
|
||||||
app.setQuitOnLastWindowClosed(false);
|
app.setQuitOnLastWindowClosed(false);
|
||||||
|
|
||||||
@@ -39,6 +45,7 @@ int main(int argc, char *argv[])
|
|||||||
parser.addOptions({
|
parser.addOptions({
|
||||||
{"json", "Write the result of the handshake with the GlobalConnect server to stdout as JSON and terminate. Useful for scripting."},
|
{"json", "Write the result of the handshake with the GlobalConnect server to stdout as JSON and terminate. Useful for scripting."},
|
||||||
{"now", "Do not show the dialog with the connect button; connect immediately instead."},
|
{"now", "Do not show the dialog with the connect button; connect immediately instead."},
|
||||||
|
{"start-minimized", "Launch the client minimized."},
|
||||||
});
|
});
|
||||||
parser.process(app);
|
parser.process(app);
|
||||||
|
|
||||||
@@ -48,7 +55,7 @@ int main(int argc, char *argv[])
|
|||||||
? static_cast<IVpn*>(new VpnJson(nullptr)) // Print to stdout and exit
|
? static_cast<IVpn*>(new VpnJson(nullptr)) // Print to stdout and exit
|
||||||
: static_cast<IVpn*>(new VpnDbus(nullptr)); // Contact GPService daemon via dbus
|
: static_cast<IVpn*>(new VpnDbus(nullptr)); // Contact GPService daemon via dbus
|
||||||
GPClient w(nullptr, vpn);
|
GPClient w(nullptr, vpn);
|
||||||
w.show();
|
parser.isSet("start-minimized") ? w.showMinimized() : w.show();
|
||||||
|
|
||||||
if (positional.size() > 0) {
|
if (positional.size() > 0) {
|
||||||
w.portal(positional.at(0));
|
w.portal(positional.at(0));
|
||||||
|
@@ -78,10 +78,7 @@ QList<GPGateway> PortalConfigResponse::parseGateways(QXmlStreamReader &xmlReader
|
|||||||
// Parse the gateways -> external -> list -> entry
|
// Parse the gateways -> external -> list -> entry
|
||||||
if (xmlReader.name() == "entry" && xmlReader.isStartElement()) {
|
if (xmlReader.name() == "entry" && xmlReader.isStartElement()) {
|
||||||
GPGateway g;
|
GPGateway g;
|
||||||
QString address = xmlReader.attributes().value("name").toString();
|
parseGateway(xmlReader, g);
|
||||||
g.setAddress(address);
|
|
||||||
g.setPriorityRules(parsePriorityRules(xmlReader));
|
|
||||||
g.setName(parseGatewayName(xmlReader));
|
|
||||||
gateways.append(g);
|
gateways.append(g);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -91,45 +88,49 @@ QList<GPGateway> PortalConfigResponse::parseGateways(QXmlStreamReader &xmlReader
|
|||||||
return gateways;
|
return gateways;
|
||||||
}
|
}
|
||||||
|
|
||||||
QMap<QString, int> PortalConfigResponse::parsePriorityRules(QXmlStreamReader &xmlReader)
|
void PortalConfigResponse::parseGateway(QXmlStreamReader &reader, GPGateway &gateway) {
|
||||||
{
|
PLOGI << "Start parsing gateway...";
|
||||||
PLOGI << "Start parsing the priority rules...";
|
|
||||||
|
auto finished = false;
|
||||||
|
while (!finished) {
|
||||||
|
if (reader.name() == "entry" && reader.isStartElement()) {
|
||||||
|
auto address = reader.attributes().value("name").toString();
|
||||||
|
gateway.setAddress(address);
|
||||||
|
} else if (reader.name() == "description" && reader.isStartElement()) { // gateway name
|
||||||
|
gateway.setName(reader.readElementText());
|
||||||
|
} else if (reader.name() == "priority-rule" && reader.isStartElement()) { // priority rules
|
||||||
|
parsePriorityRule(reader, gateway);
|
||||||
|
}
|
||||||
|
|
||||||
|
auto result = reader.readNext();
|
||||||
|
finished = result == QXmlStreamReader::Invalid || (reader.name() == "entry" && reader.isEndElement());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void PortalConfigResponse::parsePriorityRule(QXmlStreamReader &reader, GPGateway &gateway) {
|
||||||
|
PLOGI << "Start parsing priority rule...";
|
||||||
|
|
||||||
QMap<QString, int> priorityRules;
|
QMap<QString, int> priorityRules;
|
||||||
|
auto finished = false;
|
||||||
|
|
||||||
while ((xmlReader.name() != "priority-rule" || !xmlReader.isEndElement()) && !xmlReader.hasError()) {
|
while (!finished) {
|
||||||
xmlReader.readNext();
|
// Parse the priority-rule -> entry
|
||||||
|
if (reader.name() == "entry" && reader.isStartElement()) {
|
||||||
if (xmlReader.name() == "entry" && xmlReader.isStartElement()) {
|
auto ruleName = reader.attributes().value("name").toString();
|
||||||
QString ruleName = xmlReader.attributes().value("name").toString();
|
// move to the priority value
|
||||||
// Read the priority tag
|
while (reader.readNextStartElement()) {
|
||||||
while (xmlReader.name() != "priority"){
|
if (reader.name() == "priority") {
|
||||||
xmlReader.readNext();
|
auto priority = reader.readElementText().toInt();
|
||||||
}
|
priorityRules.insert(ruleName, priority);
|
||||||
int ruleValue = xmlReader.readElementText().toUInt();
|
break;
|
||||||
priorityRules.insert(ruleName, ruleValue);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
PLOGI << "Finished parsing the priority rules.";
|
auto result = reader.readNext();
|
||||||
|
finished = result == QXmlStreamReader::Invalid || (reader.name() == "priority-rule" && reader.isEndElement());
|
||||||
return priorityRules;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
QString PortalConfigResponse::parseGatewayName(QXmlStreamReader &xmlReader)
|
gateway.setPriorityRules(priorityRules);
|
||||||
{
|
|
||||||
PLOGI << "Start parsing the gateway name...";
|
|
||||||
|
|
||||||
while (xmlReader.name() != "description" || !xmlReader.isEndElement()) {
|
|
||||||
xmlReader.readNext();
|
|
||||||
if (xmlReader.name() == "description" && xmlReader.tokenType() == xmlReader.StartElement) {
|
|
||||||
PLOGI << "Finished parsing the gateway name";
|
|
||||||
return xmlReader.readElementText();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
PLOGE << "Error: <description> tag not found";
|
|
||||||
return "";
|
|
||||||
}
|
}
|
||||||
|
|
||||||
QString PortalConfigResponse::userAuthCookie() const
|
QString PortalConfigResponse::userAuthCookie() const
|
||||||
@@ -137,11 +138,6 @@ QString PortalConfigResponse::userAuthCookie() const
|
|||||||
return m_userAuthCookie;
|
return m_userAuthCookie;
|
||||||
}
|
}
|
||||||
|
|
||||||
QString PortalConfigResponse::prelogonUserAuthCookie() const
|
|
||||||
{
|
|
||||||
return m_prelogonAuthCookie;
|
|
||||||
}
|
|
||||||
|
|
||||||
QList<GPGateway> PortalConfigResponse::allGateways() const
|
QList<GPGateway> PortalConfigResponse::allGateways() const
|
||||||
{
|
{
|
||||||
return m_gateways;
|
return m_gateways;
|
||||||
@@ -176,3 +172,4 @@ void PortalConfigResponse::setPrelogonUserAuthCookie(const QString cookie)
|
|||||||
{
|
{
|
||||||
m_prelogonAuthCookie = cookie;
|
m_prelogonAuthCookie = cookie;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -19,7 +19,6 @@ public:
|
|||||||
const QString &username() const;
|
const QString &username() const;
|
||||||
QString password() const;
|
QString password() const;
|
||||||
QString userAuthCookie() const;
|
QString userAuthCookie() const;
|
||||||
QString prelogonUserAuthCookie() const;
|
|
||||||
QList<GPGateway> allGateways() const;
|
QList<GPGateway> allGateways() const;
|
||||||
void setAllGateways(QList<GPGateway> gateways);
|
void setAllGateways(QList<GPGateway> gateways);
|
||||||
|
|
||||||
@@ -44,8 +43,9 @@ private:
|
|||||||
void setPrelogonUserAuthCookie(const QString cookie);
|
void setPrelogonUserAuthCookie(const QString cookie);
|
||||||
|
|
||||||
static QList<GPGateway> parseGateways(QXmlStreamReader &xmlReader);
|
static QList<GPGateway> parseGateways(QXmlStreamReader &xmlReader);
|
||||||
static QMap<QString, int> parsePriorityRules(QXmlStreamReader &xmlReader);
|
static void parseGateway(QXmlStreamReader &reader, GPGateway &gateway);
|
||||||
static QString parseGatewayName(QXmlStreamReader &xmlReader);
|
static void parsePriorityRule(QXmlStreamReader &reader, GPGateway &gateway);
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // PORTALCONFIGRESPONSE_H
|
#endif // PORTALCONFIGRESPONSE_H
|
||||||
|
@@ -15,6 +15,7 @@ SAMLLoginWindow::SAMLLoginWindow(QWidget *parent)
|
|||||||
|
|
||||||
QVBoxLayout *verticalLayout = new QVBoxLayout(this);
|
QVBoxLayout *verticalLayout = new QVBoxLayout(this);
|
||||||
webView->setUrl(QUrl("about:blank"));
|
webView->setUrl(QUrl("about:blank"));
|
||||||
|
webView->setAttribute(Qt::WA_DeleteOnClose);
|
||||||
// webView->page()->profile()->setPersistentCookiesPolicy(QWebEngineProfile::NoPersistentCookies);
|
// webView->page()->profile()->setPersistentCookiesPolicy(QWebEngineProfile::NoPersistentCookies);
|
||||||
verticalLayout->addWidget(webView);
|
verticalLayout->addWidget(webView);
|
||||||
|
|
||||||
|
@@ -4,6 +4,12 @@ project(GPService)
|
|||||||
|
|
||||||
set(gpservice_GENERATED_SOURCES)
|
set(gpservice_GENERATED_SOURCES)
|
||||||
|
|
||||||
|
execute_process(COMMAND logname OUTPUT_VARIABLE CMAKE_LOGNAME)
|
||||||
|
string(STRIP "${CMAKE_LOGNAME}" CMAKE_LOGNAME)
|
||||||
|
|
||||||
|
message(STATUS "CMAKE_LOGNAME: ${CMAKE_LOGNAME}")
|
||||||
|
|
||||||
|
configure_file(dbus/com.yuezk.qt.GPService.conf.in dbus/com.yuezk.qt.GPService.conf)
|
||||||
configure_file(dbus/com.yuezk.qt.GPService.service.in dbus/com.yuezk.qt.GPService.service)
|
configure_file(dbus/com.yuezk.qt.GPService.service.in dbus/com.yuezk.qt.GPService.service)
|
||||||
configure_file(systemd/gpservice.service.in systemd/gpservice.service)
|
configure_file(systemd/gpservice.service.in systemd/gpservice.service)
|
||||||
|
|
||||||
@@ -65,7 +71,7 @@ target_link_libraries(gpservice
|
|||||||
target_compile_definitions(gpservice PUBLIC QAPPLICATION_CLASS=QCoreApplication)
|
target_compile_definitions(gpservice PUBLIC QAPPLICATION_CLASS=QCoreApplication)
|
||||||
|
|
||||||
install(TARGETS gpservice DESTINATION bin)
|
install(TARGETS gpservice DESTINATION bin)
|
||||||
install(FILES "dbus/com.yuezk.qt.GPService.conf" DESTINATION share/dbus-1/system.d )
|
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/dbus/com.yuezk.qt.GPService.conf" DESTINATION share/dbus-1/system.d )
|
||||||
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/dbus/com.yuezk.qt.GPService.service" DESTINATION share/dbus-1/system-services)
|
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/dbus/com.yuezk.qt.GPService.service" DESTINATION share/dbus-1/system-services)
|
||||||
install(FILES "gp.conf" DESTINATION /etc/gpservice)
|
install(FILES "gp.conf" DESTINATION /etc/gpservice)
|
||||||
|
|
||||||
|
@@ -136,7 +136,7 @@ void GPService::connect(QString server, QString username, QString passwd)
|
|||||||
<< "--cookie-on-stdin"
|
<< "--cookie-on-stdin"
|
||||||
<< server;
|
<< server;
|
||||||
|
|
||||||
log("Start process with arugments: " + args.join(" "));
|
log("Start process with arugments: " + args.join(", "));
|
||||||
|
|
||||||
openconnect->start(bin, args);
|
openconnect->start(bin, args);
|
||||||
openconnect->write((passwd + "\n").toUtf8());
|
openconnect->write((passwd + "\n").toUtf8());
|
||||||
|
@@ -42,7 +42,7 @@ Add the repository in the above table and install it with your favorite package
|
|||||||
```sh
|
```sh
|
||||||
sudo add-apt-repository ppa:yuezk/globalprotect-openconnect
|
sudo add-apt-repository ppa:yuezk/globalprotect-openconnect
|
||||||
sudo apt-get update
|
sudo apt-get update
|
||||||
sudo apt install globalprotect-openconnect
|
sudo apt-get install globalprotect-openconnect
|
||||||
```
|
```
|
||||||
|
|
||||||
> For Linux Mint, you might need to import the GPG key with: `sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 7937C393082992E5D6E4A60453FC26B43838D761` if you encountered an error `gpg: keyserver receive failed: General error`.
|
> For Linux Mint, you might need to import the GPG key with: `sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 7937C393082992E5D6E4A60453FC26B43838D761` if you encountered an error `gpg: keyserver receive failed: General error`.
|
||||||
@@ -105,7 +105,7 @@ cd GlobalProtect-openconnect
|
|||||||
>
|
>
|
||||||
> ```sh
|
> ```sh
|
||||||
> sudo add-apt-repository ppa:dwmw2/openconnect
|
> sudo add-apt-repository ppa:dwmw2/openconnect
|
||||||
> sudo apt update
|
> sudo apt-get update
|
||||||
> ```
|
> ```
|
||||||
|
|
||||||
Build and install with:
|
Build and install with:
|
||||||
|
40
debian/changelog
vendored
40
debian/changelog
vendored
@@ -1,3 +1,43 @@
|
|||||||
|
globalprotect-openconnect (1.4.6-1) unstable; urgency=medium
|
||||||
|
|
||||||
|
* Updated VERSION, Bumped 1.4.5 –> 1.4.6
|
||||||
|
* feat: display address in gateway menu item
|
||||||
|
* fix: fix bug of parsing the portal respponse
|
||||||
|
|
||||||
|
-- Kevin Yue <k3vinyue@gmail.com> Wed, 01 Jun 2022 23:55:50 +0800
|
||||||
|
|
||||||
|
globalprotect-openconnect (1.4.5-1) unstable; urgency=medium
|
||||||
|
|
||||||
|
* Updated VERSION, Bumped 1.4.4 –> 1.4.5
|
||||||
|
* chore: refine vscode settings
|
||||||
|
* fix: rollback dbus configuration
|
||||||
|
* feat: add option to start minimized
|
||||||
|
* packaging: fix postinst for debian
|
||||||
|
* packaging: add postinst for debian
|
||||||
|
* test: test debian packaging
|
||||||
|
* ci: fix the foder path
|
||||||
|
* chore: apt -> apt-get
|
||||||
|
* ci: verify debian package
|
||||||
|
* Revert "Revert "fix: improve the dbus security""
|
||||||
|
* fix: improve the portal config parsing
|
||||||
|
* Revert "fix: improve the dbus security"
|
||||||
|
* fix: improve the dbus security
|
||||||
|
* fix: free resources in slots
|
||||||
|
* chore: refine cmake files
|
||||||
|
* fix: support high DPI screen
|
||||||
|
|
||||||
|
-- Kevin Yue <k3vinyue@gmail.com> Sun, 29 May 2022 21:15:40 +0800
|
||||||
|
|
||||||
|
globalprotect-openconnect (1.4.4-1) unstable; urgency=medium
|
||||||
|
|
||||||
|
* Updated VERSION, Bumped 1.4.3 –> 1.4.4
|
||||||
|
* fix: support the HighDPI displays
|
||||||
|
* [misc] update the build script
|
||||||
|
* [ci] Enable build job for master branch
|
||||||
|
* [ci] Add ubuntu 22.04
|
||||||
|
|
||||||
|
-- Kevin Yue <k3vinyue@gmail.com> Sat, 14 May 2022 19:21:14 +0800
|
||||||
|
|
||||||
globalprotect-openconnect (1.4.3-1) unstable; urgency=medium
|
globalprotect-openconnect (1.4.3-1) unstable; urgency=medium
|
||||||
|
|
||||||
* Updated VERSION, Bumped 1.4.2 –> 1.4.3
|
* Updated VERSION, Bumped 1.4.2 –> 1.4.3
|
||||||
|
@@ -1,7 +1,7 @@
|
|||||||
# Maintainer: Keinv Yue <yuezk001@gmail.com>
|
# Maintainer: Keinv Yue <yuezk001@gmail.com>
|
||||||
|
|
||||||
_pkgver="1.4.3"
|
_pkgver="1.4.6"
|
||||||
_commit="28d832195876614c6c730b430978268242235ab3"
|
_commit="b57fb993ca6cfb5e42cf77d2d26486ad40c32d23"
|
||||||
pkgname=globalprotect-openconnect-git
|
pkgname=globalprotect-openconnect-git
|
||||||
pkgver=${_pkgver}
|
pkgver=${_pkgver}
|
||||||
pkgrel=1
|
pkgrel=1
|
||||||
|
40
packaging/aur/PKGBUILD.in
Normal file
40
packaging/aur/PKGBUILD.in
Normal file
@@ -0,0 +1,40 @@
|
|||||||
|
# Maintainer: Keinv Yue <yuezk001@gmail.com>
|
||||||
|
|
||||||
|
_pkgver="{VERSION}"
|
||||||
|
_commit="{COMMIT}"
|
||||||
|
pkgname=globalprotect-openconnect-git
|
||||||
|
pkgver=${_pkgver}
|
||||||
|
pkgrel=1
|
||||||
|
pkgdesc="A GlobalProtect VPN client (GUI) for Linux based on Openconnect and built with Qt5, supports SAML auth mode. (development version)"
|
||||||
|
arch=(x86_64 aarch64)
|
||||||
|
url="https://github.com/yuezk/GlobalProtect-openconnect"
|
||||||
|
license=('GPL3')
|
||||||
|
backup=(
|
||||||
|
etc/gpservice/gp.conf
|
||||||
|
)
|
||||||
|
install=gp.install
|
||||||
|
depends=('openconnect>=8.0.0' qt5-base qt5-webengine qt5-websockets)
|
||||||
|
makedepends=(git cmake)
|
||||||
|
conflicts=('globalprotect-openconnect')
|
||||||
|
provides=('globalprotect-openconnect' 'gpclient' 'gpservice')
|
||||||
|
|
||||||
|
source=(git+https://github.com/yuezk/GlobalProtect-openconnect#commit=${_commit})
|
||||||
|
sha256sums=('SKIP')
|
||||||
|
|
||||||
|
prepare() {
|
||||||
|
cd GlobalProtect-openconnect
|
||||||
|
echo "${_pkgver}" > VERSION
|
||||||
|
}
|
||||||
|
|
||||||
|
build() {
|
||||||
|
cd GlobalProtect-openconnect
|
||||||
|
cmake -B build \
|
||||||
|
-DCMAKE_BUILD_TYPE=Release \
|
||||||
|
-DCMAKE_CXX_FLAGS_RELEASE=-s
|
||||||
|
make -j$(nproc) -C build
|
||||||
|
}
|
||||||
|
|
||||||
|
package() {
|
||||||
|
cd GlobalProtect-openconnect
|
||||||
|
make DESTDIR="$pkgdir/" install -C build
|
||||||
|
}
|
@@ -1,3 +1,43 @@
|
|||||||
|
-------------------------------------------------------------------
|
||||||
|
Wed Jun 1 15:55:50 UTC 2022 - k3vinyue@gmail.com - 1.4.6
|
||||||
|
|
||||||
|
- Update to 1.4.6
|
||||||
|
* Updated VERSION, Bumped 1.4.5 –> 1.4.6
|
||||||
|
* feat: display address in gateway menu item
|
||||||
|
* fix: fix bug of parsing the portal respponse
|
||||||
|
|
||||||
|
-------------------------------------------------------------------
|
||||||
|
Sun May 29 13:15:40 UTC 2022 - k3vinyue@gmail.com - 1.4.5
|
||||||
|
|
||||||
|
- Update to 1.4.5
|
||||||
|
* Updated VERSION, Bumped 1.4.4 –> 1.4.5
|
||||||
|
* chore: refine vscode settings
|
||||||
|
* fix: rollback dbus configuration
|
||||||
|
* feat: add option to start minimized
|
||||||
|
* packaging: fix postinst for debian
|
||||||
|
* packaging: add postinst for debian
|
||||||
|
* test: test debian packaging
|
||||||
|
* ci: fix the foder path
|
||||||
|
* chore: apt -> apt-get
|
||||||
|
* ci: verify debian package
|
||||||
|
* Revert "Revert "fix: improve the dbus security""
|
||||||
|
* fix: improve the portal config parsing
|
||||||
|
* Revert "fix: improve the dbus security"
|
||||||
|
* fix: improve the dbus security
|
||||||
|
* fix: free resources in slots
|
||||||
|
* chore: refine cmake files
|
||||||
|
* fix: support high DPI screen
|
||||||
|
|
||||||
|
-------------------------------------------------------------------
|
||||||
|
Sat May 14 11:21:14 UTC 2022 - k3vinyue@gmail.com - 1.4.4
|
||||||
|
|
||||||
|
- Update to 1.4.4
|
||||||
|
* Updated VERSION, Bumped 1.4.3 –> 1.4.4
|
||||||
|
* fix: support the HighDPI displays
|
||||||
|
* [misc] update the build script
|
||||||
|
* [ci] Enable build job for master branch
|
||||||
|
* [ci] Add ubuntu 22.04
|
||||||
|
|
||||||
-------------------------------------------------------------------
|
-------------------------------------------------------------------
|
||||||
Mon May 9 14:20:54 UTC 2022 - k3vinyue@gmail.com - 1.4.3
|
Mon May 9 14:20:54 UTC 2022 - k3vinyue@gmail.com - 1.4.3
|
||||||
|
|
||||||
|
@@ -1,5 +1,5 @@
|
|||||||
Name: globalprotect-openconnect
|
Name: globalprotect-openconnect
|
||||||
Version: 1.4.3
|
Version: 1.4.6
|
||||||
Release: 1
|
Release: 1
|
||||||
Summary: A GlobalProtect VPN client powered by OpenConnect
|
Summary: A GlobalProtect VPN client powered by OpenConnect
|
||||||
Group: Productivity/Networking/PPP
|
Group: Productivity/Networking/PPP
|
||||||
|
@@ -1,7 +1,7 @@
|
|||||||
#!/bin/bash -e
|
#!/bin/bash -e
|
||||||
|
|
||||||
sudo apt update
|
sudo apt-get update
|
||||||
sudo apt install -y \
|
sudo apt-get install -y \
|
||||||
build-essential \
|
build-essential \
|
||||||
qtbase5-dev \
|
qtbase5-dev \
|
||||||
libqt5websockets5-dev \
|
libqt5websockets5-dev \
|
||||||
|
@@ -35,7 +35,7 @@ function update_rpm_changelog() {
|
|||||||
function generate_pkgbuild() {
|
function generate_pkgbuild() {
|
||||||
local commit_id="$(git rev-parse HEAD)"
|
local commit_id="$(git rev-parse HEAD)"
|
||||||
local version="$(cat VERSION)"
|
local version="$(cat VERSION)"
|
||||||
sed -i"" -e "s/{COMMIT}/${commit_id}/" -e "s/{VERSION}/${version}/" packaging/aur/PKGBUILD
|
sed -e "s/{COMMIT}/${commit_id}/" -e "s/{VERSION}/${version}/" packaging/aur/PKGBUILD.in > packaging/aur/PKGBUILD
|
||||||
}
|
}
|
||||||
|
|
||||||
# Update rpm version
|
# Update rpm version
|
||||||
|
17
scripts/verify-debian-package.sh
Executable file
17
scripts/verify-debian-package.sh
Executable file
@@ -0,0 +1,17 @@
|
|||||||
|
#!/bin/bash -e
|
||||||
|
|
||||||
|
sudo apt-get update
|
||||||
|
sudo apt-get install -y \
|
||||||
|
build-essential \
|
||||||
|
qtbase5-dev \
|
||||||
|
libqt5websockets5-dev \
|
||||||
|
qtwebengine5-dev \
|
||||||
|
cmake \
|
||||||
|
debhelper
|
||||||
|
|
||||||
|
mkdir -p build
|
||||||
|
|
||||||
|
cp ./artifacts/*.tar.gz build/ && cd build
|
||||||
|
tar -xzf *.tar.gz && cd globalprotect-openconnect-*/
|
||||||
|
|
||||||
|
dpkg-buildpackage -us -uc
|
Reference in New Issue
Block a user