Skip to content

Commit

Permalink
limited goodbyedpi to the windows platform
Browse files Browse the repository at this point in the history
  • Loading branch information
Nethius committed Sep 10, 2024
1 parent 5e27f0c commit f0e53a5
Show file tree
Hide file tree
Showing 5 changed files with 37 additions and 28 deletions.
51 changes: 25 additions & 26 deletions client/containers/containers_defs.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#include "containers_defs.h"

#include "QJsonObject"
#include "QJsonDocument"
#include "QJsonObject"

QDebug operator<<(QDebug debug, const amnezia::DockerContainer &c)
{
Expand Down Expand Up @@ -96,7 +96,7 @@ QMap<DockerContainer, QString> ContainerProps::containerHumanNames()
{ DockerContainer::Awg, "AmneziaWG" },
{ DockerContainer::Xray, "XRay" },
{ DockerContainer::Ipsec, QObject::tr("IPsec") },
{ DockerContainer::SSXray, "Shadowsocks"},
{ DockerContainer::SSXray, "Shadowsocks" },

{ DockerContainer::TorWebSite, QObject::tr("Website in Tor network") },
{ DockerContainer::Dns, QObject::tr("AmneziaDNS") },
Expand Down Expand Up @@ -124,27 +124,24 @@ QMap<DockerContainer, QString> ContainerProps::containerDescriptions()
"but very resistant to blockages. "
"Recommended for regions with high levels of censorship.") },
{ DockerContainer::Xray,
QObject::tr("XRay with REALITY - Suitable for countries with the highest level of internet censorship. "
"Traffic masking as web traffic at the TLS level, and protection against detection by active probing methods.") },
QObject::tr(
"XRay with REALITY - Suitable for countries with the highest level of internet censorship. "
"Traffic masking as web traffic at the TLS level, and protection against detection by active probing methods.") },
{ DockerContainer::Ipsec,
QObject::tr("IKEv2/IPsec - Modern stable protocol, a bit faster than others, restores connection after "
"signal loss. It has native support on the latest versions of Android and iOS.") },

{ DockerContainer::TorWebSite, QObject::tr("Deploy a WordPress site on the Tor network in two clicks.") },
{ DockerContainer::Dns,
QObject::tr("Replace the current DNS server with your own. This will increase your privacy level.") },
{ DockerContainer::Sftp,
QObject::tr("Create a file vault on your server to securely store and transfer files.") },
{ DockerContainer::Socks5Proxy,
QObject::tr("") } };
{ DockerContainer::Dns, QObject::tr("Replace the current DNS server with your own. This will increase your privacy level.") },
{ DockerContainer::Sftp, QObject::tr("Create a file vault on your server to securely store and transfer files.") },
{ DockerContainer::Socks5Proxy, QObject::tr("") } };
}

QMap<DockerContainer, QString> ContainerProps::containerDetailedDescriptions()
{
return {
{ DockerContainer::OpenVpn,
QObject::tr(
"OpenVPN stands as one of the most popular and time-tested VPN protocols available.\n"
QObject::tr("OpenVPN stands as one of the most popular and time-tested VPN protocols available.\n"
"It employs its unique security protocol, "
"leveraging the strength of SSL/TLS for encryption and key exchange. "
"Furthermore, OpenVPN's support for a multitude of authentication methods makes it versatile and adaptable, "
Expand All @@ -160,7 +157,8 @@ QMap<DockerContainer, QString> ContainerProps::containerDetailedDescriptions()
"* Can operate over both TCP and UDP network protocols.") },
{ DockerContainer::ShadowSocks,
QObject::tr("Shadowsocks, inspired by the SOCKS5 protocol, safeguards the connection using the AEAD cipher. "
"Although Shadowsocks is designed to be discreet and challenging to identify, it isn't identical to a standard HTTPS connection."
"Although Shadowsocks is designed to be discreet and challenging to identify, it isn't identical to a standard HTTPS "
"connection."
"However, certain traffic analysis systems might still detect a Shadowsocks connection. "
"Due to limited support in Amnezia, it's recommended to use AmneziaWG protocol.\n\n"
"* Available in the AmneziaVPN only on desktop platforms\n"
Expand Down Expand Up @@ -217,15 +215,18 @@ QMap<DockerContainer, QString> ContainerProps::containerDetailedDescriptions()
"* Works over UDP network protocol.") },
{ DockerContainer::Xray,
QObject::tr("The REALITY protocol, a pioneering development by the creators of XRay, "
"is specifically designed to counteract the highest levels of internet censorship through its novel approach to evasion.\n"
"It uniquely identifies censors during the TLS handshake phase, seamlessly operating as a proxy for legitimate clients while diverting censors to genuine websites like google.com, "
"is specifically designed to counteract the highest levels of internet censorship through its novel approach to "
"evasion.\n"
"It uniquely identifies censors during the TLS handshake phase, seamlessly operating as a proxy for legitimate "
"clients while diverting censors to genuine websites like google.com, "
"thus presenting an authentic TLS certificate and data. \n"
"This advanced capability differentiates REALITY from similar technologies by its ability to disguise web traffic as coming from random, "
"This advanced capability differentiates REALITY from similar technologies by its ability to disguise web traffic as "
"coming from random, "
"legitimate sites without the need for specific configurations. \n"
"Unlike older protocols such as VMess, VLESS, and the XTLS-Vision transport, "
"REALITY's innovative \"friend or foe\" recognition at the TLS handshake enhances security and circumvents detection by sophisticated DPI systems employing active probing techniques. "
"This makes REALITY a robust solution for maintaining internet freedom in environments with stringent censorship.")
},
"REALITY's innovative \"friend or foe\" recognition at the TLS handshake enhances security and circumvents detection "
"by sophisticated DPI systems employing active probing techniques. "
"This makes REALITY a robust solution for maintaining internet freedom in environments with stringent censorship.") },
{ DockerContainer::Ipsec,
QObject::tr("IKEv2, paired with the IPSec encryption layer, stands as a modern and stable VPN protocol.\n"
"One of its distinguishing features is its ability to swiftly switch between networks and devices, "
Expand All @@ -245,8 +246,7 @@ QMap<DockerContainer, QString> ContainerProps::containerDetailedDescriptions()
"You will be able to access it using\n FileZilla or other SFTP clients, "
"as well as mount the disk on your device to access\n it directly from your device.\n\n"
"For more detailed information, you can\n find it in the support section under \"Create SFTP file storage.\" ") },
{ DockerContainer::Socks5Proxy, QObject::tr("SOCKS5 proxy server") } }

{ DockerContainer::Socks5Proxy, QObject::tr("SOCKS5 proxy server") }
};
}

Expand Down Expand Up @@ -288,7 +288,8 @@ bool ContainerProps::isSupportedByCurrentPlatform(DockerContainer c)
case DockerContainer::Awg: return true;
case DockerContainer::Xray: return true;
case DockerContainer::Cloak: return true;
case DockerContainer::SSXray: return true;
case DockerContainer::SSXray:
return true;
// case DockerContainer::ShadowSocks: return true;
default: return false;
}
Expand Down Expand Up @@ -384,10 +385,8 @@ bool ContainerProps::isShareable(DockerContainer container)

QJsonObject ContainerProps::getProtocolConfigFromContainer(const Proto protocol, const QJsonObject &containerConfig)
{
QString protocolConfigString = containerConfig.value(ProtocolProps::protoToString(protocol))
.toObject()
.value(config_key::last_config)
.toString();
QString protocolConfigString =
containerConfig.value(ProtocolProps::protoToString(protocol)).toObject().value(config_key::last_config).toString();

return QJsonDocument::fromJson(protocolConfigString.toUtf8()).object();
}
Expand Down
8 changes: 8 additions & 0 deletions client/ui/controllers/localServicesController.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,16 @@ LocalServicesController::LocalServicesController(const QSharedPointer<ServersMod
const std::shared_ptr<Settings> &settings, QObject *parent)
: QObject(parent), m_serversModel(serversModel), m_settings(settings)
{
#ifdef Q_OS_WINDOWS
connect(&m_goodbyeDpiService, &GoodByeDpi::serviceStateChanged, this, &LocalServicesController::serviceStateChanged);
#endif
}

LocalServicesController::~LocalServicesController()
{
#ifdef Q_OS_WINDOWS
m_goodbyeDpiService.stop();
#endif
}

void LocalServicesController::toggleGoodbyeDpi(bool enable)
Expand Down Expand Up @@ -89,13 +93,17 @@ int LocalServicesController::getGoodbyeDpiModset()

void LocalServicesController::start()
{
#ifdef Q_OS_WINDOWS
auto errorCode = m_goodbyeDpiService.start(getGoodbyeDpiBlackListFile(), getGoodbyeDpiModset());
if (errorCode != ErrorCode::NoError) {
emit errorOccurred(errorCode);
}
#endif
}

void LocalServicesController::stop()
{
#ifdef Q_OS_WINDOWS
m_goodbyeDpiService.stop();
#endif
}
2 changes: 2 additions & 0 deletions client/ui/controllers/localServicesController.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,9 @@ public slots:
std::shared_ptr<Settings> m_settings;
QSharedPointer<ServersModel> m_serversModel;

#ifdef Q_OS_WINDOWS
GoodByeDpi m_goodbyeDpiService;
#endif
bool m_isGoodbyeDpiServiceEnabled = false;
QString m_defaultBlackListFile = QCoreApplication::applicationDirPath() + "/goodbyedpi/blacklist.txt";
};
Expand Down
2 changes: 0 additions & 2 deletions client/ui/controllers/settingsController.h
Original file line number Diff line number Diff line change
Expand Up @@ -113,8 +113,6 @@ public slots:
QSharedPointer<AppSplitTunnelingModel> m_appSplitTunnelingModel;
std::shared_ptr<Settings> m_settings;

GoodByeDpi m_goodbyeDpiService;

QString m_appVersion;

QDateTime m_loggingDisableDate;
Expand Down
2 changes: 2 additions & 0 deletions client/ui/qml/Pages2/PageSettings.qml
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,8 @@ PageType {
LabelWithButtonType {
Layout.fillWidth: true

visible: Qt.platform.os === "windows"

text: qsTr("Local bypass services")
rightImageSource: "qrc:/images/controls/chevron-right.svg"
leftImageSource: "qrc:/images/controls/app.svg"
Expand Down

0 comments on commit f0e53a5

Please sign in to comment.