Merge branch 'dev' of github.com:amnezia-vpn/desktop-client into feature/qt6-client-management-panel
This commit is contained in:
commit
4171afe275
55 changed files with 820 additions and 337 deletions
|
@ -109,8 +109,6 @@ QString OpenVpnOverCloakProtocol::cloakExecPath()
|
|||
{
|
||||
#ifdef Q_OS_WIN
|
||||
return Utils::executable(QString("cloak/ck-client"), true);
|
||||
#elif defined Q_OS_LINUX
|
||||
return Utils::usrExecutable("ck-client");
|
||||
#else
|
||||
return Utils::executable(QString("/ck-client"), true);
|
||||
#endif
|
||||
|
|
|
@ -109,8 +109,6 @@ QString ShadowSocksVpnProtocol::shadowSocksExecPath()
|
|||
{
|
||||
#ifdef Q_OS_WIN
|
||||
return Utils::executable(QString("ss/ss-local"), true);
|
||||
#elif defined Q_OS_LINUX
|
||||
return Utils::usrExecutable(QString("ss-local"));
|
||||
#else
|
||||
return Utils::executable(QString("/ss-local"), true);
|
||||
#endif
|
||||
|
@ -118,5 +116,17 @@ QString ShadowSocksVpnProtocol::shadowSocksExecPath()
|
|||
|
||||
void ShadowSocksVpnProtocol::readShadowSocksConfiguration(const QJsonObject &configuration)
|
||||
{
|
||||
m_shadowSocksConfig = configuration.value(ProtocolProps::key_proto_config_data(Proto::ShadowSocks)).toObject();
|
||||
QJsonObject shadowSocksConfig = configuration.value(ProtocolProps::key_proto_config_data(Proto::ShadowSocks)).toObject();
|
||||
bool isLocalPortConvertOk = false;
|
||||
bool isServerPortConvertOk = false;
|
||||
int localPort = shadowSocksConfig.value("local_port").toString().toInt(&isLocalPortConvertOk);
|
||||
int serverPort = shadowSocksConfig.value("server_port").toString().toInt(&isServerPortConvertOk);
|
||||
if (!isLocalPortConvertOk) {
|
||||
qDebug() << "Error when converting local_port field in ShadowSocks config";
|
||||
} else if (!isServerPortConvertOk) {
|
||||
qDebug() << "Error when converting server_port field in ShadowSocks config";
|
||||
}
|
||||
shadowSocksConfig["local_port"] = localPort;
|
||||
shadowSocksConfig["server_port"] = serverPort;
|
||||
m_shadowSocksConfig = shadowSocksConfig;
|
||||
}
|
||||
|
|
|
@ -12,7 +12,7 @@ WireguardProtocol::WireguardProtocol(const QJsonObject &configuration, QObject*
|
|||
VpnProtocol(configuration, parent)
|
||||
{
|
||||
m_configFile.setFileName(QDir::tempPath() + QDir::separator() + serviceName() + ".conf");
|
||||
readWireguardConfiguration(configuration);
|
||||
writeWireguardConfiguration(configuration);
|
||||
}
|
||||
|
||||
WireguardProtocol::~WireguardProtocol()
|
||||
|
@ -70,7 +70,7 @@ void WireguardProtocol::stop()
|
|||
|
||||
}
|
||||
|
||||
void WireguardProtocol::readWireguardConfiguration(const QJsonObject &configuration)
|
||||
void WireguardProtocol::writeWireguardConfiguration(const QJsonObject &configuration)
|
||||
{
|
||||
QJsonObject jConfig = configuration.value(ProtocolProps::key_proto_config_data(Proto::WireGuard)).toObject();
|
||||
|
||||
|
|
|
@ -23,7 +23,7 @@ public:
|
|||
|
||||
private:
|
||||
QString configPath() const;
|
||||
void readWireguardConfiguration(const QJsonObject &configuration);
|
||||
void writeWireguardConfiguration(const QJsonObject &configuration);
|
||||
|
||||
void updateRouteGateway(QString line);
|
||||
void updateVpnGateway(const QString &line);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue