Tiny fixes
This commit is contained in:
parent
80ada3f241
commit
d13df65bfb
6 changed files with 20 additions and 51 deletions
|
|
@ -55,6 +55,7 @@ enum ErrorCode
|
||||||
// VPN errors
|
// VPN errors
|
||||||
OpenVpnAdaptersInUseError,
|
OpenVpnAdaptersInUseError,
|
||||||
OpenVpnUnknownError,
|
OpenVpnUnknownError,
|
||||||
|
OpenVpnTapAdapterError,
|
||||||
|
|
||||||
// 3rd party utils errors
|
// 3rd party utils errors
|
||||||
OpenVpnExecutableCrashed,
|
OpenVpnExecutableCrashed,
|
||||||
|
|
|
||||||
|
|
@ -42,6 +42,7 @@ QString errorString(ErrorCode code){
|
||||||
|
|
||||||
// VPN errors
|
// VPN errors
|
||||||
case (OpenVpnAdaptersInUseError): return QObject::tr("Can't connect: another VPN connection is active");
|
case (OpenVpnAdaptersInUseError): return QObject::tr("Can't connect: another VPN connection is active");
|
||||||
|
case (OpenVpnTapAdapterError): return QObject::tr("Can't setup OpenVPN TAP network adapter");
|
||||||
|
|
||||||
case(InternalError):
|
case(InternalError):
|
||||||
default:
|
default:
|
||||||
|
|
|
||||||
|
|
@ -48,7 +48,7 @@ QSharedPointer<IpcProcessInterfaceReplica> IpcClient::CreatePrivilegedProcess()
|
||||||
qWarning() << "IpcProcessInterfaceReplica replica is not connected!";
|
qWarning() << "IpcProcessInterfaceReplica replica is not connected!";
|
||||||
}
|
}
|
||||||
|
|
||||||
connect(pd->ipcProcess.data(), &IpcProcessInterfaceReplica::destroyed, pd->ipcProcess.data(), [pd](){
|
connect(pd->ipcProcess.data(), &IpcProcessInterfaceReplica::destroyed, pd->ipcProcess.data(), [this, pd](){
|
||||||
pd->replicaNode->deleteLater();
|
pd->replicaNode->deleteLater();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -54,7 +54,7 @@ ErrorCode OpenVpnProtocol::checkAndSetupTapDriver()
|
||||||
QRemoteObjectPendingReply<bool> resultInstall = IpcClient::Interface()->checkAndInstallDriver();
|
QRemoteObjectPendingReply<bool> resultInstall = IpcClient::Interface()->checkAndInstallDriver();
|
||||||
resultInstall.waitForFinished();
|
resultInstall.waitForFinished();
|
||||||
|
|
||||||
if (!resultInstall.returnValue()) return ErrorCode::OpenVpnUnknownError;
|
if (!resultInstall.returnValue()) return ErrorCode::OpenVpnTapAdapterError;
|
||||||
}
|
}
|
||||||
return ErrorCode::NoError;
|
return ErrorCode::NoError;
|
||||||
}
|
}
|
||||||
|
|
@ -288,52 +288,11 @@ void OpenVpnProtocol::updateVpnGateway(const QString &line)
|
||||||
for (const QString &l : params) {
|
for (const QString &l : params) {
|
||||||
if (l.contains("ifconfig")) {
|
if (l.contains("ifconfig")) {
|
||||||
if (l.split(" ").size() == 3) {
|
if (l.split(" ").size() == 3) {
|
||||||
m_vpnAddress = l.split(" ").at(1);
|
m_vpnLocalAddress = l.split(" ").at(1);
|
||||||
m_vpnGateway = l.split(" ").at(2);
|
m_vpnGateway = l.split(" ").at(2);
|
||||||
|
|
||||||
qDebug() << QString("Set vpn address %1, gw %2").arg(m_vpnAddress).arg(vpnGateway());
|
qDebug() << QString("Set vpn local address %1, gw %2").arg(m_vpnLocalAddress).arg(vpnGateway());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// QProcess ipconfig;
|
|
||||||
// ipconfig.start("ipconfig", QStringList() << "/all");
|
|
||||||
// ipconfig.waitForStarted();
|
|
||||||
// ipconfig.waitForFinished();
|
|
||||||
|
|
||||||
// QString d = ipconfig.readAll();
|
|
||||||
// d.replace("\r", "");
|
|
||||||
// //qDebug().noquote() << d;
|
|
||||||
|
|
||||||
// QStringList adapters = d.split(":\n");
|
|
||||||
|
|
||||||
// bool isTapV9Present = false;
|
|
||||||
// QString tapV9;
|
|
||||||
// for (int i = 0; i < adapters.size(); ++i) {
|
|
||||||
// if (adapters.at(i).contains("TAP-Windows Adapter V9")) {
|
|
||||||
// isTapV9Present = true;
|
|
||||||
// tapV9 = adapters.at(i);
|
|
||||||
// break;
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// if (!isTapV9Present) {
|
|
||||||
// m_vpnGateway = "";
|
|
||||||
// }
|
|
||||||
|
|
||||||
// QStringList lines = tapV9.split("\n");
|
|
||||||
// for (int i = 0; i < lines.size(); ++i) {
|
|
||||||
// if (!lines.at(i).contains("DHCP")) continue;
|
|
||||||
|
|
||||||
// QRegularExpression re("(: )([\\d\\.]+)($)");
|
|
||||||
// QRegularExpressionMatch match = re.match(lines.at(i));
|
|
||||||
|
|
||||||
// if (match.hasMatch()) {
|
|
||||||
// qDebug().noquote() << "Current VPN Gateway IP Address: " << match.captured(0);
|
|
||||||
// m_vpnGateway = match.captured(2);
|
|
||||||
// return;
|
|
||||||
// }
|
|
||||||
// else continue;
|
|
||||||
// }
|
|
||||||
|
|
||||||
// m_vpnGateway = "";
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1760,7 +1760,6 @@ void MainWindow::onConnect()
|
||||||
|
|
||||||
|
|
||||||
const QJsonObject &containerConfig = m_settings.containerConfig(serverIndex, container);
|
const QJsonObject &containerConfig = m_settings.containerConfig(serverIndex, container);
|
||||||
|
|
||||||
onConnectWorker(serverIndex, credentials, container, containerConfig);
|
onConnectWorker(serverIndex, credentials, container, containerConfig);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1832,9 +1831,12 @@ void MainWindow::onPushButtonAddCustomSitesClicked()
|
||||||
|
|
||||||
const auto &cbResolv = [this, cbProcess](const QHostInfo &hostInfo){
|
const auto &cbResolv = [this, cbProcess](const QHostInfo &hostInfo){
|
||||||
const QList<QHostAddress> &addresses = hostInfo.addresses();
|
const QList<QHostAddress> &addresses = hostInfo.addresses();
|
||||||
if (!addresses.isEmpty()) {
|
QString ipv4Addr;
|
||||||
//qDebug() << "Resolved address for" << hostInfo.hostName() << addresses.first().toString();
|
for (const QHostAddress &addr: hostInfo.addresses()) {
|
||||||
cbProcess(hostInfo.hostName(), addresses.first().toString());
|
if (addr.protocol() == QAbstractSocket::NetworkLayerProtocol::IPv4Protocol) {
|
||||||
|
cbProcess(hostInfo.hostName(),addr.toString());
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -1847,7 +1849,7 @@ void MainWindow::onPushButtonAddCustomSitesClicked()
|
||||||
else {
|
else {
|
||||||
cbProcess(newSite, "");
|
cbProcess(newSite, "");
|
||||||
updateSitesPage();
|
updateSitesPage();
|
||||||
int reqId = QHostInfo::lookupHost(newSite, this, cbResolv);
|
QHostInfo::lookupHost(newSite, this, cbResolv);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1876,6 +1878,9 @@ void MainWindow::updateSitesPage()
|
||||||
Settings::RouteMode m = m_settings.routeMode();
|
Settings::RouteMode m = m_settings.routeMode();
|
||||||
if (m == Settings::VpnAllSites) return;
|
if (m == Settings::VpnAllSites) return;
|
||||||
|
|
||||||
|
if (m == Settings::VpnOnlyForwardSites) ui->label_sites_add_custom->setText(tr("These sites will be opened using VPN"));
|
||||||
|
if (m == Settings::VpnAllExceptSites) ui->label_sites_add_custom->setText(tr("These sites will be excepted from VPN"));
|
||||||
|
|
||||||
ui->tableView_sites->setModel(sitesModels.value(m));
|
ui->tableView_sites->setModel(sitesModels.value(m));
|
||||||
sitesModels.value(m)->resetCache();
|
sitesModels.value(m)->resetCache();
|
||||||
}
|
}
|
||||||
|
|
@ -1917,6 +1922,7 @@ void MainWindow::updateServerPage()
|
||||||
|
|
||||||
ui->pushButton_server_settings_clear->setVisible(m_settings.haveAuthData(selectedServerIndex));
|
ui->pushButton_server_settings_clear->setVisible(m_settings.haveAuthData(selectedServerIndex));
|
||||||
ui->pushButton_server_settings_clear_client_cache->setVisible(m_settings.haveAuthData(selectedServerIndex));
|
ui->pushButton_server_settings_clear_client_cache->setVisible(m_settings.haveAuthData(selectedServerIndex));
|
||||||
|
ui->pushButton_server_settings_share_full->setVisible(m_settings.haveAuthData(selectedServerIndex));
|
||||||
|
|
||||||
QJsonObject server = m_settings.server(selectedServerIndex);
|
QJsonObject server = m_settings.server(selectedServerIndex);
|
||||||
QString port = server.value(config_key::port).toString();
|
QString port = server.value(config_key::port).toString();
|
||||||
|
|
|
||||||
|
|
@ -99,8 +99,10 @@ cd "%RELEASE_DIR:"=%\installer"
|
||||||
echo "Creating installer..."
|
echo "Creating installer..."
|
||||||
"%QIF_BIN_DIR:"=%\binarycreator" --offline-only -v -c config\windows.xml -p packages -f %TARGET_FILENAME%
|
"%QIF_BIN_DIR:"=%\binarycreator" --offline-only -v -c config\windows.xml -p packages -f %TARGET_FILENAME%
|
||||||
|
|
||||||
|
timeout 5
|
||||||
|
|
||||||
cd %PROJECT_DIR%
|
cd %PROJECT_DIR%
|
||||||
signtool sign /v /sm /s My /n "Privacy Technologies OU" /fd sha256 /tr http://timestamp.comodoca.com/?td=sha256 /td sha256 %TARGET_FILENAME%
|
signtool sign /v /sm /s My /n "Privacy Technologies OU" /fd sha256 /tr http://timestamp.comodoca.com/?td=sha256 /td sha256 "%TARGET_FILENAME%"
|
||||||
|
|
||||||
echo "Finished, see %TARGET_FILENAME%"
|
echo "Finished, see %TARGET_FILENAME%"
|
||||||
exit 0
|
exit 0
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue