From 6afdd8375d83fb10604267a65ed969077655da2f Mon Sep 17 00:00:00 2001 From: "vladimir.kuznetsov" Date: Fri, 22 Sep 2023 00:37:55 +0500 Subject: [PATCH 001/108] added models, classes and ui files for amnezia wireguard --- client/CMakeLists.txt | 2 + client/amnezia_application.cpp | 7 +- client/amnezia_application.h | 4 +- .../amneziaWireGuardConfigurator.cpp | 15 + .../amneziaWireGuardConfigurator.h | 18 ++ client/configurators/vpn_configurator.cpp | 48 ++-- .../configurators/wireguard_configurator.cpp | 5 +- client/configurators/wireguard_configurator.h | 22 +- client/containers/containers_defs.cpp | 7 + client/containers/containers_defs.h | 1 + client/core/scripts_registry.cpp | 9 +- client/core/servercontroller.cpp | 2 + client/protocols/amneziaWireGuardProtocol.cpp | 10 + client/protocols/amneziaWireGuardProtocol.h | 17 ++ client/protocols/protocols_defs.cpp | 6 + client/protocols/protocols_defs.h | 3 +- client/protocols/vpnprotocol.cpp | 23 +- client/protocols/wireguardprotocol.cpp | 2 +- client/resources.qrc | 1 + client/ui/controllers/pageController.h | 1 + .../protocols/amneziaWireGuardConfigModel.cpp | 70 +++++ .../protocols/amneziaWireGuardConfigModel.h | 39 +++ .../qml/Components/HomeContainersListView.qml | 3 +- .../Components/SettingsContainersListView.qml | 5 + .../PageProtocolAmneziaWireGuardSettings.qml | 272 ++++++++++++++++++ client/ui/qml/Pages2/PageSetupWizardStart.qml | 2 +- 26 files changed, 534 insertions(+), 60 deletions(-) create mode 100644 client/configurators/amneziaWireGuardConfigurator.cpp create mode 100644 client/configurators/amneziaWireGuardConfigurator.h create mode 100644 client/protocols/amneziaWireGuardProtocol.cpp create mode 100644 client/protocols/amneziaWireGuardProtocol.h create mode 100644 client/ui/models/protocols/amneziaWireGuardConfigModel.cpp create mode 100644 client/ui/models/protocols/amneziaWireGuardConfigModel.h create mode 100644 client/ui/qml/Pages2/PageProtocolAmneziaWireGuardSettings.qml diff --git a/client/CMakeLists.txt b/client/CMakeLists.txt index ca5161cf..f31a82ce 100644 --- a/client/CMakeLists.txt +++ b/client/CMakeLists.txt @@ -263,6 +263,7 @@ if(WIN32 OR (APPLE AND NOT IOS) OR (LINUX AND NOT ANDROID)) ${CMAKE_CURRENT_LIST_DIR}/protocols/openvpnovercloakprotocol.h ${CMAKE_CURRENT_LIST_DIR}/protocols/shadowsocksvpnprotocol.h ${CMAKE_CURRENT_LIST_DIR}/protocols/wireguardprotocol.h + ${CMAKE_CURRENT_LIST_DIR}/protocols/amneziawireguardprotocol.h ) set(SOURCES ${SOURCES} @@ -273,6 +274,7 @@ if(WIN32 OR (APPLE AND NOT IOS) OR (LINUX AND NOT ANDROID)) ${CMAKE_CURRENT_LIST_DIR}/protocols/openvpnovercloakprotocol.cpp ${CMAKE_CURRENT_LIST_DIR}/protocols/shadowsocksvpnprotocol.cpp ${CMAKE_CURRENT_LIST_DIR}/protocols/wireguardprotocol.cpp + ${CMAKE_CURRENT_LIST_DIR}/protocols/amneziawireguardprotocol.cpp ) endif() diff --git a/client/amnezia_application.cpp b/client/amnezia_application.cpp index 23157468..cef722b1 100644 --- a/client/amnezia_application.cpp +++ b/client/amnezia_application.cpp @@ -318,8 +318,11 @@ void AmneziaApplication::initModels() m_cloakConfigModel.reset(new CloakConfigModel(this)); m_engine->rootContext()->setContextProperty("CloakConfigModel", m_cloakConfigModel.get()); - m_wireguardConfigModel.reset(new WireGuardConfigModel(this)); - m_engine->rootContext()->setContextProperty("WireGuardConfigModel", m_wireguardConfigModel.get()); + m_wireGuardConfigModel.reset(new WireGuardConfigModel(this)); + m_engine->rootContext()->setContextProperty("WireGuardConfigModel", m_wireGuardConfigModel.get()); + + m_amneziaWireGuardConfigModel.reset(new AmneziaWireGuardConfigModel(this)); + m_engine->rootContext()->setContextProperty("AmneziaWireGuardConfigModel", m_amneziaWireGuardConfigModel.get()); #ifdef Q_OS_WINDOWS m_ikev2ConfigModel.reset(new Ikev2ConfigModel(this)); diff --git a/client/amnezia_application.h b/client/amnezia_application.h index 2dd74fcb..77e50c92 100644 --- a/client/amnezia_application.h +++ b/client/amnezia_application.h @@ -31,6 +31,7 @@ #ifdef Q_OS_WINDOWS #include "ui/models/protocols/ikev2ConfigModel.h" #endif +#include "ui/models/protocols/amneziaWireGuardConfigModel.h" #include "ui/models/protocols/openvpnConfigModel.h" #include "ui/models/protocols/shadowsocksConfigModel.h" #include "ui/models/protocols/wireguardConfigModel.h" @@ -97,7 +98,8 @@ private: QScopedPointer m_openVpnConfigModel; QScopedPointer m_shadowSocksConfigModel; QScopedPointer m_cloakConfigModel; - QScopedPointer m_wireguardConfigModel; + QScopedPointer m_wireGuardConfigModel; + QScopedPointer m_amneziaWireGuardConfigModel; #ifdef Q_OS_WINDOWS QScopedPointer m_ikev2ConfigModel; #endif diff --git a/client/configurators/amneziaWireGuardConfigurator.cpp b/client/configurators/amneziaWireGuardConfigurator.cpp new file mode 100644 index 00000000..56f0c68e --- /dev/null +++ b/client/configurators/amneziaWireGuardConfigurator.cpp @@ -0,0 +1,15 @@ +#include "amneziaWireGuardConfigurator.h" + +AmneziaWireGuardConfigurator::AmneziaWireGuardConfigurator(std::shared_ptr settings, QObject *parent) + : WireguardConfigurator(settings, parent) +{ +} + +QString AmneziaWireGuardConfigurator::genAmneziaWireGuardConfig(const ServerCredentials &credentials, + DockerContainer container, + const QJsonObject &containerConfig, ErrorCode *errorCode) +{ + auto config = WireguardConfigurator::genWireguardConfig(credentials, container, containerConfig, errorCode); + + return config; +} diff --git a/client/configurators/amneziaWireGuardConfigurator.h b/client/configurators/amneziaWireGuardConfigurator.h new file mode 100644 index 00000000..02961cf1 --- /dev/null +++ b/client/configurators/amneziaWireGuardConfigurator.h @@ -0,0 +1,18 @@ +#ifndef AMNEZIAWIREGUARDCONFIGURATOR_H +#define AMNEZIAWIREGUARDCONFIGURATOR_H + +#include + +#include "wireguard_configurator.h" + +class AmneziaWireGuardConfigurator : public WireguardConfigurator +{ + Q_OBJECT +public: + AmneziaWireGuardConfigurator(std::shared_ptr settings, QObject *parent = nullptr); + + QString genAmneziaWireGuardConfig(const ServerCredentials &credentials, DockerContainer container, + const QJsonObject &containerConfig, ErrorCode *errorCode = nullptr); +}; + +#endif // AMNEZIAWIREGUARDCONFIGURATOR_H diff --git a/client/configurators/vpn_configurator.cpp b/client/configurators/vpn_configurator.cpp index ceb6a5a4..7f0e95df 100644 --- a/client/configurators/vpn_configurator.cpp +++ b/client/configurators/vpn_configurator.cpp @@ -1,21 +1,21 @@ #include "vpn_configurator.h" -#include "openvpn_configurator.h" #include "cloak_configurator.h" -#include "shadowsocks_configurator.h" -#include "wireguard_configurator.h" #include "ikev2_configurator.h" +#include "openvpn_configurator.h" +#include "shadowsocks_configurator.h" #include "ssh_configurator.h" +#include "wireguard_configurator.h" #include -#include #include +#include #include "containers/containers_defs.h" -#include "utilities.h" #include "settings.h" +#include "utilities.h" -VpnConfigurator::VpnConfigurator(std::shared_ptr settings, QObject *parent): - ConfiguratorBase(settings, parent) +VpnConfigurator::VpnConfigurator(std::shared_ptr settings, QObject *parent) + : ConfiguratorBase(settings, parent) { openVpnConfigurator = std::shared_ptr(new OpenVpnConfigurator(settings, this)); shadowSocksConfigurator = std::shared_ptr(new ShadowSocksConfigurator(settings, this)); @@ -25,8 +25,8 @@ VpnConfigurator::VpnConfigurator(std::shared_ptr settings, QObject *pa sshConfigurator = std::shared_ptr(new SshConfigurator(settings, this)); } -QString VpnConfigurator::genVpnProtocolConfig(const ServerCredentials &credentials, - DockerContainer container, const QJsonObject &containerConfig, Proto proto, ErrorCode *errorCode) +QString VpnConfigurator::genVpnProtocolConfig(const ServerCredentials &credentials, DockerContainer container, + const QJsonObject &containerConfig, Proto proto, ErrorCode *errorCode) { switch (proto) { case Proto::OpenVpn: @@ -35,17 +35,17 @@ QString VpnConfigurator::genVpnProtocolConfig(const ServerCredentials &credentia case Proto::ShadowSocks: return shadowSocksConfigurator->genShadowSocksConfig(credentials, container, containerConfig, errorCode); - case Proto::Cloak: - return cloakConfigurator->genCloakConfig(credentials, container, containerConfig, errorCode); + case Proto::Cloak: return cloakConfigurator->genCloakConfig(credentials, container, containerConfig, errorCode); case Proto::WireGuard: return wireguardConfigurator->genWireguardConfig(credentials, container, containerConfig, errorCode); - case Proto::Ikev2: - return ikev2Configurator->genIkev2Config(credentials, container, containerConfig, errorCode); + case Proto::AmneziaWireGuard: + return wireguardConfigurator->genWireguardConfig(credentials, container, containerConfig, errorCode); - default: - return ""; + case Proto::Ikev2: return ikev2Configurator->genIkev2Config(credentials, container, containerConfig, errorCode); + + default: return ""; } } @@ -62,8 +62,8 @@ QPair VpnConfigurator::getDnsForConfig(int serverIndex) if (dns.first.isEmpty() || !Utils::checkIPv4Format(dns.first)) { if (useAmneziaDns && m_settings->containers(serverIndex).contains(DockerContainer::Dns)) { dns.first = protocols::dns::amneziaDnsIp; - } - else dns.first = m_settings->primaryDns(); + } else + dns.first = m_settings->primaryDns(); } if (dns.second.isEmpty() || !Utils::checkIPv4Format(dns.second)) { dns.second = m_settings->secondaryDns(); @@ -73,8 +73,8 @@ QPair VpnConfigurator::getDnsForConfig(int serverIndex) return dns; } -QString &VpnConfigurator::processConfigWithDnsSettings(int serverIndex, DockerContainer container, - Proto proto, QString &config) +QString &VpnConfigurator::processConfigWithDnsSettings(int serverIndex, DockerContainer container, Proto proto, + QString &config) { auto dns = getDnsForConfig(serverIndex); @@ -84,8 +84,8 @@ QString &VpnConfigurator::processConfigWithDnsSettings(int serverIndex, DockerCo return config; } -QString &VpnConfigurator::processConfigWithLocalSettings(int serverIndex, DockerContainer container, - Proto proto, QString &config) +QString &VpnConfigurator::processConfigWithLocalSettings(int serverIndex, DockerContainer container, Proto proto, + QString &config) { processConfigWithDnsSettings(serverIndex, container, proto, config); @@ -95,8 +95,8 @@ QString &VpnConfigurator::processConfigWithLocalSettings(int serverIndex, Docker return config; } -QString &VpnConfigurator::processConfigWithExportSettings(int serverIndex, DockerContainer container, - Proto proto, QString &config) +QString &VpnConfigurator::processConfigWithExportSettings(int serverIndex, DockerContainer container, Proto proto, + QString &config) { processConfigWithDnsSettings(serverIndex, container, proto, config); @@ -107,7 +107,7 @@ QString &VpnConfigurator::processConfigWithExportSettings(int serverIndex, Docke } void VpnConfigurator::updateContainerConfigAfterInstallation(DockerContainer container, QJsonObject &containerConfig, - const QString &stdOut) + const QString &stdOut) { Proto mainProto = ContainerProps::defaultProtocol(container); diff --git a/client/configurators/wireguard_configurator.cpp b/client/configurators/wireguard_configurator.cpp index 14059977..02716b72 100644 --- a/client/configurators/wireguard_configurator.cpp +++ b/client/configurators/wireguard_configurator.cpp @@ -62,7 +62,10 @@ WireguardConfigurator::ConnectionData WireguardConfigurator::prepareWireguardCon { WireguardConfigurator::ConnectionData connData = WireguardConfigurator::genClientKeys(); connData.host = credentials.hostName; - connData.port = containerConfig.value(config_key::port).toString(protocols::wireguard::defaultPort); + connData.port = containerConfig.value(config_key::wireguard) + .toObject() + .value(config_key::port) + .toString(protocols::wireguard::defaultPort); if (connData.clientPrivKey.isEmpty() || connData.clientPubKey.isEmpty()) { if (errorCode) diff --git a/client/configurators/wireguard_configurator.h b/client/configurators/wireguard_configurator.h index 7674eb06..140acc47 100644 --- a/client/configurators/wireguard_configurator.h +++ b/client/configurators/wireguard_configurator.h @@ -7,32 +7,32 @@ #include "configurator_base.h" #include "core/defs.h" -class WireguardConfigurator : ConfiguratorBase +class WireguardConfigurator : public ConfiguratorBase { Q_OBJECT public: WireguardConfigurator(std::shared_ptr settings, QObject *parent = nullptr); - struct ConnectionData { + struct ConnectionData + { QString clientPrivKey; // client private key - QString clientPubKey; // client public key - QString clientIP; // internal client IP address - QString serverPubKey; // tls-auth key - QString pskKey; // preshared key - QString host; // host ip + QString clientPubKey; // client public key + QString clientIP; // internal client IP address + QString serverPubKey; // tls-auth key + QString pskKey; // preshared key + QString host; // host ip QString port; }; QString genWireguardConfig(const ServerCredentials &credentials, DockerContainer container, - const QJsonObject &containerConfig, ErrorCode *errorCode = nullptr); + const QJsonObject &containerConfig, ErrorCode *errorCode = nullptr); QString processConfigWithLocalSettings(QString config); QString processConfigWithExportSettings(QString config); - private: - ConnectionData prepareWireguardConfig(const ServerCredentials &credentials, - DockerContainer container, const QJsonObject &containerConfig, ErrorCode *errorCode = nullptr); + ConnectionData prepareWireguardConfig(const ServerCredentials &credentials, DockerContainer container, + const QJsonObject &containerConfig, ErrorCode *errorCode = nullptr); ConnectionData genClientKeys(); }; diff --git a/client/containers/containers_defs.cpp b/client/containers/containers_defs.cpp index 20fc59f4..21f7b044 100644 --- a/client/containers/containers_defs.cpp +++ b/client/containers/containers_defs.cpp @@ -84,6 +84,7 @@ QMap ContainerProps::containerHumanNames() { DockerContainer::ShadowSocks, "ShadowSocks" }, { DockerContainer::Cloak, "OpenVPN over Cloak" }, { DockerContainer::WireGuard, "WireGuard" }, + { DockerContainer::AmneziaWireGuard, "Amnezia WireGuard" }, { DockerContainer::Ipsec, QObject::tr("IPsec") }, { DockerContainer::TorWebSite, QObject::tr("Website in Tor network") }, @@ -107,6 +108,9 @@ QMap ContainerProps::containerDescriptions() { DockerContainer::WireGuard, QObject::tr("WireGuard - New popular VPN protocol with high performance, high speed and low power " "consumption. Recommended for regions with low levels of censorship.") }, + { DockerContainer::AmneziaWireGuard, + QObject::tr("WireGuard - New popular VPN protocol with high performance, high speed and low power " + "consumption. Recommended for regions with low levels of censorship.") }, { DockerContainer::Ipsec, QObject::tr("IKEv2 - 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.") }, @@ -127,6 +131,7 @@ QMap ContainerProps::containerDetailedDescriptions() QObject::tr("Container with OpenVpn and ShadowSocks protocols " "configured with traffic masking by Cloak plugin") }, { DockerContainer::WireGuard, QObject::tr("WireGuard container") }, + { DockerContainer::WireGuard, QObject::tr("Amnezia WireGuard container") }, { DockerContainer::Ipsec, QObject::tr("IPsec container") }, { DockerContainer::TorWebSite, QObject::tr("Website in Tor network") }, @@ -143,6 +148,7 @@ amnezia::ServiceType ContainerProps::containerService(DockerContainer c) case DockerContainer::Cloak: return ServiceType::Vpn; case DockerContainer::ShadowSocks: return ServiceType::Vpn; case DockerContainer::WireGuard: return ServiceType::Vpn; + case DockerContainer::AmneziaWireGuard: return ServiceType::Vpn; case DockerContainer::Ipsec: return ServiceType::Vpn; case DockerContainer::TorWebSite: return ServiceType::Other; case DockerContainer::Dns: return ServiceType::Other; @@ -160,6 +166,7 @@ Proto ContainerProps::defaultProtocol(DockerContainer c) case DockerContainer::Cloak: return Proto::Cloak; case DockerContainer::ShadowSocks: return Proto::ShadowSocks; case DockerContainer::WireGuard: return Proto::WireGuard; + case DockerContainer::AmneziaWireGuard: return Proto::AmneziaWireGuard; case DockerContainer::Ipsec: return Proto::Ikev2; case DockerContainer::TorWebSite: return Proto::TorWebSite; diff --git a/client/containers/containers_defs.h b/client/containers/containers_defs.h index 9ca51a96..774611c8 100644 --- a/client/containers/containers_defs.h +++ b/client/containers/containers_defs.h @@ -20,6 +20,7 @@ namespace amnezia ShadowSocks, Cloak, WireGuard, + AmneziaWireGuard, Ipsec, // non-vpn diff --git a/client/core/scripts_registry.cpp b/client/core/scripts_registry.cpp index 1b379ea1..31508152 100644 --- a/client/core/scripts_registry.cpp +++ b/client/core/scripts_registry.cpp @@ -1,8 +1,8 @@ #include "scripts_registry.h" -#include #include #include +#include QString amnezia::scriptFolder(amnezia::DockerContainer container) { @@ -11,11 +11,12 @@ QString amnezia::scriptFolder(amnezia::DockerContainer container) case DockerContainer::Cloak: return QLatin1String("openvpn_cloak"); case DockerContainer::ShadowSocks: return QLatin1String("openvpn_shadowsocks"); case DockerContainer::WireGuard: return QLatin1String("wireguard"); + case DockerContainer::AmneziaWireGuard: return QLatin1String("wireguard"); case DockerContainer::Ipsec: return QLatin1String("ipsec"); case DockerContainer::TorWebSite: return QLatin1String("website_tor"); case DockerContainer::Dns: return QLatin1String("dns"); - //case DockerContainer::FileShare: return QLatin1String("file_share"); + // case DockerContainer::FileShare: return QLatin1String("file_share"); case DockerContainer::Sftp: return QLatin1String("sftp"); default: return ""; } @@ -52,7 +53,7 @@ QString amnezia::scriptData(amnezia::SharedScriptType type) { QString fileName = QString(":/server_scripts/%1").arg(amnezia::scriptName(type)); QFile file(fileName); - if (! file.open(QIODevice::ReadOnly)) { + if (!file.open(QIODevice::ReadOnly)) { qDebug() << "Warning: script missing" << fileName; return ""; } @@ -67,7 +68,7 @@ QString amnezia::scriptData(amnezia::ProtocolScriptType type, DockerContainer co { QString fileName = QString(":/server_scripts/%1/%2").arg(amnezia::scriptFolder(container), amnezia::scriptName(type)); QFile file(fileName); - if (! file.open(QIODevice::ReadOnly)) { + if (!file.open(QIODevice::ReadOnly)) { qDebug() << "Warning: script missing" << fileName; return ""; } diff --git a/client/core/servercontroller.cpp b/client/core/servercontroller.cpp index b0f8146f..27213dc3 100644 --- a/client/core/servercontroller.cpp +++ b/client/core/servercontroller.cpp @@ -486,6 +486,8 @@ ServerController::Vars ServerController::genVarsForScript(const ServerCredential const QJsonObject &cloakConfig = config.value(ProtocolProps::protoToString(Proto::Cloak)).toObject(); const QJsonObject &ssConfig = config.value(ProtocolProps::protoToString(Proto::ShadowSocks)).toObject(); const QJsonObject &wireguarConfig = config.value(ProtocolProps::protoToString(Proto::WireGuard)).toObject(); + const QJsonObject &amneziaWireguarConfig = + config.value(ProtocolProps::protoToString(Proto::AmneziaWireGuard)).toObject(); const QJsonObject &sftpConfig = config.value(ProtocolProps::protoToString(Proto::Sftp)).toObject(); Vars vars; diff --git a/client/protocols/amneziaWireGuardProtocol.cpp b/client/protocols/amneziaWireGuardProtocol.cpp new file mode 100644 index 00000000..b4c5b430 --- /dev/null +++ b/client/protocols/amneziaWireGuardProtocol.cpp @@ -0,0 +1,10 @@ +#include "amneziaWireGuardProtocol.h" + +AmneziaWireGuardProtocol::AmneziaWireGuardProtocol(const QJsonObject &configuration, QObject *parent) + : WireguardProtocol(configuration, parent) +{ +} + +AmneziaWireGuardProtocol::~AmneziaWireGuardProtocol() +{ +} diff --git a/client/protocols/amneziaWireGuardProtocol.h b/client/protocols/amneziaWireGuardProtocol.h new file mode 100644 index 00000000..329a585e --- /dev/null +++ b/client/protocols/amneziaWireGuardProtocol.h @@ -0,0 +1,17 @@ +#ifndef AMNEZIAWIREGUARDPROTOCOL_H +#define AMNEZIAWIREGUARDPROTOCOL_H + +#include + +#include "wireguardprotocol.h" + +class AmneziaWireGuardProtocol : public WireguardProtocol +{ + Q_OBJECT + +public: + explicit AmneziaWireGuardProtocol(const QJsonObject &configuration, QObject *parent = nullptr); + virtual ~AmneziaWireGuardProtocol() override; +}; + +#endif // AMNEZIAWIREGUARDPROTOCOL_H diff --git a/client/protocols/protocols_defs.cpp b/client/protocols/protocols_defs.cpp index 5f8600db..64cdd003 100644 --- a/client/protocols/protocols_defs.cpp +++ b/client/protocols/protocols_defs.cpp @@ -66,6 +66,7 @@ QMap ProtocolProps::protocolHumanNames() { Proto::ShadowSocks, "ShadowSocks" }, { Proto::Cloak, "Cloak" }, { Proto::WireGuard, "WireGuard" }, + { Proto::WireGuard, "Amnezia WireGuard" }, { Proto::Ikev2, "IKEv2" }, { Proto::L2tp, "L2TP" }, @@ -88,6 +89,7 @@ amnezia::ServiceType ProtocolProps::protocolService(Proto p) case Proto::Cloak: return ServiceType::Vpn; case Proto::ShadowSocks: return ServiceType::Vpn; case Proto::WireGuard: return ServiceType::Vpn; + case Proto::AmneziaWireGuard: return ServiceType::Vpn; case Proto::TorWebSite: return ServiceType::Other; case Proto::Dns: return ServiceType::Other; case Proto::FileShare: return ServiceType::Other; @@ -103,6 +105,7 @@ int ProtocolProps::defaultPort(Proto p) case Proto::Cloak: return 443; case Proto::ShadowSocks: return 6789; case Proto::WireGuard: return 51820; + case Proto::AmneziaWireGuard: return 55424; case Proto::Ikev2: return -1; case Proto::L2tp: return -1; @@ -122,6 +125,7 @@ bool ProtocolProps::defaultPortChangeable(Proto p) case Proto::Cloak: return true; case Proto::ShadowSocks: return true; case Proto::WireGuard: return true; + case Proto::AmneziaWireGuard: return true; case Proto::Ikev2: return false; case Proto::L2tp: return false; @@ -140,6 +144,7 @@ TransportProto ProtocolProps::defaultTransportProto(Proto p) case Proto::Cloak: return TransportProto::Tcp; case Proto::ShadowSocks: return TransportProto::Tcp; case Proto::WireGuard: return TransportProto::Udp; + case Proto::AmneziaWireGuard: return TransportProto::Udp; case Proto::Ikev2: return TransportProto::Udp; case Proto::L2tp: return TransportProto::Udp; // non-vpn @@ -158,6 +163,7 @@ bool ProtocolProps::defaultTransportProtoChangeable(Proto p) case Proto::Cloak: return false; case Proto::ShadowSocks: return false; case Proto::WireGuard: return false; + case Proto::AmneziaWireGuard: return false; case Proto::Ikev2: return false; case Proto::L2tp: return false; // non-vpn diff --git a/client/protocols/protocols_defs.h b/client/protocols/protocols_defs.h index 9472164b..4e72e318 100644 --- a/client/protocols/protocols_defs.h +++ b/client/protocols/protocols_defs.h @@ -2,8 +2,8 @@ #define PROTOCOLS_DEFS_H #include -#include #include +#include namespace amnezia { @@ -158,6 +158,7 @@ namespace amnezia ShadowSocks, Cloak, WireGuard, + AmneziaWireGuard, Ikev2, L2tp, diff --git a/client/protocols/vpnprotocol.cpp b/client/protocols/vpnprotocol.cpp index 841d307c..527ede47 100644 --- a/client/protocols/vpnprotocol.cpp +++ b/client/protocols/vpnprotocol.cpp @@ -1,22 +1,21 @@ #include #include -#include "vpnprotocol.h" #include "core/errorstrings.h" +#include "vpnprotocol.h" #if defined(Q_OS_WINDOWS) || defined(Q_OS_MACX) || (defined(Q_OS_LINUX) && !defined(Q_OS_ANDROID)) -#include "openvpnprotocol.h" -#include "shadowsocksvpnprotocol.h" -#include "openvpnovercloakprotocol.h" -#include "wireguardprotocol.h" + #include "openvpnovercloakprotocol.h" + #include "openvpnprotocol.h" + #include "shadowsocksvpnprotocol.h" + #include "wireguardprotocol.h" #endif #ifdef Q_OS_WINDOWS -#include "ikev2_vpn_protocol_windows.h" + #include "ikev2_vpn_protocol_windows.h" #endif - -VpnProtocol::VpnProtocol(const QJsonObject &configuration, QObject* parent) +VpnProtocol::VpnProtocol(const QJsonObject &configuration, QObject *parent) : QObject(parent), m_connectionState(Vpn::ConnectionState::Unknown), m_rawConfig(configuration), @@ -31,7 +30,7 @@ VpnProtocol::VpnProtocol(const QJsonObject &configuration, QObject* parent) void VpnProtocol::setLastError(ErrorCode lastError) { m_lastError = lastError; - if (lastError){ + if (lastError) { setConnectionState(Vpn::ConnectionState::Error); } qCritical().noquote() << "VpnProtocol error, code" << m_lastError << errorString(m_lastError); @@ -103,7 +102,7 @@ QString VpnProtocol::vpnGateway() const return m_vpnGateway; } -VpnProtocol *VpnProtocol::factory(DockerContainer container, const QJsonObject& configuration) +VpnProtocol *VpnProtocol::factory(DockerContainer container, const QJsonObject &configuration) { switch (container) { #if defined(Q_OS_WINDOWS) @@ -114,6 +113,7 @@ VpnProtocol *VpnProtocol::factory(DockerContainer container, const QJsonObject& case DockerContainer::Cloak: return new OpenVpnOverCloakProtocol(configuration); case DockerContainer::ShadowSocks: return new ShadowSocksVpnProtocol(configuration); case DockerContainer::WireGuard: return new WireguardProtocol(configuration); + case DockerContainer::AmneziaWireGuard: return new WireguardProtocol(configuration); #endif default: return nullptr; } @@ -135,8 +135,7 @@ QString VpnProtocol::textConnectionState(Vpn::ConnectionState connectionState) case Vpn::ConnectionState::Disconnecting: return tr("Disconnecting..."); case Vpn::ConnectionState::Reconnecting: return tr("Reconnecting..."); case Vpn::ConnectionState::Error: return tr("Error"); - default: - ; + default:; } return QString(); diff --git a/client/protocols/wireguardprotocol.cpp b/client/protocols/wireguardprotocol.cpp index 7466d1af..eb37f67a 100644 --- a/client/protocols/wireguardprotocol.cpp +++ b/client/protocols/wireguardprotocol.cpp @@ -18,7 +18,7 @@ WireguardProtocol::WireguardProtocol(const QJsonObject &configuration, QObject * // MZ #if defined(MZ_LINUX) - //m_impl.reset(new LinuxController()); + // m_impl.reset(new LinuxController()); #elif defined(Q_OS_MAC) || defined(Q_OS_WIN) m_impl.reset(new LocalSocketController()); connect(m_impl.get(), &ControllerImpl::connected, this, diff --git a/client/resources.qrc b/client/resources.qrc index 5b4d6ae7..44c61172 100644 --- a/client/resources.qrc +++ b/client/resources.qrc @@ -215,5 +215,6 @@ ui/qml/Controls2/ListViewWithLabelsType.qml ui/qml/Pages2/PageServiceDnsSettings.qml ui/qml/Controls2/TopCloseButtonType.qml + ui/qml/Pages2/PageProtocolAmneziaWireGuardSettings.qml diff --git a/client/ui/controllers/pageController.h b/client/ui/controllers/pageController.h index a8f883fe..cf248900 100644 --- a/client/ui/controllers/pageController.h +++ b/client/ui/controllers/pageController.h @@ -49,6 +49,7 @@ namespace PageLoader PageProtocolShadowSocksSettings, PageProtocolCloakSettings, PageProtocolWireGuardSettings, + PageProtocolAmneziaWireGuardSettings, PageProtocolIKev2Settings, PageProtocolRaw }; diff --git a/client/ui/models/protocols/amneziaWireGuardConfigModel.cpp b/client/ui/models/protocols/amneziaWireGuardConfigModel.cpp new file mode 100644 index 00000000..9cf4ed14 --- /dev/null +++ b/client/ui/models/protocols/amneziaWireGuardConfigModel.cpp @@ -0,0 +1,70 @@ +#include "amneziaWireGuardConfigModel.h" + +#include "protocols/protocols_defs.h" + +AmneziaWireGuardConfigModel::AmneziaWireGuardConfigModel(QObject *parent) : QAbstractListModel(parent) +{ +} + +int AmneziaWireGuardConfigModel::rowCount(const QModelIndex &parent) const +{ + Q_UNUSED(parent); + return 1; +} + +bool AmneziaWireGuardConfigModel::setData(const QModelIndex &index, const QVariant &value, int role) +{ + if (!index.isValid() || index.row() < 0 || index.row() >= ContainerProps::allContainers().size()) { + return false; + } + + switch (role) { + case Roles::PortRole: m_protocolConfig.insert(config_key::port, value.toString()); break; + case Roles::CipherRole: m_protocolConfig.insert(config_key::cipher, value.toString()); break; + } + + emit dataChanged(index, index, QList { role }); + return true; +} + +QVariant AmneziaWireGuardConfigModel::data(const QModelIndex &index, int role) const +{ + if (!index.isValid() || index.row() < 0 || index.row() >= rowCount()) { + return false; + } + + switch (role) { + case Roles::PortRole: return m_protocolConfig.value(config_key::port).toString(protocols::shadowsocks::defaultPort); + case Roles::CipherRole: + return m_protocolConfig.value(config_key::cipher).toString(protocols::shadowsocks::defaultCipher); + } + + return QVariant(); +} + +void AmneziaWireGuardConfigModel::updateModel(const QJsonObject &config) +{ + beginResetModel(); + m_container = ContainerProps::containerFromString(config.value(config_key::container).toString()); + + m_fullConfig = config; + QJsonObject protocolConfig = config.value(config_key::wireguard).toObject(); + + endResetModel(); +} + +QJsonObject AmneziaWireGuardConfigModel::getConfig() +{ + m_fullConfig.insert(config_key::wireguard, m_protocolConfig); + return m_fullConfig; +} + +QHash AmneziaWireGuardConfigModel::roleNames() const +{ + QHash roles; + + roles[PortRole] = "port"; + roles[CipherRole] = "cipher"; + + return roles; +} diff --git a/client/ui/models/protocols/amneziaWireGuardConfigModel.h b/client/ui/models/protocols/amneziaWireGuardConfigModel.h new file mode 100644 index 00000000..b798c289 --- /dev/null +++ b/client/ui/models/protocols/amneziaWireGuardConfigModel.h @@ -0,0 +1,39 @@ +#ifndef AMNEZIAWIREGUARDCONFIGMODEL_H +#define AMNEZIAWIREGUARDCONFIGMODEL_H + +#include +#include + +#include "containers/containers_defs.h" + +class AmneziaWireGuardConfigModel : public QAbstractListModel +{ + Q_OBJECT + +public: + enum Roles { + PortRole = Qt::UserRole + 1, + CipherRole + }; + + explicit AmneziaWireGuardConfigModel(QObject *parent = nullptr); + + int rowCount(const QModelIndex &parent = QModelIndex()) const override; + + bool setData(const QModelIndex &index, const QVariant &value, int role) override; + QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override; + +public slots: + void updateModel(const QJsonObject &config); + QJsonObject getConfig(); + +protected: + QHash roleNames() const override; + +private: + DockerContainer m_container; + QJsonObject m_protocolConfig; + QJsonObject m_fullConfig; +}; + +#endif // AMNEZIAWIREGUARDCONFIGMODEL_H diff --git a/client/ui/qml/Components/HomeContainersListView.qml b/client/ui/qml/Components/HomeContainersListView.qml index 4708128f..037a666d 100644 --- a/client/ui/qml/Components/HomeContainersListView.qml +++ b/client/ui/qml/Components/HomeContainersListView.qml @@ -72,8 +72,7 @@ ListView { containersDropDown.menuVisible = false - if (needReconnected && - (ConnectionController.isConnected || ConnectionController.isConnectionInProgress)) { + if (needReconnected && (ConnectionController.isConnected || ConnectionController.isConnectionInProgress)) { PageController.showNotificationMessage(qsTr("Reconnect via VPN Procotol: ") + name) PageController.goToPageHome() menu.visible = false diff --git a/client/ui/qml/Components/SettingsContainersListView.qml b/client/ui/qml/Components/SettingsContainersListView.qml index edd96bd7..250ba1eb 100644 --- a/client/ui/qml/Components/SettingsContainersListView.qml +++ b/client/ui/qml/Components/SettingsContainersListView.qml @@ -64,6 +64,11 @@ ListView { // goToPage(PageEnum.PageProtocolWireGuardSettings) break } + case ContainerEnum.AmneziaWireGuard: { + WireGuardConfigModel.updateModel(config) + PageController.goToPage(PageEnum.PageProtocolAmneziaWireGuardSettings) + break + } case ContainerEnum.Ipsec: { ProtocolsModel.updateModel(config) PageController.goToPage(PageEnum.PageProtocolRaw) diff --git a/client/ui/qml/Pages2/PageProtocolAmneziaWireGuardSettings.qml b/client/ui/qml/Pages2/PageProtocolAmneziaWireGuardSettings.qml new file mode 100644 index 00000000..a905f47a --- /dev/null +++ b/client/ui/qml/Pages2/PageProtocolAmneziaWireGuardSettings.qml @@ -0,0 +1,272 @@ +import QtQuick +import QtQuick.Controls +import QtQuick.Layouts + +import SortFilterProxyModel 0.2 + +import "./" +import "../Controls2" +import "../Controls2/TextTypes" +import "../Config" +import "../Components" + +PageType { + id: root + + ColumnLayout { + id: backButton + + anchors.top: parent.top + anchors.left: parent.left + anchors.right: parent.right + + anchors.topMargin: 20 + + BackButtonType { + } + } + + FlickableType { + id: fl + anchors.top: backButton.bottom + anchors.bottom: parent.bottom + contentHeight: content.implicitHeight + + Column { + id: content + + anchors.top: parent.top + anchors.left: parent.left + anchors.right: parent.right + + enabled: ServersModel.isCurrentlyProcessedServerHasWriteAccess() + + ListView { + id: listview + + width: parent.width + height: listview.contentItem.height + + clip: true + interactive: false + + model: AmneziaWireGuardConfigModel + + delegate: Item { + implicitWidth: listview.width + implicitHeight: col.implicitHeight + + ColumnLayout { + id: col + + anchors.top: parent.top + anchors.left: parent.left + anchors.right: parent.right + + anchors.leftMargin: 16 + anchors.rightMargin: 16 + + spacing: 0 + + HeaderType { + Layout.fillWidth: true + + headerText: qsTr("Amnezia WireGuard settings") + } + + TextFieldWithHeaderType { + Layout.fillWidth: true + Layout.topMargin: 40 + + headerText: qsTr("Port") + textFieldText: port + textField.maximumLength: 5 + textField.validator: IntValidator { bottom: 1; top: 65535 } + + textField.onEditingFinished: { + if (textFieldText !== port) { + port = textFieldText + } + } + } + + TextFieldWithHeaderType { + Layout.fillWidth: true + Layout.topMargin: 16 + + headerText: qsTr("Junk packet count") + textFieldText: port + + textField.onEditingFinished: { + if (textFieldText !== port) { + port = textFieldText + } + } + } + + TextFieldWithHeaderType { + Layout.fillWidth: true + Layout.topMargin: 16 + + headerText: qsTr("Junk packet minimum size") + textFieldText: port + + textField.onEditingFinished: { + if (textFieldText !== port) { + port = textFieldText + } + } + } + + TextFieldWithHeaderType { + Layout.fillWidth: true + Layout.topMargin: 16 + + headerText: qsTr("Junk packet maximum size") + textFieldText: port + + textField.onEditingFinished: { + if (textFieldText !== port) { + port = textFieldText + } + } + } + + TextFieldWithHeaderType { + Layout.fillWidth: true + Layout.topMargin: 16 + + headerText: qsTr("Init packet junk size") + textFieldText: port + + textField.onEditingFinished: { + if (textFieldText !== port) { + port = textFieldText + } + } + } + + TextFieldWithHeaderType { + Layout.fillWidth: true + Layout.topMargin: 16 + + headerText: qsTr("Response packet junk size") + textFieldText: port + + textField.onEditingFinished: { + if (textFieldText !== port) { + port = textFieldText + } + } + } + + TextFieldWithHeaderType { + Layout.fillWidth: true + Layout.topMargin: 16 + + headerText: qsTr("Init packet magic header") + textFieldText: port + + textField.onEditingFinished: { + if (textFieldText !== port) { + port = textFieldText + } + } + } + + TextFieldWithHeaderType { + Layout.fillWidth: true + Layout.topMargin: 16 + + headerText: qsTr("Response packet magic header") + textFieldText: port + + textField.onEditingFinished: { + if (textFieldText !== port) { + port = textFieldText + } + } + } + + TextFieldWithHeaderType { + Layout.fillWidth: true + Layout.topMargin: 16 + + headerText: qsTr("Transport packet magic header") + textFieldText: port + + textField.onEditingFinished: { + if (textFieldText !== port) { + port = textFieldText + } + } + } + + TextFieldWithHeaderType { + Layout.fillWidth: true + Layout.topMargin: 16 + + headerText: qsTr("Underload packet magic header") + textFieldText: port + + textField.onEditingFinished: { + if (textFieldText !== port) { + port = textFieldText + } + } + } + + BasicButtonType { + Layout.topMargin: 24 + Layout.leftMargin: -8 + implicitHeight: 32 + + defaultColor: "transparent" + hoveredColor: Qt.rgba(1, 1, 1, 0.08) + pressedColor: Qt.rgba(1, 1, 1, 0.12) + textColor: "#EB5757" + + text: qsTr("Remove Amnezia WireGuard") + + onClicked: { + questionDrawer.headerText = qsTr("Remove Amnezia WireGuard from server?") + questionDrawer.descriptionText = qsTr("All users with whom you shared a connection will no longer be able to connect to it") + questionDrawer.yesButtonText = qsTr("Continue") + questionDrawer.noButtonText = qsTr("Cancel") + + questionDrawer.yesButtonFunction = function() { + questionDrawer.visible = false + PageController.goToPage(PageEnum.PageDeinstalling) + InstallController.removeCurrentlyProcessedContainer() + } + questionDrawer.noButtonFunction = function() { + questionDrawer.visible = false + } + questionDrawer.visible = true + } + } + + BasicButtonType { + Layout.fillWidth: true + Layout.topMargin: 24 + Layout.bottomMargin: 24 + + text: qsTr("Save and Restart Amnezia") + + onClicked: { + forceActiveFocus() +// PageController.showBusyIndicator(true) +// InstallController.updateContainer(ShadowSocksConfigModel.getConfig()) +// PageController.showBusyIndicator(false) + } + } + } + } + } + } + + QuestionDrawer { + id: questionDrawer + } + } +} diff --git a/client/ui/qml/Pages2/PageSetupWizardStart.qml b/client/ui/qml/Pages2/PageSetupWizardStart.qml index 9f5e57a5..ba78c985 100644 --- a/client/ui/qml/Pages2/PageSetupWizardStart.qml +++ b/client/ui/qml/Pages2/PageSetupWizardStart.qml @@ -62,7 +62,7 @@ PageType { function onInstallationErrorOccurred(errorMessage) { PageController.showErrorMessage(errorMessage) - var currentPageName = tabBarStackView.currentItem.objectName + var currentPageName = stackView.currentItem.objectName if (currentPageName === PageController.getPagePath(PageEnum.PageSetupWizardInstalling)) { PageController.closePage() From af53c456ea91a187defc72844e4a23de26d92987 Mon Sep 17 00:00:00 2001 From: "vladimir.kuznetsov" Date: Wed, 27 Sep 2023 00:40:01 +0500 Subject: [PATCH 002/108] added passing new wireguard config parameters over uapi and configuring the amneziawireguard container --- .../amneziaWireGuardConfigurator.cpp | 51 +++++++++++++++++-- client/configurators/vpn_configurator.cpp | 6 ++- client/configurators/vpn_configurator.h | 4 +- .../configurators/wireguard_configurator.cpp | 43 ++++++++-------- client/configurators/wireguard_configurator.h | 9 +++- client/core/scripts_registry.cpp | 3 +- client/core/scripts_registry.h | 3 +- client/core/servercontroller.cpp | 31 +++++++++++ client/daemon/daemon.cpp | 11 ++++ client/daemon/interfaceconfig.h | 10 ++++ client/mozilla/localsocketcontroller.cpp | 17 ++++++- .../macos/daemon/wireguardutilsmacos.cpp | 11 ++++ client/protocols/protocols_defs.h | 30 +++++++++++ client/resources.qrc | 5 ++ .../amnezia_wireguard/Dockerfile | 46 +++++++++++++++++ .../amnezia_wireguard/configure_container.sh | 26 ++++++++++ .../amnezia_wireguard/run_container.sh | 18 +++++++ .../server_scripts/amnezia_wireguard/start.sh | 28 ++++++++++ .../amnezia_wireguard/template.conf | 20 ++++++++ 19 files changed, 342 insertions(+), 30 deletions(-) create mode 100644 client/server_scripts/amnezia_wireguard/Dockerfile create mode 100644 client/server_scripts/amnezia_wireguard/configure_container.sh create mode 100644 client/server_scripts/amnezia_wireguard/run_container.sh create mode 100644 client/server_scripts/amnezia_wireguard/start.sh create mode 100644 client/server_scripts/amnezia_wireguard/template.conf diff --git a/client/configurators/amneziaWireGuardConfigurator.cpp b/client/configurators/amneziaWireGuardConfigurator.cpp index 56f0c68e..3ed27208 100644 --- a/client/configurators/amneziaWireGuardConfigurator.cpp +++ b/client/configurators/amneziaWireGuardConfigurator.cpp @@ -1,7 +1,10 @@ #include "amneziaWireGuardConfigurator.h" +#include +#include + AmneziaWireGuardConfigurator::AmneziaWireGuardConfigurator(std::shared_ptr settings, QObject *parent) - : WireguardConfigurator(settings, parent) + : WireguardConfigurator(settings, true, parent) { } @@ -9,7 +12,49 @@ QString AmneziaWireGuardConfigurator::genAmneziaWireGuardConfig(const ServerCred DockerContainer container, const QJsonObject &containerConfig, ErrorCode *errorCode) { - auto config = WireguardConfigurator::genWireguardConfig(credentials, container, containerConfig, errorCode); + QString config = WireguardConfigurator::genWireguardConfig(credentials, container, containerConfig, errorCode); - return config; + QJsonObject jsonConfig = QJsonDocument::fromJson(config.toUtf8()).object(); + QJsonObject awgConfig = containerConfig.value(config_key::amneziaWireguard).toObject(); + + auto junkPacketCount = + awgConfig.value(config_key::junkPacketCount).toString(protocols::amneziawireguard::defaultJunkPacketCount); + auto junkPacketMinSize = + awgConfig.value(config_key::junkPacketMinSize).toString(protocols::amneziawireguard::defaultJunkPacketMinSize); + auto junkPacketMaxSize = + awgConfig.value(config_key::junkPacketMaxSize).toString(protocols::amneziawireguard::defaultJunkPacketMaxSize); + auto initPacketJunkSize = + awgConfig.value(config_key::initPacketJunkSize).toString(protocols::amneziawireguard::defaultInitPacketJunkSize); + auto responsePacketJunkSize = + awgConfig.value(config_key::responsePacketJunkSize).toString(protocols::amneziawireguard::defaultResponsePacketJunkSize); + auto initPacketMagicHeader = + awgConfig.value(config_key::initPacketMagicHeader).toString(protocols::amneziawireguard::defaultInitPacketMagicHeader); + auto responsePacketMagicHeader = + awgConfig.value(config_key::responsePacketMagicHeader).toString(protocols::amneziawireguard::defaultResponsePacketMagicHeader); + auto underloadPacketMagicHeader = + awgConfig.value(config_key::underloadPacketMagicHeader).toString(protocols::amneziawireguard::defaultUnderloadPacketMagicHeader); + auto transportPacketMagicHeader = + awgConfig.value(config_key::transportPacketMagicHeader).toString(protocols::amneziawireguard::defaultTransportPacketMagicHeader); + + config.replace("$JUNK_PACKET_COUNT", junkPacketCount); + config.replace("$JUNK_PACKET_MIN_SIZE", junkPacketMinSize); + config.replace("$JUNK_PACKET_MAX_SIZE", junkPacketMaxSize); + config.replace("$INIT_PACKET_JUNK_SIZE", initPacketJunkSize); + config.replace("$RESPONSE_PACKET_JUNK_SIZE", responsePacketJunkSize); + config.replace("$INIT_PACKET_MAGIC_HEADER", initPacketMagicHeader); + config.replace("$RESPONSE_PACKET_MAGIC_HEADER", responsePacketMagicHeader); + config.replace("$UNDERLOAD_PACKET_MAGIC_HEADER", underloadPacketMagicHeader); + config.replace("$TRANSPORT_PACKET_MAGIC_HEADER", transportPacketMagicHeader); + + jsonConfig[config_key::junkPacketCount] = junkPacketCount; + jsonConfig[config_key::junkPacketMinSize] = junkPacketMinSize; + jsonConfig[config_key::junkPacketMaxSize] = junkPacketMaxSize; + jsonConfig[config_key::initPacketJunkSize] = initPacketJunkSize; + jsonConfig[config_key::responsePacketJunkSize] = responsePacketJunkSize; + jsonConfig[config_key::initPacketMagicHeader] = initPacketMagicHeader; + jsonConfig[config_key::responsePacketMagicHeader] = responsePacketMagicHeader; + jsonConfig[config_key::underloadPacketMagicHeader] = underloadPacketMagicHeader; + jsonConfig[config_key::transportPacketMagicHeader] = transportPacketMagicHeader; + + return QJsonDocument(jsonConfig).toJson(); } diff --git a/client/configurators/vpn_configurator.cpp b/client/configurators/vpn_configurator.cpp index 7f0e95df..6706deed 100644 --- a/client/configurators/vpn_configurator.cpp +++ b/client/configurators/vpn_configurator.cpp @@ -5,6 +5,7 @@ #include "shadowsocks_configurator.h" #include "ssh_configurator.h" #include "wireguard_configurator.h" +#include "amneziaWireGuardConfigurator.h" #include #include @@ -20,9 +21,10 @@ VpnConfigurator::VpnConfigurator(std::shared_ptr settings, QObject *pa openVpnConfigurator = std::shared_ptr(new OpenVpnConfigurator(settings, this)); shadowSocksConfigurator = std::shared_ptr(new ShadowSocksConfigurator(settings, this)); cloakConfigurator = std::shared_ptr(new CloakConfigurator(settings, this)); - wireguardConfigurator = std::shared_ptr(new WireguardConfigurator(settings, this)); + wireguardConfigurator = std::shared_ptr(new WireguardConfigurator(settings, false, this)); ikev2Configurator = std::shared_ptr(new Ikev2Configurator(settings, this)); sshConfigurator = std::shared_ptr(new SshConfigurator(settings, this)); + amneziaWireGuardConfigurator = std::shared_ptr(new AmneziaWireGuardConfigurator(settings, this)); } QString VpnConfigurator::genVpnProtocolConfig(const ServerCredentials &credentials, DockerContainer container, @@ -41,7 +43,7 @@ QString VpnConfigurator::genVpnProtocolConfig(const ServerCredentials &credentia return wireguardConfigurator->genWireguardConfig(credentials, container, containerConfig, errorCode); case Proto::AmneziaWireGuard: - return wireguardConfigurator->genWireguardConfig(credentials, container, containerConfig, errorCode); + return amneziaWireGuardConfigurator->genAmneziaWireGuardConfig(credentials, container, containerConfig, errorCode); case Proto::Ikev2: return ikev2Configurator->genIkev2Config(credentials, container, containerConfig, errorCode); diff --git a/client/configurators/vpn_configurator.h b/client/configurators/vpn_configurator.h index 3b9c761b..d304e4c3 100644 --- a/client/configurators/vpn_configurator.h +++ b/client/configurators/vpn_configurator.h @@ -13,13 +13,14 @@ class CloakConfigurator; class WireguardConfigurator; class Ikev2Configurator; class SshConfigurator; +class AmneziaWireGuardConfigurator; // Retrieve connection settings from server class VpnConfigurator : ConfiguratorBase { Q_OBJECT public: - VpnConfigurator(std::shared_ptr settings, QObject *parent = nullptr); + explicit VpnConfigurator(std::shared_ptr settings, QObject *parent = nullptr); QString genVpnProtocolConfig(const ServerCredentials &credentials, DockerContainer container, const QJsonObject &containerConfig, Proto proto, ErrorCode *errorCode = nullptr); @@ -40,6 +41,7 @@ public: std::shared_ptr wireguardConfigurator; std::shared_ptr ikev2Configurator; std::shared_ptr sshConfigurator; + std::shared_ptr amneziaWireGuardConfigurator; }; #endif // VPN_CONFIGURATOR_H diff --git a/client/configurators/wireguard_configurator.cpp b/client/configurators/wireguard_configurator.cpp index 02716b72..dd836a18 100644 --- a/client/configurators/wireguard_configurator.cpp +++ b/client/configurators/wireguard_configurator.cpp @@ -19,9 +19,17 @@ #include "settings.h" #include "utilities.h" -WireguardConfigurator::WireguardConfigurator(std::shared_ptr settings, QObject *parent) - : ConfiguratorBase(settings, parent) +WireguardConfigurator::WireguardConfigurator(std::shared_ptr settings, bool isAmneziaWireGuard, QObject *parent) + : ConfiguratorBase(settings, parent), m_isAmneziaWireGuard(isAmneziaWireGuard) { + m_serverConfigPath = m_isAmneziaWireGuard ? amnezia::protocols::amneziawireguard::serverConfigPath + : amnezia::protocols::wireguard::serverConfigPath; + m_serverPublicKeyPath = m_isAmneziaWireGuard ? amnezia::protocols::amneziawireguard::serverPublicKeyPath + : amnezia::protocols::wireguard::serverPublicKeyPath; + m_serverPskKeyPath = m_isAmneziaWireGuard ? amnezia::protocols::amneziawireguard::serverPskKeyPath + : amnezia::protocols::wireguard::serverPskKeyPath; + m_configTemplate = m_isAmneziaWireGuard ? ProtocolScriptType::amnezia_wireguard_template + : ProtocolScriptType::wireguard_template; } WireguardConfigurator::ConnectionData WireguardConfigurator::genClientKeys() @@ -62,7 +70,7 @@ WireguardConfigurator::ConnectionData WireguardConfigurator::prepareWireguardCon { WireguardConfigurator::ConnectionData connData = WireguardConfigurator::genClientKeys(); connData.host = credentials.hostName; - connData.port = containerConfig.value(config_key::wireguard) + connData.port = containerConfig.value(m_isAmneziaWireGuard ? config_key::amneziaWireguard : config_key::wireguard) .toObject() .value(config_key::port) .toString(protocols::wireguard::defaultPort); @@ -79,7 +87,7 @@ WireguardConfigurator::ConnectionData WireguardConfigurator::prepareWireguardCon // Get list of already created clients (only IP addresses) QString nextIpNumber; { - QString script = QString("cat %1 | grep AllowedIPs").arg(amnezia::protocols::wireguard::serverConfigPath); + QString script = QString("cat %1 | grep AllowedIPs").arg(m_serverConfigPath); QString stdOut; auto cbReadStdOut = [&](const QString &data, libssh::Client &) { stdOut += data + "\n"; @@ -126,8 +134,7 @@ WireguardConfigurator::ConnectionData WireguardConfigurator::prepareWireguardCon } // Get keys - connData.serverPubKey = serverController.getTextFileFromContainer( - container, credentials, amnezia::protocols::wireguard::serverPublicKeyPath, &e); + connData.serverPubKey = serverController.getTextFileFromContainer(container, credentials, m_serverPublicKeyPath, &e); connData.serverPubKey.replace("\n", ""); if (e) { if (errorCode) @@ -135,8 +142,7 @@ WireguardConfigurator::ConnectionData WireguardConfigurator::prepareWireguardCon return connData; } - connData.pskKey = serverController.getTextFileFromContainer(container, credentials, - amnezia::protocols::wireguard::serverPskKeyPath, &e); + connData.pskKey = serverController.getTextFileFromContainer(container, credentials, m_serverPskKeyPath, &e); connData.pskKey.replace("\n", ""); if (e) { @@ -150,12 +156,9 @@ WireguardConfigurator::ConnectionData WireguardConfigurator::prepareWireguardCon "PublicKey = %1\n" "PresharedKey = %2\n" "AllowedIPs = %3/32\n\n") - .arg(connData.clientPubKey) - .arg(connData.pskKey) - .arg(connData.clientIP); + .arg(connData.clientPubKey, connData.pskKey, connData.clientIP); - e = serverController.uploadTextFileToContainer(container, credentials, configPart, - protocols::wireguard::serverConfigPath, + e = serverController.uploadTextFileToContainer(container, credentials, configPart, m_serverConfigPath, libssh::SftpOverwriteMode::SftpAppendToExisting); if (e) { @@ -164,11 +167,11 @@ WireguardConfigurator::ConnectionData WireguardConfigurator::prepareWireguardCon return connData; } + QString script = QString("sudo docker exec -i $CONTAINER_NAME bash -c 'wg syncconf wg0 <(wg-quick strip %1)'") + .arg(m_serverConfigPath); + e = serverController.runScript( - credentials, - serverController.replaceVars("sudo docker exec -i $CONTAINER_NAME bash -c 'wg syncconf wg0 <(wg-quick " - "strip /opt/amnezia/wireguard/wg0.conf)'", - serverController.genVarsForScript(credentials, container))); + credentials, serverController.replaceVars(script, serverController.genVarsForScript(credentials, container))); return connData; } @@ -177,9 +180,9 @@ QString WireguardConfigurator::genWireguardConfig(const ServerCredentials &crede const QJsonObject &containerConfig, ErrorCode *errorCode) { ServerController serverController(m_settings); - QString config = - serverController.replaceVars(amnezia::scriptData(ProtocolScriptType::wireguard_template, container), - serverController.genVarsForScript(credentials, container, containerConfig)); + QString scriptData = amnezia::scriptData(m_configTemplate, container); + QString config = serverController.replaceVars( + scriptData, serverController.genVarsForScript(credentials, container, containerConfig)); ConnectionData connData = prepareWireguardConfig(credentials, container, containerConfig, errorCode); if (errorCode && *errorCode) { diff --git a/client/configurators/wireguard_configurator.h b/client/configurators/wireguard_configurator.h index 140acc47..70ed729b 100644 --- a/client/configurators/wireguard_configurator.h +++ b/client/configurators/wireguard_configurator.h @@ -6,12 +6,13 @@ #include "configurator_base.h" #include "core/defs.h" +#include "core/scripts_registry.h" class WireguardConfigurator : public ConfiguratorBase { Q_OBJECT public: - WireguardConfigurator(std::shared_ptr settings, QObject *parent = nullptr); + WireguardConfigurator(std::shared_ptr settings, bool isAmneziaWireGuard, QObject *parent = nullptr); struct ConnectionData { @@ -35,6 +36,12 @@ private: const QJsonObject &containerConfig, ErrorCode *errorCode = nullptr); ConnectionData genClientKeys(); + + bool m_isAmneziaWireGuard; + QString m_serverConfigPath; + QString m_serverPublicKeyPath; + QString m_serverPskKeyPath; + amnezia::ProtocolScriptType m_configTemplate; }; #endif // WIREGUARD_CONFIGURATOR_H diff --git a/client/core/scripts_registry.cpp b/client/core/scripts_registry.cpp index 31508152..24deb41a 100644 --- a/client/core/scripts_registry.cpp +++ b/client/core/scripts_registry.cpp @@ -11,7 +11,7 @@ QString amnezia::scriptFolder(amnezia::DockerContainer container) case DockerContainer::Cloak: return QLatin1String("openvpn_cloak"); case DockerContainer::ShadowSocks: return QLatin1String("openvpn_shadowsocks"); case DockerContainer::WireGuard: return QLatin1String("wireguard"); - case DockerContainer::AmneziaWireGuard: return QLatin1String("wireguard"); + case DockerContainer::AmneziaWireGuard: return QLatin1String("amnezia_wireguard"); case DockerContainer::Ipsec: return QLatin1String("ipsec"); case DockerContainer::TorWebSite: return QLatin1String("website_tor"); @@ -46,6 +46,7 @@ QString amnezia::scriptName(ProtocolScriptType type) case ProtocolScriptType::container_startup: return QLatin1String("start.sh"); case ProtocolScriptType::openvpn_template: return QLatin1String("template.ovpn"); case ProtocolScriptType::wireguard_template: return QLatin1String("template.conf"); + case ProtocolScriptType::amnezia_wireguard_template: return QLatin1String("template.conf"); } } diff --git a/client/core/scripts_registry.h b/client/core/scripts_registry.h index b30be2ff..5c7a1b6a 100644 --- a/client/core/scripts_registry.h +++ b/client/core/scripts_registry.h @@ -26,7 +26,8 @@ enum ProtocolScriptType { configure_container, container_startup, openvpn_template, - wireguard_template + wireguard_template, + amnezia_wireguard_template }; diff --git a/client/core/servercontroller.cpp b/client/core/servercontroller.cpp index 27213dc3..3b30451f 100644 --- a/client/core/servercontroller.cpp +++ b/client/core/servercontroller.cpp @@ -584,6 +584,37 @@ ServerController::Vars ServerController::genVarsForScript(const ServerCredential vars.append({ { "$SFTP_USER", sftpConfig.value(config_key::userName).toString() } }); vars.append({ { "$SFTP_PASSWORD", sftpConfig.value(config_key::password).toString() } }); + // Amnezia wireguard vars + vars.append({ { "$AMNEZIAWIREGUARD_SERVER_PORT", + amneziaWireguarConfig.value(config_key::port).toString(protocols::amneziawireguard::defaultPort) } }); + vars.append({ { "$JUNK_PACKET_COUNT", + amneziaWireguarConfig.value(config_key::junkPacketCount) + .toString(protocols::amneziawireguard::defaultJunkPacketCount) } }); + vars.append({ { "$JUNK_PACKET_MIN_SIZE", + amneziaWireguarConfig.value(config_key::junkPacketMinSize) + .toString(protocols::amneziawireguard::defaultJunkPacketMinSize) } }); + vars.append({ { "$JUNK_PACKET_MAX_SIZE", + amneziaWireguarConfig.value(config_key::junkPacketMaxSize) + .toString(protocols::amneziawireguard::defaultJunkPacketMaxSize) } }); + vars.append({ { "$INIT_PACKET_JUNK_SIZE", + amneziaWireguarConfig.value(config_key::initPacketJunkSize) + .toString(protocols::amneziawireguard::defaultInitPacketJunkSize) } }); + vars.append({ { "$RESPONSE_PACKET_JUNK_SIZE", + amneziaWireguarConfig.value(config_key::responsePacketJunkSize) + .toString(protocols::amneziawireguard::defaultResponsePacketJunkSize) } }); + vars.append({ { "$INIT_PACKET_MAGIC_HEADER", + amneziaWireguarConfig.value(config_key::initPacketMagicHeader) + .toString(protocols::amneziawireguard::defaultInitPacketMagicHeader) } }); + vars.append({ { "$RESPONSE_PACKET_MAGIC_HEADER", + amneziaWireguarConfig.value(config_key::responsePacketMagicHeader) + .toString(protocols::amneziawireguard::defaultResponsePacketMagicHeader) } }); + vars.append({ { "$UNDERLOAD_PACKET_MAGIC_HEADER", + amneziaWireguarConfig.value(config_key::underloadPacketMagicHeader) + .toString(protocols::amneziawireguard::defaultUnderloadPacketMagicHeader) } }); + vars.append({ { "$TRANSPORT_PACKET_MAGIC_HEADER", + amneziaWireguarConfig.value(config_key::transportPacketMagicHeader) + .toString(protocols::amneziawireguard::defaultTransportPacketMagicHeader) } }); + QString serverIp = Utils::getIPAddress(credentials.hostName); if (!serverIp.isEmpty()) { vars.append({ { "$SERVER_IP_ADDRESS", serverIp } }); diff --git a/client/daemon/daemon.cpp b/client/daemon/daemon.cpp index 3a0dc4d9..13310951 100644 --- a/client/daemon/daemon.cpp +++ b/client/daemon/daemon.cpp @@ -359,6 +359,17 @@ bool Daemon::parseConfig(const QJsonObject& obj, InterfaceConfig& config) { if (!parseStringList(obj, "vpnDisabledApps", config.m_vpnDisabledApps)) { return false; } + + config.m_junkPacketCount = obj.value("Jc").toString(); + config.m_junkPacketMinSize = obj.value("Jmin").toString(); + config.m_junkPacketMaxSize = obj.value("Jmax").toString(); + config.m_initPacketJunkSize = obj.value("S1").toString(); + config.m_responsePacketJunkSize = obj.value("S2").toString(); + config.m_initPacketMagicHeader = obj.value("H1").toString(); + config.m_responsePacketMagicHeader = obj.value("H2").toString(); + config.m_underloadPacketMagicHeader = obj.value("H3").toString(); + config.m_transportPacketMagicHeader = obj.value("H4").toString(); + return true; } diff --git a/client/daemon/interfaceconfig.h b/client/daemon/interfaceconfig.h index 61ffdd83..29aef085 100644 --- a/client/daemon/interfaceconfig.h +++ b/client/daemon/interfaceconfig.h @@ -40,6 +40,16 @@ class InterfaceConfig { QString m_installationId; #endif + QString m_junkPacketCount; + QString m_junkPacketMinSize; + QString m_junkPacketMaxSize; + QString m_initPacketJunkSize; + QString m_responsePacketJunkSize; + QString m_initPacketMagicHeader; + QString m_responsePacketMagicHeader; + QString m_underloadPacketMagicHeader; + QString m_transportPacketMagicHeader; + QJsonObject toJson() const; QString toWgConf( const QMap& extra = QMap()) const; diff --git a/client/mozilla/localsocketcontroller.cpp b/client/mozilla/localsocketcontroller.cpp index 40bc0bba..c9fa6a42 100644 --- a/client/mozilla/localsocketcontroller.cpp +++ b/client/mozilla/localsocketcontroller.cpp @@ -115,7 +115,9 @@ void LocalSocketController::daemonConnected() { } void LocalSocketController::activate(const QJsonObject &rawConfig) { - QJsonObject wgConfig = rawConfig.value("wireguard_config_data").toObject(); + QString protocolName = rawConfig.value("protocol").toString(); + + QJsonObject wgConfig = rawConfig.value(protocolName + "_config_data").toObject(); QJsonObject json; json.insert("type", "activate"); @@ -160,6 +162,19 @@ void LocalSocketController::activate(const QJsonObject &rawConfig) { // splitTunnelApps.append(QJsonValue(uri)); // } // json.insert("vpnDisabledApps", splitTunnelApps); + + if (protocolName == amnezia::config_key::amneziaWireguard) { + json.insert(amnezia::config_key::junkPacketCount, wgConfig.value(amnezia::config_key::junkPacketCount)); + json.insert(amnezia::config_key::junkPacketMinSize, wgConfig.value(amnezia::config_key::junkPacketMinSize)); + json.insert(amnezia::config_key::junkPacketMaxSize, wgConfig.value(amnezia::config_key::junkPacketMaxSize)); + json.insert(amnezia::config_key::initPacketJunkSize, wgConfig.value(amnezia::config_key::initPacketJunkSize)); + json.insert(amnezia::config_key::responsePacketJunkSize, wgConfig.value(amnezia::config_key::responsePacketJunkSize)); + json.insert(amnezia::config_key::initPacketMagicHeader, wgConfig.value(amnezia::config_key::initPacketMagicHeader)); + json.insert(amnezia::config_key::responsePacketMagicHeader, wgConfig.value(amnezia::config_key::responsePacketMagicHeader)); + json.insert(amnezia::config_key::underloadPacketMagicHeader, wgConfig.value(amnezia::config_key::underloadPacketMagicHeader)); + json.insert(amnezia::config_key::transportPacketMagicHeader, wgConfig.value(amnezia::config_key::transportPacketMagicHeader)); + } + write(json); } diff --git a/client/platforms/macos/daemon/wireguardutilsmacos.cpp b/client/platforms/macos/daemon/wireguardutilsmacos.cpp index 1f422462..ead53e23 100644 --- a/client/platforms/macos/daemon/wireguardutilsmacos.cpp +++ b/client/platforms/macos/daemon/wireguardutilsmacos.cpp @@ -163,6 +163,17 @@ bool WireguardUtilsMacos::updatePeer(const InterfaceConfig& config) { out << "allowed_ip=" << ip.toString() << "\n"; } + + out << "Jc=" << config.m_junkPacketCount << "\n"; + out << "jmin=" << config.m_junkPacketMinSize << "\n"; + out << "jmax=" << config.m_junkPacketMaxSize << "\n"; + out << "s1=" << config.m_initPacketJunkSize << "\n"; + out << "s2=" << config.m_responsePacketJunkSize << "\n"; + out << "h1=" << config.m_initPacketMagicHeader << "\n"; + out << "h2=" << config.m_responsePacketMagicHeader << "\n"; + out << "h3=" << config.m_underloadPacketMagicHeader << "\n"; + out << "h4=" << config.m_transportPacketMagicHeader << "\n"; + // Exclude the server address, except for multihop exit servers. if ((config.m_hopType != InterfaceConfig::MultiHopExit) && (m_rtmonitor != nullptr)) { diff --git a/client/protocols/protocols_defs.h b/client/protocols/protocols_defs.h index 4e72e318..e26e60a4 100644 --- a/client/protocols/protocols_defs.h +++ b/client/protocols/protocols_defs.h @@ -61,11 +61,22 @@ namespace amnezia constexpr char isThirdPartyConfig[] = "isThirdPartyConfig"; + constexpr char junkPacketCount[] = "Jc"; + constexpr char junkPacketMinSize[] = "Jmin"; + constexpr char junkPacketMaxSize[] = "Jmax"; + constexpr char initPacketJunkSize[] = "S1"; + constexpr char responsePacketJunkSize[] = "S2"; + constexpr char initPacketMagicHeader[] = "H1"; + constexpr char responsePacketMagicHeader[] = "H2"; + constexpr char underloadPacketMagicHeader[] = "H3"; + constexpr char transportPacketMagicHeader[] = "H4"; + constexpr char openvpn[] = "openvpn"; constexpr char wireguard[] = "wireguard"; constexpr char shadowsocks[] = "shadowsocks"; constexpr char cloak[] = "cloak"; constexpr char sftp[] = "sftp"; + constexpr char amneziaWireguard[] = "amneziawireguard"; } @@ -140,6 +151,25 @@ namespace amnezia } // namespace sftp + namespace amneziawireguard + { + constexpr char defaultPort[] = "55424"; + + constexpr char serverConfigPath[] = "/opt/amnezia/amneziawireguard/wg0.conf"; + constexpr char serverPublicKeyPath[] = "/opt/amnezia/amneziawireguard/wireguard_server_public_key.key"; + constexpr char serverPskKeyPath[] = "/opt/amnezia/amneziawireguard/wireguard_psk.key"; + + constexpr char defaultJunkPacketCount[] = "3"; + constexpr char defaultJunkPacketMinSize[] = "10"; + constexpr char defaultJunkPacketMaxSize[] = "30"; + constexpr char defaultInitPacketJunkSize[] = "15"; + constexpr char defaultResponsePacketJunkSize[] = "18"; + constexpr char defaultInitPacketMagicHeader[] = "1020325451"; + constexpr char defaultResponsePacketMagicHeader[] = "3288052141"; + constexpr char defaultTransportPacketMagicHeader[] = "2528465083"; + constexpr char defaultUnderloadPacketMagicHeader[] = "1766607858"; + } + } // namespace protocols namespace ProtocolEnumNS diff --git a/client/resources.qrc b/client/resources.qrc index 44c61172..b79ed3d2 100644 --- a/client/resources.qrc +++ b/client/resources.qrc @@ -216,5 +216,10 @@ ui/qml/Pages2/PageServiceDnsSettings.qml ui/qml/Controls2/TopCloseButtonType.qml ui/qml/Pages2/PageProtocolAmneziaWireGuardSettings.qml + server_scripts/amnezia_wireguard/template.conf + server_scripts/amnezia_wireguard/start.sh + server_scripts/amnezia_wireguard/configure_container.sh + server_scripts/amnezia_wireguard/run_container.sh + server_scripts/amnezia_wireguard/Dockerfile diff --git a/client/server_scripts/amnezia_wireguard/Dockerfile b/client/server_scripts/amnezia_wireguard/Dockerfile new file mode 100644 index 00000000..ed974dc6 --- /dev/null +++ b/client/server_scripts/amnezia_wireguard/Dockerfile @@ -0,0 +1,46 @@ +FROM amneziavpn/amnezia-wg:latest + +LABEL maintainer="AmneziaVPN" + +#Install required packages +RUN apk add --no-cache curl wireguard-tools dumb-init +RUN apk --update upgrade --no-cache + +RUN mkdir -p /opt/amnezia +RUN echo -e "#!/bin/bash\ntail -f /dev/null" > /opt/amnezia/start.sh +RUN chmod a+x /opt/amnezia/start.sh + +# Tune network +RUN echo -e " \n\ + fs.file-max = 51200 \n\ + \n\ + net.core.rmem_max = 67108864 \n\ + net.core.wmem_max = 67108864 \n\ + net.core.netdev_max_backlog = 250000 \n\ + net.core.somaxconn = 4096 \n\ + \n\ + net.ipv4.tcp_syncookies = 1 \n\ + net.ipv4.tcp_tw_reuse = 1 \n\ + net.ipv4.tcp_tw_recycle = 0 \n\ + net.ipv4.tcp_fin_timeout = 30 \n\ + net.ipv4.tcp_keepalive_time = 1200 \n\ + net.ipv4.ip_local_port_range = 10000 65000 \n\ + net.ipv4.tcp_max_syn_backlog = 8192 \n\ + net.ipv4.tcp_max_tw_buckets = 5000 \n\ + net.ipv4.tcp_fastopen = 3 \n\ + net.ipv4.tcp_mem = 25600 51200 102400 \n\ + net.ipv4.tcp_rmem = 4096 87380 67108864 \n\ + net.ipv4.tcp_wmem = 4096 65536 67108864 \n\ + net.ipv4.tcp_mtu_probing = 1 \n\ + net.ipv4.tcp_congestion_control = hybla \n\ + # for low-latency network, use cubic instead \n\ + # net.ipv4.tcp_congestion_control = cubic \n\ + " | sed -e 's/^\s\+//g' | tee -a /etc/sysctl.conf && \ + mkdir -p /etc/security && \ + echo -e " \n\ + * soft nofile 51200 \n\ + * hard nofile 51200 \n\ + " | sed -e 's/^\s\+//g' | tee -a /etc/security/limits.conf + +ENTRYPOINT [ "dumb-init", "/opt/amnezia/start.sh" ] +CMD [ "" ] diff --git a/client/server_scripts/amnezia_wireguard/configure_container.sh b/client/server_scripts/amnezia_wireguard/configure_container.sh new file mode 100644 index 00000000..8653a932 --- /dev/null +++ b/client/server_scripts/amnezia_wireguard/configure_container.sh @@ -0,0 +1,26 @@ +mkdir -p /opt/amnezia/amneziawireguard +cd /opt/amnezia/amneziawireguard +WIREGUARD_SERVER_PRIVATE_KEY=$(wg genkey) +echo $WIREGUARD_SERVER_PRIVATE_KEY > /opt/amnezia/amneziawireguard/wireguard_server_private_key.key + +WIREGUARD_SERVER_PUBLIC_KEY=$(echo $WIREGUARD_SERVER_PRIVATE_KEY | wg pubkey) +echo $WIREGUARD_SERVER_PUBLIC_KEY > /opt/amnezia/amneziawireguard/wireguard_server_public_key.key + +WIREGUARD_PSK=$(wg genpsk) +echo $WIREGUARD_PSK > /opt/amnezia/amneziawireguard/wireguard_psk.key + +cat > /opt/amnezia/amneziawireguard/wg0.conf < Date: Wed, 27 Sep 2023 00:45:42 +0500 Subject: [PATCH 003/108] added passing new amneziawireguard config parameters over uapi for all platforms --- client/platforms/linux/daemon/wireguardutilslinux.cpp | 10 ++++++++++ client/platforms/macos/daemon/wireguardutilsmacos.cpp | 2 +- .../platforms/windows/daemon/wireguardutilswindows.cpp | 10 ++++++++++ 3 files changed, 21 insertions(+), 1 deletion(-) diff --git a/client/platforms/linux/daemon/wireguardutilslinux.cpp b/client/platforms/linux/daemon/wireguardutilslinux.cpp index a8b7b04a..dbb92f61 100644 --- a/client/platforms/linux/daemon/wireguardutilslinux.cpp +++ b/client/platforms/linux/daemon/wireguardutilslinux.cpp @@ -161,6 +161,16 @@ bool WireguardUtilsLinux::updatePeer(const InterfaceConfig& config) { out << "allowed_ip=" << ip.toString() << "\n"; } + out << "jc=" << config.m_junkPacketCount << "\n"; + out << "jmin=" << config.m_junkPacketMinSize << "\n"; + out << "jmax=" << config.m_junkPacketMaxSize << "\n"; + out << "s1=" << config.m_initPacketJunkSize << "\n"; + out << "s2=" << config.m_responsePacketJunkSize << "\n"; + out << "h1=" << config.m_initPacketMagicHeader << "\n"; + out << "h2=" << config.m_responsePacketMagicHeader << "\n"; + out << "h3=" << config.m_underloadPacketMagicHeader << "\n"; + out << "h4=" << config.m_transportPacketMagicHeader << "\n"; + // Exclude the server address, except for multihop exit servers. if ((config.m_hopType != InterfaceConfig::MultiHopExit) && (m_rtmonitor != nullptr)) { diff --git a/client/platforms/macos/daemon/wireguardutilsmacos.cpp b/client/platforms/macos/daemon/wireguardutilsmacos.cpp index ead53e23..2170d69e 100644 --- a/client/platforms/macos/daemon/wireguardutilsmacos.cpp +++ b/client/platforms/macos/daemon/wireguardutilsmacos.cpp @@ -164,7 +164,7 @@ bool WireguardUtilsMacos::updatePeer(const InterfaceConfig& config) { } - out << "Jc=" << config.m_junkPacketCount << "\n"; + out << "jc=" << config.m_junkPacketCount << "\n"; out << "jmin=" << config.m_junkPacketMinSize << "\n"; out << "jmax=" << config.m_junkPacketMaxSize << "\n"; out << "s1=" << config.m_initPacketJunkSize << "\n"; diff --git a/client/platforms/windows/daemon/wireguardutilswindows.cpp b/client/platforms/windows/daemon/wireguardutilswindows.cpp index 1e0a4752..21df2611 100644 --- a/client/platforms/windows/daemon/wireguardutilswindows.cpp +++ b/client/platforms/windows/daemon/wireguardutilswindows.cpp @@ -165,6 +165,16 @@ bool WireguardUtilsWindows::updatePeer(const InterfaceConfig& config) { out << "allowed_ip=" << ip.toString() << "\n"; } + out << "jc=" << config.m_junkPacketCount << "\n"; + out << "jmin=" << config.m_junkPacketMinSize << "\n"; + out << "jmax=" << config.m_junkPacketMaxSize << "\n"; + out << "s1=" << config.m_initPacketJunkSize << "\n"; + out << "s2=" << config.m_responsePacketJunkSize << "\n"; + out << "h1=" << config.m_initPacketMagicHeader << "\n"; + out << "h2=" << config.m_responsePacketMagicHeader << "\n"; + out << "h3=" << config.m_underloadPacketMagicHeader << "\n"; + out << "h4=" << config.m_transportPacketMagicHeader << "\n"; + // Exclude the server address, except for multihop exit servers. if (config.m_hopType != InterfaceConfig::MultiHopExit) { m_routeMonitor.addExclusionRoute(IPAddress(config.m_serverIpv4AddrIn)); From 423305c35a49e6949a4f62664dc5a9cf2d474a19 Mon Sep 17 00:00:00 2001 From: "vladimir.kuznetsov" Date: Thu, 28 Sep 2023 02:14:07 +0500 Subject: [PATCH 004/108] moved the configuration of new parameters for awg to addInterface() --- client/daemon/daemon.cpp | 20 +++++++++------- .../linux/daemon/wireguardutilslinux.cpp | 23 ++++++++++-------- .../macos/daemon/wireguardutilsmacos.cpp | 24 ++++++++++--------- .../windows/daemon/wireguardutilswindows.cpp | 10 -------- 4 files changed, 37 insertions(+), 40 deletions(-) diff --git a/client/daemon/daemon.cpp b/client/daemon/daemon.cpp index 13310951..63a5c7f6 100644 --- a/client/daemon/daemon.cpp +++ b/client/daemon/daemon.cpp @@ -360,15 +360,17 @@ bool Daemon::parseConfig(const QJsonObject& obj, InterfaceConfig& config) { return false; } - config.m_junkPacketCount = obj.value("Jc").toString(); - config.m_junkPacketMinSize = obj.value("Jmin").toString(); - config.m_junkPacketMaxSize = obj.value("Jmax").toString(); - config.m_initPacketJunkSize = obj.value("S1").toString(); - config.m_responsePacketJunkSize = obj.value("S2").toString(); - config.m_initPacketMagicHeader = obj.value("H1").toString(); - config.m_responsePacketMagicHeader = obj.value("H2").toString(); - config.m_underloadPacketMagicHeader = obj.value("H3").toString(); - config.m_transportPacketMagicHeader = obj.value("H4").toString(); + if (!obj.value("Jc").isNull()) { + config.m_junkPacketCount = obj.value("Jc").toString(); + config.m_junkPacketMinSize = obj.value("Jmin").toString(); + config.m_junkPacketMaxSize = obj.value("Jmax").toString(); + config.m_initPacketJunkSize = obj.value("S1").toString(); + config.m_responsePacketJunkSize = obj.value("S2").toString(); + config.m_initPacketMagicHeader = obj.value("H1").toString(); + config.m_responsePacketMagicHeader = obj.value("H2").toString(); + config.m_underloadPacketMagicHeader = obj.value("H3").toString(); + config.m_transportPacketMagicHeader = obj.value("H4").toString(); + } return true; } diff --git a/client/platforms/linux/daemon/wireguardutilslinux.cpp b/client/platforms/linux/daemon/wireguardutilslinux.cpp index dbb92f61..792120a7 100644 --- a/client/platforms/linux/daemon/wireguardutilslinux.cpp +++ b/client/platforms/linux/daemon/wireguardutilslinux.cpp @@ -100,6 +100,19 @@ bool WireguardUtilsLinux::addInterface(const InterfaceConfig& config) { QTextStream out(&message); out << "private_key=" << QString(privateKey.toHex()) << "\n"; out << "replace_peers=true\n"; + + if (config.m_junkPacketCount != "") { + out << "jc=" << config.m_junkPacketCount << "\n"; + out << "jmin=" << config.m_junkPacketMinSize << "\n"; + out << "jmax=" << config.m_junkPacketMaxSize << "\n"; + out << "s1=" << config.m_initPacketJunkSize << "\n"; + out << "s2=" << config.m_responsePacketJunkSize << "\n"; + out << "h1=" << config.m_initPacketMagicHeader << "\n"; + out << "h2=" << config.m_responsePacketMagicHeader << "\n"; + out << "h3=" << config.m_underloadPacketMagicHeader << "\n"; + out << "h4=" << config.m_transportPacketMagicHeader << "\n"; + } + int err = uapiErrno(uapiCommand(message)); if (err != 0) { logger.error() << "Interface configuration failed:" << strerror(err); @@ -161,16 +174,6 @@ bool WireguardUtilsLinux::updatePeer(const InterfaceConfig& config) { out << "allowed_ip=" << ip.toString() << "\n"; } - out << "jc=" << config.m_junkPacketCount << "\n"; - out << "jmin=" << config.m_junkPacketMinSize << "\n"; - out << "jmax=" << config.m_junkPacketMaxSize << "\n"; - out << "s1=" << config.m_initPacketJunkSize << "\n"; - out << "s2=" << config.m_responsePacketJunkSize << "\n"; - out << "h1=" << config.m_initPacketMagicHeader << "\n"; - out << "h2=" << config.m_responsePacketMagicHeader << "\n"; - out << "h3=" << config.m_underloadPacketMagicHeader << "\n"; - out << "h4=" << config.m_transportPacketMagicHeader << "\n"; - // Exclude the server address, except for multihop exit servers. if ((config.m_hopType != InterfaceConfig::MultiHopExit) && (m_rtmonitor != nullptr)) { diff --git a/client/platforms/macos/daemon/wireguardutilsmacos.cpp b/client/platforms/macos/daemon/wireguardutilsmacos.cpp index 2170d69e..ef13f4c7 100644 --- a/client/platforms/macos/daemon/wireguardutilsmacos.cpp +++ b/client/platforms/macos/daemon/wireguardutilsmacos.cpp @@ -100,6 +100,19 @@ bool WireguardUtilsMacos::addInterface(const InterfaceConfig& config) { QTextStream out(&message); out << "private_key=" << QString(privateKey.toHex()) << "\n"; out << "replace_peers=true\n"; + + if (config.m_junkPacketCount != "") { + out << "jc=" << config.m_junkPacketCount << "\n"; + out << "jmin=" << config.m_junkPacketMinSize << "\n"; + out << "jmax=" << config.m_junkPacketMaxSize << "\n"; + out << "s1=" << config.m_initPacketJunkSize << "\n"; + out << "s2=" << config.m_responsePacketJunkSize << "\n"; + out << "h1=" << config.m_initPacketMagicHeader << "\n"; + out << "h2=" << config.m_responsePacketMagicHeader << "\n"; + out << "h3=" << config.m_underloadPacketMagicHeader << "\n"; + out << "h4=" << config.m_transportPacketMagicHeader << "\n"; + } + int err = uapiErrno(uapiCommand(message)); if (err != 0) { logger.error() << "Interface configuration failed:" << strerror(err); @@ -163,17 +176,6 @@ bool WireguardUtilsMacos::updatePeer(const InterfaceConfig& config) { out << "allowed_ip=" << ip.toString() << "\n"; } - - out << "jc=" << config.m_junkPacketCount << "\n"; - out << "jmin=" << config.m_junkPacketMinSize << "\n"; - out << "jmax=" << config.m_junkPacketMaxSize << "\n"; - out << "s1=" << config.m_initPacketJunkSize << "\n"; - out << "s2=" << config.m_responsePacketJunkSize << "\n"; - out << "h1=" << config.m_initPacketMagicHeader << "\n"; - out << "h2=" << config.m_responsePacketMagicHeader << "\n"; - out << "h3=" << config.m_underloadPacketMagicHeader << "\n"; - out << "h4=" << config.m_transportPacketMagicHeader << "\n"; - // Exclude the server address, except for multihop exit servers. if ((config.m_hopType != InterfaceConfig::MultiHopExit) && (m_rtmonitor != nullptr)) { diff --git a/client/platforms/windows/daemon/wireguardutilswindows.cpp b/client/platforms/windows/daemon/wireguardutilswindows.cpp index 21df2611..1e0a4752 100644 --- a/client/platforms/windows/daemon/wireguardutilswindows.cpp +++ b/client/platforms/windows/daemon/wireguardutilswindows.cpp @@ -165,16 +165,6 @@ bool WireguardUtilsWindows::updatePeer(const InterfaceConfig& config) { out << "allowed_ip=" << ip.toString() << "\n"; } - out << "jc=" << config.m_junkPacketCount << "\n"; - out << "jmin=" << config.m_junkPacketMinSize << "\n"; - out << "jmax=" << config.m_junkPacketMaxSize << "\n"; - out << "s1=" << config.m_initPacketJunkSize << "\n"; - out << "s2=" << config.m_responsePacketJunkSize << "\n"; - out << "h1=" << config.m_initPacketMagicHeader << "\n"; - out << "h2=" << config.m_responsePacketMagicHeader << "\n"; - out << "h3=" << config.m_underloadPacketMagicHeader << "\n"; - out << "h4=" << config.m_transportPacketMagicHeader << "\n"; - // Exclude the server address, except for multihop exit servers. if (config.m_hopType != InterfaceConfig::MultiHopExit) { m_routeMonitor.addExclusionRoute(IPAddress(config.m_serverIpv4AddrIn)); From 2986a18c8f3bc4bc54e2bfba97511f117f821cfe Mon Sep 17 00:00:00 2001 From: Mykola Baibuz Date: Thu, 28 Sep 2023 23:54:32 +0300 Subject: [PATCH 005/108] iOS AWG support --- .gitmodules | 6 +++--- client/3rd/awg-apple | 1 + client/3rd/wireguard-apple | 1 - client/cmake/ios.cmake | 2 +- client/ios/networkextension/CMakeLists.txt | 2 +- .../WireGuardNetworkExtension-Bridging-Header.h | 4 ++-- client/macos/app/WireGuard-Bridging-Header.h | 2 +- .../WireGuardNetworkExtension-Bridging-Header.h | 2 +- client/platforms/ios/WireGuard-Bridging-Header.h | 2 +- 9 files changed, 11 insertions(+), 11 deletions(-) create mode 160000 client/3rd/awg-apple delete mode 160000 client/3rd/wireguard-apple diff --git a/.gitmodules b/.gitmodules index 453a8ee4..c96dd6bc 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,6 +1,3 @@ -[submodule "client/3rd/wireguard-apple"] - path = client/3rd/wireguard-apple - url = https://github.com/WireGuard/wireguard-apple [submodule "client/3rd/OpenVPNAdapter"] path = client/3rd/OpenVPNAdapter url = https://github.com/amnezia-vpn/OpenVPNAdapter.git @@ -25,3 +22,6 @@ [submodule "client/3rd-prebuilt"] path = client/3rd-prebuilt url = https://github.com/amnezia-vpn/3rd-prebuilt +[submodule "client/3rd/awg-apple"] + path = client/3rd/awg-apple + url = https://github.com/amnezia-vpn/awg-apple diff --git a/client/3rd/awg-apple b/client/3rd/awg-apple new file mode 160000 index 00000000..5767a03f --- /dev/null +++ b/client/3rd/awg-apple @@ -0,0 +1 @@ +Subproject commit 5767a03f75a2b77d4f78fdd77ff51a1eefabe3b0 diff --git a/client/3rd/wireguard-apple b/client/3rd/wireguard-apple deleted file mode 160000 index 23618f99..00000000 --- a/client/3rd/wireguard-apple +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 23618f994f17d8ad8f2f65d79b4a1e8a0830b334 diff --git a/client/cmake/ios.cmake b/client/cmake/ios.cmake index 5dc1b2e7..7aa9f1a9 100644 --- a/client/cmake/ios.cmake +++ b/client/cmake/ios.cmake @@ -97,7 +97,7 @@ target_compile_options(${PROJECT} PRIVATE -DVPN_NE_BUNDLEID=\"${BUILD_IOS_APP_IDENTIFIER}.network-extension\" ) -set(WG_APPLE_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/3rd/wireguard-apple/Sources) +set(WG_APPLE_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/3rd/awg-apple/Sources) target_sources(${PROJECT} PRIVATE # ${CMAKE_CURRENT_SOURCE_DIR}/platforms/ios/iosvpnprotocol.swift diff --git a/client/ios/networkextension/CMakeLists.txt b/client/ios/networkextension/CMakeLists.txt index 29dc0bbe..16769ea3 100644 --- a/client/ios/networkextension/CMakeLists.txt +++ b/client/ios/networkextension/CMakeLists.txt @@ -58,7 +58,7 @@ target_link_libraries(networkextension PRIVATE ${FW_UI_KIT}) target_compile_options(networkextension PRIVATE -DGROUP_ID=\"${BUILD_IOS_GROUP_IDENTIFIER}\") target_compile_options(networkextension PRIVATE -DNETWORK_EXTENSION=1) -set(WG_APPLE_SOURCE_DIR ${CLIENT_ROOT_DIR}/3rd/wireguard-apple/Sources) +set(WG_APPLE_SOURCE_DIR ${CLIENT_ROOT_DIR}/3rd/awg-apple/Sources) target_sources(networkextension PRIVATE ${WG_APPLE_SOURCE_DIR}/WireGuardKit/WireGuardAdapter.swift diff --git a/client/ios/networkextension/WireGuardNetworkExtension-Bridging-Header.h b/client/ios/networkextension/WireGuardNetworkExtension-Bridging-Header.h index 03a987ad..44d0b6b0 100644 --- a/client/ios/networkextension/WireGuardNetworkExtension-Bridging-Header.h +++ b/client/ios/networkextension/WireGuardNetworkExtension-Bridging-Header.h @@ -1,6 +1,6 @@ #include "wireguard-go-version.h" -#include "3rd/wireguard-apple/Sources/WireGuardKitGo/wireguard.h" -#include "3rd/wireguard-apple/Sources/WireGuardKitC/WireGuardKitC.h" +#include "3rd/awg-apple/Sources/WireGuardKitGo/wireguard.h" +#include "3rd/awg-apple/Sources/WireGuardKitC/WireGuardKitC.h" #include #include diff --git a/client/macos/app/WireGuard-Bridging-Header.h b/client/macos/app/WireGuard-Bridging-Header.h index 40b6c89d..da71002d 100644 --- a/client/macos/app/WireGuard-Bridging-Header.h +++ b/client/macos/app/WireGuard-Bridging-Header.h @@ -3,7 +3,7 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #include "wireguard-go-version.h" -#include "3rd/wireguard-apple/Sources/WireGuardKitC/WireGuardKitC.h" +#include "3rd/awg-apple/Sources/WireGuardKitC/WireGuardKitC.h" #include #include diff --git a/client/macos/networkextension/WireGuardNetworkExtension-Bridging-Header.h b/client/macos/networkextension/WireGuardNetworkExtension-Bridging-Header.h index 8a437ce0..ea5c8e38 100644 --- a/client/macos/networkextension/WireGuardNetworkExtension-Bridging-Header.h +++ b/client/macos/networkextension/WireGuardNetworkExtension-Bridging-Header.h @@ -4,7 +4,7 @@ #include "macos/gobridge/wireguard.h" #include "wireguard-go-version.h" -#include "3rd/wireguard-apple/Sources/WireGuardKitC/WireGuardKitC.h" +#include "3rd/awg-apple/Sources/WireGuardKitC/WireGuardKitC.h" #include "3rd/ShadowSocks/ShadowSocks/ShadowSocks.h" #include "platforms/ios/ssconnectivity.h" #include "platforms/ios/iosopenvpn2ssadapter.h" diff --git a/client/platforms/ios/WireGuard-Bridging-Header.h b/client/platforms/ios/WireGuard-Bridging-Header.h index e5dfa39f..fbccb2d4 100644 --- a/client/platforms/ios/WireGuard-Bridging-Header.h +++ b/client/platforms/ios/WireGuard-Bridging-Header.h @@ -2,7 +2,7 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -#include "3rd/wireguard-apple/Sources/WireGuardKitC/WireGuardKitC.h" +#include "3rd/awg-apple/Sources/WireGuardKitC/WireGuardKitC.h" #include #include From 54b45a36e124176fe05ff620ef43ff9fccbd2c3f Mon Sep 17 00:00:00 2001 From: "vladimir.kuznetsov" Date: Fri, 29 Sep 2023 18:41:00 +0500 Subject: [PATCH 006/108] test configuration using wg instead of wg-quick to configure the server --- client/server_scripts/amnezia_wireguard/Dockerfile | 2 +- .../amnezia_wireguard/configure_container.sh | 2 +- client/server_scripts/amnezia_wireguard/start.sh | 7 ++++--- client/server_scripts/build_container.sh | 2 +- 4 files changed, 7 insertions(+), 6 deletions(-) diff --git a/client/server_scripts/amnezia_wireguard/Dockerfile b/client/server_scripts/amnezia_wireguard/Dockerfile index ed974dc6..8c536fc7 100644 --- a/client/server_scripts/amnezia_wireguard/Dockerfile +++ b/client/server_scripts/amnezia_wireguard/Dockerfile @@ -3,7 +3,7 @@ FROM amneziavpn/amnezia-wg:latest LABEL maintainer="AmneziaVPN" #Install required packages -RUN apk add --no-cache curl wireguard-tools dumb-init +RUN apk add --no-cache bash curl dumb-init RUN apk --update upgrade --no-cache RUN mkdir -p /opt/amnezia diff --git a/client/server_scripts/amnezia_wireguard/configure_container.sh b/client/server_scripts/amnezia_wireguard/configure_container.sh index 8653a932..fa7b09f9 100644 --- a/client/server_scripts/amnezia_wireguard/configure_container.sh +++ b/client/server_scripts/amnezia_wireguard/configure_container.sh @@ -12,7 +12,7 @@ echo $WIREGUARD_PSK > /opt/amnezia/amneziawireguard/wireguard_psk.key cat > /opt/amnezia/amneziawireguard/wg0.conf < Date: Sat, 30 Sep 2023 00:58:08 +0300 Subject: [PATCH 007/108] iOS AWG protocol Setup --- client/3rd-prebuilt | 2 +- client/containers/containers_defs.cpp | 1 + client/platforms/ios/ios_controller.h | 1 + client/platforms/ios/ios_controller.mm | 12 ++++++++++++ 4 files changed, 15 insertions(+), 1 deletion(-) diff --git a/client/3rd-prebuilt b/client/3rd-prebuilt index e8795854..6f0d654a 160000 --- a/client/3rd-prebuilt +++ b/client/3rd-prebuilt @@ -1 +1 @@ -Subproject commit e8795854a5cf27004fe78caecc90a961688d1d41 +Subproject commit 6f0d654a2409e2f634e7f7b95d34998c8eba2d7b diff --git a/client/containers/containers_defs.cpp b/client/containers/containers_defs.cpp index 21f7b044..0b9e44a2 100644 --- a/client/containers/containers_defs.cpp +++ b/client/containers/containers_defs.cpp @@ -186,6 +186,7 @@ bool ContainerProps::isSupportedByCurrentPlatform(DockerContainer c) switch (c) { case DockerContainer::WireGuard: return true; case DockerContainer::OpenVpn: return true; + case DockerContainer::AmneziaWireGuard: return true; case DockerContainer::Cloak: return true; // case DockerContainer::ShadowSocks: return true; diff --git a/client/platforms/ios/ios_controller.h b/client/platforms/ios/ios_controller.h index ea8adbc0..6d10dc08 100644 --- a/client/platforms/ios/ios_controller.h +++ b/client/platforms/ios/ios_controller.h @@ -62,6 +62,7 @@ private: bool setupOpenVPN(); bool setupCloak(); bool setupWireGuard(); + bool setupAmneziaWireGuard(); bool startOpenVPN(const QString &config); bool startWireGuard(const QString &jsonConfig); diff --git a/client/platforms/ios/ios_controller.mm b/client/platforms/ios/ios_controller.mm index 57394383..6782c8da 100644 --- a/client/platforms/ios/ios_controller.mm +++ b/client/platforms/ios/ios_controller.mm @@ -204,6 +204,9 @@ bool IosController::connectVpn(amnezia::Proto proto, const QJsonObject& configur if (proto == amnezia::Proto::WireGuard) { return setupWireGuard(); } + if (proto == amnezia::Proto::AmneziaWireGuard) { + return setupAmneziaWireGuard(); + } return false; } @@ -307,6 +310,15 @@ bool IosController::setupWireGuard() return startWireGuard(wgConfig); } +bool IosController::setupAmneziaWireGuard() +{ + QJsonObject config = m_rawConfig[ProtocolProps::key_proto_config_data(amnezia::Proto::AmneziaWireGuard)].toObject(); + + QString wgConfig = config[config_key::config].toString(); + + return startWireGuard(wgConfig); +} + bool IosController::startOpenVPN(const QString &config) { qDebug() << "IosController::startOpenVPN"; From 4ed153373f585d93ddf3c566ba63fbf7cc43cba3 Mon Sep 17 00:00:00 2001 From: Mykola Baibuz Date: Sat, 30 Sep 2023 16:05:23 -0400 Subject: [PATCH 008/108] Fix Linux build, some naming changes --- .../{amneziaWireGuardConfigurator.cpp => awg_configurator.cpp} | 2 +- .../{amneziaWireGuardConfigurator.h => awg_configurator.h} | 0 client/configurators/vpn_configurator.cpp | 2 +- ...mneziaWireGuardProtocol.cpp => amneziawireguardprotocol.cpp} | 2 +- .../{amneziaWireGuardProtocol.h => amneziawireguardprotocol.h} | 0 5 files changed, 3 insertions(+), 3 deletions(-) rename client/configurators/{amneziaWireGuardConfigurator.cpp => awg_configurator.cpp} (98%) rename client/configurators/{amneziaWireGuardConfigurator.h => awg_configurator.h} (100%) rename client/protocols/{amneziaWireGuardProtocol.cpp => amneziawireguardprotocol.cpp} (84%) rename client/protocols/{amneziaWireGuardProtocol.h => amneziawireguardprotocol.h} (100%) diff --git a/client/configurators/amneziaWireGuardConfigurator.cpp b/client/configurators/awg_configurator.cpp similarity index 98% rename from client/configurators/amneziaWireGuardConfigurator.cpp rename to client/configurators/awg_configurator.cpp index 3ed27208..85dbd6de 100644 --- a/client/configurators/amneziaWireGuardConfigurator.cpp +++ b/client/configurators/awg_configurator.cpp @@ -1,4 +1,4 @@ -#include "amneziaWireGuardConfigurator.h" +#include "awg_configurator.h" #include #include diff --git a/client/configurators/amneziaWireGuardConfigurator.h b/client/configurators/awg_configurator.h similarity index 100% rename from client/configurators/amneziaWireGuardConfigurator.h rename to client/configurators/awg_configurator.h diff --git a/client/configurators/vpn_configurator.cpp b/client/configurators/vpn_configurator.cpp index 6706deed..8ab43499 100644 --- a/client/configurators/vpn_configurator.cpp +++ b/client/configurators/vpn_configurator.cpp @@ -5,7 +5,7 @@ #include "shadowsocks_configurator.h" #include "ssh_configurator.h" #include "wireguard_configurator.h" -#include "amneziaWireGuardConfigurator.h" +#include "awg_configurator.h" #include #include diff --git a/client/protocols/amneziaWireGuardProtocol.cpp b/client/protocols/amneziawireguardprotocol.cpp similarity index 84% rename from client/protocols/amneziaWireGuardProtocol.cpp rename to client/protocols/amneziawireguardprotocol.cpp index b4c5b430..cab03da9 100644 --- a/client/protocols/amneziaWireGuardProtocol.cpp +++ b/client/protocols/amneziawireguardprotocol.cpp @@ -1,4 +1,4 @@ -#include "amneziaWireGuardProtocol.h" +#include "amneziawireguardprotocol.h" AmneziaWireGuardProtocol::AmneziaWireGuardProtocol(const QJsonObject &configuration, QObject *parent) : WireguardProtocol(configuration, parent) diff --git a/client/protocols/amneziaWireGuardProtocol.h b/client/protocols/amneziawireguardprotocol.h similarity index 100% rename from client/protocols/amneziaWireGuardProtocol.h rename to client/protocols/amneziawireguardprotocol.h From 39c2124a26d1401fa4434fb790ff2780f5a20d84 Mon Sep 17 00:00:00 2001 From: "vladimir.kuznetsov" Date: Sun, 1 Oct 2023 21:43:30 +0500 Subject: [PATCH 009/108] returned the awg setting via wg-quick --- client/server_scripts/amnezia_wireguard/start.sh | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/client/server_scripts/amnezia_wireguard/start.sh b/client/server_scripts/amnezia_wireguard/start.sh index 505ce53e..b371d5b5 100644 --- a/client/server_scripts/amnezia_wireguard/start.sh +++ b/client/server_scripts/amnezia_wireguard/start.sh @@ -6,11 +6,10 @@ echo "Container startup" #ifconfig eth0:0 $SERVER_IP_ADDRESS netmask 255.255.255.255 up # kill daemons in case of restart -# wg-quick down /opt/amnezia/amneziawireguard/wg0.conf +wg-quick down /opt/amnezia/amneziawireguard/wg0.conf -/usr/bin/amnezia-wg wg0 && /usr/bin/wg setconf wg0 /opt/amnezia/amneziawireguard/wg0.conf && ip address add dev wg0 10.8.1.1/24 && ip link set up dev wg0 -# # # start daemons if configured -# # if [ -f /opt/amnezia/amneziawireguard/wg0.conf ]; then (wg-quick up /opt/amnezia/amneziawireguard/wg0.conf); fi +# start daemons if configured +if [ -f /opt/amnezia/amneziawireguard/wg0.conf ]; then (wg-quick up /opt/amnezia/amneziawireguard/wg0.conf); fi # Allow traffic on the TUN interface. iptables -A INPUT -i wg0 -j ACCEPT From 50b8b3d649714a3465fbebaa0aa26543fa0b3ad1 Mon Sep 17 00:00:00 2001 From: "vladimir.kuznetsov" Date: Mon, 2 Oct 2023 18:30:32 +0500 Subject: [PATCH 010/108] added parsing of wireguard config parameters when importing native configs --- client/ui/controllers/importController.cpp | 68 +++++++++++++++++++--- 1 file changed, 61 insertions(+), 7 deletions(-) diff --git a/client/ui/controllers/importController.cpp b/client/ui/controllers/importController.cpp index d9278ece..f9cc2d03 100644 --- a/client/ui/controllers/importController.cpp +++ b/client/ui/controllers/importController.cpp @@ -223,21 +223,75 @@ QJsonObject ImportController::extractOpenVpnConfig(const QString &data) QJsonObject ImportController::extractWireGuardConfig(const QString &data) { + QMap configMap; + auto configByLines = data.split("\n"); + for (const QString &line : configByLines) { + QString trimmedLine = line.trimmed(); + if (trimmedLine.startsWith("[") && trimmedLine.endsWith("]")) { + continue; + } else { + QStringList parts = trimmedLine.split(" = "); + if (parts.count() == 2) { + configMap[parts.at(0).trimmed()] = parts.at(1).trimmed(); + } + } + } + QJsonObject lastConfig; lastConfig[config_key::config] = data; - const static QRegularExpression hostNameAndPortRegExp("Endpoint = (.*)(?::([0-9]*))?"); + const static QRegularExpression hostNameAndPortRegExp("Endpoint = (.*):([0-9]*)"); QRegularExpressionMatch hostNameAndPortMatch = hostNameAndPortRegExp.match(data); QString hostName; QString port; if (hostNameAndPortMatch.hasCaptured(1)) { hostName = hostNameAndPortMatch.captured(1); - } /*else { - qDebug() << "send error?" - }*/ + } else { + qDebug() << "Failed to import profile"; + emit importErrorOccurred(errorString(ErrorCode::ImportInvalidConfigError)); + } if (hostNameAndPortMatch.hasCaptured(2)) { port = hostNameAndPortMatch.captured(2); + } else { + port = protocols::wireguard::defaultPort; + } + + lastConfig[config_key::hostName] = hostName; + lastConfig[config_key::port] = port.toInt(); + +// if (!configMap.value("PrivateKey").isEmpty() && !configMap.value("Address").isEmpty() +// && !configMap.value("PresharedKey").isEmpty() && !configMap.value("PublicKey").isEmpty()) { + lastConfig[config_key::client_priv_key] = configMap.value("PrivateKey"); + lastConfig[config_key::client_ip] = configMap.value("Address"); + lastConfig[config_key::psk_key] = configMap.value("PresharedKey"); + lastConfig[config_key::server_pub_key] = configMap.value("PublicKey"); +// } else { +// qDebug() << "Failed to import profile"; +// emit importErrorOccurred(errorString(ErrorCode::ImportInvalidConfigError)); +// return QJsonObject(); +// } + + QString protocolName = "wireguard"; + if (!configMap.value(config_key::junkPacketCount).isEmpty() + && !configMap.value(config_key::junkPacketMinSize).isEmpty() + && !configMap.value(config_key::junkPacketMaxSize).isEmpty() + && !configMap.value(config_key::initPacketJunkSize).isEmpty() + && !configMap.value(config_key::responsePacketJunkSize).isEmpty() + && !configMap.value(config_key::initPacketMagicHeader).isEmpty() + && !configMap.value(config_key::responsePacketMagicHeader).isEmpty() + && !configMap.value(config_key::underloadPacketMagicHeader).isEmpty() + && !configMap.value(config_key::transportPacketMagicHeader).isEmpty()) { + lastConfig[config_key::junkPacketCount] = configMap.value(config_key::junkPacketCount); + lastConfig[config_key::junkPacketMinSize] = configMap.value(config_key::junkPacketMinSize); + lastConfig[config_key::junkPacketMaxSize] = configMap.value(config_key::junkPacketMaxSize); + lastConfig[config_key::initPacketJunkSize] = configMap.value(config_key::initPacketJunkSize); + lastConfig[config_key::responsePacketJunkSize] = configMap.value(config_key::responsePacketJunkSize); + lastConfig[config_key::initPacketMagicHeader] = configMap.value(config_key::initPacketMagicHeader); + lastConfig[config_key::responsePacketMagicHeader] = configMap.value(config_key::responsePacketMagicHeader); + lastConfig[config_key::underloadPacketMagicHeader] = configMap.value(config_key::underloadPacketMagicHeader); + lastConfig[config_key::transportPacketMagicHeader] = configMap.value(config_key::transportPacketMagicHeader); + protocolName = "amneziawireguard"; } QJsonObject wireguardConfig; @@ -247,15 +301,15 @@ QJsonObject ImportController::extractWireGuardConfig(const QString &data) wireguardConfig[config_key::transport_proto] = "udp"; QJsonObject containers; - containers.insert(config_key::container, QJsonValue("amnezia-wireguard")); - containers.insert(config_key::wireguard, QJsonValue(wireguardConfig)); + containers.insert(config_key::container, QJsonValue("amnezia-" + protocolName)); + containers.insert(protocolName, QJsonValue(wireguardConfig)); QJsonArray arr; arr.push_back(containers); QJsonObject config; config[config_key::containers] = arr; - config[config_key::defaultContainer] = "amnezia-wireguard"; + config[config_key::defaultContainer] = "amnezia-" + protocolName; config[config_key::description] = m_settings->nextAvailableServerName(); const static QRegularExpression dnsRegExp( From 304f29bfac020be5600ef1a8c9c2dc59177a4805 Mon Sep 17 00:00:00 2001 From: "vladimir.kuznetsov" Date: Mon, 2 Oct 2023 20:03:01 +0500 Subject: [PATCH 011/108] returned 'address' to awg server config and set it to 10.8.1.1/24 --- client/server_scripts/amnezia_wireguard/configure_container.sh | 2 +- client/server_scripts/amnezia_wireguard/start.sh | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/client/server_scripts/amnezia_wireguard/configure_container.sh b/client/server_scripts/amnezia_wireguard/configure_container.sh index fa7b09f9..6ebebc4a 100644 --- a/client/server_scripts/amnezia_wireguard/configure_container.sh +++ b/client/server_scripts/amnezia_wireguard/configure_container.sh @@ -12,7 +12,7 @@ echo $WIREGUARD_PSK > /opt/amnezia/amneziawireguard/wireguard_psk.key cat > /opt/amnezia/amneziawireguard/wg0.conf < Date: Mon, 2 Oct 2023 18:48:11 +0300 Subject: [PATCH 012/108] added parsing parameters for windows --- client/daemon/daemon.cpp | 6 +++++- client/daemon/interfaceconfig.cpp | 31 +++++++++++++++++++++++++++++++ 2 files changed, 36 insertions(+), 1 deletion(-) diff --git a/client/daemon/daemon.cpp b/client/daemon/daemon.cpp index 63a5c7f6..b85b2c33 100644 --- a/client/daemon/daemon.cpp +++ b/client/daemon/daemon.cpp @@ -360,7 +360,11 @@ bool Daemon::parseConfig(const QJsonObject& obj, InterfaceConfig& config) { return false; } - if (!obj.value("Jc").isNull()) { + if (!obj.value("Jc").isNull() && !obj.value("Jmin").isNull() + && !obj.value("Jmax").isNull() && !obj.value("S1").isNull() + && !obj.value("S2").isNull() && !obj.value("H1").isNull() + && !obj.value("H2").isNull() && !obj.value("H3").isNull() + && !obj.value("H4").isNull()) { config.m_junkPacketCount = obj.value("Jc").toString(); config.m_junkPacketMinSize = obj.value("Jmin").toString(); config.m_junkPacketMaxSize = obj.value("Jmax").toString(); diff --git a/client/daemon/interfaceconfig.cpp b/client/daemon/interfaceconfig.cpp index 68bebca0..b24a35c7 100644 --- a/client/daemon/interfaceconfig.cpp +++ b/client/daemon/interfaceconfig.cpp @@ -97,6 +97,37 @@ QString InterfaceConfig::toWgConf(const QMap& extra) const { out << "DNS = " << dnsServers.join(", ") << "\n"; } + if (!m_junkPacketCount.isNull()) { + out << "JunkPacketCount = " << m_junkPacketCount << "\n"; + } + if (!m_junkPacketMinSize.isNull()) { + out << "JunkPacketMinSize = " << m_junkPacketMinSize << "\n"; + } + if (!m_junkPacketMaxSize.isNull()) { + out << "JunkPacketMaxSize = " << m_junkPacketMaxSize << "\n"; + } + if (!m_initPacketJunkSize.isNull()) { + out << "InitPacketJunkSize = " << m_initPacketJunkSize << "\n"; + } + if (!m_responsePacketJunkSize.isNull()) { + out << "ResponsePacketJunkSize = " << m_responsePacketJunkSize << "\n"; + } + if (!m_initPacketMagicHeader.isNull()) { + out << "InitPacketMagicHeader = " << m_initPacketMagicHeader << "\n"; + } + if (!m_responsePacketMagicHeader.isNull()) { + out << "ResponsePacketMagicHeader = " << m_responsePacketMagicHeader + << "\n"; + } + if (!m_underloadPacketMagicHeader.isNull()) { + out << "UnderloadPacketMagicHeader = " << m_underloadPacketMagicHeader + << "\n"; + } + if (!m_transportPacketMagicHeader.isNull()) { + out << "TransportPacketMagicHeader = " << m_transportPacketMagicHeader + << "\n"; + } + // If any extra config was provided, append it now. for (const QString& key : extra.keys()) { out << key << " = " << extra[key] << "\n"; From a93f75fb5a6defd9a77398324046021b9347ec68 Mon Sep 17 00:00:00 2001 From: "vladimir.kuznetsov" Date: Wed, 4 Oct 2023 14:40:17 +0500 Subject: [PATCH 013/108] added full version to page about --- client/ui/controllers/settingsController.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/client/ui/controllers/settingsController.cpp b/client/ui/controllers/settingsController.cpp index 3edfe3d9..78d0dd67 100644 --- a/client/ui/controllers/settingsController.cpp +++ b/client/ui/controllers/settingsController.cpp @@ -22,7 +22,7 @@ SettingsController::SettingsController(const QSharedPointer &serve m_languageModel(languageModel), m_settings(settings) { - m_appVersion = QString("%1: %2 (%3)").arg(tr("Software version"), QString(APP_MAJOR_VERSION), __DATE__); + m_appVersion = QString("%1: %2 (%3)").arg(tr("Software version"), QString(APP_VERSION), __DATE__); #ifdef Q_OS_ANDROID if (!m_settings->isScreenshotsEnabled()) { @@ -193,4 +193,4 @@ void SettingsController::toggleScreenshotsEnabled(bool enable) } }); #endif -} \ No newline at end of file +} From a83ec10b61ae4b3d704f5063e45a4bd1a427d6ac Mon Sep 17 00:00:00 2001 From: "vladimir.kuznetsov" Date: Wed, 4 Oct 2023 14:47:10 +0500 Subject: [PATCH 014/108] updated description for full access sharing --- client/ui/qml/Pages2/PageShare.qml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/ui/qml/Pages2/PageShare.qml b/client/ui/qml/Pages2/PageShare.qml index 00b65310..6c284278 100644 --- a/client/ui/qml/Pages2/PageShare.qml +++ b/client/ui/qml/Pages2/PageShare.qml @@ -172,7 +172,7 @@ PageType { Layout.bottomMargin: 24 text: accessTypeSelector.currentIndex === 0 ? qsTr("VPN access without the ability to manage the server") : - qsTr("Full access to server") + qsTr("Access to server management. The user with whom you share full access to the connection will be able to add and remove your protocols and services to the servers, as well as change settings.") color: "#878B91" } From 9df262d5028c36de1ac4b0af00c02dd7f7021bad Mon Sep 17 00:00:00 2001 From: "vladimir.kuznetsov" Date: Wed, 4 Oct 2023 19:14:27 +0300 Subject: [PATCH 015/108] fixed sending parameters to the awg daemon for windows --- client/daemon/interfaceconfig.cpp | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/client/daemon/interfaceconfig.cpp b/client/daemon/interfaceconfig.cpp index b24a35c7..8aa06b9b 100644 --- a/client/daemon/interfaceconfig.cpp +++ b/client/daemon/interfaceconfig.cpp @@ -98,34 +98,31 @@ QString InterfaceConfig::toWgConf(const QMap& extra) const { } if (!m_junkPacketCount.isNull()) { - out << "JunkPacketCount = " << m_junkPacketCount << "\n"; + out << "Jc = " << m_junkPacketCount << "\n"; } if (!m_junkPacketMinSize.isNull()) { - out << "JunkPacketMinSize = " << m_junkPacketMinSize << "\n"; + out << "JMin = " << m_junkPacketMinSize << "\n"; } if (!m_junkPacketMaxSize.isNull()) { - out << "JunkPacketMaxSize = " << m_junkPacketMaxSize << "\n"; + out << "JMax = " << m_junkPacketMaxSize << "\n"; } if (!m_initPacketJunkSize.isNull()) { - out << "InitPacketJunkSize = " << m_initPacketJunkSize << "\n"; + out << "S1 = " << m_initPacketJunkSize << "\n"; } if (!m_responsePacketJunkSize.isNull()) { - out << "ResponsePacketJunkSize = " << m_responsePacketJunkSize << "\n"; + out << "S2 = " << m_responsePacketJunkSize << "\n"; } if (!m_initPacketMagicHeader.isNull()) { - out << "InitPacketMagicHeader = " << m_initPacketMagicHeader << "\n"; + out << "H1 = " << m_initPacketMagicHeader << "\n"; } if (!m_responsePacketMagicHeader.isNull()) { - out << "ResponsePacketMagicHeader = " << m_responsePacketMagicHeader - << "\n"; + out << "H2 = " << m_responsePacketMagicHeader << "\n"; } if (!m_underloadPacketMagicHeader.isNull()) { - out << "UnderloadPacketMagicHeader = " << m_underloadPacketMagicHeader - << "\n"; + out << "H3 = " << m_underloadPacketMagicHeader << "\n"; } if (!m_transportPacketMagicHeader.isNull()) { - out << "TransportPacketMagicHeader = " << m_transportPacketMagicHeader - << "\n"; + out << "H4 = " << m_transportPacketMagicHeader << "\n"; } // If any extra config was provided, append it now. From 396b7aac18977d04caacc3ff9bd2c67daea72757 Mon Sep 17 00:00:00 2001 From: "vladimir.kuznetsov" Date: Thu, 5 Oct 2023 13:56:00 +0500 Subject: [PATCH 016/108] fixed display of amnezia dns description on main menu --- client/ui/qml/Pages2/PageHome.qml | 92 +++++++++++++++++++------------ 1 file changed, 56 insertions(+), 36 deletions(-) diff --git a/client/ui/qml/Pages2/PageHome.qml b/client/ui/qml/Pages2/PageHome.qml index d395cd22..3808fb15 100644 --- a/client/ui/qml/Pages2/PageHome.qml +++ b/client/ui/qml/Pages2/PageHome.qml @@ -26,6 +26,55 @@ PageType { property string defaultServerHostName: ServersModel.defaultServerHostName property string defaultContainerName: ContainersModel.defaultContainerName + Connections { + target: PageController + + function onRestorePageHomeState(isContainerInstalled) { + buttonContent.state = "expanded" + if (isContainerInstalled) { + containersDropDown.menuVisible = true + } + } + function onForceCloseDrawer() { + buttonContent.state = "collapsed" + } + } + + Connections { + target: ServersModel + + function onDefaultServerIndexChanged() { + updateDescriptions() + } + } + + Connections { + target: ContainersModel + + function onDefaultContainerChanged() { + updateDescriptions() + } + } + + function updateDescriptions() { + var description = "" + if (ServersModel.isDefaultServerHasWriteAccess()) { + if (SettingsController.isAmneziaDnsEnabled() + && ContainersModel.isAmneziaDnsContainerInstalled(ServersModel.getDefaultServerIndex())) { + description += "Amnezia DNS | " + } + } else { + if (ServersModel.isDefaultServerConfigContainsAmneziaDns()) { + description += "Amnezia DNS | " + } + } + + collapsedServerMenuDescription.text = description + root.defaultContainerName + " | " + root.defaultServerHostName + expandedServersMenuDescription.text = description + root.defaultServerHostName + } + + Component.onCompleted: updateDescriptions() + MouseArea { anchors.fill: parent enabled: buttonContent.state === "expanded" @@ -43,20 +92,6 @@ PageType { } } - Connections { - target: PageController - - function onRestorePageHomeState(isContainerInstalled) { - buttonContent.state = "expanded" - if (isContainerInstalled) { - containersDropDown.menuVisible = true - } - } - function onForceCloseDrawer() { - buttonContent.state = "collapsed" - } - } - MouseArea { id: dragArea @@ -255,26 +290,10 @@ PageType { } LabelTextType { + id: collapsedServerMenuDescription Layout.bottomMargin: 44 Layout.alignment: Qt.AlignHCenter | Qt.AlignVCenter visible: buttonContent.collapsedVisibility - - text: { - var description = "" - if (ServersModel.isDefaultServerHasWriteAccess()) { - if (SettingsController.isAmneziaDnsEnabled() - && ContainersModel.isAmneziaDnsContainerInstalled(ServersModel.getDefaultServerIndex())) { - description += "Amnezia DNS | " - } - } else { - if (ServersModel.isDefaultServerConfigContainsAmneziaDns()) { - description += "Amnezia DNS | " - } - } - - description += root.defaultContainerName + " | " + root.defaultServerHostName - return description - } } ColumnLayout { @@ -297,10 +316,11 @@ PageType { } LabelTextType { + id: expandedServersMenuDescription Layout.bottomMargin: 24 - Layout.alignment: Qt.AlignHCenter | Qt.AlignVCenter - - text: root.defaultServerHostName + Layout.fillWidth: true + horizontalAlignment: Qt.AlignHCenter + verticalAlignment: Qt.AlignVCenter } RowLayout { @@ -450,11 +470,11 @@ PageType { if (hasWriteAccess) { if (SettingsController.isAmneziaDnsEnabled() && ContainersModel.isAmneziaDnsContainerInstalled(index)) { - description += "AmneziaDNS | " + description += "Amnezia DNS | " } } else { if (containsAmneziaDns) { - description += "AmneziaDNS | " + description += "Amnezia DNS | " } } From 3a77705142d8ee99c73f3269986d27bda9499ed9 Mon Sep 17 00:00:00 2001 From: Mykola Baibuz Date: Thu, 5 Oct 2023 15:55:32 -0400 Subject: [PATCH 017/108] Update AWG binary --- client/3rd-prebuilt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/3rd-prebuilt b/client/3rd-prebuilt index 6f0d654a..c6d77cff 160000 --- a/client/3rd-prebuilt +++ b/client/3rd-prebuilt @@ -1 +1 @@ -Subproject commit 6f0d654a2409e2f634e7f7b95d34998c8eba2d7b +Subproject commit c6d77cff35bcdef34306ab5ef594a313726949da From 08863edb520d99ac2931510469302ca1d755f730 Mon Sep 17 00:00:00 2001 From: Mykola Baibuz Date: Thu, 5 Oct 2023 17:11:40 -0400 Subject: [PATCH 018/108] Update AWG iOS binary again --- client/3rd-prebuilt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/3rd-prebuilt b/client/3rd-prebuilt index c6d77cff..994f4f2b 160000 --- a/client/3rd-prebuilt +++ b/client/3rd-prebuilt @@ -1 +1 @@ -Subproject commit c6d77cff35bcdef34306ab5ef594a313726949da +Subproject commit 994f4f2b030600f2d8dbf9dccf409b1591c9e463 From d77be5a244252849720763ff7a2c7e672f53b520 Mon Sep 17 00:00:00 2001 From: Mykola Baibuz Date: Fri, 6 Oct 2023 00:38:54 +0300 Subject: [PATCH 019/108] Update iOS network extension --- client/3rd/awg-apple | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/3rd/awg-apple b/client/3rd/awg-apple index 5767a03f..fab07138 160000 --- a/client/3rd/awg-apple +++ b/client/3rd/awg-apple @@ -1 +1 @@ -Subproject commit 5767a03f75a2b77d4f78fdd77ff51a1eefabe3b0 +Subproject commit fab07138dbab06ac0de256021e47e273f4df8e88 From b7a65343af4373753841b7db3c8f2bd5c4260cc6 Mon Sep 17 00:00:00 2001 From: "vladimir.kuznetsov" Date: Fri, 6 Oct 2023 16:43:52 +0500 Subject: [PATCH 020/108] added the ability to change awg parameters on the protocol settings page --- client/configurators/awg_configurator.cpp | 73 ++++++----- .../configurators/wireguard_configurator.cpp | 8 +- client/configurators/wireguard_configurator.h | 2 + client/core/servercontroller.cpp | 4 + .../protocols/amneziaWireGuardConfigModel.cpp | 81 ++++++++++-- .../protocols/amneziaWireGuardConfigModel.h | 10 +- .../Components/SettingsContainersListView.qml | 2 +- .../qml/Controls2/TextFieldWithHeaderType.qml | 7 ++ .../PageProtocolAmneziaWireGuardSettings.qml | 117 +++++++++++++----- 9 files changed, 224 insertions(+), 80 deletions(-) diff --git a/client/configurators/awg_configurator.cpp b/client/configurators/awg_configurator.cpp index 85dbd6de..6ed1cd1b 100644 --- a/client/configurators/awg_configurator.cpp +++ b/client/configurators/awg_configurator.cpp @@ -3,6 +3,8 @@ #include #include +#include "core/servercontroller.h" + AmneziaWireGuardConfigurator::AmneziaWireGuardConfigurator(std::shared_ptr settings, QObject *parent) : WireguardConfigurator(settings, true, parent) { @@ -15,46 +17,43 @@ QString AmneziaWireGuardConfigurator::genAmneziaWireGuardConfig(const ServerCred QString config = WireguardConfigurator::genWireguardConfig(credentials, container, containerConfig, errorCode); QJsonObject jsonConfig = QJsonDocument::fromJson(config.toUtf8()).object(); - QJsonObject awgConfig = containerConfig.value(config_key::amneziaWireguard).toObject(); - auto junkPacketCount = - awgConfig.value(config_key::junkPacketCount).toString(protocols::amneziawireguard::defaultJunkPacketCount); - auto junkPacketMinSize = - awgConfig.value(config_key::junkPacketMinSize).toString(protocols::amneziawireguard::defaultJunkPacketMinSize); - auto junkPacketMaxSize = - awgConfig.value(config_key::junkPacketMaxSize).toString(protocols::amneziawireguard::defaultJunkPacketMaxSize); - auto initPacketJunkSize = - awgConfig.value(config_key::initPacketJunkSize).toString(protocols::amneziawireguard::defaultInitPacketJunkSize); - auto responsePacketJunkSize = - awgConfig.value(config_key::responsePacketJunkSize).toString(protocols::amneziawireguard::defaultResponsePacketJunkSize); - auto initPacketMagicHeader = - awgConfig.value(config_key::initPacketMagicHeader).toString(protocols::amneziawireguard::defaultInitPacketMagicHeader); - auto responsePacketMagicHeader = - awgConfig.value(config_key::responsePacketMagicHeader).toString(protocols::amneziawireguard::defaultResponsePacketMagicHeader); - auto underloadPacketMagicHeader = - awgConfig.value(config_key::underloadPacketMagicHeader).toString(protocols::amneziawireguard::defaultUnderloadPacketMagicHeader); - auto transportPacketMagicHeader = - awgConfig.value(config_key::transportPacketMagicHeader).toString(protocols::amneziawireguard::defaultTransportPacketMagicHeader); + ServerController serverController(m_settings); + QString serverConfig = serverController.getTextFileFromContainer(container, credentials, protocols::amneziawireguard::serverConfigPath, errorCode); - config.replace("$JUNK_PACKET_COUNT", junkPacketCount); - config.replace("$JUNK_PACKET_MIN_SIZE", junkPacketMinSize); - config.replace("$JUNK_PACKET_MAX_SIZE", junkPacketMaxSize); - config.replace("$INIT_PACKET_JUNK_SIZE", initPacketJunkSize); - config.replace("$RESPONSE_PACKET_JUNK_SIZE", responsePacketJunkSize); - config.replace("$INIT_PACKET_MAGIC_HEADER", initPacketMagicHeader); - config.replace("$RESPONSE_PACKET_MAGIC_HEADER", responsePacketMagicHeader); - config.replace("$UNDERLOAD_PACKET_MAGIC_HEADER", underloadPacketMagicHeader); - config.replace("$TRANSPORT_PACKET_MAGIC_HEADER", transportPacketMagicHeader); + QMap serverConfigMap; + auto serverConfigLines = serverConfig.split("\n"); + for (auto &line : serverConfigLines) { + auto trimmedLine = line.trimmed(); + if (trimmedLine.startsWith("[") && trimmedLine.endsWith("]")) { + continue; + } else { + QStringList parts = trimmedLine.split(" = "); + if (parts.count() == 2) { + serverConfigMap.insert(parts[0].trimmed(), parts[1].trimmed()); + } + } + } - jsonConfig[config_key::junkPacketCount] = junkPacketCount; - jsonConfig[config_key::junkPacketMinSize] = junkPacketMinSize; - jsonConfig[config_key::junkPacketMaxSize] = junkPacketMaxSize; - jsonConfig[config_key::initPacketJunkSize] = initPacketJunkSize; - jsonConfig[config_key::responsePacketJunkSize] = responsePacketJunkSize; - jsonConfig[config_key::initPacketMagicHeader] = initPacketMagicHeader; - jsonConfig[config_key::responsePacketMagicHeader] = responsePacketMagicHeader; - jsonConfig[config_key::underloadPacketMagicHeader] = underloadPacketMagicHeader; - jsonConfig[config_key::transportPacketMagicHeader] = transportPacketMagicHeader; + config.replace("$JUNK_PACKET_COUNT", serverConfigMap.value(config_key::junkPacketCount)); + config.replace("$JUNK_PACKET_MIN_SIZE", serverConfigMap.value(config_key::junkPacketMinSize)); + config.replace("$JUNK_PACKET_MAX_SIZE", serverConfigMap.value(config_key::junkPacketMaxSize)); + config.replace("$INIT_PACKET_JUNK_SIZE", serverConfigMap.value(config_key::initPacketJunkSize)); + config.replace("$RESPONSE_PACKET_JUNK_SIZE", serverConfigMap.value(config_key::responsePacketJunkSize)); + config.replace("$INIT_PACKET_MAGIC_HEADER", serverConfigMap.value(config_key::initPacketMagicHeader)); + config.replace("$RESPONSE_PACKET_MAGIC_HEADER", serverConfigMap.value(config_key::responsePacketMagicHeader)); + config.replace("$UNDERLOAD_PACKET_MAGIC_HEADER", serverConfigMap.value(config_key::underloadPacketMagicHeader)); + config.replace("$TRANSPORT_PACKET_MAGIC_HEADER", serverConfigMap.value(config_key::transportPacketMagicHeader)); + + jsonConfig[config_key::junkPacketCount] = serverConfigMap.value(config_key::junkPacketCount); + jsonConfig[config_key::junkPacketMinSize] = serverConfigMap.value(config_key::junkPacketMinSize); + jsonConfig[config_key::junkPacketMaxSize] = serverConfigMap.value(config_key::junkPacketMaxSize); + jsonConfig[config_key::initPacketJunkSize] = serverConfigMap.value(config_key::initPacketJunkSize); + jsonConfig[config_key::responsePacketJunkSize] = serverConfigMap.value(config_key::responsePacketJunkSize); + jsonConfig[config_key::initPacketMagicHeader] = serverConfigMap.value(config_key::initPacketMagicHeader); + jsonConfig[config_key::responsePacketMagicHeader] = serverConfigMap.value(config_key::responsePacketMagicHeader); + jsonConfig[config_key::underloadPacketMagicHeader] = serverConfigMap.value(config_key::underloadPacketMagicHeader); + jsonConfig[config_key::transportPacketMagicHeader] = serverConfigMap.value(config_key::transportPacketMagicHeader); return QJsonDocument(jsonConfig).toJson(); } diff --git a/client/configurators/wireguard_configurator.cpp b/client/configurators/wireguard_configurator.cpp index dd836a18..5ea042c1 100644 --- a/client/configurators/wireguard_configurator.cpp +++ b/client/configurators/wireguard_configurator.cpp @@ -30,6 +30,9 @@ WireguardConfigurator::WireguardConfigurator(std::shared_ptr settings, : amnezia::protocols::wireguard::serverPskKeyPath; m_configTemplate = m_isAmneziaWireGuard ? ProtocolScriptType::amnezia_wireguard_template : ProtocolScriptType::wireguard_template; + + m_protocolName = m_isAmneziaWireGuard ? config_key::amneziaWireguard : config_key::wireguard; + m_defaultPort = m_isAmneziaWireGuard ? protocols::wireguard::defaultPort : protocols::amneziawireguard::defaultPort; } WireguardConfigurator::ConnectionData WireguardConfigurator::genClientKeys() @@ -70,10 +73,7 @@ WireguardConfigurator::ConnectionData WireguardConfigurator::prepareWireguardCon { WireguardConfigurator::ConnectionData connData = WireguardConfigurator::genClientKeys(); connData.host = credentials.hostName; - connData.port = containerConfig.value(m_isAmneziaWireGuard ? config_key::amneziaWireguard : config_key::wireguard) - .toObject() - .value(config_key::port) - .toString(protocols::wireguard::defaultPort); + connData.port = containerConfig.value(m_protocolName).toObject().value(config_key::port).toString(m_defaultPort); if (connData.clientPrivKey.isEmpty() || connData.clientPubKey.isEmpty()) { if (errorCode) diff --git a/client/configurators/wireguard_configurator.h b/client/configurators/wireguard_configurator.h index 70ed729b..10eecbb4 100644 --- a/client/configurators/wireguard_configurator.h +++ b/client/configurators/wireguard_configurator.h @@ -42,6 +42,8 @@ private: QString m_serverPublicKeyPath; QString m_serverPskKeyPath; amnezia::ProtocolScriptType m_configTemplate; + QString m_protocolName; + QString m_defaultPort; }; #endif // WIREGUARD_CONFIGURATOR_H diff --git a/client/core/servercontroller.cpp b/client/core/servercontroller.cpp index 3b30451f..b5467dac 100644 --- a/client/core/servercontroller.cpp +++ b/client/core/servercontroller.cpp @@ -338,6 +338,10 @@ bool ServerController::isReinstallContainerRequired(DockerContainer container, c return true; } + if (container == DockerContainer::AmneziaWireGuard) { + return true; + } + return false; } diff --git a/client/ui/models/protocols/amneziaWireGuardConfigModel.cpp b/client/ui/models/protocols/amneziaWireGuardConfigModel.cpp index 9cf4ed14..a1ce4385 100644 --- a/client/ui/models/protocols/amneziaWireGuardConfigModel.cpp +++ b/client/ui/models/protocols/amneziaWireGuardConfigModel.cpp @@ -1,5 +1,7 @@ #include "amneziaWireGuardConfigModel.h" +#include + #include "protocols/protocols_defs.h" AmneziaWireGuardConfigModel::AmneziaWireGuardConfigModel(QObject *parent) : QAbstractListModel(parent) @@ -20,7 +22,27 @@ bool AmneziaWireGuardConfigModel::setData(const QModelIndex &index, const QVaria switch (role) { case Roles::PortRole: m_protocolConfig.insert(config_key::port, value.toString()); break; - case Roles::CipherRole: m_protocolConfig.insert(config_key::cipher, value.toString()); break; + case Roles::JunkPacketCountRole: m_protocolConfig.insert(config_key::junkPacketCount, value.toString()); break; + case Roles::JunkPacketMinSizeRole: m_protocolConfig.insert(config_key::junkPacketMinSize, value.toString()); break; + case Roles::JunkPacketMaxSizeRole: m_protocolConfig.insert(config_key::junkPacketMaxSize, value.toString()); break; + case Roles::InitPacketJunkSizeRole: + m_protocolConfig.insert(config_key::initPacketJunkSize, value.toString()); + break; + case Roles::ResponsePacketJunkSizeRole: + m_protocolConfig.insert(config_key::responsePacketJunkSize, value.toString()); + break; + case Roles::InitPacketMagicHeaderRole: + m_protocolConfig.insert(config_key::initPacketMagicHeader, value.toString()); + break; + case Roles::ResponsePacketMagicHeaderRole: + m_protocolConfig.insert(config_key::responsePacketMagicHeader, value.toString()); + break; + case Roles::UnderloadPacketMagicHeaderRole: + m_protocolConfig.insert(config_key::underloadPacketMagicHeader, value.toString()); + break; + case Roles::TransportPacketMagicHeaderRole: + m_protocolConfig.insert(config_key::transportPacketMagicHeader, value.toString()); + break; } emit dataChanged(index, index, QList { role }); @@ -34,9 +56,16 @@ QVariant AmneziaWireGuardConfigModel::data(const QModelIndex &index, int role) c } switch (role) { - case Roles::PortRole: return m_protocolConfig.value(config_key::port).toString(protocols::shadowsocks::defaultPort); - case Roles::CipherRole: - return m_protocolConfig.value(config_key::cipher).toString(protocols::shadowsocks::defaultCipher); + case Roles::PortRole: return m_protocolConfig.value(config_key::port).toString(); + case Roles::JunkPacketCountRole: return m_protocolConfig.value(config_key::junkPacketCount); + case Roles::JunkPacketMinSizeRole: return m_protocolConfig.value(config_key::junkPacketMinSize); + case Roles::JunkPacketMaxSizeRole: return m_protocolConfig.value(config_key::junkPacketMaxSize); + case Roles::InitPacketJunkSizeRole: return m_protocolConfig.value(config_key::initPacketJunkSize); + case Roles::ResponsePacketJunkSizeRole: return m_protocolConfig.value(config_key::responsePacketJunkSize); + case Roles::InitPacketMagicHeaderRole: return m_protocolConfig.value(config_key::initPacketMagicHeader); + case Roles::ResponsePacketMagicHeaderRole: return m_protocolConfig.value(config_key::responsePacketMagicHeader); + case Roles::UnderloadPacketMagicHeaderRole: return m_protocolConfig.value(config_key::underloadPacketMagicHeader); + case Roles::TransportPacketMagicHeaderRole: return m_protocolConfig.value(config_key::transportPacketMagicHeader); } return QVariant(); @@ -48,14 +77,44 @@ void AmneziaWireGuardConfigModel::updateModel(const QJsonObject &config) m_container = ContainerProps::containerFromString(config.value(config_key::container).toString()); m_fullConfig = config; - QJsonObject protocolConfig = config.value(config_key::wireguard).toObject(); + + QJsonObject protocolConfig = config.value(config_key::amneziaWireguard).toObject(); + + m_protocolConfig[config_key::port] = + protocolConfig.value(config_key::port).toString(protocols::amneziawireguard::defaultPort); + m_protocolConfig[config_key::junkPacketCount] = + protocolConfig.value(config_key::junkPacketCount).toString(protocols::amneziawireguard::defaultJunkPacketCount); + m_protocolConfig[config_key::junkPacketMinSize] = + protocolConfig.value(config_key::junkPacketMinSize) + .toString(protocols::amneziawireguard::defaultJunkPacketMinSize); + m_protocolConfig[config_key::junkPacketMaxSize] = + protocolConfig.value(config_key::junkPacketMaxSize) + .toString(protocols::amneziawireguard::defaultJunkPacketMaxSize); + m_protocolConfig[config_key::initPacketJunkSize] = + protocolConfig.value(config_key::initPacketJunkSize) + .toString(protocols::amneziawireguard::defaultInitPacketJunkSize); + m_protocolConfig[config_key::responsePacketJunkSize] = + protocolConfig.value(config_key::responsePacketJunkSize) + .toString(protocols::amneziawireguard::defaultResponsePacketJunkSize); + m_protocolConfig[config_key::initPacketMagicHeader] = + protocolConfig.value(config_key::initPacketMagicHeader) + .toString(protocols::amneziawireguard::defaultInitPacketMagicHeader); + m_protocolConfig[config_key::responsePacketMagicHeader] = + protocolConfig.value(config_key::responsePacketMagicHeader) + .toString(protocols::amneziawireguard::defaultResponsePacketMagicHeader); + m_protocolConfig[config_key::underloadPacketMagicHeader] = + protocolConfig.value(config_key::underloadPacketMagicHeader) + .toString(protocols::amneziawireguard::defaultUnderloadPacketMagicHeader); + m_protocolConfig[config_key::transportPacketMagicHeader] = + protocolConfig.value(config_key::transportPacketMagicHeader) + .toString(protocols::amneziawireguard::defaultTransportPacketMagicHeader); endResetModel(); } QJsonObject AmneziaWireGuardConfigModel::getConfig() { - m_fullConfig.insert(config_key::wireguard, m_protocolConfig); + m_fullConfig.insert(config_key::amneziaWireguard, m_protocolConfig); return m_fullConfig; } @@ -64,7 +123,15 @@ QHash AmneziaWireGuardConfigModel::roleNames() const QHash roles; roles[PortRole] = "port"; - roles[CipherRole] = "cipher"; + roles[JunkPacketCountRole] = "junkPacketCount"; + roles[JunkPacketMinSizeRole] = "junkPacketMinSize"; + roles[JunkPacketMaxSizeRole] = "junkPacketMaxSize"; + roles[InitPacketJunkSizeRole] = "initPacketJunkSize"; + roles[ResponsePacketJunkSizeRole] = "responsePacketJunkSize"; + roles[InitPacketMagicHeaderRole] = "initPacketMagicHeader"; + roles[ResponsePacketMagicHeaderRole] = "responsePacketMagicHeader"; + roles[UnderloadPacketMagicHeaderRole] = "underloadPacketMagicHeader"; + roles[TransportPacketMagicHeaderRole] = "transportPacketMagicHeader"; return roles; } diff --git a/client/ui/models/protocols/amneziaWireGuardConfigModel.h b/client/ui/models/protocols/amneziaWireGuardConfigModel.h index b798c289..9419d5c9 100644 --- a/client/ui/models/protocols/amneziaWireGuardConfigModel.h +++ b/client/ui/models/protocols/amneziaWireGuardConfigModel.h @@ -13,7 +13,15 @@ class AmneziaWireGuardConfigModel : public QAbstractListModel public: enum Roles { PortRole = Qt::UserRole + 1, - CipherRole + JunkPacketCountRole, + JunkPacketMinSizeRole, + JunkPacketMaxSizeRole, + InitPacketJunkSizeRole, + ResponsePacketJunkSizeRole, + InitPacketMagicHeaderRole, + ResponsePacketMagicHeaderRole, + UnderloadPacketMagicHeaderRole, + TransportPacketMagicHeaderRole }; explicit AmneziaWireGuardConfigModel(QObject *parent = nullptr); diff --git a/client/ui/qml/Components/SettingsContainersListView.qml b/client/ui/qml/Components/SettingsContainersListView.qml index 250ba1eb..df25b492 100644 --- a/client/ui/qml/Components/SettingsContainersListView.qml +++ b/client/ui/qml/Components/SettingsContainersListView.qml @@ -65,7 +65,7 @@ ListView { break } case ContainerEnum.AmneziaWireGuard: { - WireGuardConfigModel.updateModel(config) + AmneziaWireGuardConfigModel.updateModel(config) PageController.goToPage(PageEnum.PageProtocolAmneziaWireGuardSettings) break } diff --git a/client/ui/qml/Controls2/TextFieldWithHeaderType.qml b/client/ui/qml/Controls2/TextFieldWithHeaderType.qml index 3f80428e..a23e9354 100644 --- a/client/ui/qml/Controls2/TextFieldWithHeaderType.qml +++ b/client/ui/qml/Controls2/TextFieldWithHeaderType.qml @@ -12,6 +12,7 @@ Item { property string headerTextColor: "#878b91" property alias errorText: errorField.text + property bool checkEmptyText: false property string buttonText property string buttonImageSource @@ -98,6 +99,12 @@ Item { root.errorText = "" } + onActiveFocusChanged: { + if (checkEmptyText && textFieldText === "") { + errorText = qsTr("The field can't be empty") + } + } + MouseArea { anchors.fill: parent acceptedButtons: Qt.RightButton diff --git a/client/ui/qml/Pages2/PageProtocolAmneziaWireGuardSettings.qml b/client/ui/qml/Pages2/PageProtocolAmneziaWireGuardSettings.qml index a905f47a..35edb15c 100644 --- a/client/ui/qml/Pages2/PageProtocolAmneziaWireGuardSettings.qml +++ b/client/ui/qml/Pages2/PageProtocolAmneziaWireGuardSettings.qml @@ -4,6 +4,8 @@ import QtQuick.Layouts import SortFilterProxyModel 0.2 +import PageEnum 1.0 + import "./" import "../Controls2" import "../Controls2/TextTypes" @@ -75,6 +77,7 @@ PageType { } TextFieldWithHeaderType { + id: portTextField Layout.fillWidth: true Layout.topMargin: 40 @@ -88,132 +91,175 @@ PageType { port = textFieldText } } + + checkEmptyText: true } TextFieldWithHeaderType { + id: junkPacketCountTextField Layout.fillWidth: true Layout.topMargin: 16 headerText: qsTr("Junk packet count") - textFieldText: port + textFieldText: junkPacketCount + textField.validator: IntValidator { bottom: 0 } textField.onEditingFinished: { - if (textFieldText !== port) { - port = textFieldText + console.log("1") + if (textFieldText === "") { + textFieldText = "0" + } + + if (textFieldText !== junkPacketCount) { + junkPacketCount = textFieldText } } + + checkEmptyText: true } TextFieldWithHeaderType { + id: junkPacketMinSizeTextField Layout.fillWidth: true Layout.topMargin: 16 headerText: qsTr("Junk packet minimum size") - textFieldText: port + textFieldText: junkPacketMinSize + textField.validator: IntValidator { bottom: 0 } textField.onEditingFinished: { - if (textFieldText !== port) { - port = textFieldText + if (textFieldText !== junkPacketMinSize) { + junkPacketMinSize = textFieldText } } + + checkEmptyText: true } TextFieldWithHeaderType { + id: junkPacketMaxSizeTextField Layout.fillWidth: true Layout.topMargin: 16 headerText: qsTr("Junk packet maximum size") - textFieldText: port + textFieldText: junkPacketMaxSize + textField.validator: IntValidator { bottom: 0 } textField.onEditingFinished: { - if (textFieldText !== port) { - port = textFieldText + if (textFieldText !== junkPacketMaxSize) { + junkPacketMaxSize = textFieldText } } + + checkEmptyText: true } TextFieldWithHeaderType { + id: initPacketJunkSizeTextField Layout.fillWidth: true Layout.topMargin: 16 headerText: qsTr("Init packet junk size") - textFieldText: port + textFieldText: initPacketJunkSize + textField.validator: IntValidator { bottom: 0 } textField.onEditingFinished: { - if (textFieldText !== port) { - port = textFieldText + if (textFieldText !== initPacketJunkSize) { + initPacketJunkSize = textFieldText } } + + checkEmptyText: true } TextFieldWithHeaderType { + id: responsePacketJunkSizeTextField Layout.fillWidth: true Layout.topMargin: 16 headerText: qsTr("Response packet junk size") - textFieldText: port + textFieldText: responsePacketJunkSize + textField.validator: IntValidator { bottom: 0 } textField.onEditingFinished: { - if (textFieldText !== port) { - port = textFieldText + if (textFieldText !== responsePacketJunkSize) { + responsePacketJunkSize = textFieldText } } + + checkEmptyText: true } TextFieldWithHeaderType { + id: initPacketMagicHeaderTextField Layout.fillWidth: true Layout.topMargin: 16 headerText: qsTr("Init packet magic header") - textFieldText: port + textFieldText: initPacketMagicHeader + textField.validator: IntValidator { bottom: 0 } textField.onEditingFinished: { - if (textFieldText !== port) { - port = textFieldText + if (textFieldText !== initPacketMagicHeader) { + initPacketMagicHeader = textFieldText } } + + checkEmptyText: true } TextFieldWithHeaderType { + id: responsePacketMagicHeaderTextField Layout.fillWidth: true Layout.topMargin: 16 headerText: qsTr("Response packet magic header") - textFieldText: port + textFieldText: responsePacketMagicHeader + textField.validator: IntValidator { bottom: 0 } textField.onEditingFinished: { - if (textFieldText !== port) { - port = textFieldText + if (textFieldText !== responsePacketMagicHeader) { + responsePacketMagicHeader = textFieldText } } + + checkEmptyText: true } TextFieldWithHeaderType { + id: transportPacketMagicHeaderTextField Layout.fillWidth: true Layout.topMargin: 16 headerText: qsTr("Transport packet magic header") - textFieldText: port + textFieldText: transportPacketMagicHeader + textField.validator: IntValidator { bottom: 0 } textField.onEditingFinished: { - if (textFieldText !== port) { - port = textFieldText + if (textFieldText !== transportPacketMagicHeader) { + transportPacketMagicHeader = textFieldText } } + + checkEmptyText: true } TextFieldWithHeaderType { + id: underloadPacketMagicHeaderTextField Layout.fillWidth: true Layout.topMargin: 16 headerText: qsTr("Underload packet magic header") - textFieldText: port + textFieldText: underloadPacketMagicHeader + textField.validator: IntValidator { bottom: 0 } textField.onEditingFinished: { - if (textFieldText !== port) { - port = textFieldText + if (textFieldText !== underloadPacketMagicHeader) { + underloadPacketMagicHeader = textFieldText } } + + checkEmptyText: true } BasicButtonType { @@ -251,13 +297,24 @@ PageType { Layout.topMargin: 24 Layout.bottomMargin: 24 + enabled: underloadPacketMagicHeaderTextField.errorText === "" && + transportPacketMagicHeaderTextField.errorText === "" && + responsePacketMagicHeaderTextField.errorText === "" && + initPacketMagicHeaderTextField.errorText === "" && + responsePacketJunkSizeTextField.errorText === "" && + initPacketJunkSizeTextField.errorText === "" && + junkPacketMaxSizeTextField.errorText === "" && + junkPacketMinSizeTextField.errorText === "" && + junkPacketCountTextField.errorText === "" && + portTextField.errorText === "" + text: qsTr("Save and Restart Amnezia") onClicked: { forceActiveFocus() -// PageController.showBusyIndicator(true) -// InstallController.updateContainer(ShadowSocksConfigModel.getConfig()) -// PageController.showBusyIndicator(false) + PageController.showBusyIndicator(true) + InstallController.updateContainer(AmneziaWireGuardConfigModel.getConfig()) + PageController.showBusyIndicator(false) } } } From 16fc0617e479a1e4b4b1dd1b320765af4bc117ba Mon Sep 17 00:00:00 2001 From: "vladimir.kuznetsov" Date: Fri, 6 Oct 2023 17:02:28 +0500 Subject: [PATCH 021/108] renamed amneziawireguard files to awg --- .../{amneziaWireGuardConfigModel.cpp => awgConfigModel.cpp} | 0 .../protocols/{amneziaWireGuardConfigModel.h => awgConfigModel.h} | 0 ...olAmneziaWireGuardSettings.qml => PageProtocolAwgSettings.qml} | 0 3 files changed, 0 insertions(+), 0 deletions(-) rename client/ui/models/protocols/{amneziaWireGuardConfigModel.cpp => awgConfigModel.cpp} (100%) rename client/ui/models/protocols/{amneziaWireGuardConfigModel.h => awgConfigModel.h} (100%) rename client/ui/qml/Pages2/{PageProtocolAmneziaWireGuardSettings.qml => PageProtocolAwgSettings.qml} (100%) diff --git a/client/ui/models/protocols/amneziaWireGuardConfigModel.cpp b/client/ui/models/protocols/awgConfigModel.cpp similarity index 100% rename from client/ui/models/protocols/amneziaWireGuardConfigModel.cpp rename to client/ui/models/protocols/awgConfigModel.cpp diff --git a/client/ui/models/protocols/amneziaWireGuardConfigModel.h b/client/ui/models/protocols/awgConfigModel.h similarity index 100% rename from client/ui/models/protocols/amneziaWireGuardConfigModel.h rename to client/ui/models/protocols/awgConfigModel.h diff --git a/client/ui/qml/Pages2/PageProtocolAmneziaWireGuardSettings.qml b/client/ui/qml/Pages2/PageProtocolAwgSettings.qml similarity index 100% rename from client/ui/qml/Pages2/PageProtocolAmneziaWireGuardSettings.qml rename to client/ui/qml/Pages2/PageProtocolAwgSettings.qml From aa4a79934a90e71c9f48a345ddcfcd22224214c8 Mon Sep 17 00:00:00 2001 From: "vladimir.kuznetsov" Date: Fri, 6 Oct 2023 17:19:44 +0500 Subject: [PATCH 022/108] renamed amenziawireguard to awg --- client/amnezia_application.cpp | 4 +-- client/amnezia_application.h | 4 +-- client/configurators/awg_configurator.cpp | 6 ++-- client/configurators/awg_configurator.h | 12 ++++---- client/configurators/vpn_configurator.cpp | 6 ++-- client/configurators/vpn_configurator.h | 4 +-- .../configurators/wireguard_configurator.cpp | 16 +++++------ client/configurators/wireguard_configurator.h | 6 ++-- client/containers/containers_defs.cpp | 10 +++---- client/containers/containers_defs.h | 2 +- client/core/scripts_registry.cpp | 2 +- client/core/servercontroller.cpp | 28 +++++++++---------- client/mozilla/localsocketcontroller.cpp | 4 +-- client/protocols/amneziawireguardprotocol.cpp | 4 +-- client/protocols/amneziawireguardprotocol.h | 12 ++++---- client/protocols/protocols_defs.cpp | 10 +++---- client/protocols/protocols_defs.h | 12 ++++---- client/protocols/vpnprotocol.cpp | 2 +- client/resources.qrc | 2 +- .../amnezia_wireguard/configure_container.sh | 16 +++++------ .../amnezia_wireguard/run_container.sh | 2 +- .../server_scripts/amnezia_wireguard/start.sh | 7 ++--- .../amnezia_wireguard/template.conf | 2 +- client/ui/controllers/importController.cpp | 2 +- client/ui/controllers/pageController.h | 2 +- client/ui/models/protocols/awgConfigModel.cpp | 16 +++++------ client/ui/models/protocols/awgConfigModel.h | 10 +++---- .../Components/SettingsContainersListView.qml | 6 ++-- .../ui/qml/Pages2/PageProtocolAwgSettings.qml | 4 +-- 29 files changed, 105 insertions(+), 108 deletions(-) diff --git a/client/amnezia_application.cpp b/client/amnezia_application.cpp index cef722b1..f372a1d8 100644 --- a/client/amnezia_application.cpp +++ b/client/amnezia_application.cpp @@ -321,8 +321,8 @@ void AmneziaApplication::initModels() m_wireGuardConfigModel.reset(new WireGuardConfigModel(this)); m_engine->rootContext()->setContextProperty("WireGuardConfigModel", m_wireGuardConfigModel.get()); - m_amneziaWireGuardConfigModel.reset(new AmneziaWireGuardConfigModel(this)); - m_engine->rootContext()->setContextProperty("AmneziaWireGuardConfigModel", m_amneziaWireGuardConfigModel.get()); + m_awgConfigModel.reset(new AwgConfigModel(this)); + m_engine->rootContext()->setContextProperty("AwgConfigModel", m_awgConfigModel.get()); #ifdef Q_OS_WINDOWS m_ikev2ConfigModel.reset(new Ikev2ConfigModel(this)); diff --git a/client/amnezia_application.h b/client/amnezia_application.h index 77e50c92..32300421 100644 --- a/client/amnezia_application.h +++ b/client/amnezia_application.h @@ -31,7 +31,7 @@ #ifdef Q_OS_WINDOWS #include "ui/models/protocols/ikev2ConfigModel.h" #endif -#include "ui/models/protocols/amneziaWireGuardConfigModel.h" +#include "ui/models/protocols/awgConfigModel.h" #include "ui/models/protocols/openvpnConfigModel.h" #include "ui/models/protocols/shadowsocksConfigModel.h" #include "ui/models/protocols/wireguardConfigModel.h" @@ -99,7 +99,7 @@ private: QScopedPointer m_shadowSocksConfigModel; QScopedPointer m_cloakConfigModel; QScopedPointer m_wireGuardConfigModel; - QScopedPointer m_amneziaWireGuardConfigModel; + QScopedPointer m_awgConfigModel; #ifdef Q_OS_WINDOWS QScopedPointer m_ikev2ConfigModel; #endif diff --git a/client/configurators/awg_configurator.cpp b/client/configurators/awg_configurator.cpp index 6ed1cd1b..8962067a 100644 --- a/client/configurators/awg_configurator.cpp +++ b/client/configurators/awg_configurator.cpp @@ -5,12 +5,12 @@ #include "core/servercontroller.h" -AmneziaWireGuardConfigurator::AmneziaWireGuardConfigurator(std::shared_ptr settings, QObject *parent) +AwgConfigurator::AwgConfigurator(std::shared_ptr settings, QObject *parent) : WireguardConfigurator(settings, true, parent) { } -QString AmneziaWireGuardConfigurator::genAmneziaWireGuardConfig(const ServerCredentials &credentials, +QString AwgConfigurator::genAwgConfig(const ServerCredentials &credentials, DockerContainer container, const QJsonObject &containerConfig, ErrorCode *errorCode) { @@ -19,7 +19,7 @@ QString AmneziaWireGuardConfigurator::genAmneziaWireGuardConfig(const ServerCred QJsonObject jsonConfig = QJsonDocument::fromJson(config.toUtf8()).object(); ServerController serverController(m_settings); - QString serverConfig = serverController.getTextFileFromContainer(container, credentials, protocols::amneziawireguard::serverConfigPath, errorCode); + QString serverConfig = serverController.getTextFileFromContainer(container, credentials, protocols::awg::serverConfigPath, errorCode); QMap serverConfigMap; auto serverConfigLines = serverConfig.split("\n"); diff --git a/client/configurators/awg_configurator.h b/client/configurators/awg_configurator.h index 02961cf1..cf0f2cae 100644 --- a/client/configurators/awg_configurator.h +++ b/client/configurators/awg_configurator.h @@ -1,18 +1,18 @@ -#ifndef AMNEZIAWIREGUARDCONFIGURATOR_H -#define AMNEZIAWIREGUARDCONFIGURATOR_H +#ifndef AWGCONFIGURATOR_H +#define AWGCONFIGURATOR_H #include #include "wireguard_configurator.h" -class AmneziaWireGuardConfigurator : public WireguardConfigurator +class AwgConfigurator : public WireguardConfigurator { Q_OBJECT public: - AmneziaWireGuardConfigurator(std::shared_ptr settings, QObject *parent = nullptr); + AwgConfigurator(std::shared_ptr settings, QObject *parent = nullptr); - QString genAmneziaWireGuardConfig(const ServerCredentials &credentials, DockerContainer container, + QString genAwgConfig(const ServerCredentials &credentials, DockerContainer container, const QJsonObject &containerConfig, ErrorCode *errorCode = nullptr); }; -#endif // AMNEZIAWIREGUARDCONFIGURATOR_H +#endif // AWGCONFIGURATOR_H diff --git a/client/configurators/vpn_configurator.cpp b/client/configurators/vpn_configurator.cpp index 8ab43499..6c5286c2 100644 --- a/client/configurators/vpn_configurator.cpp +++ b/client/configurators/vpn_configurator.cpp @@ -24,7 +24,7 @@ VpnConfigurator::VpnConfigurator(std::shared_ptr settings, QObject *pa wireguardConfigurator = std::shared_ptr(new WireguardConfigurator(settings, false, this)); ikev2Configurator = std::shared_ptr(new Ikev2Configurator(settings, this)); sshConfigurator = std::shared_ptr(new SshConfigurator(settings, this)); - amneziaWireGuardConfigurator = std::shared_ptr(new AmneziaWireGuardConfigurator(settings, this)); + awgConfigurator = std::shared_ptr(new AwgConfigurator(settings, this)); } QString VpnConfigurator::genVpnProtocolConfig(const ServerCredentials &credentials, DockerContainer container, @@ -42,8 +42,8 @@ QString VpnConfigurator::genVpnProtocolConfig(const ServerCredentials &credentia case Proto::WireGuard: return wireguardConfigurator->genWireguardConfig(credentials, container, containerConfig, errorCode); - case Proto::AmneziaWireGuard: - return amneziaWireGuardConfigurator->genAmneziaWireGuardConfig(credentials, container, containerConfig, errorCode); + case Proto::Awg: + return awgConfigurator->genAwgConfig(credentials, container, containerConfig, errorCode); case Proto::Ikev2: return ikev2Configurator->genIkev2Config(credentials, container, containerConfig, errorCode); diff --git a/client/configurators/vpn_configurator.h b/client/configurators/vpn_configurator.h index d304e4c3..ac89b0e4 100644 --- a/client/configurators/vpn_configurator.h +++ b/client/configurators/vpn_configurator.h @@ -13,7 +13,7 @@ class CloakConfigurator; class WireguardConfigurator; class Ikev2Configurator; class SshConfigurator; -class AmneziaWireGuardConfigurator; +class AwgConfigurator; // Retrieve connection settings from server class VpnConfigurator : ConfiguratorBase @@ -41,7 +41,7 @@ public: std::shared_ptr wireguardConfigurator; std::shared_ptr ikev2Configurator; std::shared_ptr sshConfigurator; - std::shared_ptr amneziaWireGuardConfigurator; + std::shared_ptr awgConfigurator; }; #endif // VPN_CONFIGURATOR_H diff --git a/client/configurators/wireguard_configurator.cpp b/client/configurators/wireguard_configurator.cpp index 5ea042c1..a526e109 100644 --- a/client/configurators/wireguard_configurator.cpp +++ b/client/configurators/wireguard_configurator.cpp @@ -19,20 +19,20 @@ #include "settings.h" #include "utilities.h" -WireguardConfigurator::WireguardConfigurator(std::shared_ptr settings, bool isAmneziaWireGuard, QObject *parent) - : ConfiguratorBase(settings, parent), m_isAmneziaWireGuard(isAmneziaWireGuard) +WireguardConfigurator::WireguardConfigurator(std::shared_ptr settings, bool isAwg, QObject *parent) + : ConfiguratorBase(settings, parent), m_isAwg(isAwg) { - m_serverConfigPath = m_isAmneziaWireGuard ? amnezia::protocols::amneziawireguard::serverConfigPath + m_serverConfigPath = m_isAwg ? amnezia::protocols::awg::serverConfigPath : amnezia::protocols::wireguard::serverConfigPath; - m_serverPublicKeyPath = m_isAmneziaWireGuard ? amnezia::protocols::amneziawireguard::serverPublicKeyPath + m_serverPublicKeyPath = m_isAwg ? amnezia::protocols::awg::serverPublicKeyPath : amnezia::protocols::wireguard::serverPublicKeyPath; - m_serverPskKeyPath = m_isAmneziaWireGuard ? amnezia::protocols::amneziawireguard::serverPskKeyPath + m_serverPskKeyPath = m_isAwg ? amnezia::protocols::awg::serverPskKeyPath : amnezia::protocols::wireguard::serverPskKeyPath; - m_configTemplate = m_isAmneziaWireGuard ? ProtocolScriptType::amnezia_wireguard_template + m_configTemplate = m_isAwg ? ProtocolScriptType::amnezia_wireguard_template : ProtocolScriptType::wireguard_template; - m_protocolName = m_isAmneziaWireGuard ? config_key::amneziaWireguard : config_key::wireguard; - m_defaultPort = m_isAmneziaWireGuard ? protocols::wireguard::defaultPort : protocols::amneziawireguard::defaultPort; + m_protocolName = m_isAwg ? config_key::awg : config_key::wireguard; + m_defaultPort = m_isAwg ? protocols::wireguard::defaultPort : protocols::awg::defaultPort; } WireguardConfigurator::ConnectionData WireguardConfigurator::genClientKeys() diff --git a/client/configurators/wireguard_configurator.h b/client/configurators/wireguard_configurator.h index 10eecbb4..7f8e1587 100644 --- a/client/configurators/wireguard_configurator.h +++ b/client/configurators/wireguard_configurator.h @@ -12,7 +12,7 @@ class WireguardConfigurator : public ConfiguratorBase { Q_OBJECT public: - WireguardConfigurator(std::shared_ptr settings, bool isAmneziaWireGuard, QObject *parent = nullptr); + WireguardConfigurator(std::shared_ptr settings, bool isAwg, QObject *parent = nullptr); struct ConnectionData { @@ -36,8 +36,8 @@ private: const QJsonObject &containerConfig, ErrorCode *errorCode = nullptr); ConnectionData genClientKeys(); - - bool m_isAmneziaWireGuard; + + bool m_isAwg; QString m_serverConfigPath; QString m_serverPublicKeyPath; QString m_serverPskKeyPath; diff --git a/client/containers/containers_defs.cpp b/client/containers/containers_defs.cpp index 0b9e44a2..5f8d2e51 100644 --- a/client/containers/containers_defs.cpp +++ b/client/containers/containers_defs.cpp @@ -84,7 +84,7 @@ QMap ContainerProps::containerHumanNames() { DockerContainer::ShadowSocks, "ShadowSocks" }, { DockerContainer::Cloak, "OpenVPN over Cloak" }, { DockerContainer::WireGuard, "WireGuard" }, - { DockerContainer::AmneziaWireGuard, "Amnezia WireGuard" }, + { DockerContainer::Awg, "Amnezia WireGuard" }, { DockerContainer::Ipsec, QObject::tr("IPsec") }, { DockerContainer::TorWebSite, QObject::tr("Website in Tor network") }, @@ -108,7 +108,7 @@ QMap ContainerProps::containerDescriptions() { DockerContainer::WireGuard, QObject::tr("WireGuard - New popular VPN protocol with high performance, high speed and low power " "consumption. Recommended for regions with low levels of censorship.") }, - { DockerContainer::AmneziaWireGuard, + { DockerContainer::Awg, QObject::tr("WireGuard - New popular VPN protocol with high performance, high speed and low power " "consumption. Recommended for regions with low levels of censorship.") }, { DockerContainer::Ipsec, @@ -148,7 +148,7 @@ amnezia::ServiceType ContainerProps::containerService(DockerContainer c) case DockerContainer::Cloak: return ServiceType::Vpn; case DockerContainer::ShadowSocks: return ServiceType::Vpn; case DockerContainer::WireGuard: return ServiceType::Vpn; - case DockerContainer::AmneziaWireGuard: return ServiceType::Vpn; + case DockerContainer::Awg: return ServiceType::Vpn; case DockerContainer::Ipsec: return ServiceType::Vpn; case DockerContainer::TorWebSite: return ServiceType::Other; case DockerContainer::Dns: return ServiceType::Other; @@ -166,7 +166,7 @@ Proto ContainerProps::defaultProtocol(DockerContainer c) case DockerContainer::Cloak: return Proto::Cloak; case DockerContainer::ShadowSocks: return Proto::ShadowSocks; case DockerContainer::WireGuard: return Proto::WireGuard; - case DockerContainer::AmneziaWireGuard: return Proto::AmneziaWireGuard; + case DockerContainer::Awg: return Proto::Awg; case DockerContainer::Ipsec: return Proto::Ikev2; case DockerContainer::TorWebSite: return Proto::TorWebSite; @@ -186,7 +186,7 @@ bool ContainerProps::isSupportedByCurrentPlatform(DockerContainer c) switch (c) { case DockerContainer::WireGuard: return true; case DockerContainer::OpenVpn: return true; - case DockerContainer::AmneziaWireGuard: return true; + case DockerContainer::Awg: return true; case DockerContainer::Cloak: return true; // case DockerContainer::ShadowSocks: return true; diff --git a/client/containers/containers_defs.h b/client/containers/containers_defs.h index 774611c8..ce8a2683 100644 --- a/client/containers/containers_defs.h +++ b/client/containers/containers_defs.h @@ -20,7 +20,7 @@ namespace amnezia ShadowSocks, Cloak, WireGuard, - AmneziaWireGuard, + Awg, Ipsec, // non-vpn diff --git a/client/core/scripts_registry.cpp b/client/core/scripts_registry.cpp index 24deb41a..82ae1fce 100644 --- a/client/core/scripts_registry.cpp +++ b/client/core/scripts_registry.cpp @@ -11,7 +11,7 @@ QString amnezia::scriptFolder(amnezia::DockerContainer container) case DockerContainer::Cloak: return QLatin1String("openvpn_cloak"); case DockerContainer::ShadowSocks: return QLatin1String("openvpn_shadowsocks"); case DockerContainer::WireGuard: return QLatin1String("wireguard"); - case DockerContainer::AmneziaWireGuard: return QLatin1String("amnezia_wireguard"); + case DockerContainer::Awg: return QLatin1String("amnezia_wireguard"); case DockerContainer::Ipsec: return QLatin1String("ipsec"); case DockerContainer::TorWebSite: return QLatin1String("website_tor"); diff --git a/client/core/servercontroller.cpp b/client/core/servercontroller.cpp index b5467dac..60691759 100644 --- a/client/core/servercontroller.cpp +++ b/client/core/servercontroller.cpp @@ -337,8 +337,8 @@ bool ServerController::isReinstallContainerRequired(DockerContainer container, c != newProtoConfig.value(config_key::port).toString(protocols::shadowsocks::defaultPort)) return true; } - - if (container == DockerContainer::AmneziaWireGuard) { + + if (container == DockerContainer::Awg) { return true; } @@ -491,7 +491,7 @@ ServerController::Vars ServerController::genVarsForScript(const ServerCredential const QJsonObject &ssConfig = config.value(ProtocolProps::protoToString(Proto::ShadowSocks)).toObject(); const QJsonObject &wireguarConfig = config.value(ProtocolProps::protoToString(Proto::WireGuard)).toObject(); const QJsonObject &amneziaWireguarConfig = - config.value(ProtocolProps::protoToString(Proto::AmneziaWireGuard)).toObject(); + config.value(ProtocolProps::protoToString(Proto::Awg)).toObject(); const QJsonObject &sftpConfig = config.value(ProtocolProps::protoToString(Proto::Sftp)).toObject(); Vars vars; @@ -589,35 +589,35 @@ ServerController::Vars ServerController::genVarsForScript(const ServerCredential vars.append({ { "$SFTP_PASSWORD", sftpConfig.value(config_key::password).toString() } }); // Amnezia wireguard vars - vars.append({ { "$AMNEZIAWIREGUARD_SERVER_PORT", - amneziaWireguarConfig.value(config_key::port).toString(protocols::amneziawireguard::defaultPort) } }); + vars.append({ { "$AWG_SERVER_PORT", + amneziaWireguarConfig.value(config_key::port).toString(protocols::awg::defaultPort) } }); vars.append({ { "$JUNK_PACKET_COUNT", amneziaWireguarConfig.value(config_key::junkPacketCount) - .toString(protocols::amneziawireguard::defaultJunkPacketCount) } }); + .toString(protocols::awg::defaultJunkPacketCount) } }); vars.append({ { "$JUNK_PACKET_MIN_SIZE", amneziaWireguarConfig.value(config_key::junkPacketMinSize) - .toString(protocols::amneziawireguard::defaultJunkPacketMinSize) } }); + .toString(protocols::awg::defaultJunkPacketMinSize) } }); vars.append({ { "$JUNK_PACKET_MAX_SIZE", amneziaWireguarConfig.value(config_key::junkPacketMaxSize) - .toString(protocols::amneziawireguard::defaultJunkPacketMaxSize) } }); + .toString(protocols::awg::defaultJunkPacketMaxSize) } }); vars.append({ { "$INIT_PACKET_JUNK_SIZE", amneziaWireguarConfig.value(config_key::initPacketJunkSize) - .toString(protocols::amneziawireguard::defaultInitPacketJunkSize) } }); + .toString(protocols::awg::defaultInitPacketJunkSize) } }); vars.append({ { "$RESPONSE_PACKET_JUNK_SIZE", amneziaWireguarConfig.value(config_key::responsePacketJunkSize) - .toString(protocols::amneziawireguard::defaultResponsePacketJunkSize) } }); + .toString(protocols::awg::defaultResponsePacketJunkSize) } }); vars.append({ { "$INIT_PACKET_MAGIC_HEADER", amneziaWireguarConfig.value(config_key::initPacketMagicHeader) - .toString(protocols::amneziawireguard::defaultInitPacketMagicHeader) } }); + .toString(protocols::awg::defaultInitPacketMagicHeader) } }); vars.append({ { "$RESPONSE_PACKET_MAGIC_HEADER", amneziaWireguarConfig.value(config_key::responsePacketMagicHeader) - .toString(protocols::amneziawireguard::defaultResponsePacketMagicHeader) } }); + .toString(protocols::awg::defaultResponsePacketMagicHeader) } }); vars.append({ { "$UNDERLOAD_PACKET_MAGIC_HEADER", amneziaWireguarConfig.value(config_key::underloadPacketMagicHeader) - .toString(protocols::amneziawireguard::defaultUnderloadPacketMagicHeader) } }); + .toString(protocols::awg::defaultUnderloadPacketMagicHeader) } }); vars.append({ { "$TRANSPORT_PACKET_MAGIC_HEADER", amneziaWireguarConfig.value(config_key::transportPacketMagicHeader) - .toString(protocols::amneziawireguard::defaultTransportPacketMagicHeader) } }); + .toString(protocols::awg::defaultTransportPacketMagicHeader) } }); QString serverIp = Utils::getIPAddress(credentials.hostName); if (!serverIp.isEmpty()) { diff --git a/client/mozilla/localsocketcontroller.cpp b/client/mozilla/localsocketcontroller.cpp index d454c16e..2f6fe371 100644 --- a/client/mozilla/localsocketcontroller.cpp +++ b/client/mozilla/localsocketcontroller.cpp @@ -162,8 +162,8 @@ void LocalSocketController::activate(const QJsonObject &rawConfig) { // splitTunnelApps.append(QJsonValue(uri)); // } // json.insert("vpnDisabledApps", splitTunnelApps); - - if (protocolName == amnezia::config_key::amneziaWireguard) { + + if (protocolName == amnezia::config_key::awg) { json.insert(amnezia::config_key::junkPacketCount, wgConfig.value(amnezia::config_key::junkPacketCount)); json.insert(amnezia::config_key::junkPacketMinSize, wgConfig.value(amnezia::config_key::junkPacketMinSize)); json.insert(amnezia::config_key::junkPacketMaxSize, wgConfig.value(amnezia::config_key::junkPacketMaxSize)); diff --git a/client/protocols/amneziawireguardprotocol.cpp b/client/protocols/amneziawireguardprotocol.cpp index cab03da9..e0e51296 100644 --- a/client/protocols/amneziawireguardprotocol.cpp +++ b/client/protocols/amneziawireguardprotocol.cpp @@ -1,10 +1,10 @@ #include "amneziawireguardprotocol.h" -AmneziaWireGuardProtocol::AmneziaWireGuardProtocol(const QJsonObject &configuration, QObject *parent) +Awg::Awg(const QJsonObject &configuration, QObject *parent) : WireguardProtocol(configuration, parent) { } -AmneziaWireGuardProtocol::~AmneziaWireGuardProtocol() +Awg::~Awg() { } diff --git a/client/protocols/amneziawireguardprotocol.h b/client/protocols/amneziawireguardprotocol.h index 329a585e..d7fc9c92 100644 --- a/client/protocols/amneziawireguardprotocol.h +++ b/client/protocols/amneziawireguardprotocol.h @@ -1,17 +1,17 @@ -#ifndef AMNEZIAWIREGUARDPROTOCOL_H -#define AMNEZIAWIREGUARDPROTOCOL_H +#ifndef AWGPROTOCOL_H +#define AWGPROTOCOL_H #include #include "wireguardprotocol.h" -class AmneziaWireGuardProtocol : public WireguardProtocol +class Awg : public WireguardProtocol { Q_OBJECT public: - explicit AmneziaWireGuardProtocol(const QJsonObject &configuration, QObject *parent = nullptr); - virtual ~AmneziaWireGuardProtocol() override; + explicit Awg(const QJsonObject &configuration, QObject *parent = nullptr); + virtual ~Awg() override; }; -#endif // AMNEZIAWIREGUARDPROTOCOL_H +#endif // AWGPROTOCOL_H diff --git a/client/protocols/protocols_defs.cpp b/client/protocols/protocols_defs.cpp index 64cdd003..3982ef9c 100644 --- a/client/protocols/protocols_defs.cpp +++ b/client/protocols/protocols_defs.cpp @@ -89,7 +89,7 @@ amnezia::ServiceType ProtocolProps::protocolService(Proto p) case Proto::Cloak: return ServiceType::Vpn; case Proto::ShadowSocks: return ServiceType::Vpn; case Proto::WireGuard: return ServiceType::Vpn; - case Proto::AmneziaWireGuard: return ServiceType::Vpn; + case Proto::Awg: return ServiceType::Vpn; case Proto::TorWebSite: return ServiceType::Other; case Proto::Dns: return ServiceType::Other; case Proto::FileShare: return ServiceType::Other; @@ -105,7 +105,7 @@ int ProtocolProps::defaultPort(Proto p) case Proto::Cloak: return 443; case Proto::ShadowSocks: return 6789; case Proto::WireGuard: return 51820; - case Proto::AmneziaWireGuard: return 55424; + case Proto::Awg: return 55424; case Proto::Ikev2: return -1; case Proto::L2tp: return -1; @@ -125,7 +125,7 @@ bool ProtocolProps::defaultPortChangeable(Proto p) case Proto::Cloak: return true; case Proto::ShadowSocks: return true; case Proto::WireGuard: return true; - case Proto::AmneziaWireGuard: return true; + case Proto::Awg: return true; case Proto::Ikev2: return false; case Proto::L2tp: return false; @@ -144,7 +144,7 @@ TransportProto ProtocolProps::defaultTransportProto(Proto p) case Proto::Cloak: return TransportProto::Tcp; case Proto::ShadowSocks: return TransportProto::Tcp; case Proto::WireGuard: return TransportProto::Udp; - case Proto::AmneziaWireGuard: return TransportProto::Udp; + case Proto::Awg: return TransportProto::Udp; case Proto::Ikev2: return TransportProto::Udp; case Proto::L2tp: return TransportProto::Udp; // non-vpn @@ -163,7 +163,7 @@ bool ProtocolProps::defaultTransportProtoChangeable(Proto p) case Proto::Cloak: return false; case Proto::ShadowSocks: return false; case Proto::WireGuard: return false; - case Proto::AmneziaWireGuard: return false; + case Proto::Awg: return false; case Proto::Ikev2: return false; case Proto::L2tp: return false; // non-vpn diff --git a/client/protocols/protocols_defs.h b/client/protocols/protocols_defs.h index e26e60a4..d6af132b 100644 --- a/client/protocols/protocols_defs.h +++ b/client/protocols/protocols_defs.h @@ -76,7 +76,7 @@ namespace amnezia constexpr char shadowsocks[] = "shadowsocks"; constexpr char cloak[] = "cloak"; constexpr char sftp[] = "sftp"; - constexpr char amneziaWireguard[] = "amneziawireguard"; + constexpr char awg[] = "awg"; } @@ -151,13 +151,13 @@ namespace amnezia } // namespace sftp - namespace amneziawireguard + namespace awg { constexpr char defaultPort[] = "55424"; - constexpr char serverConfigPath[] = "/opt/amnezia/amneziawireguard/wg0.conf"; - constexpr char serverPublicKeyPath[] = "/opt/amnezia/amneziawireguard/wireguard_server_public_key.key"; - constexpr char serverPskKeyPath[] = "/opt/amnezia/amneziawireguard/wireguard_psk.key"; + constexpr char serverConfigPath[] = "/opt/amnezia/awg/wg0.conf"; + constexpr char serverPublicKeyPath[] = "/opt/amnezia/awg/wireguard_server_public_key.key"; + constexpr char serverPskKeyPath[] = "/opt/amnezia/awg/wireguard_psk.key"; constexpr char defaultJunkPacketCount[] = "3"; constexpr char defaultJunkPacketMinSize[] = "10"; @@ -188,7 +188,7 @@ namespace amnezia ShadowSocks, Cloak, WireGuard, - AmneziaWireGuard, + Awg, Ikev2, L2tp, diff --git a/client/protocols/vpnprotocol.cpp b/client/protocols/vpnprotocol.cpp index 527ede47..2ddc0684 100644 --- a/client/protocols/vpnprotocol.cpp +++ b/client/protocols/vpnprotocol.cpp @@ -113,7 +113,7 @@ VpnProtocol *VpnProtocol::factory(DockerContainer container, const QJsonObject & case DockerContainer::Cloak: return new OpenVpnOverCloakProtocol(configuration); case DockerContainer::ShadowSocks: return new ShadowSocksVpnProtocol(configuration); case DockerContainer::WireGuard: return new WireguardProtocol(configuration); - case DockerContainer::AmneziaWireGuard: return new WireguardProtocol(configuration); + case DockerContainer::Awg: return new WireguardProtocol(configuration); #endif default: return nullptr; } diff --git a/client/resources.qrc b/client/resources.qrc index b79ed3d2..1688d79e 100644 --- a/client/resources.qrc +++ b/client/resources.qrc @@ -215,7 +215,7 @@ ui/qml/Controls2/ListViewWithLabelsType.qml ui/qml/Pages2/PageServiceDnsSettings.qml ui/qml/Controls2/TopCloseButtonType.qml - ui/qml/Pages2/PageProtocolAmneziaWireGuardSettings.qml + ui/qml/Pages2/PageProtocolAwgSettings.qml server_scripts/amnezia_wireguard/template.conf server_scripts/amnezia_wireguard/start.sh server_scripts/amnezia_wireguard/configure_container.sh diff --git a/client/server_scripts/amnezia_wireguard/configure_container.sh b/client/server_scripts/amnezia_wireguard/configure_container.sh index 6ebebc4a..322cc38f 100644 --- a/client/server_scripts/amnezia_wireguard/configure_container.sh +++ b/client/server_scripts/amnezia_wireguard/configure_container.sh @@ -1,19 +1,19 @@ -mkdir -p /opt/amnezia/amneziawireguard -cd /opt/amnezia/amneziawireguard +mkdir -p /opt/amnezia/awg +cd /opt/amnezia/awg WIREGUARD_SERVER_PRIVATE_KEY=$(wg genkey) -echo $WIREGUARD_SERVER_PRIVATE_KEY > /opt/amnezia/amneziawireguard/wireguard_server_private_key.key +echo $WIREGUARD_SERVER_PRIVATE_KEY > /opt/amnezia/awg/wireguard_server_private_key.key WIREGUARD_SERVER_PUBLIC_KEY=$(echo $WIREGUARD_SERVER_PRIVATE_KEY | wg pubkey) -echo $WIREGUARD_SERVER_PUBLIC_KEY > /opt/amnezia/amneziawireguard/wireguard_server_public_key.key +echo $WIREGUARD_SERVER_PUBLIC_KEY > /opt/amnezia/awg/wireguard_server_public_key.key WIREGUARD_PSK=$(wg genpsk) -echo $WIREGUARD_PSK > /opt/amnezia/amneziawireguard/wireguard_psk.key +echo $WIREGUARD_PSK > /opt/amnezia/awg/wireguard_psk.key -cat > /opt/amnezia/amneziawireguard/wg0.conf < /opt/amnezia/awg/wg0.conf < #include "protocols/protocols_defs.h" -AmneziaWireGuardConfigModel::AmneziaWireGuardConfigModel(QObject *parent) : QAbstractListModel(parent) +AwgConfigModel::AwgConfigModel(QObject *parent) : QAbstractListModel(parent) { } -int AmneziaWireGuardConfigModel::rowCount(const QModelIndex &parent) const +int AwgConfigModel::rowCount(const QModelIndex &parent) const { Q_UNUSED(parent); return 1; } -bool AmneziaWireGuardConfigModel::setData(const QModelIndex &index, const QVariant &value, int role) +bool AwgConfigModel::setData(const QModelIndex &index, const QVariant &value, int role) { if (!index.isValid() || index.row() < 0 || index.row() >= ContainerProps::allContainers().size()) { return false; @@ -49,7 +49,7 @@ bool AmneziaWireGuardConfigModel::setData(const QModelIndex &index, const QVaria return true; } -QVariant AmneziaWireGuardConfigModel::data(const QModelIndex &index, int role) const +QVariant AwgConfigModel::data(const QModelIndex &index, int role) const { if (!index.isValid() || index.row() < 0 || index.row() >= rowCount()) { return false; @@ -71,7 +71,7 @@ QVariant AmneziaWireGuardConfigModel::data(const QModelIndex &index, int role) c return QVariant(); } -void AmneziaWireGuardConfigModel::updateModel(const QJsonObject &config) +void AwgConfigModel::updateModel(const QJsonObject &config) { beginResetModel(); m_container = ContainerProps::containerFromString(config.value(config_key::container).toString()); @@ -112,13 +112,13 @@ void AmneziaWireGuardConfigModel::updateModel(const QJsonObject &config) endResetModel(); } -QJsonObject AmneziaWireGuardConfigModel::getConfig() +QJsonObject AwgConfigModel::getConfig() { m_fullConfig.insert(config_key::amneziaWireguard, m_protocolConfig); return m_fullConfig; } -QHash AmneziaWireGuardConfigModel::roleNames() const +QHash AwgConfigModel::roleNames() const { QHash roles; diff --git a/client/ui/models/protocols/awgConfigModel.h b/client/ui/models/protocols/awgConfigModel.h index 9419d5c9..e67a3708 100644 --- a/client/ui/models/protocols/awgConfigModel.h +++ b/client/ui/models/protocols/awgConfigModel.h @@ -1,12 +1,12 @@ -#ifndef AMNEZIAWIREGUARDCONFIGMODEL_H -#define AMNEZIAWIREGUARDCONFIGMODEL_H +#ifndef AWGCONFIGMODEL_H +#define AWGCONFIGMODEL_H #include #include #include "containers/containers_defs.h" -class AmneziaWireGuardConfigModel : public QAbstractListModel +class AwgConfigModel : public QAbstractListModel { Q_OBJECT @@ -24,7 +24,7 @@ public: TransportPacketMagicHeaderRole }; - explicit AmneziaWireGuardConfigModel(QObject *parent = nullptr); + explicit AwgConfigModel(QObject *parent = nullptr); int rowCount(const QModelIndex &parent = QModelIndex()) const override; @@ -44,4 +44,4 @@ private: QJsonObject m_fullConfig; }; -#endif // AMNEZIAWIREGUARDCONFIGMODEL_H +#endif // AWGCONFIGMODEL_H diff --git a/client/ui/qml/Components/SettingsContainersListView.qml b/client/ui/qml/Components/SettingsContainersListView.qml index df25b492..89eb727e 100644 --- a/client/ui/qml/Components/SettingsContainersListView.qml +++ b/client/ui/qml/Components/SettingsContainersListView.qml @@ -64,9 +64,9 @@ ListView { // goToPage(PageEnum.PageProtocolWireGuardSettings) break } - case ContainerEnum.AmneziaWireGuard: { - AmneziaWireGuardConfigModel.updateModel(config) - PageController.goToPage(PageEnum.PageProtocolAmneziaWireGuardSettings) + case ContainerEnum.Awg: { + AwgConfigModel.updateModel(config) + PageController.goToPage(PageEnum.PageProtocolAwgSettings) break } case ContainerEnum.Ipsec: { diff --git a/client/ui/qml/Pages2/PageProtocolAwgSettings.qml b/client/ui/qml/Pages2/PageProtocolAwgSettings.qml index 35edb15c..69d34114 100644 --- a/client/ui/qml/Pages2/PageProtocolAwgSettings.qml +++ b/client/ui/qml/Pages2/PageProtocolAwgSettings.qml @@ -52,7 +52,7 @@ PageType { clip: true interactive: false - model: AmneziaWireGuardConfigModel + model: AwgConfigModel delegate: Item { implicitWidth: listview.width @@ -313,7 +313,7 @@ PageType { onClicked: { forceActiveFocus() PageController.showBusyIndicator(true) - InstallController.updateContainer(AmneziaWireGuardConfigModel.getConfig()) + InstallController.updateContainer(AwgConfigModel.getConfig()) PageController.showBusyIndicator(false) } } From 671ca0a66fa1f7fef101f9cf3a835940847e770b Mon Sep 17 00:00:00 2001 From: "vladimir.kuznetsov" Date: Fri, 6 Oct 2023 17:26:45 +0500 Subject: [PATCH 023/108] renamed amneziawireguard to awg --- client/CMakeLists.txt | 4 ++-- ...awireguardprotocol.cpp => awgprotocol.cpp} | 2 +- ...neziawireguardprotocol.h => awgprotocol.h} | 0 client/ui/models/protocols/awgConfigModel.cpp | 24 +++++++++---------- client/ui/qml/Pages2/PageShare.qml | 2 +- 5 files changed, 16 insertions(+), 16 deletions(-) rename client/protocols/{amneziawireguardprotocol.cpp => awgprotocol.cpp} (77%) rename client/protocols/{amneziawireguardprotocol.h => awgprotocol.h} (100%) diff --git a/client/CMakeLists.txt b/client/CMakeLists.txt index f0f71f52..3988f9b5 100644 --- a/client/CMakeLists.txt +++ b/client/CMakeLists.txt @@ -263,7 +263,7 @@ if(WIN32 OR (APPLE AND NOT IOS) OR (LINUX AND NOT ANDROID)) ${CMAKE_CURRENT_LIST_DIR}/protocols/openvpnovercloakprotocol.h ${CMAKE_CURRENT_LIST_DIR}/protocols/shadowsocksvpnprotocol.h ${CMAKE_CURRENT_LIST_DIR}/protocols/wireguardprotocol.h - ${CMAKE_CURRENT_LIST_DIR}/protocols/amneziawireguardprotocol.h + ${CMAKE_CURRENT_LIST_DIR}/protocols/awgprotocol.h ) set(SOURCES ${SOURCES} @@ -274,7 +274,7 @@ if(WIN32 OR (APPLE AND NOT IOS) OR (LINUX AND NOT ANDROID)) ${CMAKE_CURRENT_LIST_DIR}/protocols/openvpnovercloakprotocol.cpp ${CMAKE_CURRENT_LIST_DIR}/protocols/shadowsocksvpnprotocol.cpp ${CMAKE_CURRENT_LIST_DIR}/protocols/wireguardprotocol.cpp - ${CMAKE_CURRENT_LIST_DIR}/protocols/amneziawireguardprotocol.cpp + ${CMAKE_CURRENT_LIST_DIR}/protocols/awgprotocol.cpp ) endif() diff --git a/client/protocols/amneziawireguardprotocol.cpp b/client/protocols/awgprotocol.cpp similarity index 77% rename from client/protocols/amneziawireguardprotocol.cpp rename to client/protocols/awgprotocol.cpp index e0e51296..64415dbe 100644 --- a/client/protocols/amneziawireguardprotocol.cpp +++ b/client/protocols/awgprotocol.cpp @@ -1,4 +1,4 @@ -#include "amneziawireguardprotocol.h" +#include "awgprotocol.h" Awg::Awg(const QJsonObject &configuration, QObject *parent) : WireguardProtocol(configuration, parent) diff --git a/client/protocols/amneziawireguardprotocol.h b/client/protocols/awgprotocol.h similarity index 100% rename from client/protocols/amneziawireguardprotocol.h rename to client/protocols/awgprotocol.h diff --git a/client/ui/models/protocols/awgConfigModel.cpp b/client/ui/models/protocols/awgConfigModel.cpp index 7e12be0d..7d0277b9 100644 --- a/client/ui/models/protocols/awgConfigModel.cpp +++ b/client/ui/models/protocols/awgConfigModel.cpp @@ -78,43 +78,43 @@ void AwgConfigModel::updateModel(const QJsonObject &config) m_fullConfig = config; - QJsonObject protocolConfig = config.value(config_key::amneziaWireguard).toObject(); + QJsonObject protocolConfig = config.value(config_key::awg).toObject(); m_protocolConfig[config_key::port] = - protocolConfig.value(config_key::port).toString(protocols::amneziawireguard::defaultPort); + protocolConfig.value(config_key::port).toString(protocols::awg::defaultPort); m_protocolConfig[config_key::junkPacketCount] = - protocolConfig.value(config_key::junkPacketCount).toString(protocols::amneziawireguard::defaultJunkPacketCount); + protocolConfig.value(config_key::junkPacketCount).toString(protocols::awg::defaultJunkPacketCount); m_protocolConfig[config_key::junkPacketMinSize] = protocolConfig.value(config_key::junkPacketMinSize) - .toString(protocols::amneziawireguard::defaultJunkPacketMinSize); + .toString(protocols::awg::defaultJunkPacketMinSize); m_protocolConfig[config_key::junkPacketMaxSize] = protocolConfig.value(config_key::junkPacketMaxSize) - .toString(protocols::amneziawireguard::defaultJunkPacketMaxSize); + .toString(protocols::awg::defaultJunkPacketMaxSize); m_protocolConfig[config_key::initPacketJunkSize] = protocolConfig.value(config_key::initPacketJunkSize) - .toString(protocols::amneziawireguard::defaultInitPacketJunkSize); + .toString(protocols::awg::defaultInitPacketJunkSize); m_protocolConfig[config_key::responsePacketJunkSize] = protocolConfig.value(config_key::responsePacketJunkSize) - .toString(protocols::amneziawireguard::defaultResponsePacketJunkSize); + .toString(protocols::awg::defaultResponsePacketJunkSize); m_protocolConfig[config_key::initPacketMagicHeader] = protocolConfig.value(config_key::initPacketMagicHeader) - .toString(protocols::amneziawireguard::defaultInitPacketMagicHeader); + .toString(protocols::awg::defaultInitPacketMagicHeader); m_protocolConfig[config_key::responsePacketMagicHeader] = protocolConfig.value(config_key::responsePacketMagicHeader) - .toString(protocols::amneziawireguard::defaultResponsePacketMagicHeader); + .toString(protocols::awg::defaultResponsePacketMagicHeader); m_protocolConfig[config_key::underloadPacketMagicHeader] = protocolConfig.value(config_key::underloadPacketMagicHeader) - .toString(protocols::amneziawireguard::defaultUnderloadPacketMagicHeader); + .toString(protocols::awg::defaultUnderloadPacketMagicHeader); m_protocolConfig[config_key::transportPacketMagicHeader] = protocolConfig.value(config_key::transportPacketMagicHeader) - .toString(protocols::amneziawireguard::defaultTransportPacketMagicHeader); + .toString(protocols::awg::defaultTransportPacketMagicHeader); endResetModel(); } QJsonObject AwgConfigModel::getConfig() { - m_fullConfig.insert(config_key::amneziaWireguard, m_protocolConfig); + m_fullConfig.insert(config_key::awg, m_protocolConfig); return m_fullConfig; } diff --git a/client/ui/qml/Pages2/PageShare.qml b/client/ui/qml/Pages2/PageShare.qml index a03b3717..16759da1 100644 --- a/client/ui/qml/Pages2/PageShare.qml +++ b/client/ui/qml/Pages2/PageShare.qml @@ -317,7 +317,7 @@ PageType { if (index === ContainerProps.containerFromString("amnezia-openvpn")) { root.connectionTypesModel.push(openVpnConnectionFormat) - } else if (index === ContainerProps.containerFromString("amnezia-wireguard")) { + } else if (index === ContainerProps.containerFromString("amnezia-awg")) { root.connectionTypesModel.push(wireGuardConnectionFormat) } } From 445fc6efb1ccd1717530a2bb80b1c41d55839159 Mon Sep 17 00:00:00 2001 From: "vladimir.kuznetsov" Date: Fri, 6 Oct 2023 22:05:48 +0500 Subject: [PATCH 024/108] renamed amneziawireguard to awg in ios controller --- client/platforms/ios/ios_controller.h | 2 +- client/platforms/ios/ios_controller.mm | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/client/platforms/ios/ios_controller.h b/client/platforms/ios/ios_controller.h index 6d10dc08..68f30ce8 100644 --- a/client/platforms/ios/ios_controller.h +++ b/client/platforms/ios/ios_controller.h @@ -62,7 +62,7 @@ private: bool setupOpenVPN(); bool setupCloak(); bool setupWireGuard(); - bool setupAmneziaWireGuard(); + bool setupAwg(); bool startOpenVPN(const QString &config); bool startWireGuard(const QString &jsonConfig); diff --git a/client/platforms/ios/ios_controller.mm b/client/platforms/ios/ios_controller.mm index 6782c8da..5665ff1d 100644 --- a/client/platforms/ios/ios_controller.mm +++ b/client/platforms/ios/ios_controller.mm @@ -204,8 +204,8 @@ bool IosController::connectVpn(amnezia::Proto proto, const QJsonObject& configur if (proto == amnezia::Proto::WireGuard) { return setupWireGuard(); } - if (proto == amnezia::Proto::AmneziaWireGuard) { - return setupAmneziaWireGuard(); + if (proto == amnezia::Proto::Awg) { + return setupAwg(); } return false; @@ -310,9 +310,9 @@ bool IosController::setupWireGuard() return startWireGuard(wgConfig); } -bool IosController::setupAmneziaWireGuard() +bool IosController::setupAwg() { - QJsonObject config = m_rawConfig[ProtocolProps::key_proto_config_data(amnezia::Proto::AmneziaWireGuard)].toObject(); + QJsonObject config = m_rawConfig[ProtocolProps::key_proto_config_data(amnezia::Proto::Awg)].toObject(); QString wgConfig = config[config_key::config].toString(); From 7f2ef65fe6acc1215633d0900cbe2e7a95bf3b92 Mon Sep 17 00:00:00 2001 From: Mykola Baibuz Date: Fri, 6 Oct 2023 17:20:41 -0400 Subject: [PATCH 025/108] Update WG to AWG for Android --- client/3rd-prebuilt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/3rd-prebuilt b/client/3rd-prebuilt index 994f4f2b..fbb5f586 160000 --- a/client/3rd-prebuilt +++ b/client/3rd-prebuilt @@ -1 +1 @@ -Subproject commit 994f4f2b030600f2d8dbf9dccf409b1591c9e463 +Subproject commit fbb5f586b94efc3f65edeaf9559c8a5c4e752d66 From bdfa8bfe5b78d4ff55dad27853c2a67cf44350af Mon Sep 17 00:00:00 2001 From: Mykola Baibuz Date: Sat, 7 Oct 2023 09:01:29 -0400 Subject: [PATCH 026/108] AWG Android support --- .../wireguard/config/BadConfigException.java | 9 + .../src/com/wireguard/config/Interface.java | 278 +++++++++++++++++- .../android/src/org/amnezia/vpn/VPNService.kt | 31 +- client/containers/containers_defs.cpp | 1 + 4 files changed, 309 insertions(+), 10 deletions(-) diff --git a/client/android/src/com/wireguard/config/BadConfigException.java b/client/android/src/com/wireguard/config/BadConfigException.java index 33910501..af909b0d 100644 --- a/client/android/src/com/wireguard/config/BadConfigException.java +++ b/client/android/src/com/wireguard/config/BadConfigException.java @@ -70,6 +70,15 @@ public class BadConfigException extends Exception { EXCLUDED_APPLICATIONS("ExcludedApplications"), INCLUDED_APPLICATIONS("IncludedApplications"), LISTEN_PORT("ListenPort"), + JC("Jc"), + JMIN("Jmin"), + JMAX("Jmax"), + S1("S1"), + S2("S2"), + H1("H1"), + H2("H2"), + H3("H3"), + H4("H4"), MTU("MTU"), PERSISTENT_KEEPALIVE("PersistentKeepalive"), PRE_SHARED_KEY("PresharedKey"), diff --git a/client/android/src/com/wireguard/config/Interface.java b/client/android/src/com/wireguard/config/Interface.java index 2594d701..df6b7fb1 100644 --- a/client/android/src/com/wireguard/config/Interface.java +++ b/client/android/src/com/wireguard/config/Interface.java @@ -44,6 +44,15 @@ public final class Interface { private final KeyPair keyPair; private final Optional listenPort; private final Optional mtu; + private final Optional jc; + private final Optional jmin; + private final Optional jmax; + private final Optional s1; + private final Optional s2; + private final Optional h1; + private final Optional h2; + private final Optional h3; + private final Optional h4; private Interface(final Builder builder) { // Defensively copy to ensure immutability even if the Builder is reused. @@ -56,6 +65,15 @@ public final class Interface { keyPair = Objects.requireNonNull(builder.keyPair, "Interfaces must have a private key"); listenPort = builder.listenPort; mtu = builder.mtu; + jc = builder.jc; + jmax = builder.jmax; + jmin = builder.jmin; + s1 = builder.s1; + s2 = builder.s2; + h1 = builder.h1; + h2 = builder.h2; + h3 = builder.h3; + h4 = builder.h4; } /** @@ -95,6 +113,33 @@ public final class Interface { case "privatekey": builder.parsePrivateKey(attribute.getValue()); break; + case "jc": + builder.parseJc(attribute.getValue()); + break; + case "jmin": + builder.parseJmin(attribute.getValue()); + break; + case "jmax": + builder.parseJmax(attribute.getValue()); + break; + case "s1": + builder.parseS1(attribute.getValue()); + break; + case "s2": + builder.parseS2(attribute.getValue()); + break; + case "h1": + builder.parseH1(attribute.getValue()); + break; + case "h2": + builder.parseH2(attribute.getValue()); + break; + case "h3": + builder.parseH3(attribute.getValue()); + break; + case "h4": + builder.parseH4(attribute.getValue()); + break; default: throw new BadConfigException( Section.INTERFACE, Location.TOP_LEVEL, Reason.UNKNOWN_ATTRIBUTE, attribute.getKey()); @@ -111,7 +156,9 @@ public final class Interface { return addresses.equals(other.addresses) && dnsServers.equals(other.dnsServers) && excludedApplications.equals(other.excludedApplications) && includedApplications.equals(other.includedApplications) && keyPair.equals(other.keyPair) - && listenPort.equals(other.listenPort) && mtu.equals(other.mtu); + && listenPort.equals(other.listenPort) && mtu.equals(other.mtu) && jc.equals(other.jc) && jmin.equals(other.jmin) + && jmax.equals(other.jmax) && s1.equals(other.s1) && s2.equals(other.s2) && h1.equals(other.h1) && h2.equals(other.h2) + && h3.equals(other.h3) && h4.equals(other.h4); } /** @@ -180,6 +227,42 @@ public final class Interface { public Optional getMtu() { return mtu; } + + public Optional getJc() { + return jc; + } + + public Optional getJmin() { + return jmin; + } + + public Optional getJmax() { + return jmax; + } + + public Optional getS1() { + return s1; + } + + public Optional getS2() { + return s2; + } + + public Optional getH1() { + return h1; + } + + public Optional getH2() { + return h2; + } + + public Optional getH3() { + return h3; + } + + public Optional getH4() { + return h4; + } @Override public int hashCode() { @@ -191,6 +274,15 @@ public final class Interface { hash = 31 * hash + keyPair.hashCode(); hash = 31 * hash + listenPort.hashCode(); hash = 31 * hash + mtu.hashCode(); + hash = 31 * hash + jc.hashCode(); + hash = 31 * hash + jmin.hashCode(); + hash = 31 * hash + jmax.hashCode(); + hash = 31 * hash + s1.hashCode(); + hash = 31 * hash + s2.hashCode(); + hash = 31 * hash + h1.hashCode(); + hash = 31 * hash + h2.hashCode(); + hash = 31 * hash + h3.hashCode(); + hash = 31 * hash + h4.hashCode(); return hash; } @@ -234,6 +326,19 @@ public final class Interface { .append('\n'); listenPort.ifPresent(lp -> sb.append("ListenPort = ").append(lp).append('\n')); mtu.ifPresent(m -> sb.append("MTU = ").append(m).append('\n')); + + jc.ifPresent(t_jc -> sb.append("Jc = ").append(t_jc).append('\n')); + jmin.ifPresent(t_jmin -> sb.append("Jmin = ").append(t_jmin).append('\n')); + jmax.ifPresent(t_jmax -> sb.append("Jmax = ").append(t_jmax).append('\n')); + + s1.ifPresent(t_s1 -> sb.append("S1 = ").append(t_s1).append('\n')); + s2.ifPresent(t_s2 -> sb.append("S2 = ").append(t_s2).append('\n')); + + h1.ifPresent(t_h1 -> sb.append("H1 = ").append(t_h1).append('\n')); + h2.ifPresent(t_h2 -> sb.append("H2 = ").append(t_h2).append('\n')); + h3.ifPresent(t_h3 -> sb.append("H3 = ").append(t_h3).append('\n')); + h4.ifPresent(t_h4 -> sb.append("H4 = ").append(t_h4).append('\n')); + sb.append("PrivateKey = ").append(keyPair.getPrivateKey().toBase64()).append('\n'); return sb.toString(); } @@ -248,6 +353,18 @@ public final class Interface { final StringBuilder sb = new StringBuilder(); sb.append("private_key=").append(keyPair.getPrivateKey().toHex()).append('\n'); listenPort.ifPresent(lp -> sb.append("listen_port=").append(lp).append('\n')); + + jc.ifPresent(t_jc -> sb.append("jc=").append(t_jc).append('\n')); + jmin.ifPresent(t_jmin -> sb.append("jmin=").append(t_jmin).append('\n')); + jmax.ifPresent(t_jmax -> sb.append("jmax=").append(t_jmax).append('\n')); + + s1.ifPresent(t_s1 -> sb.append("s1=").append(t_s1).append('\n')); + s2.ifPresent(t_s2 -> sb.append("s2=").append(t_s2).append('\n')); + + h1.ifPresent(t_h1 -> sb.append("h1=").append(t_h1).append('\n')); + h2.ifPresent(t_h2 -> sb.append("h2=").append(t_h2).append('\n')); + h3.ifPresent(t_h3 -> sb.append("h3=").append(t_h3).append('\n')); + h4.ifPresent(t_h4 -> sb.append("h4=").append(t_h4).append('\n')); return sb.toString(); } @@ -267,6 +384,17 @@ public final class Interface { private Optional listenPort = Optional.empty(); // Defaults to not present. private Optional mtu = Optional.empty(); + private Optional jc = Optional.empty(); + private Optional jmin = Optional.empty(); + private Optional jmax = Optional.empty(); + + private Optional s1 = Optional.empty(); + private Optional s2 = Optional.empty(); + + private Optional h1 = Optional.empty(); + private Optional h2 = Optional.empty(); + private Optional h3 = Optional.empty(); + private Optional h4 = Optional.empty(); public Builder addAddress(final InetNetwork address) { addresses.add(address); @@ -362,6 +490,78 @@ public final class Interface { } } + public Builder parseJc(final String jc) throws BadConfigException { + try { + return setJc(Integer.parseInt(jc)); + } catch (final NumberFormatException e) { + throw new BadConfigException(Section.INTERFACE, Location.JC, jc, e); + } + } + + public Builder parseJmax(final String jmax) throws BadConfigException { + try { + return setJmax(Integer.parseInt(jmax)); + } catch (final NumberFormatException e) { + throw new BadConfigException(Section.INTERFACE, Location.JMAX, jmax, e); + } + } + + public Builder parseJmin(final String jmin) throws BadConfigException { + try { + return setJmin(Integer.parseInt(jmin)); + } catch (final NumberFormatException e) { + throw new BadConfigException(Section.INTERFACE, Location.JMIN, jmin, e); + } + } + + public Builder parseS1(final String s1) throws BadConfigException { + try { + return setS1(Integer.parseInt(s1)); + } catch (final NumberFormatException e) { + throw new BadConfigException(Section.INTERFACE, Location.S1, s1, e); + } + } + + public Builder parseS2(final String s2) throws BadConfigException { + try { + return setS2(Integer.parseInt(s2)); + } catch (final NumberFormatException e) { + throw new BadConfigException(Section.INTERFACE, Location.S2, s2, e); + } + } + + public Builder parseH1(final String h1) throws BadConfigException { + try { + return setH1(Long.parseLong(h1)); + } catch (final NumberFormatException e) { + throw new BadConfigException(Section.INTERFACE, Location.H1, h1, e); + } + } + + public Builder parseH2(final String h2) throws BadConfigException { + try { + return setH2(Long.parseLong(h2)); + } catch (final NumberFormatException e) { + throw new BadConfigException(Section.INTERFACE, Location.H2, h2, e); + } + } + + public Builder parseH3(final String h3) throws BadConfigException { + try { + return setH3(Long.parseLong(h3)); + } catch (final NumberFormatException e) { + throw new BadConfigException(Section.INTERFACE, Location.H3, h3, e); + } + } + + public Builder parseH4(final String h4) throws BadConfigException { + try { + return setH4(Long.parseLong(h4)); + } catch (final NumberFormatException e) { + throw new BadConfigException(Section.INTERFACE, Location.H4, h4, e); + } + } + public Builder parsePrivateKey(final String privateKey) throws BadConfigException { try { return setKeyPair(new KeyPair(Key.fromBase64(privateKey))); @@ -386,9 +586,81 @@ public final class Interface { public Builder setMtu(final int mtu) throws BadConfigException { if (mtu < 0) throw new BadConfigException( - Section.INTERFACE, Location.LISTEN_PORT, Reason.INVALID_VALUE, String.valueOf(mtu)); + Section.INTERFACE, Location.MTU, Reason.INVALID_VALUE, String.valueOf(mtu)); this.mtu = mtu == 0 ? Optional.empty() : Optional.of(mtu); return this; } + + public Builder setJc(final int jc) throws BadConfigException { + if (jc < 0) + throw new BadConfigException( + Section.INTERFACE, Location.JC, Reason.INVALID_VALUE, String.valueOf(jc)); + this.jc = jc == 0 ? Optional.empty() : Optional.of(jc); + return this; + } + + public Builder setJmin(final int jmin) throws BadConfigException { + if (jmin < 0) + throw new BadConfigException( + Section.INTERFACE, Location.JMIN, Reason.INVALID_VALUE, String.valueOf(jmin)); + this.jmin = jmin == 0 ? Optional.empty() : Optional.of(jmin); + return this; + } + + public Builder setJmax(final int jmax) throws BadConfigException { + if (jmax < 0) + throw new BadConfigException( + Section.INTERFACE, Location.JMAX, Reason.INVALID_VALUE, String.valueOf(jmax)); + this.jmax = jmax == 0 ? Optional.empty() : Optional.of(jmax); + return this; + } + + public Builder setS1(final int s1) throws BadConfigException { + if (s1 < 0) + throw new BadConfigException( + Section.INTERFACE, Location.S1, Reason.INVALID_VALUE, String.valueOf(s1)); + this.s1 = s1 == 0 ? Optional.empty() : Optional.of(s1); + return this; + } + + public Builder setS2(final int s2) throws BadConfigException { + if (s2 < 0) + throw new BadConfigException( + Section.INTERFACE, Location.S2, Reason.INVALID_VALUE, String.valueOf(s2)); + this.s2 = s2 == 0 ? Optional.empty() : Optional.of(s2); + return this; + } + + public Builder setH1(final long h1) throws BadConfigException { + if (h1 < 0) + throw new BadConfigException( + Section.INTERFACE, Location.H1, Reason.INVALID_VALUE, String.valueOf(h1)); + this.h1 = h1 == 0 ? Optional.empty() : Optional.of(h1); + return this; + } + + public Builder setH2(final long h2) throws BadConfigException { + if (h2 < 0) + throw new BadConfigException( + Section.INTERFACE, Location.H2, Reason.INVALID_VALUE, String.valueOf(h2)); + this.h2 = h2 == 0 ? Optional.empty() : Optional.of(h2); + return this; + } + + public Builder setH3(final long h3) throws BadConfigException { + if (h3 < 0) + throw new BadConfigException( + Section.INTERFACE, Location.H3, Reason.INVALID_VALUE, String.valueOf(h3)); + this.h3 = h3 == 0 ? Optional.empty() : Optional.of(h3); + return this; + } + + public Builder setH4(final long h4) throws BadConfigException { + if (h4 < 0) + throw new BadConfigException( + Section.INTERFACE, Location.H4, Reason.INVALID_VALUE, String.valueOf(h4)); + this.h4 = h4 == 0 ? Optional.empty() : Optional.of(h4); + return this; + } } -} +} diff --git a/client/android/src/org/amnezia/vpn/VPNService.kt b/client/android/src/org/amnezia/vpn/VPNService.kt index 082fe412..fe08a3cf 100644 --- a/client/android/src/org/amnezia/vpn/VPNService.kt +++ b/client/android/src/org/amnezia/vpn/VPNService.kt @@ -380,7 +380,10 @@ class VPNService : BaseVpnService(), LocalDnsService.Interface { mNetworkState.bindNetworkListener() } "wireguard" -> { - startWireGuard() + startWireGuard("wireguard") + } + "awg" -> { + startWireGuard("awg") } "shadowsocks" -> { startShadowsocks() @@ -457,7 +460,8 @@ class VPNService : BaseVpnService(), LocalDnsService.Interface { fun turnOff() { Log.v(tag, "Aman: turnOff....................") when (mProtocol) { - "wireguard" -> { + "wireguard", + "awg" -> { GoBackend.wgTurnOff(currentTunnelHandle) } "cloak", @@ -559,14 +563,14 @@ class VPNService : BaseVpnService(), LocalDnsService.Interface { } return parseData } - + /** * Create a Wireguard [Config] from a [json] string - * The [json] will be created in AndroidVpnProtocol.cpp */ - private fun buildWireguardConfig(obj: JSONObject): Config { + private fun buildWireguardConfig(obj: JSONObject, type: String): Config { val confBuilder = Config.Builder() - val wireguardConfigData = obj.getJSONObject("wireguard_config_data") + val wireguardConfigData = obj.getJSONObject(type) val config = parseConfigData(wireguardConfigData.getString("config")) val peerBuilder = Peer.Builder() val peerConfig = config["Peer"]!! @@ -599,6 +603,19 @@ class VPNService : BaseVpnService(), LocalDnsService.Interface { ifaceConfig["DNS"]!!.split(",").forEach { ifaceBuilder.addDnsServer(InetNetwork.parse(it.trim()).address) } + + ifaceBuilder.parsePrivateKey(ifaceConfig["PrivateKey"]) + if (type == "awg_config_data") { + ifaceBuilder.parseJc(ifaceConfig["Jc"]) + ifaceBuilder.parseJmin(ifaceConfig["Jmin"]) + ifaceBuilder.parseJmax(ifaceConfig["Jmax"]) + ifaceBuilder.parseS1(ifaceConfig["S1"]) + ifaceBuilder.parseS2(ifaceConfig["S2"]) + ifaceBuilder.parseH1(ifaceConfig["H1"]) + ifaceBuilder.parseH2(ifaceConfig["H2"]) + ifaceBuilder.parseH3(ifaceConfig["H3"]) + ifaceBuilder.parseH4(ifaceConfig["H4"]) + } /*val jExcludedApplication = obj.getJSONArray("excludedApps") (0 until jExcludedApplication.length()).toList().forEach { val appName = jExcludedApplication.get(it).toString() @@ -716,8 +733,8 @@ class VPNService : BaseVpnService(), LocalDnsService.Interface { }).start() } - private fun startWireGuard() { - val wireguard_conf = buildWireguardConfig(mConfig!!) + private fun startWireGuard(type: String) { + val wireguard_conf = buildWireguardConfig(mConfig!!, type + "_config_data") Log.i(tag, "startWireGuard: wireguard_conf : $wireguard_conf") if (currentTunnelHandle != -1) { Log.e(tag, "Tunnel already up") diff --git a/client/containers/containers_defs.cpp b/client/containers/containers_defs.cpp index 5f8d2e51..0337eb44 100644 --- a/client/containers/containers_defs.cpp +++ b/client/containers/containers_defs.cpp @@ -204,6 +204,7 @@ bool ContainerProps::isSupportedByCurrentPlatform(DockerContainer c) case DockerContainer::WireGuard: return true; case DockerContainer::OpenVpn: return true; case DockerContainer::ShadowSocks: return true; + case DockerContainer::Awg: return true; case DockerContainer::Cloak: return true; default: return false; } From 357c283437372e827fe3581a7398695f8a86cca8 Mon Sep 17 00:00:00 2001 From: albexk Date: Sun, 8 Oct 2023 20:08:32 +0300 Subject: [PATCH 027/108] Disable android accessibility --- client/main.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/client/main.cpp b/client/main.cpp index 396b7625..bf861dc2 100644 --- a/client/main.cpp +++ b/client/main.cpp @@ -26,6 +26,11 @@ int main(int argc, char *argv[]) AllowSetForegroundWindow(ASFW_ANY); #endif +// QTBUG-95974 QTBUG-95764 QTBUG-102168 +#ifdef Q_OS_ANDROID + qputenv("QT_ANDROID_DISABLE_ACCESSIBILITY", "1"); +#endif + #if defined(Q_OS_ANDROID) || defined(Q_OS_IOS) AmneziaApplication app(argc, argv); #else From e01dd2bf57e6edd93bdcd499dd512c5e2c53617b Mon Sep 17 00:00:00 2001 From: "vladimir.kuznetsov" Date: Mon, 9 Oct 2023 19:16:06 +0500 Subject: [PATCH 028/108] added close application button in settings page --- client/images/controls/x-circle.svg | 5 + client/resources.qrc | 1 + client/translations/amneziavpn_ru.ts | 145 ++++++++++-------- client/translations/amneziavpn_zh_CN.ts | 141 ++++++++++------- client/ui/controllers/pageController.cpp | 5 + client/ui/controllers/pageController.h | 3 +- .../ui/qml/Controls2/LabelWithButtonType.qml | 7 +- client/ui/qml/Pages2/PageSettings.qml | 14 ++ 8 files changed, 205 insertions(+), 116 deletions(-) create mode 100644 client/images/controls/x-circle.svg diff --git a/client/images/controls/x-circle.svg b/client/images/controls/x-circle.svg new file mode 100644 index 00000000..2d3f5b26 --- /dev/null +++ b/client/images/controls/x-circle.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/client/resources.qrc b/client/resources.qrc index 5b4d6ae7..f0494852 100644 --- a/client/resources.qrc +++ b/client/resources.qrc @@ -215,5 +215,6 @@ ui/qml/Controls2/ListViewWithLabelsType.qml ui/qml/Pages2/PageServiceDnsSettings.qml ui/qml/Controls2/TopCloseButtonType.qml + images/controls/x-circle.svg diff --git a/client/translations/amneziavpn_ru.ts b/client/translations/amneziavpn_ru.ts index e0bab018..92061f89 100644 --- a/client/translations/amneziavpn_ru.ts +++ b/client/translations/amneziavpn_ru.ts @@ -26,41 +26,41 @@ ConnectionController - + VPN Protocols is not installed. Please install VPN container at first - + Connection... - + Connected - + Settings updated successfully, Reconnnection... - + Reconnection... - - - + + + Connect - + Disconnection... @@ -130,7 +130,7 @@ ImportController - + Scanned %1 of %2. @@ -139,50 +139,55 @@ InstallController - + %1 installed successfully. - + %1 is already installed on the server. - + +Added containers that were already installed on the server + + + + Already installed containers were found on the server. All installed containers have been added to the application - + Settings updated successfully - + Server '%1' was removed - + All containers from server '%1' have been removed - + %1 has been removed from the server '%2' - + Please login as the user - + Server added successfully @@ -250,12 +255,12 @@ Already installed containers were found on the server. All installed containers PageHome - + VPN protocol - + Servers @@ -771,6 +776,11 @@ Already installed containers were found on the server. All installed containers About AmneziaVPN + + + Close application + + PageSettingsAbout @@ -865,71 +875,76 @@ And if you don't like the app, all the more support it - the donation will + Allow application screenshots + + + + Auto start - + Launch the application every time - + starts - + Start minimized - + Launch application minimized - + Language - + Logging - + Enabled - + Disabled - + Reset settings and remove all data from the application - + Reset settings and remove all data from the application? - + All settings will be reset to default. All installed AmneziaVPN services will still remain on the server. - + Continue Продолжить - + Cancel @@ -1525,17 +1540,17 @@ It's okay as long as it's from someone you trust. PageSetupWizardEasy - + What is the level of internet control in your region? - + Set up a VPN yourself - + I want to choose a VPN protocol @@ -1545,7 +1560,7 @@ It's okay as long as it's from someone you trust. Продолжить - + Set up later @@ -1749,11 +1764,6 @@ It's okay as long as it's from someone you trust. VPN access without the ability to manage the server - - - Full access to server - - Server @@ -1765,13 +1775,17 @@ It's okay as long as it's from someone you trust. - + + File with accessing settings to + + + + Connection to - - + File with connection settings to @@ -1795,29 +1809,30 @@ It's okay as long as it's from someone you trust. Full access + + + Access to server management. The user with whom you share full access to the connection will be able to add and remove your protocols and services to the servers, as well as change settings. + + Servers - - Protocols - - - - + + Protocol - - + + Connection format - + Share @@ -2433,6 +2448,16 @@ It's okay as long as it's from someone you trust. error 0x%1: %2 + + + WireGuard Configuration Highlighter + + + + + &Randomize colors + + SelectLanguageDrawer @@ -2459,22 +2484,22 @@ It's okay as long as it's from someone you trust. SettingsController - + Software version - + All settings have been reset to default values - + Cached profiles cleared - + Backup file is corrupted @@ -2504,7 +2529,7 @@ It's okay as long as it's from someone you trust. - Show content + Show connection settings diff --git a/client/translations/amneziavpn_zh_CN.ts b/client/translations/amneziavpn_zh_CN.ts index 37e27786..6c57e9f1 100644 --- a/client/translations/amneziavpn_zh_CN.ts +++ b/client/translations/amneziavpn_zh_CN.ts @@ -27,40 +27,40 @@ ConnectionController - - - + + + Connect 连接 - + VPN Protocols is not installed. Please install VPN container at first 不存在VPN协议,请先安装 - + Connection... 连接中 - + Connected 已连接 - + Reconnection... 重连中 - + Disconnection... 断开中 - + Settings updated successfully, Reconnnection... 配置已更新,重连中 @@ -130,7 +130,7 @@ ImportController - + Scanned %1 of %2. 扫描 %1 of %2. @@ -147,41 +147,46 @@ - + %1 installed successfully. %1 安装成功。 - + %1 is already installed on the server. 服务器上已经安装 %1。 - + +Added containers that were already installed on the server + + + + Already installed containers were found on the server. All installed containers have been added to the application 在服务上发现已经安装协议并添加到应用程序 - + Settings updated successfully 配置更新成功 - + Server '%1' was removed 已移除服务器 '%1' - + All containers from server '%1' have been removed 服务器 '%1' 的所有容器已移除 - + %1 has been removed from the server '%2' %1 已从服务器 '%2' 上移除 @@ -202,12 +207,12 @@ Already installed containers were found on the server. All installed containers 协议已从 - + Please login as the user 请以用户身份登录 - + Server added successfully 服务器添加成功 @@ -275,12 +280,12 @@ Already installed containers were found on the server. All installed containers PageHome - + VPN protocol VPN协议 - + Servers 服务器 @@ -797,6 +802,11 @@ Already installed containers were found on the server. All installed containers About AmneziaVPN 关于 + + + Close application + + PageSettingsAbout @@ -892,71 +902,76 @@ And if you don't like the app, all the more support it - the donation will + Allow application screenshots + + + + Auto start 自动运行 - + Launch the application every time 总是在系统 - + starts 启动时自动运行运用程序 - + Start minimized 最小化 - + Launch application minimized 开启应用程序时窗口最小化 - + Language 语言 - + Logging 日志 - + Enabled 开启 - + Disabled 禁用 - + Reset settings and remove all data from the application 重置并清理应用的所有数据 - + Reset settings and remove all data from the application? 重置并清理应用的所有数据? - + All settings will be reset to default. All installed AmneziaVPN services will still remain on the server. 所有配置恢复为默认值。在服务器上保留所有已安装的AmneziaVPN服务。 - + Continue 继续 - + Cancel 取消 @@ -1561,17 +1576,17 @@ It's okay as long as it's from someone you trust. PageSetupWizardEasy - + What is the level of internet control in your region? 您所在地区的互联网控制力度如何? - + Set up a VPN yourself 自己架设VPN - + I want to choose a VPN protocol 我想选择VPN协议 @@ -1581,7 +1596,7 @@ It's okay as long as it's from someone you trust. 继续 - + Set up later 稍后设置 @@ -1807,8 +1822,12 @@ It's okay as long as it's from someone you trust. + Access to server management. The user with whom you share full access to the connection will be able to add and remove your protocols and services to the servers, as well as change settings. + + + Full access to server - 获得服务器完整授权 + 获得服务器完整授权 @@ -1827,33 +1846,37 @@ It's okay as long as it's from someone you trust. - + File with accessing settings to + + + + File with connection settings to 连接配置文件的内容为: - Protocols - 协议 + 协议 - + + Protocol 协议 - + Connection to 连接到 - - + + Connection format 连接方式 - + Share 共享 @@ -2469,6 +2492,16 @@ It's okay as long as it's from someone you trust. error 0x%1: %2 错误 0x%1: %2 + + + WireGuard Configuration Highlighter + + + + + &Randomize colors + + SelectLanguageDrawer @@ -2495,22 +2528,22 @@ It's okay as long as it's from someone you trust. SettingsController - + Software version 软件版本 - + Backup file is corrupted 备份文件已损坏 - + All settings have been reset to default values 所配置恢复为默认值 - + Cached profiles cleared 缓存的配置文件已清除 @@ -2540,8 +2573,12 @@ It's okay as long as it's from someone you trust. + Show connection settings + + + Show content - 展示内容 + 展示内容 diff --git a/client/ui/controllers/pageController.cpp b/client/ui/controllers/pageController.cpp index cb500618..ed60500a 100644 --- a/client/ui/controllers/pageController.cpp +++ b/client/ui/controllers/pageController.cpp @@ -157,3 +157,8 @@ void PageController::setTriggeredBtConnectButton(bool trigger) { m_isTriggeredByConnectButton = trigger; } + +void PageController::closeApplication() +{ + qApp->quit(); +} diff --git a/client/ui/controllers/pageController.h b/client/ui/controllers/pageController.h index 70732bd9..69c80fe6 100644 --- a/client/ui/controllers/pageController.h +++ b/client/ui/controllers/pageController.h @@ -84,10 +84,11 @@ public slots: void drawerOpen(); void drawerClose(); - bool isTriggeredByConnectButton(); void setTriggeredBtConnectButton(bool trigger); + void closeApplication(); + signals: void goToPage(PageLoader::PageEnum page, bool slide = true); void goToStartPage(); diff --git a/client/ui/qml/Controls2/LabelWithButtonType.qml b/client/ui/qml/Controls2/LabelWithButtonType.qml index bb051f76..6bc45a8c 100644 --- a/client/ui/qml/Controls2/LabelWithButtonType.qml +++ b/client/ui/qml/Controls2/LabelWithButtonType.qml @@ -17,6 +17,7 @@ Item { property string rightImageSource property string leftImageSource + property bool isLeftImageHoverEnabled: true //todo separete this qml file to 3 property string textColor: "#d7d8db" property string descriptionColor: "#878B91" @@ -42,9 +43,9 @@ Item { visible: leftImageSource ? true : false - Layout.preferredHeight: rightImageSource ? leftImage.implicitHeight : 56 - Layout.preferredWidth: rightImageSource ? leftImage.implicitWidth : 56 - Layout.rightMargin: rightImageSource ? 16 : 0 + Layout.preferredHeight: rightImageSource || !isLeftImageHoverEnabled ? leftImage.implicitHeight : 56 + Layout.preferredWidth: rightImageSource || !isLeftImageHoverEnabled ? leftImage.implicitWidth : 56 + Layout.rightMargin: rightImageSource || !isLeftImageHoverEnabled ? 16 : 0 radius: 12 color: "transparent" diff --git a/client/ui/qml/Pages2/PageSettings.qml b/client/ui/qml/Pages2/PageSettings.qml index e020dc2c..a806d472 100644 --- a/client/ui/qml/Pages2/PageSettings.qml +++ b/client/ui/qml/Pages2/PageSettings.qml @@ -107,6 +107,20 @@ PageType { } DividerType {} + + LabelWithButtonType { + Layout.fillWidth: true + + text: qsTr("Close application") + leftImageSource: "qrc:/images/controls/x-circle.svg" + isLeftImageHoverEnabled: false + + clickedFunction: function() { + PageController.closeApplication() + } + } + + DividerType {} } } } From c08e23085ed9361fd19d75008f99542d59d0d9f4 Mon Sep 17 00:00:00 2001 From: Mykola Baibuz Date: Mon, 9 Oct 2023 10:29:42 -0400 Subject: [PATCH 029/108] Fix protocol change from AWG to WG for Android --- client/3rd-prebuilt | 2 +- .../src/com/wireguard/config/Interface.java | 18 ++++++++-------- .../android/src/org/amnezia/vpn/VPNService.kt | 21 +++++++++++++++++-- 3 files changed, 29 insertions(+), 12 deletions(-) diff --git a/client/3rd-prebuilt b/client/3rd-prebuilt index fbb5f586..c3ca525f 160000 --- a/client/3rd-prebuilt +++ b/client/3rd-prebuilt @@ -1 +1 @@ -Subproject commit fbb5f586b94efc3f65edeaf9559c8a5c4e752d66 +Subproject commit c3ca525f92e57fecdd6047e35b4ccded8b173407 diff --git a/client/android/src/com/wireguard/config/Interface.java b/client/android/src/com/wireguard/config/Interface.java index df6b7fb1..4b561680 100644 --- a/client/android/src/com/wireguard/config/Interface.java +++ b/client/android/src/com/wireguard/config/Interface.java @@ -595,7 +595,7 @@ public final class Interface { if (jc < 0) throw new BadConfigException( Section.INTERFACE, Location.JC, Reason.INVALID_VALUE, String.valueOf(jc)); - this.jc = jc == 0 ? Optional.empty() : Optional.of(jc); + this.jc = Optional.of(jc); return this; } @@ -603,7 +603,7 @@ public final class Interface { if (jmin < 0) throw new BadConfigException( Section.INTERFACE, Location.JMIN, Reason.INVALID_VALUE, String.valueOf(jmin)); - this.jmin = jmin == 0 ? Optional.empty() : Optional.of(jmin); + this.jmin = Optional.of(jmin); return this; } @@ -611,7 +611,7 @@ public final class Interface { if (jmax < 0) throw new BadConfigException( Section.INTERFACE, Location.JMAX, Reason.INVALID_VALUE, String.valueOf(jmax)); - this.jmax = jmax == 0 ? Optional.empty() : Optional.of(jmax); + this.jmax = Optional.of(jmax); return this; } @@ -619,7 +619,7 @@ public final class Interface { if (s1 < 0) throw new BadConfigException( Section.INTERFACE, Location.S1, Reason.INVALID_VALUE, String.valueOf(s1)); - this.s1 = s1 == 0 ? Optional.empty() : Optional.of(s1); + this.s1 = Optional.of(s1); return this; } @@ -627,7 +627,7 @@ public final class Interface { if (s2 < 0) throw new BadConfigException( Section.INTERFACE, Location.S2, Reason.INVALID_VALUE, String.valueOf(s2)); - this.s2 = s2 == 0 ? Optional.empty() : Optional.of(s2); + this.s2 = Optional.of(s2); return this; } @@ -635,7 +635,7 @@ public final class Interface { if (h1 < 0) throw new BadConfigException( Section.INTERFACE, Location.H1, Reason.INVALID_VALUE, String.valueOf(h1)); - this.h1 = h1 == 0 ? Optional.empty() : Optional.of(h1); + this.h1 = Optional.of(h1); return this; } @@ -643,7 +643,7 @@ public final class Interface { if (h2 < 0) throw new BadConfigException( Section.INTERFACE, Location.H2, Reason.INVALID_VALUE, String.valueOf(h2)); - this.h2 = h2 == 0 ? Optional.empty() : Optional.of(h2); + this.h2 = Optional.of(h2); return this; } @@ -651,7 +651,7 @@ public final class Interface { if (h3 < 0) throw new BadConfigException( Section.INTERFACE, Location.H3, Reason.INVALID_VALUE, String.valueOf(h3)); - this.h3 = h3 == 0 ? Optional.empty() : Optional.of(h3); + this.h3 = Optional.of(h3); return this; } @@ -659,7 +659,7 @@ public final class Interface { if (h4 < 0) throw new BadConfigException( Section.INTERFACE, Location.H4, Reason.INVALID_VALUE, String.valueOf(h4)); - this.h4 = h4 == 0 ? Optional.empty() : Optional.of(h4); + this.h4 = Optional.of(h4); return this; } } diff --git a/client/android/src/org/amnezia/vpn/VPNService.kt b/client/android/src/org/amnezia/vpn/VPNService.kt index fe08a3cf..06f58980 100644 --- a/client/android/src/org/amnezia/vpn/VPNService.kt +++ b/client/android/src/org/amnezia/vpn/VPNService.kt @@ -615,6 +615,17 @@ class VPNService : BaseVpnService(), LocalDnsService.Interface { ifaceBuilder.parseH2(ifaceConfig["H2"]) ifaceBuilder.parseH3(ifaceConfig["H3"]) ifaceBuilder.parseH4(ifaceConfig["H4"]) + } else { + ifaceBuilder.parseJc("0") + ifaceBuilder.parseJmin("0") + ifaceBuilder.parseJmax("0") + ifaceBuilder.parseS1("0") + ifaceBuilder.parseS2("0") + ifaceBuilder.parseH1("0") + ifaceBuilder.parseH2("0") + ifaceBuilder.parseH3("0") + ifaceBuilder.parseH4("0") + } /*val jExcludedApplication = obj.getJSONArray("excludedApps") (0 until jExcludedApplication.length()).toList().forEach { @@ -745,9 +756,15 @@ class VPNService : BaseVpnService(), LocalDnsService.Interface { val builder = Builder() setupBuilder(wireguard_conf, builder) builder.setSession("Amnezia") + + builder.establish().use { tun -> - if (tun == null) return - currentTunnelHandle = GoBackend.wgTurnOn("Amnezia", tun.detachFd(), wgConfig) + if (tun == null) return + if (type == "awg"){ + currentTunnelHandle = GoBackend.wgTurnOn("awg0", tun.detachFd(), wgConfig) + } else { + currentTunnelHandle = GoBackend.wgTurnOn("amn0", tun.detachFd(), wgConfig) + } } if (currentTunnelHandle < 0) { Log.e(tag, "Activation Error Code -> $currentTunnelHandle") From 042788bec3f8316e9b5ccd73f5b6362ef84cd330 Mon Sep 17 00:00:00 2001 From: "vladimir.kuznetsov" Date: Mon, 9 Oct 2023 20:19:22 +0500 Subject: [PATCH 030/108] moved add new server button to main tabbar --- client/ui/qml/Pages2/PageHome.qml | 13 +------ .../ui/qml/Pages2/PageSettingsServersList.qml | 10 ------ .../qml/Pages2/PageSetupWizardInstalling.qml | 6 +--- client/ui/qml/Pages2/PageStart.qml | 35 ++++++++++++++++--- 4 files changed, 33 insertions(+), 31 deletions(-) diff --git a/client/ui/qml/Pages2/PageHome.qml b/client/ui/qml/Pages2/PageHome.qml index 3808fb15..519c17a5 100644 --- a/client/ui/qml/Pages2/PageHome.qml +++ b/client/ui/qml/Pages2/PageHome.qml @@ -96,7 +96,7 @@ PageType { id: dragArea anchors.fill: buttonBackground - cursorShape: Qt.PointingHandCursor + cursorShape: buttonContent.state === "collapsed" ? Qt.PointingHandCursor : Qt.ArrowCursor hoverEnabled: true drag.target: buttonContent @@ -385,18 +385,7 @@ PageType { Layout.rightMargin: 16 visible: buttonContent.expandedVisibility - actionButtonImage: "qrc:/images/controls/plus.svg" - headerText: qsTr("Servers") - - actionButtonFunction: function() { - buttonContent.state = "collapsed" - connectionTypeSelection.visible = true - } - } - - ConnectionTypeSelectionDrawer { - id: connectionTypeSelection } } diff --git a/client/ui/qml/Pages2/PageSettingsServersList.qml b/client/ui/qml/Pages2/PageSettingsServersList.qml index c0807f35..040aafc3 100644 --- a/client/ui/qml/Pages2/PageSettingsServersList.qml +++ b/client/ui/qml/Pages2/PageSettingsServersList.qml @@ -34,20 +34,10 @@ PageType { Layout.leftMargin: 16 Layout.rightMargin: 16 - actionButtonImage: "qrc:/images/controls/plus.svg" - headerText: qsTr("Servers") - - actionButtonFunction: function() { - connectionTypeSelection.visible = true - } } } - ConnectionTypeSelectionDrawer { - id: connectionTypeSelection - } - FlickableType { anchors.top: header.bottom anchors.topMargin: 16 diff --git a/client/ui/qml/Pages2/PageSetupWizardInstalling.qml b/client/ui/qml/Pages2/PageSetupWizardInstalling.qml index f2919398..84f6be89 100644 --- a/client/ui/qml/Pages2/PageSetupWizardInstalling.qml +++ b/client/ui/qml/Pages2/PageSetupWizardInstalling.qml @@ -42,11 +42,7 @@ PageType { function onInstallServerFinished(finishedMessage) { PageController.goToStartPage() - if (stackView.currentItem.objectName === PageController.getPagePath(PageEnum.PageHome)) { - PageController.restorePageHomeState() - } else if (stackView.currentItem.objectName === PageController.getPagePath(PageEnum.PageSettings)) { - PageController.goToPage(PageEnum.PageSettingsServersList, false) - } else { + if (stackView.currentItem.objectName === PageController.getPagePath(PageEnum.PageSetupWizardStart)) { PageController.replaceStartPage() } diff --git a/client/ui/qml/Pages2/PageStart.qml b/client/ui/qml/Pages2/PageStart.qml index 43366af7..99132bf1 100644 --- a/client/ui/qml/Pages2/PageStart.qml +++ b/client/ui/qml/Pages2/PageStart.qml @@ -9,6 +9,7 @@ import "./" import "../Controls2" import "../Controls2/TextTypes" import "../Config" +import "../Components" PageType { id: root @@ -17,14 +18,14 @@ PageType { target: PageController function onGoToPageHome() { - tabBar.currentIndex = 0 + tabBar.setCurrentIndex(0) tabBarStackView.goToTabBarPage(PageEnum.PageHome) PageController.updateDrawerRootPage(PageEnum.PageHome) } function onGoToPageSettings() { - tabBar.currentIndex = 2 + tabBar.setCurrentIndex(2) tabBarStackView.goToTabBarPage(PageEnum.PageSettings) PageController.updateDrawerRootPage(PageEnum.PageSettings) @@ -70,6 +71,7 @@ PageType { } function onGoToStartPage() { + connectionTypeSelection.close() while (tabBarStackView.depth > 1) { tabBarStackView.pop() } @@ -120,6 +122,8 @@ PageType { height: root.height - tabBar.implicitHeight function goToTabBarPage(page) { + connectionTypeSelection.close() + var pagePath = PageController.getPagePath(page) tabBarStackView.clear(StackView.Immediate) tabBarStackView.replace(pagePath, { "objectName" : pagePath }, StackView.Immediate) @@ -137,14 +141,16 @@ PageType { TabBar { id: tabBar + property int previousIndex: 0 + anchors.right: parent.right anchors.left: parent.left anchors.bottom: parent.bottom topPadding: 8 bottomPadding: 8 - leftPadding: shareTabButton.visible ? 96 : 128 - rightPadding: shareTabButton.visible ? 96 : 128 + leftPadding: 96 + rightPadding: 96 background: Shape { width: parent.width @@ -171,8 +177,10 @@ PageType { onClicked: { tabBarStackView.goToTabBarPage(PageEnum.PageHome) ServersModel.currentlyProcessedIndex = ServersModel.defaultIndex + tabBar.previousIndex = 0 } } + TabImageButtonType { id: shareTabButton @@ -193,13 +201,24 @@ PageType { image: "qrc:/images/controls/share-2.svg" onClicked: { tabBarStackView.goToTabBarPage(PageEnum.PageShare) + tabBar.previousIndex = 1 } } + TabImageButtonType { isSelected: tabBar.currentIndex === 2 image: "qrc:/images/controls/settings-2.svg" onClicked: { tabBarStackView.goToTabBarPage(PageEnum.PageSettings) + tabBar.previousIndex = 2 + } + } + + TabImageButtonType { + isSelected: tabBar.currentIndex === 3 + image: "qrc:/images/controls/plus.svg" + onClicked: { + connectionTypeSelection.open() } } } @@ -215,4 +234,12 @@ PageType { x: tabBarStackView.width - topCloseButton.width z: 1 } + + ConnectionTypeSelectionDrawer { + id: connectionTypeSelection + + onAboutToHide: { + tabBar.setCurrentIndex(tabBar.previousIndex) + } + } } From d364dbac2ce6c3e1f82bc55950f323915f869b8e Mon Sep 17 00:00:00 2001 From: "vladimir.kuznetsov" Date: Mon, 9 Oct 2023 22:39:32 +0500 Subject: [PATCH 031/108] now when a new container is installed, it is selected as the default container --- client/translations/amneziavpn_ru.ts | 28 +++++++++---------- client/translations/amneziavpn_zh_CN.ts | 28 +++++++++---------- client/ui/controllers/installController.cpp | 1 + .../qml/Components/HomeContainersListView.qml | 2 -- .../qml/Pages2/PageSetupWizardViewConfig.qml | 6 +--- client/ui/qml/Pages2/PageShare.qml | 2 +- 6 files changed, 31 insertions(+), 36 deletions(-) diff --git a/client/translations/amneziavpn_ru.ts b/client/translations/amneziavpn_ru.ts index 92061f89..2f36f748 100644 --- a/client/translations/amneziavpn_ru.ts +++ b/client/translations/amneziavpn_ru.ts @@ -162,32 +162,32 @@ Already installed containers were found on the server. All installed containers - + Settings updated successfully - + Server '%1' was removed - + All containers from server '%1' have been removed - + %1 has been removed from the server '%2' - + Please login as the user - + Server added successfully @@ -260,7 +260,7 @@ Already installed containers were found on the server. All installed containers - + Servers @@ -1343,7 +1343,7 @@ And if you don't like the app, all the more support it - the donation will PageSettingsServersList - + Servers @@ -1568,33 +1568,33 @@ It's okay as long as it's from someone you trust. PageSetupWizardInstalling - + The server has already been added to the application - + Amnesia has detected that your server is currently - + busy installing other software. Amnesia installation - + will pause until the server finishes installing other software - + Installing - + Usually it takes no more than 5 minutes diff --git a/client/translations/amneziavpn_zh_CN.ts b/client/translations/amneziavpn_zh_CN.ts index 6c57e9f1..c2376be0 100644 --- a/client/translations/amneziavpn_zh_CN.ts +++ b/client/translations/amneziavpn_zh_CN.ts @@ -171,22 +171,22 @@ Already installed containers were found on the server. All installed containers 在服务上发现已经安装协议并添加到应用程序 - + Settings updated successfully 配置更新成功 - + Server '%1' was removed 已移除服务器 '%1' - + All containers from server '%1' have been removed 服务器 '%1' 的所有容器已移除 - + %1 has been removed from the server '%2' %1 已从服务器 '%2' 上移除 @@ -207,12 +207,12 @@ Already installed containers were found on the server. All installed containers 协议已从 - + Please login as the user 请以用户身份登录 - + Server added successfully 服务器添加成功 @@ -285,7 +285,7 @@ Already installed containers were found on the server. All installed containers VPN协议 - + Servers 服务器 @@ -1378,7 +1378,7 @@ And if you don't like the app, all the more support it - the donation will PageSettingsServersList - + Servers 服务器 @@ -1605,32 +1605,32 @@ It's okay as long as it's from someone you trust. PageSetupWizardInstalling - + Usually it takes no more than 5 minutes 通常不超过5分钟 - + The server has already been added to the application 服务器已添加到应用程序中 - + Amnesia has detected that your server is currently Amnezia 检测到您的服务器当前 - + busy installing other software. Amnesia installation 正安装其他软件。Amnezia安装 - + will pause until the server finishes installing other software 将暂停,直到服务器完成安装其他软件。 - + Installing 安装中 diff --git a/client/ui/controllers/installController.cpp b/client/ui/controllers/installController.cpp index 72cc34b6..34917cac 100644 --- a/client/ui/controllers/installController.cpp +++ b/client/ui/controllers/installController.cpp @@ -183,6 +183,7 @@ void InstallController::installContainer(DockerContainer container, QJsonObject "All installed containers have been added to the application"); } + m_containersModel->setData(m_containersModel->index(0, 0), container, ContainersModel::Roles::IsDefaultRole); emit installContainerFinished(finishMessage, ContainerProps::containerService(container) == ServiceType::Other); return; } diff --git a/client/ui/qml/Components/HomeContainersListView.qml b/client/ui/qml/Components/HomeContainersListView.qml index 4708128f..86a755c1 100644 --- a/client/ui/qml/Components/HomeContainersListView.qml +++ b/client/ui/qml/Components/HomeContainersListView.qml @@ -76,7 +76,6 @@ ListView { (ConnectionController.isConnected || ConnectionController.isConnectionInProgress)) { PageController.showNotificationMessage(qsTr("Reconnect via VPN Procotol: ") + name) PageController.goToPageHome() - menu.visible = false ConnectionController.openConnection() } } else { @@ -84,7 +83,6 @@ ListView { InstallController.setShouldCreateServer(false) PageController.goToPage(PageEnum.PageSetupWizardProtocolSettings) containersDropDown.menuVisible = false - menu.visible = false } } diff --git a/client/ui/qml/Pages2/PageSetupWizardViewConfig.qml b/client/ui/qml/Pages2/PageSetupWizardViewConfig.qml index 2f1fc392..83132bd9 100644 --- a/client/ui/qml/Pages2/PageSetupWizardViewConfig.qml +++ b/client/ui/qml/Pages2/PageSetupWizardViewConfig.qml @@ -25,11 +25,7 @@ PageType { function onImportFinished() { PageController.goToStartPage() - if (stackView.currentItem.objectName === PageController.getPagePath(PageEnum.PageHome)) { - PageController.restorePageHomeState() - } else if (stackView.currentItem.objectName === PageController.getPagePath(PageEnum.PageSettings)) { - PageController.goToPage(PageEnum.PageSettingsServersList, false) - } else { + if (stackView.currentItem.objectName === PageController.getPagePath(PageEnum.PageSetupWizardStart)) { PageController.replaceStartPage() } } diff --git a/client/ui/qml/Pages2/PageShare.qml b/client/ui/qml/Pages2/PageShare.qml index 6c284278..2fa5e4a1 100644 --- a/client/ui/qml/Pages2/PageShare.qml +++ b/client/ui/qml/Pages2/PageShare.qml @@ -187,7 +187,7 @@ PageType { drawerHeight: 0.4375 - descriptionText: qsTr("Servers") + descriptionText: qsTr("Server") headerText: qsTr("Server") listView: ListViewWithRadioButtonType { From cb7fe50d46190b59c73793956aed0e00778fa67f Mon Sep 17 00:00:00 2001 From: "vladimir.kuznetsov" Date: Mon, 9 Oct 2023 22:40:06 +0500 Subject: [PATCH 032/108] added margins for picture with qr code --- client/ui/qml/Components/ShareConnectionDrawer.qml | 1 + 1 file changed, 1 insertion(+) diff --git a/client/ui/qml/Components/ShareConnectionDrawer.qml b/client/ui/qml/Components/ShareConnectionDrawer.qml index 2419b51a..1158dadc 100644 --- a/client/ui/qml/Components/ShareConnectionDrawer.qml +++ b/client/ui/qml/Components/ShareConnectionDrawer.qml @@ -213,6 +213,7 @@ DrawerType { Image { anchors.fill: parent + anchors.margins: 2 smooth: false source: ExportController.qrCodesCount ? ExportController.qrCodes[0] : "" From 00be3c3ccc61be2640c39aa69e96d8210ea81c2e Mon Sep 17 00:00:00 2001 From: "vladimir.kuznetsov" Date: Mon, 9 Oct 2023 22:54:33 +0500 Subject: [PATCH 033/108] corrections to the text --- client/ui/qml/Pages2/PageProtocolOpenVpnSettings.qml | 2 +- client/ui/qml/Pages2/PageProtocolRaw.qml | 2 +- client/ui/qml/Pages2/PageSettingsAbout.qml | 4 ++-- client/ui/qml/Pages2/PageSettingsBackup.qml | 2 +- client/ui/qml/Pages2/PageSettingsConnection.qml | 2 +- client/ui/qml/Pages2/PageSettingsServerProtocol.qml | 2 +- 6 files changed, 7 insertions(+), 7 deletions(-) diff --git a/client/ui/qml/Pages2/PageProtocolOpenVpnSettings.qml b/client/ui/qml/Pages2/PageProtocolOpenVpnSettings.qml index 491bdf31..c8469dcb 100644 --- a/client/ui/qml/Pages2/PageProtocolOpenVpnSettings.qml +++ b/client/ui/qml/Pages2/PageProtocolOpenVpnSettings.qml @@ -360,7 +360,7 @@ PageType { onClicked: { questionDrawer.headerText = qsTr("Remove OpenVpn from server?") - questionDrawer.descriptionText = qsTr("All users with whom you shared a connection will no longer be able to connect to it") + questionDrawer.descriptionText = qsTr("All users who you shared a connection with will no longer be able to connect to it.") questionDrawer.yesButtonText = qsTr("Continue") questionDrawer.noButtonText = qsTr("Cancel") diff --git a/client/ui/qml/Pages2/PageProtocolRaw.qml b/client/ui/qml/Pages2/PageProtocolRaw.qml index 34ca4055..2324c091 100644 --- a/client/ui/qml/Pages2/PageProtocolRaw.qml +++ b/client/ui/qml/Pages2/PageProtocolRaw.qml @@ -174,7 +174,7 @@ PageType { clickedFunction: function() { questionDrawer.headerText = qsTr("Remove %1 from server?").arg(ContainersModel.getCurrentlyProcessedContainerName()) - questionDrawer.descriptionText = qsTr("All users with whom you shared a connection will no longer be able to connect to it") + questionDrawer.descriptionText = qsTr("All users who you shared a connection with will no longer be able to connect to it.") questionDrawer.yesButtonText = qsTr("Continue") questionDrawer.noButtonText = qsTr("Cancel") diff --git a/client/ui/qml/Pages2/PageSettingsAbout.qml b/client/ui/qml/Pages2/PageSettingsAbout.qml index e73ef88f..eaa9eb3d 100644 --- a/client/ui/qml/Pages2/PageSettingsAbout.qml +++ b/client/ui/qml/Pages2/PageSettingsAbout.qml @@ -68,8 +68,8 @@ PageType { height: 20 font.pixelSize: 14 - text: qsTr("This is a free and open source application. If you like it, support the developers with a donation. -And if you don't like the app, all the more support it - the donation will be used to improve the app.") + text: qsTr("This is a free and open source application. If you like it, support the developers with a donation. ") + + qsTr("And if you don’t like the application, all the more reason to support it - the donation will be used for the improving the application.") color: "#CCCAC8" } diff --git a/client/ui/qml/Pages2/PageSettingsBackup.qml b/client/ui/qml/Pages2/PageSettingsBackup.qml index 7a556dfb..96214893 100644 --- a/client/ui/qml/Pages2/PageSettingsBackup.qml +++ b/client/ui/qml/Pages2/PageSettingsBackup.qml @@ -77,7 +77,7 @@ PageType { Layout.fillWidth: true Layout.topMargin: -12 - text: qsTr("It will help you instantly restore connection settings at the next installation") + text: qsTr("You can save your settings to a backup file to restore them the next time you install the application.") color: "#878B91" } diff --git a/client/ui/qml/Pages2/PageSettingsConnection.qml b/client/ui/qml/Pages2/PageSettingsConnection.qml index ae5fd7f4..374e1ce4 100644 --- a/client/ui/qml/Pages2/PageSettingsConnection.qml +++ b/client/ui/qml/Pages2/PageSettingsConnection.qml @@ -97,7 +97,7 @@ PageType { Layout.fillWidth: true text: qsTr("Split site tunneling") - descriptionText: qsTr("Allows you to connect to some sites through a secure connection, and to others bypassing it") + descriptionText: qsTr("Allows you to choose which sites you want to use the VPN for.") rightImageSource: "qrc:/images/controls/chevron-right.svg" clickedFunction: function() { diff --git a/client/ui/qml/Pages2/PageSettingsServerProtocol.qml b/client/ui/qml/Pages2/PageSettingsServerProtocol.qml index 998948d1..30758da4 100644 --- a/client/ui/qml/Pages2/PageSettingsServerProtocol.qml +++ b/client/ui/qml/Pages2/PageSettingsServerProtocol.qml @@ -114,7 +114,7 @@ PageType { clickedFunction: function() { questionDrawer.headerText = qsTr("Remove %1 from server?").arg(ContainersModel.getCurrentlyProcessedContainerName()) - questionDrawer.descriptionText = qsTr("All users with whom you shared a connection will no longer be able to connect to it") + questionDrawer.descriptionText = qsTr("All users who you shared a connection with will no longer be able to connect to it.") questionDrawer.yesButtonText = qsTr("Continue") questionDrawer.noButtonText = qsTr("Cancel") From 4a2706a9d9d9df05767661fbb7ceaeb966ff94b2 Mon Sep 17 00:00:00 2001 From: "vladimir.kuznetsov" Date: Mon, 9 Oct 2023 23:00:53 +0500 Subject: [PATCH 034/108] increased the application version to 4.0.8.1 --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 716d6a7f..af4ae898 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -2,7 +2,7 @@ cmake_minimum_required(VERSION 3.25.0 FATAL_ERROR) set(PROJECT AmneziaVPN) -project(${PROJECT} VERSION 4.0.7.1 +project(${PROJECT} VERSION 4.0.8.1 DESCRIPTION "AmneziaVPN" HOMEPAGE_URL "https://amnezia.org/" ) From bb2d794b6fe596b11321e9fbb0e8cc828ea59c01 Mon Sep 17 00:00:00 2001 From: "vladimir.kuznetsov" Date: Mon, 9 Oct 2023 23:18:24 +0500 Subject: [PATCH 035/108] corrections to the text --- client/containers/containers_defs.cpp | 4 +- client/protocols/protocols_defs.cpp | 2 +- client/translations/amneziavpn_ru.ts | 298 ++++++++++++------ client/translations/amneziavpn_zh_CN.ts | 294 ++++++++++++----- .../ui/qml/Pages2/PageProtocolAwgSettings.qml | 8 +- 5 files changed, 431 insertions(+), 175 deletions(-) diff --git a/client/containers/containers_defs.cpp b/client/containers/containers_defs.cpp index 0337eb44..fd13bfe0 100644 --- a/client/containers/containers_defs.cpp +++ b/client/containers/containers_defs.cpp @@ -84,7 +84,7 @@ QMap ContainerProps::containerHumanNames() { DockerContainer::ShadowSocks, "ShadowSocks" }, { DockerContainer::Cloak, "OpenVPN over Cloak" }, { DockerContainer::WireGuard, "WireGuard" }, - { DockerContainer::Awg, "Amnezia WireGuard" }, + { DockerContainer::Awg, "AmneziaWG" }, { DockerContainer::Ipsec, QObject::tr("IPsec") }, { DockerContainer::TorWebSite, QObject::tr("Website in Tor network") }, @@ -131,7 +131,7 @@ QMap ContainerProps::containerDetailedDescriptions() QObject::tr("Container with OpenVpn and ShadowSocks protocols " "configured with traffic masking by Cloak plugin") }, { DockerContainer::WireGuard, QObject::tr("WireGuard container") }, - { DockerContainer::WireGuard, QObject::tr("Amnezia WireGuard container") }, + { DockerContainer::WireGuard, QObject::tr("AmneziaWG container") }, { DockerContainer::Ipsec, QObject::tr("IPsec container") }, { DockerContainer::TorWebSite, QObject::tr("Website in Tor network") }, diff --git a/client/protocols/protocols_defs.cpp b/client/protocols/protocols_defs.cpp index 3982ef9c..b7f6b1d8 100644 --- a/client/protocols/protocols_defs.cpp +++ b/client/protocols/protocols_defs.cpp @@ -66,7 +66,7 @@ QMap ProtocolProps::protocolHumanNames() { Proto::ShadowSocks, "ShadowSocks" }, { Proto::Cloak, "Cloak" }, { Proto::WireGuard, "WireGuard" }, - { Proto::WireGuard, "Amnezia WireGuard" }, + { Proto::WireGuard, "AmneziaWG" }, { Proto::Ikev2, "IKEv2" }, { Proto::L2tp, "L2TP" }, diff --git a/client/translations/amneziavpn_ru.ts b/client/translations/amneziavpn_ru.ts index e0bab018..f2e7a811 100644 --- a/client/translations/amneziavpn_ru.ts +++ b/client/translations/amneziavpn_ru.ts @@ -26,41 +26,41 @@ ConnectionController - + VPN Protocols is not installed. Please install VPN container at first - + Connection... - + Connected - + Settings updated successfully, Reconnnection... - + Reconnection... - - - + + + Connect - + Disconnection... @@ -122,7 +122,7 @@ - + Reconnect via VPN Procotol: @@ -130,7 +130,7 @@ ImportController - + Scanned %1 of %2. @@ -139,50 +139,55 @@ InstallController - + %1 installed successfully. - + %1 is already installed on the server. - + +Added containers that were already installed on the server + + + + Already installed containers were found on the server. All installed containers have been added to the application - + Settings updated successfully - + Server '%1' was removed - + All containers from server '%1' have been removed - + %1 has been removed from the server '%2' - + Please login as the user - + Server added successfully @@ -250,16 +255,104 @@ Already installed containers were found on the server. All installed containers PageHome - + VPN protocol - + Servers + + PageProtocolAwgSettings + + + AmneziaWG settings + + + + + Port + + + + + Junk packet count + + + + + Junk packet minimum size + + + + + Junk packet maximum size + + + + + Init packet junk size + + + + + Response packet junk size + + + + + Init packet magic header + + + + + Response packet magic header + + + + + Transport packet magic header + + + + + Underload packet magic header + + + + + Remove AmneziaWG + + + + + Remove AmneziaWG from server? + + + + + All users who you shared a connection with will no longer be able to connect to it. + + + + + Continue + Продолжить + + + + Cancel + + + + + Save and Restart Amnezia + + + PageProtocolCloakSettings @@ -865,71 +958,76 @@ And if you don't like the app, all the more support it - the donation will + Allow application screenshots + + + + Auto start - + Launch the application every time - + starts - + Start minimized - + Launch application minimized - + Language - + Logging - + Enabled - + Disabled - + Reset settings and remove all data from the application - + Reset settings and remove all data from the application? - + All settings will be reset to default. All installed AmneziaVPN services will still remain on the server. - + Continue Продолжить - + Cancel @@ -1525,17 +1623,17 @@ It's okay as long as it's from someone you trust. PageSetupWizardEasy - + What is the level of internet control in your region? - + Set up a VPN yourself - + I want to choose a VPN protocol @@ -1545,7 +1643,7 @@ It's okay as long as it's from someone you trust. Продолжить - + Set up later @@ -1749,11 +1847,6 @@ It's okay as long as it's from someone you trust. VPN access without the ability to manage the server - - - Full access to server - - Server @@ -1765,13 +1858,17 @@ It's okay as long as it's from someone you trust. - + + File with accessing settings to + + + + Connection to - - + File with connection settings to @@ -1795,29 +1892,30 @@ It's okay as long as it's from someone you trust. Full access + + + Access to server management. The user with whom you share full access to the connection will be able to add and remove your protocols and services to the servers, as well as change settings. + + Servers - - Protocols - - - - + + Protocol - - + + Connection format - + Share @@ -2273,103 +2371,109 @@ It's okay as long as it's from someone you trust. - + IPsec - + DNS Service - + Sftp file sharing service - - + + Website in Tor network - + Amnezia DNS - + OpenVPN is the most popular VPN protocol, with flexible configuration options. It uses its own security protocol with SSL/TLS for key exchange. - + ShadowSocks - masks VPN traffic, making it similar to normal web traffic, but is recognised by analysis systems in some highly censored regions. - + OpenVPN over Cloak - OpenVPN with VPN masquerading as web traffic and protection against active-probbing detection. Ideal for bypassing blocking in regions with the highest levels of censorship. - + + WireGuard - New popular VPN protocol with high performance, high speed and low power consumption. Recommended for regions with low levels of censorship. - + IKEv2 - 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. - + Deploy a WordPress site on the Tor network in two clicks. - + Replace the current DNS server with your own. This will increase your privacy level. - + Creates a file vault on your server to securely store and transfer files. - + OpenVPN container - + Container with OpenVpn and ShadowSocks - + Container with OpenVpn and ShadowSocks protocols configured with traffic masking by Cloak plugin - + WireGuard container - - IPsec container + + AmneziaWG container + IPsec container + + + + Sftp file sharing service - is secure FTP service - + Sftp service @@ -2433,6 +2537,16 @@ It's okay as long as it's from someone you trust. error 0x%1: %2 + + + WireGuard Configuration Highlighter + + + + + &Randomize colors + + SelectLanguageDrawer @@ -2459,22 +2573,22 @@ It's okay as long as it's from someone you trust. SettingsController - + Software version - + All settings have been reset to default values - + Cached profiles cleared - + Backup file is corrupted @@ -2504,7 +2618,7 @@ It's okay as long as it's from someone you trust. - Show content + Show connection settings @@ -2589,6 +2703,14 @@ It's okay as long as it's from someone you trust. + + TextFieldWithHeaderType + + + The field can't be empty + + + VpnConnection @@ -2643,32 +2765,32 @@ It's okay as long as it's from someone you trust. amnezia::ContainerProps - + Low - + High - + Medium - + Many foreign websites and VPN providers are blocked - + Some foreign sites are blocked, but VPN providers are not blocked - + I just want to increase the level of privacy diff --git a/client/translations/amneziavpn_zh_CN.ts b/client/translations/amneziavpn_zh_CN.ts index 37e27786..cbf0caa1 100644 --- a/client/translations/amneziavpn_zh_CN.ts +++ b/client/translations/amneziavpn_zh_CN.ts @@ -27,40 +27,40 @@ ConnectionController - - - + + + Connect 连接 - + VPN Protocols is not installed. Please install VPN container at first 不存在VPN协议,请先安装 - + Connection... 连接中 - + Connected 已连接 - + Reconnection... 重连中 - + Disconnection... 断开中 - + Settings updated successfully, Reconnnection... 配置已更新,重连中 @@ -122,7 +122,7 @@ 当前平台不支持所选协议 - + Reconnect via VPN Procotol: 重连基于VPN协议: @@ -130,7 +130,7 @@ ImportController - + Scanned %1 of %2. 扫描 %1 of %2. @@ -147,41 +147,46 @@ - + %1 installed successfully. %1 安装成功。 - + %1 is already installed on the server. 服务器上已经安装 %1。 - + +Added containers that were already installed on the server + + + + Already installed containers were found on the server. All installed containers have been added to the application 在服务上发现已经安装协议并添加到应用程序 - + Settings updated successfully 配置更新成功 - + Server '%1' was removed 已移除服务器 '%1' - + All containers from server '%1' have been removed 服务器 '%1' 的所有容器已移除 - + %1 has been removed from the server '%2' %1 已从服务器 '%2' 上移除 @@ -202,12 +207,12 @@ Already installed containers were found on the server. All installed containers 协议已从 - + Please login as the user 请以用户身份登录 - + Server added successfully 服务器添加成功 @@ -275,16 +280,104 @@ Already installed containers were found on the server. All installed containers PageHome - + VPN protocol VPN协议 - + Servers 服务器 + + PageProtocolAwgSettings + + + AmneziaWG settings + + + + + Port + 端口 + + + + Junk packet count + + + + + Junk packet minimum size + + + + + Junk packet maximum size + + + + + Init packet junk size + + + + + Response packet junk size + + + + + Init packet magic header + + + + + Response packet magic header + + + + + Transport packet magic header + + + + + Underload packet magic header + + + + + Remove AmneziaWG + + + + + Remove AmneziaWG from server? + + + + + All users who you shared a connection with will no longer be able to connect to it. + + + + + Continue + 继续 + + + + Cancel + 取消 + + + + Save and Restart Amnezia + 保存并重启Amnezia + + PageProtocolCloakSettings @@ -892,71 +985,76 @@ And if you don't like the app, all the more support it - the donation will + Allow application screenshots + + + + Auto start 自动运行 - + Launch the application every time 总是在系统 - + starts 启动时自动运行运用程序 - + Start minimized 最小化 - + Launch application minimized 开启应用程序时窗口最小化 - + Language 语言 - + Logging 日志 - + Enabled 开启 - + Disabled 禁用 - + Reset settings and remove all data from the application 重置并清理应用的所有数据 - + Reset settings and remove all data from the application? 重置并清理应用的所有数据? - + All settings will be reset to default. All installed AmneziaVPN services will still remain on the server. 所有配置恢复为默认值。在服务器上保留所有已安装的AmneziaVPN服务。 - + Continue 继续 - + Cancel 取消 @@ -1561,17 +1659,17 @@ It's okay as long as it's from someone you trust. PageSetupWizardEasy - + What is the level of internet control in your region? 您所在地区的互联网控制力度如何? - + Set up a VPN yourself 自己架设VPN - + I want to choose a VPN protocol 我想选择VPN协议 @@ -1581,7 +1679,7 @@ It's okay as long as it's from someone you trust. 继续 - + Set up later 稍后设置 @@ -1807,8 +1905,12 @@ It's okay as long as it's from someone you trust. + Access to server management. The user with whom you share full access to the connection will be able to add and remove your protocols and services to the servers, as well as change settings. + + + Full access to server - 获得服务器完整授权 + 获得服务器完整授权 @@ -1827,33 +1929,37 @@ It's okay as long as it's from someone you trust. - + File with accessing settings to + + + + File with connection settings to 连接配置文件的内容为: - Protocols - 协议 + 协议 - + + Protocol 协议 - + Connection to 连接到 - - + + Connection format 连接方式 - + Share 共享 @@ -2104,7 +2210,7 @@ It's okay as long as it's from someone you trust. QObject - + Sftp service Sftp 服务 @@ -2314,98 +2420,104 @@ It's okay as long as it's from someone you trust. 内部错误 - + IPsec - - + + Website in Tor network 在 Tor 网络中架设网站 - + Amnezia DNS - + Sftp file sharing service SFTP文件共享服务 - + OpenVPN is the most popular VPN protocol, with flexible configuration options. It uses its own security protocol with SSL/TLS for key exchange. OpenVPN 是最流行的 VPN 协议,具有灵活的配置选项。它使用自己的安全协议与 SSL/TLS 进行密钥交换。 - + ShadowSocks - masks VPN traffic, making it similar to normal web traffic, but is recognised by analysis systems in some highly censored regions. ShadowSocks - 混淆 VPN 流量,使其与正常的 Web 流量相似,但在一些审查力度高的地区可以被分析系统识别。 - + OpenVPN over Cloak - OpenVPN with VPN masquerading as web traffic and protection against active-probbing detection. Ideal for bypassing blocking in regions with the highest levels of censorship. OpenVPN over Cloak - OpenVPN 与 VPN 具有伪装成网络流量和防止主动探测检测的保护。非常适合绕过审查力度特别强的地区的封锁。 - + + WireGuard - New popular VPN protocol with high performance, high speed and low power consumption. Recommended for regions with low levels of censorship. WireGuard - 新型流行的VPN协议,具有高性能、高速度和低功耗。建议用于审查力度较低的地区 - + IKEv2 - 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. IKEv2 - 现代稳定协议,相比其他协议较快一些,在信号丢失后恢复连接。Android 和 iOS最新版原生支持。 - + Deploy a WordPress site on the Tor network in two clicks. 只需点击两次即可架设 WordPress 网站到 Tor 网络 - + Replace the current DNS server with your own. This will increase your privacy level. 将当前的 DNS 服务器替换为您自己的。这将提高您的隐私级别。 - + Creates a file vault on your server to securely store and transfer files. 在您的服务器上创建文件库以安全地存储和传输文件 - + OpenVPN container OpenVPN容器 - + Container with OpenVpn and ShadowSocks 带有 OpenVpn 和 ShadowSocks 的容器 - + Container with OpenVpn and ShadowSocks protocols configured with traffic masking by Cloak plugin 具有 OpenVpn 和 ShadowSocks 协议的容器,通过 Cloak 插件配置混淆流量 - + WireGuard container WireGuard 容器 - + + AmneziaWG container + + + + IPsec container IPsec 容器 - + DNS Service DNS 服务 - + Sftp file sharing service - is secure FTP service Sftp 文件共享服务 - 安全的 FTP 服务 @@ -2469,6 +2581,16 @@ It's okay as long as it's from someone you trust. error 0x%1: %2 错误 0x%1: %2 + + + WireGuard Configuration Highlighter + + + + + &Randomize colors + + SelectLanguageDrawer @@ -2495,22 +2617,22 @@ It's okay as long as it's from someone you trust. SettingsController - + Software version 软件版本 - + Backup file is corrupted 备份文件已损坏 - + All settings have been reset to default values 所配置恢复为默认值 - + Cached profiles cleared 缓存的配置文件已清除 @@ -2540,8 +2662,12 @@ It's okay as long as it's from someone you trust. + Show connection settings + + + Show content - 展示内容 + 展示内容 @@ -2625,6 +2751,14 @@ It's okay as long as it's from someone you trust. 退出 + + TextFieldWithHeaderType + + + The field can't be empty + + + VpnConnection @@ -2679,32 +2813,32 @@ It's okay as long as it's from someone you trust. amnezia::ContainerProps - + Low - + High - + Medium - + I just want to increase the level of privacy 我只是想提高隐私级别 - + Many foreign websites and VPN providers are blocked 大多国外网站和VPN提供商被屏蔽 - + Some foreign sites are blocked, but VPN providers are not blocked 一些国外网站被屏蔽,但VPN提供商未被屏蔽 diff --git a/client/ui/qml/Pages2/PageProtocolAwgSettings.qml b/client/ui/qml/Pages2/PageProtocolAwgSettings.qml index 69d34114..079c85a1 100644 --- a/client/ui/qml/Pages2/PageProtocolAwgSettings.qml +++ b/client/ui/qml/Pages2/PageProtocolAwgSettings.qml @@ -73,7 +73,7 @@ PageType { HeaderType { Layout.fillWidth: true - headerText: qsTr("Amnezia WireGuard settings") + headerText: qsTr("AmneziaWG settings") } TextFieldWithHeaderType { @@ -272,11 +272,11 @@ PageType { pressedColor: Qt.rgba(1, 1, 1, 0.12) textColor: "#EB5757" - text: qsTr("Remove Amnezia WireGuard") + text: qsTr("Remove AmneziaWG") onClicked: { - questionDrawer.headerText = qsTr("Remove Amnezia WireGuard from server?") - questionDrawer.descriptionText = qsTr("All users with whom you shared a connection will no longer be able to connect to it") + questionDrawer.headerText = qsTr("Remove AmneziaWG from server?") + questionDrawer.descriptionText = qsTr("All users who you shared a connection with will no longer be able to connect to it.") questionDrawer.yesButtonText = qsTr("Continue") questionDrawer.noButtonText = qsTr("Cancel") From 992961c4888cd848b6ae86fbb3a8def9bb586d1a Mon Sep 17 00:00:00 2001 From: Mykola Baibuz Date: Mon, 9 Oct 2023 16:32:43 -0400 Subject: [PATCH 036/108] Update Windows WG to AWG protocol support --- client/3rd-prebuilt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/3rd-prebuilt b/client/3rd-prebuilt index c3ca525f..15b0ff39 160000 --- a/client/3rd-prebuilt +++ b/client/3rd-prebuilt @@ -1 +1 @@ -Subproject commit c3ca525f92e57fecdd6047e35b4ccded8b173407 +Subproject commit 15b0ff395d9d372339c5ea8ea35cb2715b975ea9 From da02f498509c4f7ba4178ab9fbbdd92caf599647 Mon Sep 17 00:00:00 2001 From: ronoaer Date: Tue, 10 Oct 2023 08:43:56 +0800 Subject: [PATCH 037/108] update x value of topbutton when resize window --- client/ui/qml/Controls2/TopCloseButtonType.qml | 4 ++++ client/ui/qml/Pages2/PageStart.qml | 7 ++++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/client/ui/qml/Controls2/TopCloseButtonType.qml b/client/ui/qml/Controls2/TopCloseButtonType.qml index 4a738214..e29b0be4 100644 --- a/client/ui/qml/Controls2/TopCloseButtonType.qml +++ b/client/ui/qml/Controls2/TopCloseButtonType.qml @@ -5,6 +5,8 @@ import QtQuick.Shapes Popup { id: root + property alias buttonWidth: button.implicitWidth + modal: false closePolicy: Popup.NoAutoClose padding: 4 @@ -20,6 +22,8 @@ Popup { } ImageButtonType { + id: button + image: "qrc:/images/svg/close_black_24dp.svg" imageColor: "#D7D8DB" diff --git a/client/ui/qml/Pages2/PageStart.qml b/client/ui/qml/Pages2/PageStart.qml index 99132bf1..4af774fa 100644 --- a/client/ui/qml/Pages2/PageStart.qml +++ b/client/ui/qml/Pages2/PageStart.qml @@ -136,6 +136,11 @@ PageType { ServersModel.currentlyProcessedIndex = ServersModel.defaultIndex tabBarStackView.push(pagePath, { "objectName" : pagePath }) } + + onWidthChanged: { + topCloseButton.x = tabBarStackView.x + tabBarStackView.width - + topCloseButton.buttonWidth - topCloseButton.rightPadding + } } TabBar { @@ -231,7 +236,7 @@ PageType { TopCloseButtonType { id: topCloseButton - x: tabBarStackView.width - topCloseButton.width + x: tabBarStackView.width - topCloseButton.buttonWidth - topCloseButton.rightPadding z: 1 } From 9d6559f0d732008387936addf1e9c3061019bf59 Mon Sep 17 00:00:00 2001 From: "vladimir.kuznetsov" Date: Tue, 10 Oct 2023 12:50:41 +0500 Subject: [PATCH 038/108] fixed an error when after the first connection with admin config the container model was not updated --- client/amnezia_application.cpp | 2 + client/translations/amneziavpn_ru.ts | 54 ++++++++-------- client/translations/amneziavpn_zh_CN.ts | 86 ++++++++++++++++--------- client/ui/models/containers_model.cpp | 5 ++ client/ui/models/containers_model.h | 2 + client/vpnconnection.cpp | 1 + client/vpnconnection.h | 2 + 7 files changed, 95 insertions(+), 57 deletions(-) diff --git a/client/amnezia_application.cpp b/client/amnezia_application.cpp index 5b6d2491..4e6bce2b 100644 --- a/client/amnezia_application.cpp +++ b/client/amnezia_application.cpp @@ -279,6 +279,8 @@ void AmneziaApplication::initModels() { m_containersModel.reset(new ContainersModel(m_settings, this)); m_engine->rootContext()->setContextProperty("ContainersModel", m_containersModel.get()); + connect(m_vpnConnection.get(), &VpnConnection::newVpnConfigurationCreated, m_containersModel.get(), + &ContainersModel::updateContainersConfig); m_serversModel.reset(new ServersModel(m_settings, this)); m_engine->rootContext()->setContextProperty("ServersModel", m_serversModel.get()); diff --git a/client/translations/amneziavpn_ru.ts b/client/translations/amneziavpn_ru.ts index 47d0510f..27cb25e2 100644 --- a/client/translations/amneziavpn_ru.ts +++ b/client/translations/amneziavpn_ru.ts @@ -4,7 +4,7 @@ AmneziaApplication - + Split tunneling for WireGuard is not implemented, the option was disabled @@ -130,7 +130,7 @@ ImportController - + Scanned %1 of %2. @@ -162,32 +162,32 @@ Already installed containers were found on the server. All installed containers - + Settings updated successfully - + Server '%1' was removed - + All containers from server '%1' have been removed - + %1 has been removed from the server '%2' - + Please login as the user - + Server added successfully @@ -559,7 +559,7 @@ Already installed containers were found on the server. All installed containers - All users with whom you shared a connection will no longer be able to connect to it + All users who you shared a connection with will no longer be able to connect to it. @@ -607,7 +607,7 @@ Already installed containers were found on the server. All installed containers - All users with whom you shared a connection will no longer be able to connect to it + All users who you shared a connection with will no longer be able to connect to it. @@ -879,8 +879,12 @@ Already installed containers were found on the server. All installed containers - This is a free and open source application. If you like it, support the developers with a donation. -And if you don't like the app, all the more support it - the donation will be used to improve the app. + This is a free and open source application. If you like it, support the developers with a donation. + + + + + And if you don’t like the application, all the more reason to support it - the donation will be used for the improving the application. @@ -1056,7 +1060,7 @@ And if you don't like the app, all the more support it - the donation will - It will help you instantly restore connection settings at the next installation + You can save your settings to a backup file to restore them the next time you install the application. @@ -1150,7 +1154,7 @@ And if you don't like the app, all the more support it - the donation will - Allows you to connect to some sites through a secure connection, and to others bypassing it + Allows you to choose which sites you want to use the VPN for. @@ -1414,7 +1418,7 @@ And if you don't like the app, all the more support it - the donation will - All users with whom you shared a connection will no longer be able to connect to it + All users who you shared a connection with will no longer be able to connect to it. @@ -1800,27 +1804,27 @@ It's okay as long as it's from someone you trust. PageSetupWizardViewConfig - + New connection - + Do not use connection code from public sources. It could be created to intercept your data. - + Collapse content - + Show content - + Connect @@ -1853,6 +1857,7 @@ It's okay as long as it's from someone you trust. + Server @@ -1902,11 +1907,6 @@ It's okay as long as it's from someone you trust. Access to server management. The user with whom you share full access to the connection will be able to add and remove your protocols and services to the servers, as well as change settings. - - - Servers - - @@ -2627,7 +2627,7 @@ It's okay as long as it's from someone you trust. - + To read the QR code in the Amnezia app, select "Add server" → "I have data to connect" → "QR code, key or settings file" @@ -2719,7 +2719,7 @@ It's okay as long as it's from someone you trust. VpnConnection - + Mbps diff --git a/client/translations/amneziavpn_zh_CN.ts b/client/translations/amneziavpn_zh_CN.ts index e9d73b46..32d2d742 100644 --- a/client/translations/amneziavpn_zh_CN.ts +++ b/client/translations/amneziavpn_zh_CN.ts @@ -4,7 +4,7 @@ AmneziaApplication - + Split tunneling for WireGuard is not implemented, the option was disabled 未启用选项,还未实现基于WireGuard协议的VPN分流 @@ -30,9 +30,6 @@ - - - Connect 连接 @@ -133,7 +130,7 @@ ImportController - + Scanned %1 of %2. 扫描 %1 of %2. @@ -174,22 +171,22 @@ Already installed containers were found on the server. All installed containers 在服务上发现已经安装协议并添加到应用程序 - + Settings updated successfully 配置更新成功 - + Server '%1' was removed 已移除服务器 '%1' - + All containers from server '%1' have been removed 服务器 '%1' 的所有容器已移除 - + %1 has been removed from the server '%2' %1 已从服务器 '%2' 上移除 @@ -210,12 +207,12 @@ Already installed containers were found on the server. All installed containers 协议已从 - + Please login as the user 请以用户身份登录 - + Server added successfully 服务器添加成功 @@ -587,8 +584,12 @@ Already installed containers were found on the server. All installed containers + All users who you shared a connection with will no longer be able to connect to it. + + + All users with whom you shared a connection will no longer be able to connect to it - 与您共享连接的所有用户将无法再连接到此链接 + 与您共享连接的所有用户将无法再连接到此链接 @@ -633,14 +634,18 @@ Already installed containers were found on the server. All installed containers Remove %1 from server? 从服务器移除 %1 ? + + + All users who you shared a connection with will no longer be able to connect to it. + + from server? 从服务器 - All users with whom you shared a connection will no longer be able to connect to it - 与您共享连接的所有用户将无法再连接到此链接 + 与您共享连接的所有用户将无法再连接到此链接 @@ -907,12 +912,21 @@ Already installed containers were found on the server. All installed containers 捐款 - This is a free and open source application. If you like it, support the developers with a donation. And if you don't like the app, all the more support it - the donation will be used to improve the app. - 这是一个免费且开源的应用软件。如果您喜欢它,请捐助支持我们继续研发。 + 这是一个免费且开源的应用软件。如果您喜欢它,请捐助支持我们继续研发。 如果您不喜欢,请捐助支持我们改进它。 + + + This is a free and open source application. If you like it, support the developers with a donation. + + + + + And if you don’t like the application, all the more reason to support it - the donation will be used for the improving the application. + + Card on Patreon @@ -1085,9 +1099,13 @@ And if you don't like the app, all the more support it - the donation will 配置备份 - It will help you instantly restore connection settings at the next installation - 帮助您在下次安装时立即恢复连接设置 + 帮助您在下次安装时立即恢复连接设置 + + + + You can save your settings to a backup file to restore them the next time you install the application. + @@ -1184,8 +1202,12 @@ And if you don't like the app, all the more support it - the donation will + Allows you to choose which sites you want to use the VPN for. + + + Allows you to connect to some sites through a secure connection, and to others bypassing it - 使用VPN访问指定网站,其他的则绕过 + 使用VPN访问指定网站,其他的则绕过 @@ -1441,6 +1463,11 @@ And if you don't like the app, all the more support it - the donation will Remove 移除 + + + All users who you shared a connection with will no longer be able to connect to it. + + from server? 从服务器 @@ -1451,9 +1478,8 @@ And if you don't like the app, all the more support it - the donation will 从服务器移除 %1 ? - All users with whom you shared a connection will no longer be able to connect to it - 与您共享连接的所有用户将无法再连接到此链接 + 与您共享连接的所有用户将无法再连接到此链接 @@ -1839,27 +1865,27 @@ It's okay as long as it's from someone you trust. PageSetupWizardViewConfig - + New connection 新连接 - + Do not use connection code from public sources. It could be created to intercept your data. 请勿使用公共来源的连接代码。它可以被创建来拦截您的数据。 - + Collapse content - + Show content 展示内容 - + Connect 连接 @@ -1921,11 +1947,11 @@ It's okay as long as it's from someone you trust. 获得服务器完整授权 - Servers - 服务器 + 服务器 + Server 服务器 @@ -2678,7 +2704,7 @@ It's okay as long as it's from someone you trust. 展示内容 - + To read the QR code in the Amnezia app, select "Add server" → "I have data to connect" → "QR code, key or settings file" 要读取 Amnezia 应用程序中的二维码,请选择“添加服务器”→“我有数据要连接”→“二维码、密钥或配置文件” @@ -2770,7 +2796,7 @@ It's okay as long as it's from someone you trust. VpnConnection - + Mbps diff --git a/client/ui/models/containers_model.cpp b/client/ui/models/containers_model.cpp index 6cf855a6..0c99041e 100644 --- a/client/ui/models/containers_model.cpp +++ b/client/ui/models/containers_model.cpp @@ -228,6 +228,11 @@ bool ContainersModel::isAnyContainerInstalled() return false; } +void ContainersModel::updateContainersConfig() +{ + m_containers = m_settings->containers(m_currentlyProcessedServerIndex); +} + QHash ContainersModel::roleNames() const { QHash roles; diff --git a/client/ui/models/containers_model.h b/client/ui/models/containers_model.h index 2cc41cbf..cc549bb3 100644 --- a/client/ui/models/containers_model.h +++ b/client/ui/models/containers_model.h @@ -65,6 +65,8 @@ public slots: bool isAnyContainerInstalled(); + void updateContainersConfig(); + protected: QHash roleNames() const override; diff --git a/client/vpnconnection.cpp b/client/vpnconnection.cpp index 1cff01e6..46e8be60 100644 --- a/client/vpnconnection.cpp +++ b/client/vpnconnection.cpp @@ -323,6 +323,7 @@ void VpnConnection::connectToVpn(int serverIndex, const ServerCredentials &crede ErrorCode e = ErrorCode::NoError; m_vpnConfiguration = createVpnConfiguration(serverIndex, credentials, container, containerConfig, &e); + emit newVpnConfigurationCreated(); if (e) { emit connectionStateChanged(Vpn::ConnectionState::Error); return; diff --git a/client/vpnconnection.h b/client/vpnconnection.h index 20ee14fa..f6b2343c 100644 --- a/client/vpnconnection.h +++ b/client/vpnconnection.h @@ -79,6 +79,8 @@ signals: void serviceIsNotReady(); + void newVpnConfigurationCreated(); + protected slots: void onBytesChanged(quint64 receivedBytes, quint64 sentBytes); void onConnectionStateChanged(Vpn::ConnectionState state); From 5d59a1a10e19764bff4afc0f2e2e8a48c2972ece Mon Sep 17 00:00:00 2001 From: "vladimir.kuznetsov" Date: Tue, 10 Oct 2023 12:50:41 +0500 Subject: [PATCH 039/108] fixed an error when after the first connection with admin config the container model was not updated --- client/amnezia_application.cpp | 2 + client/translations/amneziavpn_ru.ts | 42 +++++++-------- client/translations/amneziavpn_zh_CN.ts | 71 +++++++++++++++++-------- client/ui/models/containers_model.cpp | 5 ++ client/ui/models/containers_model.h | 2 + client/vpnconnection.cpp | 1 + client/vpnconnection.h | 2 + 7 files changed, 83 insertions(+), 42 deletions(-) diff --git a/client/amnezia_application.cpp b/client/amnezia_application.cpp index d8039d9b..b8af9438 100644 --- a/client/amnezia_application.cpp +++ b/client/amnezia_application.cpp @@ -279,6 +279,8 @@ void AmneziaApplication::initModels() { m_containersModel.reset(new ContainersModel(m_settings, this)); m_engine->rootContext()->setContextProperty("ContainersModel", m_containersModel.get()); + connect(m_vpnConnection.get(), &VpnConnection::newVpnConfigurationCreated, m_containersModel.get(), + &ContainersModel::updateContainersConfig); m_serversModel.reset(new ServersModel(m_settings, this)); m_engine->rootContext()->setContextProperty("ServersModel", m_serversModel.get()); diff --git a/client/translations/amneziavpn_ru.ts b/client/translations/amneziavpn_ru.ts index 2f36f748..0e1d65df 100644 --- a/client/translations/amneziavpn_ru.ts +++ b/client/translations/amneziavpn_ru.ts @@ -4,7 +4,7 @@ AmneziaApplication - + Split tunneling for WireGuard is not implemented, the option was disabled @@ -130,7 +130,7 @@ ImportController - + Scanned %1 of %2. @@ -471,7 +471,7 @@ Already installed containers were found on the server. All installed containers - All users with whom you shared a connection will no longer be able to connect to it + All users who you shared a connection with will no longer be able to connect to it. @@ -519,7 +519,7 @@ Already installed containers were found on the server. All installed containers - All users with whom you shared a connection will no longer be able to connect to it + All users who you shared a connection with will no longer be able to connect to it. @@ -791,8 +791,12 @@ Already installed containers were found on the server. All installed containers - This is a free and open source application. If you like it, support the developers with a donation. -And if you don't like the app, all the more support it - the donation will be used to improve the app. + This is a free and open source application. If you like it, support the developers with a donation. + + + + + And if you don’t like the application, all the more reason to support it - the donation will be used for the improving the application. @@ -968,7 +972,7 @@ And if you don't like the app, all the more support it - the donation will - It will help you instantly restore connection settings at the next installation + You can save your settings to a backup file to restore them the next time you install the application. @@ -1062,7 +1066,7 @@ And if you don't like the app, all the more support it - the donation will - Allows you to connect to some sites through a secure connection, and to others bypassing it + Allows you to choose which sites you want to use the VPN for. @@ -1326,7 +1330,7 @@ And if you don't like the app, all the more support it - the donation will - All users with whom you shared a connection will no longer be able to connect to it + All users who you shared a connection with will no longer be able to connect to it. @@ -1712,27 +1716,27 @@ It's okay as long as it's from someone you trust. PageSetupWizardViewConfig - + New connection - + Do not use connection code from public sources. It could be created to intercept your data. - + Collapse content - + Show content - + Connect @@ -1765,6 +1769,7 @@ It's okay as long as it's from someone you trust. + Server @@ -1814,11 +1819,6 @@ It's okay as long as it's from someone you trust. Access to server management. The user with whom you share full access to the connection will be able to add and remove your protocols and services to the servers, as well as change settings. - - - Servers - - @@ -2533,7 +2533,7 @@ It's okay as long as it's from someone you trust. - + To read the QR code in the Amnezia app, select "Add server" → "I have data to connect" → "QR code, key or settings file" @@ -2617,7 +2617,7 @@ It's okay as long as it's from someone you trust. VpnConnection - + Mbps diff --git a/client/translations/amneziavpn_zh_CN.ts b/client/translations/amneziavpn_zh_CN.ts index c2376be0..645d281f 100644 --- a/client/translations/amneziavpn_zh_CN.ts +++ b/client/translations/amneziavpn_zh_CN.ts @@ -4,7 +4,7 @@ AmneziaApplication - + Split tunneling for WireGuard is not implemented, the option was disabled 未启用选项,还未实现基于WireGuard协议的VPN分流 @@ -130,7 +130,7 @@ ImportController - + Scanned %1 of %2. 扫描 %1 of %2. @@ -496,8 +496,12 @@ Already installed containers were found on the server. All installed containers + All users who you shared a connection with will no longer be able to connect to it. + + + All users with whom you shared a connection will no longer be able to connect to it - 与您共享连接的所有用户将无法再连接到此链接 + 与您共享连接的所有用户将无法再连接到此链接 @@ -542,14 +546,18 @@ Already installed containers were found on the server. All installed containers Remove %1 from server? 从服务器移除 %1 ? + + + All users who you shared a connection with will no longer be able to connect to it. + + from server? 从服务器 - All users with whom you shared a connection will no longer be able to connect to it - 与您共享连接的所有用户将无法再连接到此链接 + 与您共享连接的所有用户将无法再连接到此链接 @@ -816,12 +824,21 @@ Already installed containers were found on the server. All installed containers 捐款 - This is a free and open source application. If you like it, support the developers with a donation. And if you don't like the app, all the more support it - the donation will be used to improve the app. - 这是一个免费且开源的应用软件。如果您喜欢它,请捐助支持我们继续研发。 + 这是一个免费且开源的应用软件。如果您喜欢它,请捐助支持我们继续研发。 如果您不喜欢,请捐助支持我们改进它。 + + + This is a free and open source application. If you like it, support the developers with a donation. + + + + + And if you don’t like the application, all the more reason to support it - the donation will be used for the improving the application. + + Card on Patreon @@ -994,9 +1011,13 @@ And if you don't like the app, all the more support it - the donation will 配置备份 - It will help you instantly restore connection settings at the next installation - 帮助您在下次安装时立即恢复连接设置 + 帮助您在下次安装时立即恢复连接设置 + + + + You can save your settings to a backup file to restore them the next time you install the application. + @@ -1093,8 +1114,12 @@ And if you don't like the app, all the more support it - the donation will + Allows you to choose which sites you want to use the VPN for. + + + Allows you to connect to some sites through a secure connection, and to others bypassing it - 使用VPN访问指定网站,其他的则绕过 + 使用VPN访问指定网站,其他的则绕过 @@ -1350,6 +1375,11 @@ And if you don't like the app, all the more support it - the donation will Remove 移除 + + + All users who you shared a connection with will no longer be able to connect to it. + + from server? 从服务器 @@ -1360,9 +1390,8 @@ And if you don't like the app, all the more support it - the donation will 从服务器移除 %1 ? - All users with whom you shared a connection will no longer be able to connect to it - 与您共享连接的所有用户将无法再连接到此链接 + 与您共享连接的所有用户将无法再连接到此链接 @@ -1748,27 +1777,27 @@ It's okay as long as it's from someone you trust. PageSetupWizardViewConfig - + New connection 新连接 - + Do not use connection code from public sources. It could be created to intercept your data. 请勿使用公共来源的连接代码。它可以被创建来拦截您的数据。 - + Collapse content - + Show content 展示内容 - + Connect 连接 @@ -1830,11 +1859,11 @@ It's okay as long as it's from someone you trust. 获得服务器完整授权 - Servers - 服务器 + 服务器 + Server 服务器 @@ -2581,7 +2610,7 @@ It's okay as long as it's from someone you trust. 展示内容 - + To read the QR code in the Amnezia app, select "Add server" → "I have data to connect" → "QR code, key or settings file" 要读取 Amnezia 应用程序中的二维码,请选择“添加服务器”→“我有数据要连接”→“二维码、密钥或配置文件” @@ -2665,7 +2694,7 @@ It's okay as long as it's from someone you trust. VpnConnection - + Mbps diff --git a/client/ui/models/containers_model.cpp b/client/ui/models/containers_model.cpp index 6cf855a6..0c99041e 100644 --- a/client/ui/models/containers_model.cpp +++ b/client/ui/models/containers_model.cpp @@ -228,6 +228,11 @@ bool ContainersModel::isAnyContainerInstalled() return false; } +void ContainersModel::updateContainersConfig() +{ + m_containers = m_settings->containers(m_currentlyProcessedServerIndex); +} + QHash ContainersModel::roleNames() const { QHash roles; diff --git a/client/ui/models/containers_model.h b/client/ui/models/containers_model.h index 2cc41cbf..cc549bb3 100644 --- a/client/ui/models/containers_model.h +++ b/client/ui/models/containers_model.h @@ -65,6 +65,8 @@ public slots: bool isAnyContainerInstalled(); + void updateContainersConfig(); + protected: QHash roleNames() const override; diff --git a/client/vpnconnection.cpp b/client/vpnconnection.cpp index 1cff01e6..46e8be60 100644 --- a/client/vpnconnection.cpp +++ b/client/vpnconnection.cpp @@ -323,6 +323,7 @@ void VpnConnection::connectToVpn(int serverIndex, const ServerCredentials &crede ErrorCode e = ErrorCode::NoError; m_vpnConfiguration = createVpnConfiguration(serverIndex, credentials, container, containerConfig, &e); + emit newVpnConfigurationCreated(); if (e) { emit connectionStateChanged(Vpn::ConnectionState::Error); return; diff --git a/client/vpnconnection.h b/client/vpnconnection.h index 20ee14fa..f6b2343c 100644 --- a/client/vpnconnection.h +++ b/client/vpnconnection.h @@ -79,6 +79,8 @@ signals: void serviceIsNotReady(); + void newVpnConfigurationCreated(); + protected slots: void onBytesChanged(quint64 receivedBytes, quint64 sentBytes); void onConnectionStateChanged(Vpn::ConnectionState state); From fa06dbbd291712c5fa1aba2f32fabf03e45a01e1 Mon Sep 17 00:00:00 2001 From: Mykola Baibuz Date: Tue, 10 Oct 2023 08:52:36 -0400 Subject: [PATCH 040/108] Bump Android verion --- client/android/build.gradle | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/client/android/build.gradle b/client/android/build.gradle index cfc53460..49e378a0 100644 --- a/client/android/build.gradle +++ b/client/android/build.gradle @@ -138,8 +138,8 @@ android { resConfig "en" minSdkVersion = 24 targetSdkVersion = 34 - versionCode 32 // Change to a higher number - versionName "3.0.9" // Change to a higher number + versionCode 36 // Change to a higher number + versionName "4.0.8" // Change to a higher number javaCompileOptions.annotationProcessorOptions.arguments = [ "room.schemaLocation": "${qtAndroidDir}/schemas".toString() From d92729d346e14a7ee8ad3ba646202605d9642789 Mon Sep 17 00:00:00 2001 From: pokamest Date: Wed, 11 Oct 2023 15:30:55 +0100 Subject: [PATCH 041/108] Fix install_docker.sh --- client/server_scripts/install_docker.sh | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/client/server_scripts/install_docker.sh b/client/server_scripts/install_docker.sh index d8284dfd..e780dac5 100644 --- a/client/server_scripts/install_docker.sh +++ b/client/server_scripts/install_docker.sh @@ -5,9 +5,9 @@ else echo "Packet manager not found"; exit 1; fi;\ echo "Dist: $dist, Packet manager: $pm, Docker pkg: $docker_pkg";\ if [ "$dist" = "debian" ]; then export DEBIAN_FRONTEND=noninteractive; fi;\ if ! command -v sudo > /dev/null 2>&1; then $pm update -yq; $pm install -yq sudo; fi;\ -if ! command -v fuser > /dev/null 2>&1; then $pm install -yq psmisc; fi;\ -if ! command -v lsof > /dev/null 2>&1; then $pm install -yq lsof; fi;\ -if ! command -v docker > /dev/null 2>&1; then $pm update -yq; $pm install -yq $docker_pkg;\ +if ! command -v fuser > /dev/null 2>&1; then sudo $pm install -yq psmisc; fi;\ +if ! command -v lsof > /dev/null 2>&1; then sudo $pm install -yq lsof; fi;\ +if ! command -v docker > /dev/null 2>&1; then sudo $pm update -yq; sudo $pm install -yq $docker_pkg;\ if [ "$dist" = "fedora" ] || [ "$dist" = "debian" ]; then sudo systemctl enable docker && sudo systemctl start docker; fi;\ fi;\ if [ "$dist" = "debian" ]; then \ @@ -17,4 +17,3 @@ if [ "$dist" = "debian" ]; then \ fi;\ if ! command -v sudo > /dev/null 2>&1; then echo "Failed to install Docker";exit 1;fi;\ docker --version - From 10435cea69b369fc6c85b633582b6e34ffa6b698 Mon Sep 17 00:00:00 2001 From: pokamest Date: Thu, 12 Oct 2023 01:15:05 +0100 Subject: [PATCH 042/108] Tiny refactoring and text fixes --- .../configurators/wireguard_configurator.cpp | 2 +- client/core/scripts_registry.cpp | 4 +- client/core/scripts_registry.h | 2 +- client/resources.qrc | 10 ++-- .../{amnezia_wireguard => awg}/Dockerfile | 0 .../configure_container.sh | 0 .../run_container.sh | 0 .../{amnezia_wireguard => awg}/start.sh | 0 .../{amnezia_wireguard => awg}/template.conf | 0 client/translations/amneziavpn_ru.ts | 28 ++++------- client/translations/amneziavpn_zh_CN.ts | 48 +++++++++++-------- client/ui/qml/Pages2/PageSettings.qml | 2 + .../ui/qml/Pages2/PageSettingsConnection.qml | 9 ++-- .../qml/Pages2/PageSettingsSplitTunneling.qml | 6 +-- deploy/build_windows.bat | 2 +- 15 files changed, 58 insertions(+), 55 deletions(-) rename client/server_scripts/{amnezia_wireguard => awg}/Dockerfile (100%) rename client/server_scripts/{amnezia_wireguard => awg}/configure_container.sh (100%) rename client/server_scripts/{amnezia_wireguard => awg}/run_container.sh (100%) rename client/server_scripts/{amnezia_wireguard => awg}/start.sh (100%) rename client/server_scripts/{amnezia_wireguard => awg}/template.conf (100%) diff --git a/client/configurators/wireguard_configurator.cpp b/client/configurators/wireguard_configurator.cpp index a526e109..e22c8282 100644 --- a/client/configurators/wireguard_configurator.cpp +++ b/client/configurators/wireguard_configurator.cpp @@ -28,7 +28,7 @@ WireguardConfigurator::WireguardConfigurator(std::shared_ptr settings, : amnezia::protocols::wireguard::serverPublicKeyPath; m_serverPskKeyPath = m_isAwg ? amnezia::protocols::awg::serverPskKeyPath : amnezia::protocols::wireguard::serverPskKeyPath; - m_configTemplate = m_isAwg ? ProtocolScriptType::amnezia_wireguard_template + m_configTemplate = m_isAwg ? ProtocolScriptType::awg_template : ProtocolScriptType::wireguard_template; m_protocolName = m_isAwg ? config_key::awg : config_key::wireguard; diff --git a/client/core/scripts_registry.cpp b/client/core/scripts_registry.cpp index 82ae1fce..f209a2b1 100644 --- a/client/core/scripts_registry.cpp +++ b/client/core/scripts_registry.cpp @@ -11,7 +11,7 @@ QString amnezia::scriptFolder(amnezia::DockerContainer container) case DockerContainer::Cloak: return QLatin1String("openvpn_cloak"); case DockerContainer::ShadowSocks: return QLatin1String("openvpn_shadowsocks"); case DockerContainer::WireGuard: return QLatin1String("wireguard"); - case DockerContainer::Awg: return QLatin1String("amnezia_wireguard"); + case DockerContainer::Awg: return QLatin1String("awg"); case DockerContainer::Ipsec: return QLatin1String("ipsec"); case DockerContainer::TorWebSite: return QLatin1String("website_tor"); @@ -46,7 +46,7 @@ QString amnezia::scriptName(ProtocolScriptType type) case ProtocolScriptType::container_startup: return QLatin1String("start.sh"); case ProtocolScriptType::openvpn_template: return QLatin1String("template.ovpn"); case ProtocolScriptType::wireguard_template: return QLatin1String("template.conf"); - case ProtocolScriptType::amnezia_wireguard_template: return QLatin1String("template.conf"); + case ProtocolScriptType::awg_template: return QLatin1String("template.conf"); } } diff --git a/client/core/scripts_registry.h b/client/core/scripts_registry.h index 5c7a1b6a..02fc94fd 100644 --- a/client/core/scripts_registry.h +++ b/client/core/scripts_registry.h @@ -27,7 +27,7 @@ enum ProtocolScriptType { container_startup, openvpn_template, wireguard_template, - amnezia_wireguard_template + awg_template }; diff --git a/client/resources.qrc b/client/resources.qrc index 1b639266..4c63383c 100644 --- a/client/resources.qrc +++ b/client/resources.qrc @@ -217,10 +217,10 @@ ui/qml/Controls2/TopCloseButtonType.qml images/controls/x-circle.svg ui/qml/Pages2/PageProtocolAwgSettings.qml - server_scripts/amnezia_wireguard/template.conf - server_scripts/amnezia_wireguard/start.sh - server_scripts/amnezia_wireguard/configure_container.sh - server_scripts/amnezia_wireguard/run_container.sh - server_scripts/amnezia_wireguard/Dockerfile + server_scripts/awg/template.conf + server_scripts/awg/start.sh + server_scripts/awg/configure_container.sh + server_scripts/awg/run_container.sh + server_scripts/awg/Dockerfile diff --git a/client/server_scripts/amnezia_wireguard/Dockerfile b/client/server_scripts/awg/Dockerfile similarity index 100% rename from client/server_scripts/amnezia_wireguard/Dockerfile rename to client/server_scripts/awg/Dockerfile diff --git a/client/server_scripts/amnezia_wireguard/configure_container.sh b/client/server_scripts/awg/configure_container.sh similarity index 100% rename from client/server_scripts/amnezia_wireguard/configure_container.sh rename to client/server_scripts/awg/configure_container.sh diff --git a/client/server_scripts/amnezia_wireguard/run_container.sh b/client/server_scripts/awg/run_container.sh similarity index 100% rename from client/server_scripts/amnezia_wireguard/run_container.sh rename to client/server_scripts/awg/run_container.sh diff --git a/client/server_scripts/amnezia_wireguard/start.sh b/client/server_scripts/awg/start.sh similarity index 100% rename from client/server_scripts/amnezia_wireguard/start.sh rename to client/server_scripts/awg/start.sh diff --git a/client/server_scripts/amnezia_wireguard/template.conf b/client/server_scripts/awg/template.conf similarity index 100% rename from client/server_scripts/amnezia_wireguard/template.conf rename to client/server_scripts/awg/template.conf diff --git a/client/translations/amneziavpn_ru.ts b/client/translations/amneziavpn_ru.ts index 27cb25e2..c46bebd9 100644 --- a/client/translations/amneziavpn_ru.ts +++ b/client/translations/amneziavpn_ru.ts @@ -1149,7 +1149,12 @@ Already installed containers were found on the server. All installed containers - Split site tunneling + Split tunneling + + + + + App-based split tunneling @@ -1157,11 +1162,6 @@ Already installed containers were found on the server. All installed containers Allows you to choose which sites you want to use the VPN for. - - - Separate application tunneling - - Allows you to use the VPN only for certain applications @@ -1444,17 +1444,17 @@ Already installed containers were found on the server. All installed containers PageSettingsSplitTunneling - Only the addresses in the list must be opened via VPN + Addresses from the list should be accessed via VPN - Addresses from the list should never be opened via VPN + Addresses from the list should not be accessed via VPN - Split site tunneling + Split tunneling @@ -2542,16 +2542,6 @@ It's okay as long as it's from someone you trust. error 0x%1: %2 - - - WireGuard Configuration Highlighter - - - - - &Randomize colors - - SelectLanguageDrawer diff --git a/client/translations/amneziavpn_zh_CN.ts b/client/translations/amneziavpn_zh_CN.ts index 32d2d742..b4855a72 100644 --- a/client/translations/amneziavpn_zh_CN.ts +++ b/client/translations/amneziavpn_zh_CN.ts @@ -1197,8 +1197,17 @@ And if you don't like the app, all the more support it - the donation will + Split tunneling + + + + + App-based split tunneling + + + Split site tunneling - 网站级VPN分流 + 网站级VPN分流 @@ -1210,9 +1219,8 @@ And if you don't like the app, all the more support it - the donation will 使用VPN访问指定网站,其他的则绕过 - Separate application tunneling - 应用级VPN分流 + 应用级VPN分流 @@ -1503,19 +1511,31 @@ And if you don't like the app, all the more support it - the donation will PageSettingsSplitTunneling - Only the addresses in the list must be opened via VPN - 仅列表中的地址须通过VPN访问 + 仅列表中的地址须通过VPN访问 + + + Addresses from the list should never be opened via VPN + 勿通过VPN访问列表中的地址 + + + Split site tunneling + 网站级VPN分流 + + + + Addresses from the list should be accessed via VPN + - Addresses from the list should never be opened via VPN - 勿通过VPN访问列表中的地址 + Addresses from the list should not be accessed via VPN + - Split site tunneling - 网站级VPN分流 + Split tunneling + @@ -2615,16 +2635,6 @@ It's okay as long as it's from someone you trust. error 0x%1: %2 错误 0x%1: %2 - - - WireGuard Configuration Highlighter - - - - - &Randomize colors - - SelectLanguageDrawer diff --git a/client/ui/qml/Pages2/PageSettings.qml b/client/ui/qml/Pages2/PageSettings.qml index a806d472..d90f3ec8 100644 --- a/client/ui/qml/Pages2/PageSettings.qml +++ b/client/ui/qml/Pages2/PageSettings.qml @@ -95,6 +95,7 @@ PageType { DividerType {} LabelWithButtonType { + id: about Layout.fillWidth: true text: qsTr("About AmneziaVPN") @@ -110,6 +111,7 @@ PageType { LabelWithButtonType { Layout.fillWidth: true + Layout.preferredHeight: about.height text: qsTr("Close application") leftImageSource: "qrc:/images/controls/x-circle.svg" diff --git a/client/ui/qml/Pages2/PageSettingsConnection.qml b/client/ui/qml/Pages2/PageSettingsConnection.qml index 374e1ce4..b5343d24 100644 --- a/client/ui/qml/Pages2/PageSettingsConnection.qml +++ b/client/ui/qml/Pages2/PageSettingsConnection.qml @@ -96,8 +96,8 @@ PageType { LabelWithButtonType { Layout.fillWidth: true - text: qsTr("Split site tunneling") - descriptionText: qsTr("Allows you to choose which sites you want to use the VPN for.") + text: qsTr("Site-based split tunneling") + descriptionText: qsTr("Allows you to select which sites you want to access through the VPN") rightImageSource: "qrc:/images/controls/chevron-right.svg" clickedFunction: function() { @@ -109,8 +109,9 @@ PageType { LabelWithButtonType { Layout.fillWidth: true + visible: false - text: qsTr("Separate application tunneling") + text: qsTr("App-based split tunneling") descriptionText: qsTr("Allows you to use the VPN only for certain applications") rightImageSource: "qrc:/images/controls/chevron-right.svg" @@ -118,7 +119,7 @@ PageType { } } - DividerType {} + // DividerType {} } } } diff --git a/client/ui/qml/Pages2/PageSettingsSplitTunneling.qml b/client/ui/qml/Pages2/PageSettingsSplitTunneling.qml index b79d5d22..45f2dae9 100644 --- a/client/ui/qml/Pages2/PageSettingsSplitTunneling.qml +++ b/client/ui/qml/Pages2/PageSettingsSplitTunneling.qml @@ -46,12 +46,12 @@ PageType { QtObject { id: onlyForwardSites - property string name: qsTr("Only the addresses in the list must be opened via VPN") + property string name: qsTr("Addresses from the list should be accessed via VPN") property int type: routeMode.onlyForwardSites } QtObject { id: allExceptSites - property string name: qsTr("Addresses from the list should never be opened via VPN") + property string name: qsTr("Addresses from the list should not be accessed via VPN") property int type: routeMode.allExceptSites } @@ -81,7 +81,7 @@ PageType { Layout.fillWidth: true Layout.leftMargin: 16 - headerText: qsTr("Split site tunneling") + headerText: qsTr("Split tunneling") } SwitcherType { diff --git a/deploy/build_windows.bat b/deploy/build_windows.bat index c4b7b8cf..7ac37f14 100644 --- a/deploy/build_windows.bat +++ b/deploy/build_windows.bat @@ -47,7 +47,7 @@ cd %PROJECT_DIR% call "%QT_BIN_DIR:"=%\qt-cmake" . -B %WORK_DIR% cd %WORK_DIR% -cmake --build . --config release +cmake --build . --config release -- /p:UseMultiToolTask=true /m if %errorlevel% neq 0 exit /b %errorlevel% cmake --build . --target clean From a4624c7377c975e14957dc41b34345240d2d0c15 Mon Sep 17 00:00:00 2001 From: "vladimir.kuznetsov" Date: Thu, 12 Oct 2023 10:57:13 +0500 Subject: [PATCH 043/108] removed the close button for the app for mobile platforms --- client/ui/qml/Pages2/PageSettings.qml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/client/ui/qml/Pages2/PageSettings.qml b/client/ui/qml/Pages2/PageSettings.qml index a806d472..387f5ffa 100644 --- a/client/ui/qml/Pages2/PageSettings.qml +++ b/client/ui/qml/Pages2/PageSettings.qml @@ -109,6 +109,7 @@ PageType { DividerType {} LabelWithButtonType { + visible: GC.isMobile() Layout.fillWidth: true text: qsTr("Close application") @@ -120,7 +121,9 @@ PageType { } } - DividerType {} + DividerType { + visible: GC.isMobile() + } } } } From d1f66cbf4d64549a340d682b5f1d3da361160479 Mon Sep 17 00:00:00 2001 From: ronoaer Date: Thu, 12 Oct 2023 16:26:37 +0800 Subject: [PATCH 044/108] updated translations for branch feature/amnezia-wireguard-client-impl --- client/translations/amneziavpn_ru.ts | 29 +- client/translations/amneziavpn_zh_CN.ts | 1061 +++++++++-------- client/ui/controllers/sitesController.cpp | 2 +- client/ui/qml/Pages2/PageProtocolRaw.qml | 2 +- .../ui/qml/Pages2/PageSettingsApplication.qml | 2 +- 5 files changed, 550 insertions(+), 546 deletions(-) diff --git a/client/translations/amneziavpn_ru.ts b/client/translations/amneziavpn_ru.ts index c46bebd9..ac099552 100644 --- a/client/translations/amneziavpn_ru.ts +++ b/client/translations/amneziavpn_ru.ts @@ -592,7 +592,7 @@ Already installed containers were found on the server. All installed containers - Connection options + Connection options %1 @@ -860,12 +860,12 @@ Already installed containers were found on the server. All installed containers - + About AmneziaVPN - + Close application @@ -977,12 +977,7 @@ Already installed containers were found on the server. All installed containers - Launch the application every time - - - - - starts + Launch the application every time %1 starts @@ -1149,21 +1144,21 @@ Already installed containers were found on the server. All installed containers - Split tunneling - - - - - App-based split tunneling + Site-based split tunneling - Allows you to choose which sites you want to use the VPN for. + Allows you to select which sites you want to access through the VPN + App-based split tunneling + + + + Allows you to use the VPN only for certain applications @@ -2651,7 +2646,7 @@ It's okay as long as it's from someone you trust. - The JSON data is not an array in file: + The JSON data is not an array in file: %1 diff --git a/client/translations/amneziavpn_zh_CN.ts b/client/translations/amneziavpn_zh_CN.ts index b4855a72..7a08682c 100644 --- a/client/translations/amneziavpn_zh_CN.ts +++ b/client/translations/amneziavpn_zh_CN.ts @@ -6,7 +6,7 @@ Split tunneling for WireGuard is not implemented, the option was disabled - 未启用选项,还未实现基于WireGuard协议的VPN分流 + 未启用选项,还未实现基于WireGuard协议的VPN分离 @@ -14,13 +14,13 @@ AmneziaVPN - + VPN Connected Refers to the app - which is currently running the background and waiting - VPN已连接 + VPN已连接 @@ -31,38 +31,38 @@ Connect - 连接 + 连接 VPN Protocols is not installed. Please install VPN container at first - 不存在VPN协议,请先安装 + 请先安装VPN协议 Connection... - 连接中 + 连接中 Connected - 已连接 + 已连接 Reconnection... - 重连中 + 重连中 Disconnection... - 断开中 + 断开中 Settings updated successfully, Reconnnection... - 配置已更新,重连中 + 配置已更新,重连中 @@ -70,17 +70,17 @@ Connection data - 连接数据 + 连接方式 Server IP, login and password - 服务器IP,用户名和密码 + 服务器IP,用户名和密码 QR code, key or configuration file - 二维码,授权码或者配置文件 + 二维码,授权码或者配置文件 @@ -88,22 +88,22 @@ C&ut - 剪切 + 剪切 &Copy - 拷贝 + 拷贝 &Paste - 粘贴 + 粘贴 &SelectAll - 全选 + 全选 @@ -111,7 +111,7 @@ Access error! - 访问错误 + 访问错误 @@ -119,12 +119,12 @@ The selected protocol is not supported on the current platform - 当前平台不支持所选协议 + 当前平台不支持所选协议 Reconnect via VPN Procotol: - 重连基于VPN协议: + 重连VPN基于协议: @@ -132,7 +132,7 @@ Scanned %1 of %2. - 扫描 %1 of %2. + 扫描 %1 of %2. @@ -149,46 +149,46 @@ %1 installed successfully. - %1 安装成功。 + %1 安装成功。 %1 is already installed on the server. - 服务器上已经安装 %1。 + 服务器上已经安装 %1。 Added containers that were already installed on the server - + 添加已安装在服务器上的容器 Already installed containers were found on the server. All installed containers have been added to the application - -在服务上发现已经安装协议并添加到应用程序 + +在服务上发现已经安装协议并添加至应用 Settings updated successfully - 配置更新成功 + 配置更新成功 Server '%1' was removed - 已移除服务器 '%1' + 已移除服务器 '%1' All containers from server '%1' have been removed - 服务器 '%1' 的所有容器已移除 + 服务器 '%1' 的所有容器已移除 %1 has been removed from the server '%2' - %1 已从服务器 '%2' 上移除 + %1 已从服务器 '%2' 上移除 1% has been removed from the server '%2' @@ -209,12 +209,12 @@ Already installed containers were found on the server. All installed containers Please login as the user - 请以用户身份登录 + 请以用户身份登录 Server added successfully - 服务器添加成功 + 增加服务器成功 @@ -222,17 +222,17 @@ Already installed containers were found on the server. All installed containers Read key failed: %1 - 获取授权码失败: %1 + 获取授权码失败: %1 Write key failed: %1 - 写入授权码失败: %1 + 写入授权码失败: %1 Delete key failed: %1 - 删除授权码失败: %1 + 删除授权码失败: %1 @@ -241,27 +241,27 @@ Already installed containers were found on the server. All installed containers AmneziaVPN - + VPN Connected - 已连接到VPN + 已连接到VPN VPN Disconnected - 已从VPN断开 + 已从VPN断开 AmneziaVPN notification - AmneziaVPN 提示 + AmneziaVPN 提示 Unsecured network detected: - 发现不安全网络 + 发现不安全网络 @@ -269,12 +269,12 @@ Already installed containers were found on the server. All installed containers Removing services from %1 - 正从 %1 移除服务 + 正从 %1 移除服务 Usually it takes no more than 5 minutes - 通常5分钟之内完成 + 大约5分钟之内完成 @@ -282,12 +282,12 @@ Already installed containers were found on the server. All installed containers VPN protocol - VPN协议 + VPN协议 Servers - 服务器 + 服务器 @@ -295,87 +295,87 @@ Already installed containers were found on the server. All installed containers AmneziaWG settings - + AmneziaWG 配置 Port - 端口 + 端口 Junk packet count - + 垃圾包数量 Junk packet minimum size - + 垃圾包最小值 Junk packet maximum size - + 垃圾包最大值 Init packet junk size - + 初始化垃圾包大小 Response packet junk size - + 响应垃圾包大小 Init packet magic header - + 初始化数据包魔数头 Response packet magic header - + 响应包魔数头 Transport packet magic header - + 传输包魔数头 Underload packet magic header - + 低负载数据包魔数头 Remove AmneziaWG - + 移除AmneziaWG Remove AmneziaWG from server? - + 从服务上移除AmneziaWG? All users who you shared a connection with will no longer be able to connect to it. - + 使用此共享连接的所有用户,将无法再连接它。 Continue - 继续 + 继续 Cancel - 取消 + 取消 Save and Restart Amnezia - 保存并重启Amnezia + 保存并重启Amnezia @@ -383,28 +383,28 @@ Already installed containers were found on the server. All installed containers Cloak settings - Cloak 配置 + Cloak 配置 Disguised as traffic from - 伪装流量来自 + 伪装流量为 Port - 端口 + 端口 Cipher - 解码 + 加密算法 Save and Restart Amnezia - 保存并重启Amnezia + 保存并重启Amnezia @@ -412,180 +412,180 @@ Already installed containers were found on the server. All installed containers OpenVPN settings - OpenVPN 配置 + OpenVPN 配置 VPN Addresses Subnet - VPN子网掩码 + VPN子网掩码 Network protocol - 网络协议 + 网络协议 Port - 端口 + 端口 Auto-negotiate encryption - 自动协商加密 + 自定义加密方式 Hash - + SHA512 - + SHA384 - + SHA256 - + SHA3-512 - + SHA3-384 - + SHA3-256 - + whirlpool - + BLAKE2b512 - + BLAKE2s256 - + SHA1 - + Cipher - 解码 + AES-256-GCM - + AES-192-GCM - + AES-128-GCM - + AES-256-CBC - + AES-192-CBC - + AES-128-CBC - + ChaCha20-Poly1305 - + ARIA-256-CBC - + CAMELLIA-256-CBC - + none - + TLS auth - TLS认证 + TLS认证 Block DNS requests outside of VPN - 阻止VPN外的DNS请求 + 阻止VPN外的DNS请求 Additional client configuration commands - 附加客户端配置命令 + 附加客户端配置命令 Commands: - 命令: + 命令: Additional server configuration commands - 附加服务器端配置命令 + 附加服务器端配置命令 Remove OpenVPN - 移除OpenVPN + 移除OpenVPN Remove OpenVpn from server? - 从服务器移除OpenVPN吗? + 从服务器移除OpenVPN吗? All users who you shared a connection with will no longer be able to connect to it. - + 使用此共享连接的所有用户,将无法再连接它。 All users with whom you shared a connection will no longer be able to connect to it @@ -594,17 +594,17 @@ Already installed containers were found on the server. All installed containers Continue - 继续 + 继续 Cancel - 取消 + 取消 Save and Restart Amnezia - 保存并重启Amnezia + 保存并重启Amnezia @@ -612,32 +612,36 @@ Already installed containers were found on the server. All installed containers settings - 配置 + 配置 Show connection options - 展示连接选项 + 显示连接选项 + + + Connection options + 连接选项 - Connection options - 连接选项 + Connection options %1 + %1 连接选项 Remove - 移除 + 移除 Remove %1 from server? - 从服务器移除 %1 ? + 从服务器移除 %1 ? All users who you shared a connection with will no longer be able to connect to it. - + 使用此共享连接的所有用户,将无法再连接它。 from server? @@ -650,12 +654,12 @@ Already installed containers were found on the server. All installed containers Continue - 继续 + 继续 Cancel - 取消 + 取消 @@ -663,23 +667,23 @@ Already installed containers were found on the server. All installed containers ShadowSocks settings - ShadowSocks 配置 + ShadowSocks 配置 Port - 端口 + 端口 Cipher - 解码 + 加密算法 Save and Restart Amnezia - 保存并重启Amnezia + 保存并重启Amnezia @@ -688,22 +692,23 @@ Already installed containers were found on the server. All installed containers A DNS service is installed on your server, and it is only accessible via VPN. - 您的服务器上安装了DNS服务,并且只能通过VPN访问。 + 您的服务器已安装DNS服务,仅能通过VPN访问。 + The DNS address is the same as the address of your server. You can configure DNS in the settings, under the connections tab. - DNS地址与您的服务器地址相同。您可以在连接选项卡下的设置中配置 DNS + 其地址与您的服务器地址相同。您可以在 设置 连接 中进行配置。 Remove - 移除 + 移除 Remove %1 from server? - 从服务器移除 %1 ? + 从服务器移除 %1 ? from server? @@ -712,12 +717,12 @@ Already installed containers were found on the server. All installed containers Continue - 继续 + 继续 Cancel - 取消 + 取消 @@ -725,17 +730,17 @@ Already installed containers were found on the server. All installed containers Settings updated successfully - 配置更新成功 + 配置更新成功 SFTP settings - SFTP 配置 + SFTP 配置 Host - 主机 + 主机 @@ -743,69 +748,69 @@ Already installed containers were found on the server. All installed containers Copied - 拷贝 + 拷贝 Port - 端口 + 端口 Login - 用户 + 用户 Password - 密码 + 密码 Mount folder on device - 在设备上挂载文件夹 + 挂载文件夹 In order to mount remote SFTP folder as local drive, perform following steps: <br> - 要将远程 SFTP 文件夹安装为本地驱动器,请执行以下步骤: <br> + 为将远程 SFTP 文件夹挂载到本地,请执行以下步骤: <br> <br>1. Install the latest version of - <br>1. 安装最新版的 + <br>1. 安装最新版的 <br>2. Install the latest version of - <br>2. 安装最新版的 + <br>2. 安装最新版的 Detailed instructions - 详细说明 + 详细说明 Remove SFTP and all data stored there - 移除SFTP和其本地所有数据 + 移除SFTP和其本地所有数据 Remove SFTP and all data stored there? - 移除SFTP和其本地所有数据? + 移除SFTP和其本地所有数据? Continue - 继续 + 继续 Cancel - 取消 + 取消 @@ -813,57 +818,57 @@ Already installed containers were found on the server. All installed containers Settings updated successfully - 配置更新成功 + 配置更新成功 Tor website settings - Tor网站配置 + Tor网站配置 Website address - 网址 + 网址 Copied - 拷贝 + 已拷贝 Use <a href="https://www.torproject.org/download/" style="color: #FBB26A;">Tor Browser</a> to open this url. - 用 <a href="https://www.torproject.org/download/" style="color: #FBB26A;">Tor 浏览器</a> 打开上面网址 + 用 <a href="https://www.torproject.org/download/" style="color: #FBB26A;">Tor 浏览器</a> 打开上面网址 After installation it takes several minutes while your onion site will become available in the Tor Network. - 安装几分钟后,洋葱站点才会在 Tor 网络中生效。 + 完成安装几分钟后,洋葱站点才会在 Tor 网络中生效。 When configuring WordPress set the domain as this onion address. - 配置 WordPress 时,将域设置为此洋葱地址。 + 配置 WordPress 时,将域设置为此洋葱地址。 Remove website - 移除网站 + 移除网站 The site with all data will be removed from the tor network. - 网站及其所有数据将从 Tor 网络中删除 + 网站及其所有数据将从 Tor 网络中删除 Continue - 继续 + 继续 Cancel - 取消 + 取消 @@ -871,37 +876,37 @@ Already installed containers were found on the server. All installed containers Settings - 设置 + 设置 Servers - 服务器 + 服务器 Connection - 连接 + 连接 Application - 应用 + 应用 Backup - 备份 + 备份 - + About AmneziaVPN - 关于 + 关于 - + Close application - + 关闭应用 @@ -909,7 +914,7 @@ Already installed containers were found on the server. All installed containers Support the project with a donation - 捐款 + 捐款 This is a free and open source application. If you like it, support the developers with a donation. @@ -920,82 +925,83 @@ And if you don't like the app, all the more support it - the donation will This is a free and open source application. If you like it, support the developers with a donation. - + 这是一个免费且开源的软件。如果您喜欢它,请捐助开发者们。 + And if you don’t like the application, all the more reason to support it - the donation will be used for the improving the application. - + 如果您不喜欢,请捐助支持我们改进它。 Card on Patreon - Patreon订阅 + Patreon订阅 https://www.patreon.com/amneziavpn - + Show other methods on Github - 其他捐款途径 + 其他捐款途径 Contacts - 联系方式 + 联系方式 Telegram group - 电报群 + 电报群 To discuss features - 用于功能讨论 + 用于功能讨论 https://t.me/amnezia_vpn_en - + Mail - 邮件 + 邮件 For reviews and bug reports - 用于评论和提交软件的缺陷 + 用于评论和提交软件的缺陷 Github - + https://github.com/amnezia-vpn/amnezia-client - + Website - 官网 + 官网 https://amnezia.org - + Check for updates - 更新 + 检查更新 @@ -1003,82 +1009,85 @@ And if you don't like the app, all the more support it - the donation will Application - 应用 + 应用 Allow application screenshots - + 允许截屏 Auto start - 自动运行 + 自动运行 - Launch the application every time - 总是在系统 + 总是在系统 + + + starts + 启动时自动运行运用程序 - starts - 启动时自动运行运用程序 + Launch the application every time %1 starts + 运行应用软件在%1系统启动时 Start minimized - 最小化 + 最小化 Launch application minimized - 开启应用程序时窗口最小化 + 开启应用软件时窗口最小化 Language - 语言 + 语言 Logging - 日志 + 日志 Enabled - 开启 + 开启 Disabled - 禁用 + 禁用 Reset settings and remove all data from the application - 重置并清理应用的所有数据 + 重置并清理应用的所有数据 Reset settings and remove all data from the application? - 重置并清理应用的所有数据? + 重置并清理应用的所有数据? All settings will be reset to default. All installed AmneziaVPN services will still remain on the server. - 所有配置恢复为默认值。在服务器上保留所有已安装的AmneziaVPN服务。 + 所有配置恢复为默认值。服务器已安装的AmneziaVPN服务将被保留。 Continue - 继续 + 继续 Cancel - 取消 + 取消 @@ -1086,17 +1095,17 @@ And if you don't like the app, all the more support it - the donation will Settings restored from backup file - 从备份文件还原配置 + 从备份文件还原配置 Backup - 备份 + 备份 Configuration backup - 配置备份 + 备份设置 It will help you instantly restore connection settings at the next installation @@ -1105,53 +1114,53 @@ And if you don't like the app, all the more support it - the donation will You can save your settings to a backup file to restore them the next time you install the application. - + 您可以将配置信息备份到文件中,以便在下次安装应用软件时恢复配置 Make a backup - 进行备份 + 进行备份 Save backup file - 保存备份 + 保存备份 Backup files (*.backup) - + Restore from backup - 从备份还原 + 从备份还原 Open backup file - 打开备份文件 + 打开备份文件 Import settings from a backup file? - 从备份文件导入设置? + 从备份文件导入设置? All current settings will be reset - 当前所有设置将重置 + 当前所有设置将重置 Continue - 继续 + 继续 Cancel - 取消 + 取消 @@ -1159,17 +1168,17 @@ And if you don't like the app, all the more support it - the donation will Connection - 连接 + 连接 Auto connect - 自动连接 + 自动连接 Connect to VPN on app start - 应用开启时连接VPN + 应用开启时连接VPN Use AmneziaDNS if installed on the server @@ -1178,42 +1187,42 @@ And if you don't like the app, all the more support it - the donation will Use AmneziaDNS - 使用AmneziaDNS + 使用AmneziaDNS If AmneziaDNS is installed on the server - 如其已安装至服务器上 + 如果已在服务器安装AmneziaDNS DNS servers - DNS服务器列表 + DNS服务器 If AmneziaDNS is not used or installed - 如果未使用或未安装AmneziaDNS + 如果未使用或未安装AmneziaDNS - Split tunneling - + Site-based split tunneling + 基于网站的隧道分离 - + + Allows you to select which sites you want to access through the VPN + 配置想要通过VPN访问网站 + + + App-based split tunneling - + 基于应用的隧道分离 Split site tunneling 网站级VPN分流 - - - Allows you to choose which sites you want to use the VPN for. - - Allows you to connect to some sites through a secure connection, and to others bypassing it 使用VPN访问指定网站,其他的则绕过 @@ -1223,9 +1232,9 @@ And if you don't like the app, all the more support it - the donation will 应用级VPN分流 - + Allows you to use the VPN only for certain applications - 仅限指定应用使用VPN + 仅指定应用使用VPN @@ -1233,57 +1242,57 @@ And if you don't like the app, all the more support it - the donation will DNS servers - DNS服务器 + DNS服务器 If AmneziaDNS is not used or installed - 如果未使用或未安装Amnezia DNS + 如果未使用或未安装AmneziaDNS Primary DNS - 首选 DNS + 首选 DNS Secondary DNS - 备用 DNS + 备用 DNS Restore default - 恢复默认配置 + 恢复默认配置 Restore default DNS settings? - 是否恢复默认DNS配置? + 是否恢复默认DNS配置? Continue - 继续 + 继续 Cancel - 取消 + 取消 Settings have been reset - 已重置 + 已重置 Save - 保存 + 保存 Settings saved - 配置已保存 + 配置已保存 @@ -1291,57 +1300,57 @@ And if you don't like the app, all the more support it - the donation will Logging - 日志 + 日志 Save logs - 记录日志 + 记录日志 Open folder with logs - 打开日志文件夹 + 打开日志文件夹 Save - 保存 + 保存 Logs files (*.log) - + Save logs to file - 保存日志到文件 + 保存日志到文件 Clear logs? - 清除日志? + 清理日志? Continue - 继续 + 继续 Cancel - 取消 + 取消 Logs have been cleaned up - 已清理日志 + 日志已清理 Clear logs - 清理日志 + 清理日志 @@ -1349,27 +1358,27 @@ And if you don't like the app, all the more support it - the donation will All installed containers have been added to the application - 所有已安装的容器已添加到应用程序中 + 所有已安装的容器,已被添加到应用软件 No new installed containers found - 未找到新安装的容器 + 未发现新安装的容器 Clear Amnezia cache - 清除 Amnezia 缓存 + 清除 Amnezia 缓存 May be needed when changing other settings - 更改其他设置时可能需要 + 更改其他设置时可能需要缓存 Clear cached profiles? - 清除缓存的配置文件? + 清除缓存? @@ -1381,54 +1390,54 @@ And if you don't like the app, all the more support it - the donation will Continue - 继续 + 继续 Cancel - 取消 + 取消 Check the server for previously installed Amnezia services - 检查服务器上是否存在 Amnezia 服务 + 检查服务器上,是否存在之前安装的 Amnezia 服务 Add them to the application if they were not displayed - 如果存在且未被显示,则添加到应用程序里 + 如果存在且未显示,则添加到应用软件 Remove server from application - 移除本地服务器信息 + 移除本地服务器信息 Remove server? - 移除本地服务器信息? + 移除本地服务器信息? All installed AmneziaVPN services will still remain on the server. - 所有已安装的 AmneziaVPN 服务仍将保留在服务器上。 + 所有已安装的 AmneziaVPN 服务仍将保留在服务器上。 Clear server from Amnezia software - 移除Amnezia中服务器信息 + 清理Amnezia中服务器信息 Clear server from Amnezia software? - 从Amnezia中清除服务器? + 清理Amnezia中服务器信息 All containers will be deleted on the server. This means that configuration files, keys and certificates will be deleted. - 服务器上的所有容器都将被删除。这意味着配置文件、密钥和证书将被删除。 + 服务器上的所有容器都将被删除。配置文件、密钥和证书也将被删除。 @@ -1436,27 +1445,27 @@ And if you don't like the app, all the more support it - the donation will Server name - 服务器名称 + 服务器名 Save - 保存 + 保存 Protocols - 协议 + 协议 Services - 服务 + 服务 Data - 数据 + 数据 @@ -1464,17 +1473,17 @@ And if you don't like the app, all the more support it - the donation will settings - 配置 + 配置 Remove - 移除 + 移除 All users who you shared a connection with will no longer be able to connect to it. - + 使用此共享连接的所有用户,将无法再连接它。 from server? @@ -1483,7 +1492,7 @@ And if you don't like the app, all the more support it - the donation will Remove %1 from server? - 从服务器移除 %1 ? + 从服务器移除 %1 ? All users with whom you shared a connection will no longer be able to connect to it @@ -1492,12 +1501,12 @@ And if you don't like the app, all the more support it - the donation will Continue - 继续 + 继续 Cancel - 取消 + 取消 @@ -1505,7 +1514,7 @@ And if you don't like the app, all the more support it - the donation will Servers - 服务器 + 服务器 @@ -1525,90 +1534,90 @@ And if you don't like the app, all the more support it - the donation will Addresses from the list should be accessed via VPN - + 仅使用VPN访问 Addresses from the list should not be accessed via VPN - + 不使用VPN访问 Split tunneling - + 隧道分离 Mode - 方式 + 规则 Remove - 移除 + 移除 Continue - 继续 + 继续 Cancel - 取消 + 取消 Site or IP - 网址或IP地址 + 网站或IP地址 Import/Export Sites - 导入/导出网址 + 导入/导出网站 Import - 导入 + 导入 Save site list - 保存网址 + 保存网址 Save sites - 保存网址 + 保存网址 Sites files (*.json) - + Import a list of sites - 导入网址列表 + 导入网址列表 Replace site list - 替换网址列表 + 替换网址列表 Open sites file - 打开网址文件 + 打开网址文件 Add imported sites to existing ones - 将导入的网址添加到现有网址中 + 将导入的网址添加到现有网址中 @@ -1616,45 +1625,45 @@ And if you don't like the app, all the more support it - the donation will Server connection - 服务器连接 + 服务器连接 Do not use connection code from public sources. It may have been created to intercept your data. It's okay as long as it's from someone you trust. - 请勿使用公共来源的连接代码。它可能是为了拦截您的数据而创建的。 -最好是来源可信。 + 请勿使用公共来源的连接码。它可能是为了拦截您的数据而创建的。 +请确保连接码来源可信。 What do you have? - + 你用什么方式创建连接? File with connection settings or backup - 包含连接配置或备份的文件 + 包含连接配置或备份的文件 File with connection settings - 包含连接配置的文件 + 包含连接配置的文件 Open config file - 打开配置文件 + 打开配置文件 QR-code - 二维码 + 二维码 Key as text - 授权码文本 + 授权码文本 @@ -1662,52 +1671,52 @@ It's okay as long as it's from someone you trust. Server connection - 服务器连接 + 连接服务器 Server IP address [:port] - 服务器IP [:端口] + 服务器IP [:端口] 255.255.255.255:88 - + Login to connect via SSH - 用户名 + ssh账号 Password / SSH private key - 密码 或者 私钥 + 密码 或 私钥 Continue - 继续 + 继续 Ip address cannot be empty - IP不能为空 + IP不能为空 Enter the address in the format 255.255.255.255:88 - 按照这种格式输入 255.255.255.255:88 + 按照这种格式输入 255.255.255.255:88 Login cannot be empty - 用户名不能为空 + 账号不能为空 Password/private key cannot be empty - 密码或者私钥不能为空 + 密码或私钥不能为空 @@ -1715,27 +1724,27 @@ It's okay as long as it's from someone you trust. What is the level of internet control in your region? - 您所在地区的互联网控制力度如何? + 您所在地区的互联网管控力度如何? Set up a VPN yourself - 自己架设VPN + 自己架设VPN I want to choose a VPN protocol - 我想选择VPN协议 + 我想选择VPN协议 Continue - 继续 + 继续 Set up later - 稍后设置 + 稍后设置 @@ -1744,32 +1753,32 @@ It's okay as long as it's from someone you trust. Usually it takes no more than 5 minutes - 通常不超过5分钟 + 通常不超过5分钟 The server has already been added to the application - 服务器已添加到应用程序中 + 服务器已添加到应用软件中 Amnesia has detected that your server is currently - Amnezia 检测到您的服务器当前 + Amnezia 检测到您的服务器当前 busy installing other software. Amnesia installation - 正安装其他软件。Amnezia安装 + 正安装其他软件。Amnezia安装 will pause until the server finishes installing other software - 将暂停,直到服务器完成安装其他软件。 + 将暂停,直到其他软件安装完成。 Installing - 安装中 + 安装中 @@ -1777,32 +1786,32 @@ It's okay as long as it's from someone you trust. Installing %1 - 正在安装 %1 + 正在安装 %1 More detailed - 更多细节 + 更多细节 Close - 关闭 + 关闭 Network protocol - 网络协议 + 网络协议 Port - 端口 + 端口 Install - 安装 + 安装 @@ -1810,12 +1819,12 @@ It's okay as long as it's from someone you trust. VPN protocol - VPN 协议 + VPN 协议 Choose the one with the highest priority for you. Later, you can install other protocols and additional services, such as DNS proxy and SFTP. - 选择最适合您的一项。稍后,您可以安装其他协议和附加服务,例如 DNS 代理和 SFTP。 + 选择你认为优先级最高的一项。稍后,您可以安装其他协议和附加服务,例如 DNS 代理和 SFTP。 @@ -1823,7 +1832,7 @@ It's okay as long as it's from someone you trust. Point the camera at the QR code and hold for a couple of seconds. - 将相机对准二维码并按住几秒钟 + 将相机对准二维码并按住几秒钟 @@ -1831,27 +1840,27 @@ It's okay as long as it's from someone you trust. Settings restored from backup file - 从备份文件还原配置 + 从备份文件还原配置 Free service for creating a personal VPN on your server. - + 在您的服务器上架设私人免费VPN服务。 Helps you access blocked content without revealing your privacy, even to VPN providers. - + 帮助您访问受限内容,保护您的隐私,即使是VPN提供商也无法获取。 I have the data to connect - + 我有连接配置 I have nothing - + 我没有 @@ -1859,27 +1868,27 @@ It's okay as long as it's from someone you trust. Connection key - 连接授权码 + 连接授权码 A line that starts with vpn://... - 以 vpn://... 开始的行 + 以 vpn://... 开始的行 Key - 授权码 + 授权码 Insert - 插入 + 插入 Continue - 继续 + 继续 @@ -1887,27 +1896,27 @@ It's okay as long as it's from someone you trust. New connection - 新连接 + 新连接 Do not use connection code from public sources. It could be created to intercept your data. - 请勿使用公共来源的连接代码。它可以被创建来拦截您的数据。 + 请勿使用公共来源的连接码。它可以被创建来拦截您的数据。 Collapse content - + 折叠内容 Show content - 展示内容 + 显示内容 Connect - 连接 + 连接 @@ -1915,52 +1924,52 @@ It's okay as long as it's from someone you trust. Save OpenVPN config - 保存OpenVPN配置 + 保存OpenVPN配置 Save WireGuard config - 保存WireGuard配置 + 保存WireGuard配置 For the AmneziaVPN app - AmneziaVPN 应用 + AmneziaVPN 应用 OpenVpn native format - OpenVPN原生格式 + OpenVPN原生格式 WireGuard native format - WireGuard原生格式 + WireGuard原生格式 VPN Access - 访问VPN + 访问VPN Connection - 连接 + 连接 Full access - 完整授权 + 完全访问 VPN access without the ability to manage the server - 无权控制服务器 + 访问VPN,但没有权限管理服务。 Access to server management. The user with whom you share full access to the connection will be able to add and remove your protocols and services to the servers, as well as change settings. - + 除访问VPN外,用户还能添加和删除协议、服务以及更改配置信息 Full access to server @@ -1974,22 +1983,22 @@ It's okay as long as it's from someone you trust. Server - 服务器 + 服务器 Accessing - 访问 + 访问 File with accessing settings to - + 访问配置文件的内容为: File with connection settings to - 连接配置文件的内容为: + 连接配置文件的内容为: Protocols @@ -1999,23 +2008,23 @@ It's okay as long as it's from someone you trust. Protocol - 协议 + 协议 Connection to - 连接到 + 连接到 Connection format - 连接方式 + 连接格式 Share - 共享 + 共享 @@ -2023,7 +2032,7 @@ It's okay as long as it's from someone you trust. Close - 关闭 + 关闭 @@ -2031,38 +2040,38 @@ It's okay as long as it's from someone you trust. Password entry not found - 没有密码输入 + 未发现秘密 Could not decrypt data - 不能加密数据 + 数据无法加密 Unknown error - 位置错误 + 未知错误 Could not open wallet: %1; %2 - 无法打开钱包: %1; %2 + 无法打开钱包: %1; %2 Password not found - 未发现密码 + 未发现密码 Could not open keystore - 无法打开密钥库 + 无法打开密钥库 Could not remove private key from keystore - 无法从密钥库中删除私钥 + 无法从密钥库中删除私钥 @@ -2070,12 +2079,12 @@ It's okay as long as it's from someone you trust. Unknown error - 未知错误 + 未知错误 Access to keychain denied - 访问钥匙串被拒绝 + 访问钥匙串被拒绝 @@ -2083,27 +2092,27 @@ It's okay as long as it's from someone you trust. Could not store data in settings: access error - 无法在配置中存储数据:访问错误 + 无法在配置中存储数据:访问错误 Could not store data in settings: format error - 无法在陪置中存储数据:格式错误 + 无法在陪置中存储数据:格式错误 Could not delete data from settings: access error - 无法在配置中删除数据:访问错误 + 无法在配置中删除数据:访问错误 Could not delete data from settings: format error - 无法在配置中删除数据:格式错误 + 无法在配置中删除数据:格式错误 Entry not found - 未找到条目 + 未找到条目 @@ -2111,80 +2120,80 @@ It's okay as long as it's from someone you trust. Password entry not found - 没有密码输入 + 未发现密码 Could not decrypt data - 不能加密数据 + 数据无法加密 D-Bus is not running - + D-Bus未运行 Unknown error - + 未知错误 No keychain service available - + 没有有效的钥匙串服务 Could not open wallet: %1; %2 - 无法打开钱包: %1; %2 + 无法打开钱包: %1; %2 Access to keychain denied - 访问钥匙串被拒绝 + 访问钥匙串被拒绝 Could not determine data type: %1; %2 - + 无法确定数据类型: %1; %2 Entry not found - + 未找到记录 Unsupported entry type 'Map' - + 不支持的记录类型 'Map' Unknown kwallet entry type '%1' - + 未知钱包类型 '%1' Password not found - 未发现密码 + 未发现密码 Could not open keystore - 无法打开密钥库 + 无法打开密钥库 Could not retrieve private key from keystore - 无法从密钥存储库中检索私钥 + 无法从密钥存储库中检索私钥 Could not create decryption cipher - 无法创建解密密码 + 无法创建解密算法 @@ -2192,73 +2201,73 @@ It's okay as long as it's from someone you trust. Credential size exceeds maximum size of %1 - + 证书大小超过上限,最大为: %1 Credential key exceeds maximum size of %1 - + 凭证密钥大小超过上限,最大为: %1 Writing credentials failed: Win32 error code %1 - + 写入凭证失败,Win32错误码: %1 Encryption failed - + 加密失败 D-Bus is not running - + D-Bus未运行 Unknown error - + 未知错误 Could not open wallet: %1; %2 - 无法打开钱包: %1; %2 + 无法打开钱包: %1; %2 Password not found - 未发现密码 + 未发现密码 Could not open keystore - 无法打开密钥库 + 无法打开密钥库 Could not create private key generator - 无法创建私钥生成器 + 无法创建私钥生成器 Could not generate new private key - 无法生成新的私钥 + 无法生成新的私钥 Could not retrieve private key from keystore - 无法从密钥库检索私钥 + 无法从密钥库检索私钥 Could not create encryption cipher - 无法创建加密密码 + 无法创建加密密码 Could not encrypt data - 无法加密数据 + 无法加密数据 @@ -2266,374 +2275,374 @@ It's okay as long as it's from someone you trust. Sftp service - Sftp 服务 + Sftp 服务 No error - 没有错误 + 没有错误 Unknown Error - 位置错误 + 未知错误 Function not implemented - 功能未实现 + 功能未实现 Server check failed - 服务器检测失败 + 服务器检测失败 Server port already used. Check for another software - 检测服务器该端口是否被其他软件被占用 + 检测服务器该端口是否被其他软件被占用 Server error: Docker container missing - Server error: Docker容器丢失 + 服务器错误: Docker容器丢失 Server error: Docker failed - Server error: Docker失败 + 服务器错误: Docker失败 Installation canceled by user - 用户取消安装 + 用户取消安装 The user does not have permission to use sudo - 用户没有root权限 + 用户没有root权限 Ssh request was denied - ssh请求被拒绝 + ssh请求被拒绝 Ssh request was interrupted - ssh请求中断 + ssh请求中断 Ssh internal error - ssh内部错误 + ssh内部错误 Invalid private key or invalid passphrase entered - 输入的私钥或密码无效 + 输入的私钥或密码无效 The selected private key format is not supported, use openssh ED25519 key types or PEM key types - 不支持所选私钥格式,请使用 openssh ED25519 密钥类型或 PEM 密钥类型 + 不支持所选私钥格式,请使用 openssh ED25519 密钥类型或 PEM 密钥类型 Timeout connecting to server - 连接服务器超时 + 连接服务器超时 Sftp error: End-of-file encountered - Sftp错误: 遇到文件结尾 + Sftp错误: End-of-file encountered Sftp error: File does not exist - Sftp错误: 文件不存在 + Sftp错误: 文件不存在 Sftp error: Permission denied - Sftp错误: 权限受限 + Sftp错误: 权限不足 Sftp error: Generic failure - Sftp错误: 一般失败 + Sftp错误: 一般失败 Sftp error: Garbage received from server - Sftp错误: 从服务器收到垃圾信息 + Sftp错误: 从服务器收到垃圾信息 Sftp error: No connection has been set up - + Sftp 错误: 未建立连接 Sftp error: There was a connection, but we lost it - + Sftp 错误: 已有连接丢失 Sftp error: Operation not supported by libssh yet - + Sftp error: libssh不支持该操作 Sftp error: Invalid file handle - + Sftp error: 无效的文件句柄 Sftp error: No such file or directory path exists - + Sftp 错误: 文件夹或文件不存在 Sftp error: An attempt to create an already existing file or directory has been made - + Sftp 错误: 文件或目录已存在 Sftp error: Write-protected filesystem - + Sftp 错误: 文件系统写保护 Sftp error: No media was in remote drive - + Sftp 错误: 远程驱动器中没有媒介 Failed to save config to disk - 配置保存到磁盘失败 + 配置保存到磁盘失败 OpenVPN config missing - OpenVPN配置丢失 + OpenVPN配置丢失 OpenVPN management server error - OpenVPN 管理服务器错误 + OpenVPN 管理服务器错误 OpenVPN executable missing - OpenVPN 可执行文件丢失 + OpenVPN 可执行文件丢失 ShadowSocks (ss-local) executable missing - ShadowSocks (ss-local) 执行文件丢失 + ShadowSocks (ss-local) 执行文件丢失 Cloak (ck-client) executable missing - Cloak (ck-client) 执行文件丢失 + Cloak (ck-client) 执行文件丢失 Amnezia helper service error - Amnezia 帮助服务错误 + Amnezia 服务连接失败 OpenSSL failed - OpenSSL失败 + OpenSSL错误 Can't connect: another VPN connection is active - 无法连接:另一个VPN连接处于活动状态 + 无法连接:另一个VPN连接处于活跃状态 Can't setup OpenVPN TAP network adapter - 无法设置 OpenVPN TAP 网络适配器 + 无法设置 OpenVPN TAP 网络适配器 VPN pool error: no available addresses - VPN 池错误:没有可用地址 + VPN 池错误:没有可用地址 The config does not contain any containers and credentiaks for connecting to the server - 该配置不包含任何用于连接到服务器的容器和凭据。 + 该配置不包含任何用于连接到服务器的容器和凭据。 Internal error - 内部错误 + 内部错误 IPsec - + Website in Tor network - 在 Tor 网络中架设网站 + 在 Tor 网络中架设网站 Amnezia DNS - + Sftp file sharing service - SFTP文件共享服务 + SFTP文件共享服务 OpenVPN is the most popular VPN protocol, with flexible configuration options. It uses its own security protocol with SSL/TLS for key exchange. - OpenVPN 是最流行的 VPN 协议,具有灵活的配置选项。它使用自己的安全协议与 SSL/TLS 进行密钥交换。 + OpenVPN 是最流行的 VPN 协议,具有灵活的配置选项。它使用自己的安全协议与 SSL/TLS 进行密钥交换。 ShadowSocks - masks VPN traffic, making it similar to normal web traffic, but is recognised by analysis systems in some highly censored regions. - ShadowSocks - 混淆 VPN 流量,使其与正常的 Web 流量相似,但在一些审查力度高的地区可以被分析系统识别。 + ShadowSocks - 混淆 VPN 流量,使其与正常的 Web 流量相似,但在一些审查力度高的地区可以被分析系统识别。 OpenVPN over Cloak - OpenVPN with VPN masquerading as web traffic and protection against active-probbing detection. Ideal for bypassing blocking in regions with the highest levels of censorship. - OpenVPN over Cloak - OpenVPN 与 VPN 具有伪装成网络流量和防止主动探测检测的保护。非常适合绕过审查力度特别强的地区的封锁。 + OpenVPN over Cloak - OpenVPN 与 VPN 具有伪装成网络流量和防止主动探测检测的保护。非常适合绕过审查力度特别强的地区的封锁。 WireGuard - New popular VPN protocol with high performance, high speed and low power consumption. Recommended for regions with low levels of censorship. - WireGuard - 新型流行的VPN协议,具有高性能、高速度和低功耗。建议用于审查力度较低的地区 + WireGuard - 新型流行的VPN协议,具有高性能、高速度和低功耗。建议用于审查力度较低的地区 IKEv2 - 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. - IKEv2 - 现代稳定协议,相比其他协议较快一些,在信号丢失后恢复连接。Android 和 iOS最新版原生支持。 + IKEv2 - 现代稳定协议,相比其他协议较快一些,在信号丢失后恢复连接。Android 和 iOS最新版原生支持。 Deploy a WordPress site on the Tor network in two clicks. - 只需点击两次即可架设 WordPress 网站到 Tor 网络 + 只需点击两次即可架设 WordPress 网站到 Tor 网络 Replace the current DNS server with your own. This will increase your privacy level. - 将当前的 DNS 服务器替换为您自己的。这将提高您的隐私级别。 + 将当前的 DNS 服务器替换为您自己的。这将提高您的隐私保护级别。 Creates a file vault on your server to securely store and transfer files. - 在您的服务器上创建文件库以安全地存储和传输文件 + 在您的服务器上创建文件仓库,以便安全地存储和传输文件 OpenVPN container - OpenVPN容器 + OpenVPN容器 Container with OpenVpn and ShadowSocks - 带有 OpenVpn 和 ShadowSocks 的容器 + 含 OpenVpn 和 ShadowSocks 的容器 Container with OpenVpn and ShadowSocks protocols configured with traffic masking by Cloak plugin - 具有 OpenVpn 和 ShadowSocks 协议的容器,通过 Cloak 插件配置混淆流量 + 含 OpenVpn 和 ShadowSocks 协议的容器,通过 Cloak 插件配置混淆流量 WireGuard container - WireGuard 容器 + WireGuard 容器 AmneziaWG container - + IPsec container - IPsec 容器 + IPsec 容器 DNS Service - DNS 服务 + DNS 服务 Sftp file sharing service - is secure FTP service - Sftp 文件共享服务 - 安全的 FTP 服务 + Sftp 文件共享服务 - 安全的 FTP 服务 Entry not found - 未找到记录 + 未找到记录 Access to keychain denied - 访问钥匙串被拒绝 + 访问钥匙串被拒绝 No keyring daemon - 没有密钥环守护进程 + 没有密钥环守护进程 Already unlocked - 已经解锁 + 已经解锁 No such keyring - 没有这样的密钥环 + 没有这样的密钥环 Bad arguments - 错误参数 + 错误参数 I/O error - I/O错误 + I/O错误 Cancelled - 已取消 + 已取消 Keyring already exists - 密匙环已经存在 + 密匙环已经存在 No match - 不匹配 + 不匹配 Unknown error - 未知错误 + 未知错误 error 0x%1: %2 - 错误 0x%1: %2 + 错误 0x%1: %2 @@ -2641,7 +2650,7 @@ It's okay as long as it's from someone you trust. Choose language - 选择语言 + 选择语言 @@ -2649,13 +2658,13 @@ It's okay as long as it's from someone you trust. Server #1 - + Server - 服务器 + 服务器 @@ -2663,22 +2672,22 @@ It's okay as long as it's from someone you trust. Software version - 软件版本 + 软件版本 Backup file is corrupted - 备份文件已损坏 + 备份文件已损坏 All settings have been reset to default values - 所配置恢复为默认值 + 所配置恢复为默认值 Cached profiles cleared - 缓存的配置文件已清除 + 缓存的配置文件已清除 @@ -2687,27 +2696,27 @@ It's okay as long as it's from someone you trust. Save AmneziaVPN config - 保存配置 + 保存配置 Share - 共享 + 共享 Copy - 拷贝 + 拷贝 Copied - 已拷贝 + 已拷贝 Show connection settings - + 显示连接配置 Show content @@ -2716,7 +2725,7 @@ It's okay as long as it's from someone you trust. To read the QR code in the Amnezia app, select "Add server" → "I have data to connect" → "QR code, key or settings file" - 要读取 Amnezia 应用程序中的二维码,请选择“添加服务器”→“我有数据要连接”→“二维码、密钥或配置文件” + 要应用二维码到 Amnezia,请底部工具栏点击“+”→“连接方式”→“二维码、授权码或配置文件” @@ -2724,42 +2733,42 @@ It's okay as long as it's from someone you trust. Hostname not look like ip adress or domain name - + 请输入有效的域名或IP地址 New site added: %1 - + 已经添加新网站: %1 Site removed: %1 - + 已移除网站: %1 Can't open file: %1 - + 无法打开文件: %1 Failed to parse JSON data from file: %1 - + JSON解析失败,文件: %1 - The JSON data is not an array in file: - + The JSON data is not an array in file: %1 + 文件中的JSON数据不是一个数组,文件: %1 Import completed - + 完成导入 Export completed - + 完成导出 @@ -2768,31 +2777,31 @@ It's okay as long as it's from someone you trust. Show - 界面 + 显示 Connect - 连接 + 连接 Disconnect - 断开 + 断开 Visit Website - 官网 + 官网 Quit - 退出 + 退出 @@ -2800,7 +2809,7 @@ It's okay as long as it's from someone you trust. The field can't be empty - + 输入不能为空 @@ -2808,7 +2817,7 @@ It's okay as long as it's from someone you trust. Mbps - + @@ -2816,42 +2825,42 @@ It's okay as long as it's from someone you trust. Unknown - 未知 + 未知 Disconnected - 断开连接 + 连接已断开 Preparing - 准备中 + 准备中 Connecting... - 连接中 + 连接中 Connected - 已连接 + 已连接 Disconnecting... - 断开中 + 断开中 Reconnecting... - 重连中 + 重连中 Error - 错误 + 错误 @@ -2859,32 +2868,32 @@ It's okay as long as it's from someone you trust. Low - + High - + Medium - + I just want to increase the level of privacy - 我只是想提高隐私级别 + 我只是想提高隐私保护级别 Many foreign websites and VPN providers are blocked - 大多国外网站和VPN提供商被屏蔽 + 大多国外网站和VPN提供商被屏蔽 Some foreign sites are blocked, but VPN providers are not blocked - 一些国外网站被屏蔽,但VPN提供商未被屏蔽 + 一些国外网站被屏蔽,但VPN提供商未被屏蔽 @@ -2892,12 +2901,12 @@ It's okay as long as it's from someone you trust. Private key passphrase - 私钥密码 + 私钥密码 Save - 保存 + 保存 diff --git a/client/ui/controllers/sitesController.cpp b/client/ui/controllers/sitesController.cpp index 4d0391be..8c420899 100644 --- a/client/ui/controllers/sitesController.cpp +++ b/client/ui/controllers/sitesController.cpp @@ -97,7 +97,7 @@ void SitesController::importSites(const QString &fileName, bool replaceExisting) } if (!jsonDocument.isArray()) { - emit errorOccurred(tr("The JSON data is not an array in file: ").arg(fileName)); + emit errorOccurred(tr("The JSON data is not an array in file: %1").arg(fileName)); return; } diff --git a/client/ui/qml/Pages2/PageProtocolRaw.qml b/client/ui/qml/Pages2/PageProtocolRaw.qml index 2324c091..f0959143 100644 --- a/client/ui/qml/Pages2/PageProtocolRaw.qml +++ b/client/ui/qml/Pages2/PageProtocolRaw.qml @@ -127,7 +127,7 @@ PageType { Layout.fillWidth: true Layout.topMargin: 16 - headerText: qsTr("Connection options ") + protocolName + headerText: qsTr("Connection options %1").arg(protocolName) } TextArea { diff --git a/client/ui/qml/Pages2/PageSettingsApplication.qml b/client/ui/qml/Pages2/PageSettingsApplication.qml index c5536fdb..49e3a5d9 100644 --- a/client/ui/qml/Pages2/PageSettingsApplication.qml +++ b/client/ui/qml/Pages2/PageSettingsApplication.qml @@ -70,7 +70,7 @@ PageType { Layout.margins: 16 text: qsTr("Auto start") - descriptionText: qsTr("Launch the application every time ") + Qt.platform.os + qsTr(" starts") + descriptionText: qsTr("Launch the application every time %1 starts").arg(Qt.platform.os) checked: SettingsController.isAutoStartEnabled() onCheckedChanged: { From 7c8399ce88d92fa17c1a05b8b3926f1ef0821280 Mon Sep 17 00:00:00 2001 From: pokamest Date: Thu, 12 Oct 2023 13:57:58 +0100 Subject: [PATCH 045/108] Fix awg description --- client/containers/containers_defs.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/client/containers/containers_defs.cpp b/client/containers/containers_defs.cpp index fd13bfe0..2fcff6a7 100644 --- a/client/containers/containers_defs.cpp +++ b/client/containers/containers_defs.cpp @@ -109,8 +109,8 @@ QMap ContainerProps::containerDescriptions() QObject::tr("WireGuard - New popular VPN protocol with high performance, high speed and low power " "consumption. Recommended for regions with low levels of censorship.") }, { DockerContainer::Awg, - QObject::tr("WireGuard - New popular VPN protocol with high performance, high speed and low power " - "consumption. Recommended for regions with low levels of censorship.") }, + QObject::tr("AmneziaWG - Special protocol from Amnezia, based on WireGuard. It's fast like WireGuard, but very resistant to blockages. " + "Recommended for regions with high levels of censorship.") }, { DockerContainer::Ipsec, QObject::tr("IKEv2 - 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.") }, From 3836836c72645797fb0f1896555fcde5e8087bc2 Mon Sep 17 00:00:00 2001 From: pokamest Date: Sat, 14 Oct 2023 02:15:49 +0100 Subject: [PATCH 046/108] Change easySetupOrder --- client/containers/containers_defs.cpp | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/client/containers/containers_defs.cpp b/client/containers/containers_defs.cpp index 2fcff6a7..4bd3b0ef 100644 --- a/client/containers/containers_defs.cpp +++ b/client/containers/containers_defs.cpp @@ -233,8 +233,8 @@ bool ContainerProps::isEasySetupContainer(DockerContainer container) { switch (container) { case DockerContainer::WireGuard: return true; + case DockerContainer::Awg: return true; case DockerContainer::Cloak: return true; - case DockerContainer::OpenVpn: return true; default: return false; } } @@ -243,8 +243,8 @@ QString ContainerProps::easySetupHeader(DockerContainer container) { switch (container) { case DockerContainer::WireGuard: return tr("Low"); - case DockerContainer::Cloak: return tr("High"); - case DockerContainer::OpenVpn: return tr("Medium"); + case DockerContainer::Awg: return tr("Medium or High"); + case DockerContainer::Cloak: return tr("Extreme"); default: return ""; } } @@ -252,9 +252,9 @@ QString ContainerProps::easySetupHeader(DockerContainer container) QString ContainerProps::easySetupDescription(DockerContainer container) { switch (container) { - case DockerContainer::WireGuard: return tr("I just want to increase the level of privacy"); - case DockerContainer::Cloak: return tr("Many foreign websites and VPN providers are blocked"); - case DockerContainer::OpenVpn: return tr("Some foreign sites are blocked, but VPN providers are not blocked"); + case DockerContainer::WireGuard: return tr("I just want to increase the level of my privacy."); + case DockerContainer::Awg: return tr("I want to bypass censorship. This option recommended in most cases."); + case DockerContainer::Cloak: return tr("Most VPN protocols are blocked. Recommended if other options are not working."); default: return ""; } } @@ -262,9 +262,9 @@ QString ContainerProps::easySetupDescription(DockerContainer container) int ContainerProps::easySetupOrder(DockerContainer container) { switch (container) { - case DockerContainer::WireGuard: return 1; - case DockerContainer::Cloak: return 3; - case DockerContainer::OpenVpn: return 2; + case DockerContainer::WireGuard: return 3; + case DockerContainer::Awg: return 2; + case DockerContainer::Cloak: return 1; default: return 0; } } From 8163e5143495f0856e11178e60507d84240cef46 Mon Sep 17 00:00:00 2001 From: "vladimir.kuznetsov" Date: Sat, 14 Oct 2023 16:52:22 +0500 Subject: [PATCH 047/108] fixes on page split tunneling according to the design layout --- client/translations/amneziavpn_ru.ts | 4 +-- client/translations/amneziavpn_zh_CN.ts | 4 +-- .../ui/qml/Controls2/LabelWithButtonType.qml | 21 +++++++++++++--- .../ui/qml/Pages2/PageSettingsConnection.qml | 12 +++++++-- .../qml/Pages2/PageSettingsSplitTunneling.qml | 25 ++++++++++++++++--- 5 files changed, 53 insertions(+), 13 deletions(-) diff --git a/client/translations/amneziavpn_ru.ts b/client/translations/amneziavpn_ru.ts index 0e1d65df..153c2569 100644 --- a/client/translations/amneziavpn_ru.ts +++ b/client/translations/amneziavpn_ru.ts @@ -130,7 +130,7 @@ ImportController - + Scanned %1 of %2. @@ -777,7 +777,7 @@ Already installed containers were found on the server. All installed containers - + Close application diff --git a/client/translations/amneziavpn_zh_CN.ts b/client/translations/amneziavpn_zh_CN.ts index 645d281f..4f566201 100644 --- a/client/translations/amneziavpn_zh_CN.ts +++ b/client/translations/amneziavpn_zh_CN.ts @@ -130,7 +130,7 @@ ImportController - + Scanned %1 of %2. 扫描 %1 of %2. @@ -811,7 +811,7 @@ Already installed containers were found on the server. All installed containers 关于 - + Close application diff --git a/client/ui/qml/Controls2/LabelWithButtonType.qml b/client/ui/qml/Controls2/LabelWithButtonType.qml index 6bc45a8c..8b85d591 100644 --- a/client/ui/qml/Controls2/LabelWithButtonType.qml +++ b/client/ui/qml/Controls2/LabelWithButtonType.qml @@ -20,7 +20,9 @@ Item { property bool isLeftImageHoverEnabled: true //todo separete this qml file to 3 property string textColor: "#d7d8db" + property string textDisabledColor: "#878B91" property string descriptionColor: "#878B91" + property string descriptionDisabledColor: "#494B50" property real textOpacity: 1.0 property string rightImageColor: "#d7d8db" @@ -71,7 +73,14 @@ Item { ListItemTitleType { text: root.text - color: root.descriptionOnTop ? root.descriptionColor : root.textColor + color: { + if (root.enabled) { + return root.descriptionOnTop ? root.descriptionColor : root.textColor + } else { + return root.descriptionOnTop ? root.descriptionDisabledColor : root.textDisabledColor + } + } + maximumLineCount: root.textMaximumLineCount elide: root.textElide @@ -96,7 +105,13 @@ Item { id: description text: root.descriptionText - color: root.descriptionOnTop ? root.textColor : root.descriptionColor + color: { + if (root.enabled) { + return root.descriptionOnTop ? root.textColor : root.descriptionColor + } else { + return root.descriptionOnTop ? root.textDisabledColor : root.descriptionDisabledColor + } + } opacity: root.textOpacity @@ -157,7 +172,7 @@ Item { MouseArea { anchors.fill: parent cursorShape: Qt.PointingHandCursor - hoverEnabled: true + hoverEnabled: root.enabled onEntered: { if (rightImageSource) { diff --git a/client/ui/qml/Pages2/PageSettingsConnection.qml b/client/ui/qml/Pages2/PageSettingsConnection.qml index 374e1ce4..76dbdff6 100644 --- a/client/ui/qml/Pages2/PageSettingsConnection.qml +++ b/client/ui/qml/Pages2/PageSettingsConnection.qml @@ -94,6 +94,8 @@ PageType { DividerType {} LabelWithButtonType { + visible: !GC.isMobile() + Layout.fillWidth: true text: qsTr("Split site tunneling") @@ -105,9 +107,13 @@ PageType { } } - DividerType {} + DividerType { + visible: !GC.isMobile() + } LabelWithButtonType { + visible: !GC.isMobile() + Layout.fillWidth: true text: qsTr("Separate application tunneling") @@ -118,7 +124,9 @@ PageType { } } - DividerType {} + DividerType { + visible: !GC.isMobile() + } } } } diff --git a/client/ui/qml/Pages2/PageSettingsSplitTunneling.qml b/client/ui/qml/Pages2/PageSettingsSplitTunneling.qml index b79d5d22..f90c6719 100644 --- a/client/ui/qml/Pages2/PageSettingsSplitTunneling.qml +++ b/client/ui/qml/Pages2/PageSettingsSplitTunneling.qml @@ -20,6 +20,10 @@ import "../Components" PageType { id: root + property bool pageEnabled: { + return !ConnectionController.isConnected + } + Connections { target: SitesController @@ -78,6 +82,8 @@ PageType { RowLayout { HeaderType { + enabled: root.pageEnabled + Layout.fillWidth: true Layout.leftMargin: 16 @@ -89,6 +95,8 @@ PageType { property int lastActiveRouteMode: routeMode.onlyForwardSites + enabled: root.pageEnabled + Layout.fillWidth: true Layout.rightMargin: 16 @@ -115,7 +123,7 @@ PageType { drawerHeight: 0.4375 - enabled: switcher.checked + enabled: switcher.checked && root.pageEnabled headerText: qsTr("Mode") @@ -155,9 +163,9 @@ PageType { FlickableType { anchors.top: header.bottom anchors.topMargin: 16 - contentHeight: col.implicitHeight + connectButton.implicitHeight + connectButton.anchors.bottomMargin + connectButton.anchors.topMargin + contentHeight: col.implicitHeight + addSiteButton.implicitHeight + addSiteButton.anchors.bottomMargin + addSiteButton.anchors.topMargin - enabled: switcher.checked + enabled: switcher.checked && root.pageEnabled Column { id: col @@ -221,8 +229,17 @@ PageType { } } + Rectangle { + anchors.fill: addSiteButton + anchors.bottomMargin: -24 + color: "#0E0E11" + opacity: 0.8 + } + RowLayout { - id: connectButton + id: addSiteButton + + enabled: root.pageEnabled anchors.bottom: parent.bottom anchors.left: parent.left From ffc9e5823a7aa897e43d3b2d0690e7814b6c2a0f Mon Sep 17 00:00:00 2001 From: "vladimir.kuznetsov" Date: Sat, 14 Oct 2023 18:21:49 +0500 Subject: [PATCH 048/108] text corrections --- client/containers/containers_defs.cpp | 88 ++++-- client/translations/amneziavpn_ru.ts | 231 ++++++++++------ client/translations/amneziavpn_zh_CN.ts | 255 +++++++++++++----- .../ConnectionTypeSelectionDrawer.qml | 9 +- .../Pages2/PageServiceTorWebsiteSettings.qml | 2 +- .../PageSetupWizardProtocolSettings.qml | 23 +- client/ui/qml/Pages2/PageShare.qml | 2 +- 7 files changed, 411 insertions(+), 199 deletions(-) diff --git a/client/containers/containers_defs.cpp b/client/containers/containers_defs.cpp index 4bd3b0ef..1c79874c 100644 --- a/client/containers/containers_defs.cpp +++ b/client/containers/containers_defs.cpp @@ -108,9 +108,10 @@ QMap ContainerProps::containerDescriptions() { DockerContainer::WireGuard, QObject::tr("WireGuard - New popular VPN protocol with high performance, high speed and low power " "consumption. Recommended for regions with low levels of censorship.") }, - { DockerContainer::Awg, - QObject::tr("AmneziaWG - Special protocol from Amnezia, based on WireGuard. It's fast like WireGuard, but very resistant to blockages. " - "Recommended for regions with high levels of censorship.") }, + { DockerContainer::Awg, + QObject::tr("AmneziaWG - Special protocol from Amnezia, based on WireGuard. It's fast like WireGuard, " + "but very resistant to blockages. " + "Recommended for regions with high levels of censorship.") }, { DockerContainer::Ipsec, QObject::tr("IKEv2 - 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.") }, @@ -125,19 +126,73 @@ QMap ContainerProps::containerDescriptions() QMap ContainerProps::containerDetailedDescriptions() { - return { { DockerContainer::OpenVpn, QObject::tr("OpenVPN container") }, - { DockerContainer::ShadowSocks, QObject::tr("Container with OpenVpn and ShadowSocks") }, - { DockerContainer::Cloak, - QObject::tr("Container with OpenVpn and ShadowSocks protocols " - "configured with traffic masking by Cloak plugin") }, - { DockerContainer::WireGuard, QObject::tr("WireGuard container") }, - { DockerContainer::WireGuard, QObject::tr("AmneziaWG container") }, - { DockerContainer::Ipsec, QObject::tr("IPsec container") }, + return { + { DockerContainer::OpenVpn, + QObject::tr( + "The time-tested most popular VPN protocol.\n\n" + "Uses a proprietary security protocol with SSL/TLS for encryption and key exchange and supports " + "various authentication methods, making it suitable for a variety of devices and operating " + "systems.\n\n" + "* Normal power consumption on mobile devices\n" + "* Flexible customisation to suit user needs to work with different operating systems and devices.\n" + "* Recognised by DPI analysis systems and therefore susceptible to blocking.\n" + "* Can operate over both TCP and UDP network protocols.") }, + { DockerContainer::ShadowSocks, + QObject::tr("Based on the SOCKS5 proxy protocol, which protects the connection using the AEAD cipher - " + "roughly along the same lines as SSH tunnelling. A Shadowsocks connection is difficult to " + "identify because it is virtually identical to a normal HTTPS connection.\n\n" + "However, some traffic analysis systems can still recognise a ShadowSocks connection, so in " + "countries with high levels of censorship we recommend using OpenVPN in conjunction with Cloak.\n" + "* Average power consumption on mobile devices (higher than OpenVPN).\n" + "* It is possible to configure the encryption protocol.\n" + "* Recognised by some DPI analysis systems\n" + "* Works only via TCP network protocol\n") }, + { DockerContainer::Cloak, + QObject::tr("This is a combination of the OpenVPN protocol and the Cloak plugin designed specifically for " + "blocking protection.\n\n" + "OpenVPN provides a secure VPN connection by encrypting all Internet traffic between the client " + "and the server.\n\n" + "Cloak protects OpenVPN from detection and blocking. \n\n" + "Cloak can modify packet metadata so that it completely masks VPN traffic as normal web traffic, " + "and also protects the VPN from detection by Active Probing. This makes it very resistant to " + "being detected\n\n" + "Immediately after receiving the first data packet, Cloak authenticates the incoming connection. " + "If authentication fails, the plugin masks the server as a fake website and your VPN becomes " + "invisible to analysis systems.\n\n" + "If there is a high level of Internet censorship in your region, we advise you to use only " + "OpenVPN over Cloak from the first connection\n" + "* High power consumption on mobile devices\n" + "* Flexible settings\n" + "* Not recognised by DPI analysis systems\n" + "* Works via TCP network protocol\n") }, + { DockerContainer::WireGuard, + QObject::tr("A relatively new popular VPN protocol with a simplified architecture.\n" + "Provides stable VPN connection, high performance on all devices. Uses hard-coded encryption " + "settings. WireGuard compared to OpenVPN has lower latency and better data transfer throughput.\n" - { DockerContainer::TorWebSite, QObject::tr("Website in Tor network") }, - { DockerContainer::Dns, QObject::tr("DNS Service") }, - //{DockerContainer::FileShare, QObject::tr("SMB file sharing service - is Window file sharing protocol")}, - { DockerContainer::Sftp, QObject::tr("Sftp file sharing service - is secure FTP service") } }; + "* Low power consumption on mobile devices.\n" + "* Minimum number of settings.\n" + "* Easily recognised by DPI analysis systems, susceptible to blocking.\n" + "* Works via UDP network protocol.\n") }, + { DockerContainer::Awg, QObject::tr("AmneziaWG container") }, + { DockerContainer::Ipsec, + QObject::tr("A modern stable protocol.\n\n" + + "IKEv2 with IPSec encryption layer. Transmits data over fixed UDP ports 500 and 4500 protecting " + "them with strong 3DES and AES crypto algorithms. Allows very fast switching between networks " + "and devices. Due to its security, stability and speed, IKEv2 is currently one of the best VPN " + "solutions for mobile devices. Vulnerable to detection and blocking.\n" + + "* Low power consumption, on mobile devices\n" + "* Minimal configuration.\n" + "* Recognised by DPI analysis systems.\n" + "* Works only over UDP network protocol\n") }, + + { DockerContainer::TorWebSite, QObject::tr("Website in Tor network") }, + { DockerContainer::Dns, QObject::tr("DNS Service") }, + //{DockerContainer::FileShare, QObject::tr("SMB file sharing service - is Window file sharing protocol")}, + { DockerContainer::Sftp, QObject::tr("Sftp file sharing service - is secure FTP service") } + }; } amnezia::ServiceType ContainerProps::containerService(DockerContainer c) @@ -254,7 +309,8 @@ QString ContainerProps::easySetupDescription(DockerContainer container) switch (container) { case DockerContainer::WireGuard: return tr("I just want to increase the level of my privacy."); case DockerContainer::Awg: return tr("I want to bypass censorship. This option recommended in most cases."); - case DockerContainer::Cloak: return tr("Most VPN protocols are blocked. Recommended if other options are not working."); + case DockerContainer::Cloak: + return tr("Most VPN protocols are blocked. Recommended if other options are not working."); default: return ""; } } diff --git a/client/translations/amneziavpn_ru.ts b/client/translations/amneziavpn_ru.ts index 8a2ffffc..94ce0b3a 100644 --- a/client/translations/amneziavpn_ru.ts +++ b/client/translations/amneziavpn_ru.ts @@ -68,17 +68,22 @@ ConnectionTypeSelectionDrawer - - Connection data + + Add server - + + Select data type + + + + Server IP, login and password - + QR code, key or configuration file @@ -130,7 +135,7 @@ ImportController - + Scanned %1 of %2. @@ -808,7 +813,7 @@ Already installed containers were found on the server. All installed containers - When configuring WordPress set the domain as this onion address. + When configuring WordPress set the this address as domain. @@ -865,7 +870,7 @@ Already installed containers were found on the server. All installed containers - + Close application @@ -1143,22 +1148,22 @@ Already installed containers were found on the server. All installed containers - + Site-based split tunneling - + Allows you to select which sites you want to access through the VPN - + App-based split tunneling - + Allows you to use the VPN only for certain applications @@ -1438,90 +1443,90 @@ Already installed containers were found on the server. All installed containers PageSettingsSplitTunneling - + Addresses from the list should be accessed via VPN - + Addresses from the list should not be accessed via VPN - + Split tunneling - + Mode - + Remove - + Continue Продолжить - + Cancel - + Site or IP - + Import/Export Sites - + Import - + Save site list - + Save sites - - - + + + Sites files (*.json) - + Import a list of sites - + Replace site list - - + + Open sites file - + Add imported sites to existing ones @@ -1699,22 +1704,22 @@ It's okay as long as it's from someone you trust. - + Close - + Network protocol - + Port - + Install @@ -1851,6 +1856,11 @@ It's okay as long as it's from someone you trust. VPN access without the ability to manage the server + + + Access to server management. The user with whom you share full access to the connection will be able to add and remove your protocols and services to the server, as well as change settings. + + @@ -1897,11 +1907,6 @@ It's okay as long as it's from someone you trust. Full access - - - Access to server management. The user with whom you share full access to the connection will be able to add and remove your protocols and services to the servers, as well as change settings. - - @@ -2376,7 +2381,74 @@ It's okay as long as it's from someone you trust. - + + The time-tested most popular VPN protocol. + +Uses a proprietary security protocol with SSL/TLS for encryption and key exchange and supports various authentication methods, making it suitable for a variety of devices and operating systems. + +* Normal power consumption on mobile devices +* Flexible customisation to suit user needs to work with different operating systems and devices. +* Recognised by DPI analysis systems and therefore susceptible to blocking. +* Can operate over both TCP and UDP network protocols. + + + + + Based on the SOCKS5 proxy protocol, which protects the connection using the AEAD cipher - roughly along the same lines as SSH tunnelling. A Shadowsocks connection is difficult to identify because it is virtually identical to a normal HTTPS connection. + +However, some traffic analysis systems can still recognise a ShadowSocks connection, so in countries with high levels of censorship we recommend using OpenVPN in conjunction with Cloak. +* Average power consumption on mobile devices (higher than OpenVPN). +* It is possible to configure the encryption protocol. +* Recognised by some DPI analysis systems +* Works only via TCP network protocol + + + + + + This is a combination of the OpenVPN protocol and the Cloak plugin designed specifically for blocking protection. + +OpenVPN provides a secure VPN connection by encrypting all Internet traffic between the client and the server. + +Cloak protects OpenVPN from detection and blocking. + +Cloak can modify packet metadata so that it completely masks VPN traffic as normal web traffic, and also protects the VPN from detection by Active Probing. This makes it very resistant to being detected + +Immediately after receiving the first data packet, Cloak authenticates the incoming connection. If authentication fails, the plugin masks the server as a fake website and your VPN becomes invisible to analysis systems. + +If there is a high level of Internet censorship in your region, we advise you to use only OpenVPN over Cloak from the first connection +* High power consumption on mobile devices +* Flexible settings +* Not recognised by DPI analysis systems +* Works via TCP network protocol + + + + + + A relatively new popular VPN protocol with a simplified architecture. +Provides stable VPN connection, high performance on all devices. Uses hard-coded encryption settings. WireGuard compared to OpenVPN has lower latency and better data transfer throughput. +* Low power consumption on mobile devices. +* Minimum number of settings. +* Easily recognised by DPI analysis systems, susceptible to blocking. +* Works via UDP network protocol. + + + + + + A modern stable protocol. + +IKEv2 with IPSec encryption layer. Transmits data over fixed UDP ports 500 and 4500 protecting them with strong 3DES and AES crypto algorithms. Allows very fast switching between networks and devices. Due to its security, stability and speed, IKEv2 is currently one of the best VPN solutions for mobile devices. Vulnerable to detection and blocking. +* Low power consumption, on mobile devices +* Minimal configuration. +* Recognised by DPI analysis systems. +* Works only over UDP network protocol + + + + + DNS Service @@ -2387,7 +2459,7 @@ It's okay as long as it's from someone you trust. - + Website in Tor network @@ -2413,62 +2485,41 @@ It's okay as long as it's from someone you trust. - WireGuard - New popular VPN protocol with high performance, high speed and low power consumption. Recommended for regions with low levels of censorship. - + + AmneziaWG - Special protocol from Amnezia, based on WireGuard. It's fast like WireGuard, but very resistant to blockages. Recommended for regions with high levels of censorship. + + + + IKEv2 - 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. - + Deploy a WordPress site on the Tor network in two clicks. - + Replace the current DNS server with your own. This will increase your privacy level. - + Creates a file vault on your server to securely store and transfer files. - - OpenVPN container - - - - - Container with OpenVpn and ShadowSocks - - - - - Container with OpenVpn and ShadowSocks protocols configured with traffic masking by Cloak plugin - - - - - WireGuard container - - - - + AmneziaWG container - - IPsec container - - - - + Sftp file sharing service - is secure FTP service @@ -2537,6 +2588,16 @@ It's okay as long as it's from someone you trust. error 0x%1: %2 + + + WireGuard Configuration Highlighter + + + + + &Randomize colors + + SelectLanguageDrawer @@ -2755,33 +2816,33 @@ It's okay as long as it's from someone you trust. amnezia::ContainerProps - + Low - - High + + Medium or High - - Medium + + Extreme - - Many foreign websites and VPN providers are blocked + + I just want to increase the level of my privacy. - - Some foreign sites are blocked, but VPN providers are not blocked + + I want to bypass censorship. This option recommended in most cases. - - I just want to increase the level of privacy + + Most VPN protocols are blocked. Recommended if other options are not working. diff --git a/client/translations/amneziavpn_zh_CN.ts b/client/translations/amneziavpn_zh_CN.ts index e60f0d8b..359655f8 100644 --- a/client/translations/amneziavpn_zh_CN.ts +++ b/client/translations/amneziavpn_zh_CN.ts @@ -68,17 +68,26 @@ ConnectionTypeSelectionDrawer - Connection data - 连接方式 + 连接方式 - + + Add server + + + + + Select data type + + + + Server IP, login and password 服务器IP,用户名和密码 - + QR code, key or configuration file 二维码,授权码或者配置文件 @@ -130,7 +139,7 @@ ImportController - + Scanned %1 of %2. 扫描 %1 of %2. @@ -847,8 +856,12 @@ Already installed containers were found on the server. All installed containers + When configuring WordPress set the this address as domain. + + + When configuring WordPress set the domain as this onion address. - 配置 WordPress 时,将域设置为此洋葱地址。 + 配置 WordPress 时,将域设置为此洋葱地址。 @@ -904,7 +917,7 @@ Already installed containers were found on the server. All installed containers 关于 - + Close application 关闭应用 @@ -1205,17 +1218,17 @@ And if you don't like the app, all the more support it - the donation will 如果未使用或未安装AmneziaDNS - + Site-based split tunneling 基于网站的隧道分离 - + Allows you to select which sites you want to access through the VPN 配置想要通过VPN访问网站 - + App-based split tunneling 基于应用的隧道分离 @@ -1232,7 +1245,7 @@ And if you don't like the app, all the more support it - the donation will 应用级VPN分流 - + Allows you to use the VPN only for certain applications 仅指定应用使用VPN @@ -1532,90 +1545,90 @@ And if you don't like the app, all the more support it - the donation will 网站级VPN分流 - + Addresses from the list should be accessed via VPN 仅使用VPN访问 - + Addresses from the list should not be accessed via VPN 不使用VPN访问 - + Split tunneling 隧道分离 - + Mode 规则 - + Remove 移除 - + Continue 继续 - + Cancel 取消 - + Site or IP 网站或IP地址 - + Import/Export Sites 导入/导出网站 - + Import 导入 - + Save site list 保存网址 - + Save sites 保存网址 - - - + + + Sites files (*.json) - + Import a list of sites 导入网址列表 - + Replace site list 替换网址列表 - - + + Open sites file 打开网址文件 - + Add imported sites to existing ones 将导入的网址添加到现有网址中 @@ -1794,22 +1807,22 @@ It's okay as long as it's from someone you trust. 更多细节 - + Close 关闭 - + Network protocol 网络协议 - + Port 端口 - + Install 安装 @@ -1968,8 +1981,12 @@ It's okay as long as it's from someone you trust. + Access to server management. The user with whom you share full access to the connection will be able to add and remove your protocols and services to the server, as well as change settings. + + + Access to server management. The user with whom you share full access to the connection will be able to add and remove your protocols and services to the servers, as well as change settings. - 除访问VPN外,用户还能添加和删除协议、服务以及更改配置信息 + 除访问VPN外,用户还能添加和删除协议、服务以及更改配置信息 Full access to server @@ -2489,7 +2506,7 @@ It's okay as long as it's from someone you trust. - + Website in Tor network 在 Tor 网络中架设网站 @@ -2520,67 +2537,133 @@ It's okay as long as it's from someone you trust. - WireGuard - New popular VPN protocol with high performance, high speed and low power consumption. Recommended for regions with low levels of censorship. WireGuard - 新型流行的VPN协议,具有高性能、高速度和低功耗。建议用于审查力度较低的地区 - + + AmneziaWG - Special protocol from Amnezia, based on WireGuard. It's fast like WireGuard, but very resistant to blockages. Recommended for regions with high levels of censorship. + + + + IKEv2 - 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. IKEv2 - 现代稳定协议,相比其他协议较快一些,在信号丢失后恢复连接。Android 和 iOS最新版原生支持。 - + Deploy a WordPress site on the Tor network in two clicks. 只需点击两次即可架设 WordPress 网站到 Tor 网络 - + Replace the current DNS server with your own. This will increase your privacy level. 将当前的 DNS 服务器替换为您自己的。这将提高您的隐私保护级别。 - + Creates a file vault on your server to securely store and transfer files. 在您的服务器上创建文件仓库,以便安全地存储和传输文件 - - - OpenVPN container - OpenVPN容器 - - - - Container with OpenVpn and ShadowSocks - 含 OpenVpn 和 ShadowSocks 的容器 - + The time-tested most popular VPN protocol. + +Uses a proprietary security protocol with SSL/TLS for encryption and key exchange and supports various authentication methods, making it suitable for a variety of devices and operating systems. + +* Normal power consumption on mobile devices +* Flexible customisation to suit user needs to work with different operating systems and devices. +* Recognised by DPI analysis systems and therefore susceptible to blocking. +* Can operate over both TCP and UDP network protocols. + + + + + Based on the SOCKS5 proxy protocol, which protects the connection using the AEAD cipher - roughly along the same lines as SSH tunnelling. A Shadowsocks connection is difficult to identify because it is virtually identical to a normal HTTPS connection. + +However, some traffic analysis systems can still recognise a ShadowSocks connection, so in countries with high levels of censorship we recommend using OpenVPN in conjunction with Cloak. +* Average power consumption on mobile devices (higher than OpenVPN). +* It is possible to configure the encryption protocol. +* Recognised by some DPI analysis systems +* Works only via TCP network protocol + + + + + + This is a combination of the OpenVPN protocol and the Cloak plugin designed specifically for blocking protection. + +OpenVPN provides a secure VPN connection by encrypting all Internet traffic between the client and the server. + +Cloak protects OpenVPN from detection and blocking. + +Cloak can modify packet metadata so that it completely masks VPN traffic as normal web traffic, and also protects the VPN from detection by Active Probing. This makes it very resistant to being detected + +Immediately after receiving the first data packet, Cloak authenticates the incoming connection. If authentication fails, the plugin masks the server as a fake website and your VPN becomes invisible to analysis systems. + +If there is a high level of Internet censorship in your region, we advise you to use only OpenVPN over Cloak from the first connection +* High power consumption on mobile devices +* Flexible settings +* Not recognised by DPI analysis systems +* Works via TCP network protocol + + + + + + A relatively new popular VPN protocol with a simplified architecture. +Provides stable VPN connection, high performance on all devices. Uses hard-coded encryption settings. WireGuard compared to OpenVPN has lower latency and better data transfer throughput. +* Low power consumption on mobile devices. +* Minimum number of settings. +* Easily recognised by DPI analysis systems, susceptible to blocking. +* Works via UDP network protocol. + + + + + + A modern stable protocol. + +IKEv2 with IPSec encryption layer. Transmits data over fixed UDP ports 500 and 4500 protecting them with strong 3DES and AES crypto algorithms. Allows very fast switching between networks and devices. Due to its security, stability and speed, IKEv2 is currently one of the best VPN solutions for mobile devices. Vulnerable to detection and blocking. +* Low power consumption, on mobile devices +* Minimal configuration. +* Recognised by DPI analysis systems. +* Works only over UDP network protocol + + + + + OpenVPN container + OpenVPN容器 + + + Container with OpenVpn and ShadowSocks + 含 OpenVpn 和 ShadowSocks 的容器 + + Container with OpenVpn and ShadowSocks protocols configured with traffic masking by Cloak plugin - 含 OpenVpn 和 ShadowSocks 协议的容器,通过 Cloak 插件配置混淆流量 + 含 OpenVpn 和 ShadowSocks 协议的容器,通过 Cloak 插件配置混淆流量 - WireGuard container - WireGuard 容器 + WireGuard 容器 - + AmneziaWG container - IPsec container - IPsec 容器 + IPsec 容器 - + DNS Service DNS 服务 - + Sftp file sharing service - is secure FTP service Sftp 文件共享服务 - 安全的 FTP 服务 @@ -2644,6 +2727,16 @@ It's okay as long as it's from someone you trust. error 0x%1: %2 错误 0x%1: %2 + + + WireGuard Configuration Highlighter + + + + + &Randomize colors + + SelectLanguageDrawer @@ -2866,34 +2959,54 @@ It's okay as long as it's from someone you trust. amnezia::ContainerProps - + Low - + + Medium or High + + + + + Extreme + + + + + I just want to increase the level of my privacy. + + + + + I want to bypass censorship. This option recommended in most cases. + + + + + Most VPN protocols are blocked. Recommended if other options are not working. + + + High - + - Medium - + - I just want to increase the level of privacy - 我只是想提高隐私保护级别 + 我只是想提高隐私保护级别 - Many foreign websites and VPN providers are blocked - 大多国外网站和VPN提供商被屏蔽 + 大多国外网站和VPN提供商被屏蔽 - Some foreign sites are blocked, but VPN providers are not blocked - 一些国外网站被屏蔽,但VPN提供商未被屏蔽 + 一些国外网站被屏蔽,但VPN提供商未被屏蔽 diff --git a/client/ui/qml/Components/ConnectionTypeSelectionDrawer.qml b/client/ui/qml/Components/ConnectionTypeSelectionDrawer.qml index ecde1554..6128c652 100644 --- a/client/ui/qml/Components/ConnectionTypeSelectionDrawer.qml +++ b/client/ui/qml/Components/ConnectionTypeSelectionDrawer.qml @@ -20,16 +20,15 @@ DrawerType { anchors.right: parent.right spacing: 0 - Header2TextType { + Header2Type { Layout.fillWidth: true Layout.topMargin: 24 Layout.rightMargin: 16 Layout.leftMargin: 16 - Layout.bottomMargin: 32 - Layout.alignment: Qt.AlignHCenter + Layout.bottomMargin: 16 - text: qsTr("Connection data") - wrapMode: Text.WordWrap + headerText: qsTr("Add server") + descriptionText: qsTr("Select data type") } LabelWithButtonType { diff --git a/client/ui/qml/Pages2/PageServiceTorWebsiteSettings.qml b/client/ui/qml/Pages2/PageServiceTorWebsiteSettings.qml index 04d7076c..0d5baa3d 100644 --- a/client/ui/qml/Pages2/PageServiceTorWebsiteSettings.qml +++ b/client/ui/qml/Pages2/PageServiceTorWebsiteSettings.qml @@ -121,7 +121,7 @@ PageType { Layout.leftMargin: 16 Layout.rightMargin: 16 - text: qsTr("When configuring WordPress set the domain as this onion address.") + text: qsTr("When configuring WordPress set the this address as domain.") } BasicButtonType { diff --git a/client/ui/qml/Pages2/PageSetupWizardProtocolSettings.qml b/client/ui/qml/Pages2/PageSetupWizardProtocolSettings.qml index 7535464a..2b97f044 100644 --- a/client/ui/qml/Pages2/PageSetupWizardProtocolSettings.qml +++ b/client/ui/qml/Pages2/PageSetupWizardProtocolSettings.qml @@ -144,33 +144,16 @@ PageType { headerText: name } - TextField { - implicitWidth: parent.width + ParagraphTextType { Layout.fillWidth: true Layout.topMargin: 16 Layout.bottomMargin: 16 - padding: 0 - leftPadding: 0 - height: 24 - - color: "#D7D8DB" - - font.pixelSize: 16 - font.weight: Font.Medium - font.family: "PT Root UI VF" - text: detailedDescription - - wrapMode: Text.WordWrap - - readOnly: true - background: Rectangle { - anchors.fill: parent - color: "transparent" - } + textFormat: Text.MarkdownText } + Rectangle { Layout.fillHeight: true color: "transparent" diff --git a/client/ui/qml/Pages2/PageShare.qml b/client/ui/qml/Pages2/PageShare.qml index a92d3e51..aa04a1fe 100644 --- a/client/ui/qml/Pages2/PageShare.qml +++ b/client/ui/qml/Pages2/PageShare.qml @@ -172,7 +172,7 @@ PageType { Layout.bottomMargin: 24 text: accessTypeSelector.currentIndex === 0 ? qsTr("VPN access without the ability to manage the server") : - qsTr("Access to server management. The user with whom you share full access to the connection will be able to add and remove your protocols and services to the servers, as well as change settings.") + qsTr("Access to server management. The user with whom you share full access to the connection will be able to add and remove your protocols and services to the server, as well as change settings.") color: "#878B91" } From 3ac09181c6065afd40f5e281a20249b866058439 Mon Sep 17 00:00:00 2001 From: pokamest Date: Sat, 14 Oct 2023 15:55:07 +0100 Subject: [PATCH 049/108] Text lables fixes --- .../qml/Components/ConnectionTypeSelectionDrawer.qml | 6 +++--- client/ui/qml/Pages2/PageSetupWizardCredentials.qml | 10 +++++++++- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/client/ui/qml/Components/ConnectionTypeSelectionDrawer.qml b/client/ui/qml/Components/ConnectionTypeSelectionDrawer.qml index ecde1554..81ccd245 100644 --- a/client/ui/qml/Components/ConnectionTypeSelectionDrawer.qml +++ b/client/ui/qml/Components/ConnectionTypeSelectionDrawer.qml @@ -28,7 +28,7 @@ DrawerType { Layout.bottomMargin: 32 Layout.alignment: Qt.AlignHCenter - text: qsTr("Connection data") + text: qsTr("Add new connection") wrapMode: Text.WordWrap } @@ -37,7 +37,7 @@ DrawerType { Layout.fillWidth: true Layout.topMargin: 16 - text: qsTr("Server IP, login and password") + text: qsTr("Configure your server") rightImageSource: "qrc:/images/controls/chevron-right.svg" clickedFunction: function() { @@ -51,7 +51,7 @@ DrawerType { LabelWithButtonType { Layout.fillWidth: true - text: qsTr("QR code, key or configuration file") + text: qsTr("Open QR code, key or config file") rightImageSource: "qrc:/images/controls/chevron-right.svg" clickedFunction: function() { diff --git a/client/ui/qml/Pages2/PageSetupWizardCredentials.qml b/client/ui/qml/Pages2/PageSetupWizardCredentials.qml index bc24c196..5c32b0c5 100644 --- a/client/ui/qml/Pages2/PageSetupWizardCredentials.qml +++ b/client/ui/qml/Pages2/PageSetupWizardCredentials.qml @@ -41,7 +41,7 @@ PageType { HeaderType { Layout.fillWidth: true - headerText: qsTr("Server connection") + headerText: qsTr("Configure your server") } TextFieldWithHeaderType { @@ -107,6 +107,14 @@ PageType { PageController.goToPage(PageEnum.PageSetupWizardEasy) } } + + LabelTextType { + Layout.fillWidth: true + Layout.topMargin: 12 + + text: qsTr("All data you enter will remain strictly confidential +and will not be shared or disclosed to the Amnezia or any third parties") + } } } From b6d2030041d2924bd1b661bda1af846be65c6022 Mon Sep 17 00:00:00 2001 From: pokamest Date: Sat, 14 Oct 2023 15:55:52 +0100 Subject: [PATCH 050/108] Ru translation --- client/translations/amneziavpn_ru.ts | 1076 +++++++++++++------------- 1 file changed, 559 insertions(+), 517 deletions(-) diff --git a/client/translations/amneziavpn_ru.ts b/client/translations/amneziavpn_ru.ts index ac099552..d2ad31b7 100644 --- a/client/translations/amneziavpn_ru.ts +++ b/client/translations/amneziavpn_ru.ts @@ -6,7 +6,7 @@ Split tunneling for WireGuard is not implemented, the option was disabled - + Раздельное туннелирование для "Wireguard" не реализовано,опция отключена @@ -14,13 +14,13 @@ AmneziaVPN - + AmneziaVPN VPN Connected Refers to the app - which is currently running the background and waiting - + VPN Подключен @@ -29,27 +29,28 @@ VPN Protocols is not installed. Please install VPN container at first - + VPN протоколы не установлены. + Пожалуйста, установите протокол Connection... - + Подключение... Connected - + Подключено Settings updated successfully, Reconnnection... - + Настройки успешно обновлены. Подключение... Reconnection... - + Переподключение... @@ -57,29 +58,41 @@ Connect - + Подключиться Disconnection... - + Отключение... ConnectionTypeSelectionDrawer - Connection data + Данные для подлкючения + + + Server IP, login and password + IP сервера, логин и пароль + + + QR code, key or configuration file + QR-код, ключ, файл настроек или бекап + + + + Add new connection - Server IP, login and password + Configure your server - QR code, key or configuration file + Open QR code, key or config file @@ -88,22 +101,22 @@ C&ut - + &Вырезать &Copy - + &Копировать &Paste - + &Вставить &SelectAll - + &ВыбратьВсе @@ -111,7 +124,7 @@ Access error! - + Ошибка доступа! @@ -119,12 +132,12 @@ The selected protocol is not supported on the current platform - + Выбранный протокол не поддерживается на данном устройстве Reconnect via VPN Procotol: - + Переподключение через VPN протокол: @@ -132,7 +145,7 @@ Scanned %1 of %2. - + Отсканировано %1 из%2. @@ -141,55 +154,57 @@ %1 installed successfully. - + %1 успешно установлен. %1 is already installed on the server. - + %1 уже установлен на сервер. Added containers that were already installed on the server - + +В приложение добавлены обнаруженные на сервере протоклы и сервисы Already installed containers were found on the server. All installed containers have been added to the application - + +На сервере обнаружены установленные протоколы и сервисы, все они добавлены в приложение Settings updated successfully - + Настройки успешно обновлены Server '%1' was removed - + Сервер '%1' был удален All containers from server '%1' have been removed - + Все протоклы и сервисы были удалены с сервера '%1' %1 has been removed from the server '%2' - + %1 был удален с сервера '%2' Please login as the user - + Пожалуйста, войдите в систему от имени пользователя Server added successfully - + Сервер успешно добавлен @@ -197,17 +212,17 @@ Already installed containers were found on the server. All installed containers Read key failed: %1 - + Не удалось считать ключ: %1 Write key failed: %1 - + Не удалось записать ключ: %1 Delete key failed: %1 - + Не удалось удалить ключ: %1 @@ -216,27 +231,27 @@ Already installed containers were found on the server. All installed containers AmneziaVPN - + AmneziaVPN VPN Connected - + VPN Подключен VPN Disconnected - + VPN Выключен AmneziaVPN notification - + Уведомление AmneziaVPN Unsecured network detected: - + Обнаружена незащищенная сеть: @@ -244,12 +259,12 @@ Already installed containers were found on the server. All installed containers Removing services from %1 - + Удаление сервисов c %1 Usually it takes no more than 5 minutes - + Обычно это занимает не более 5 минут @@ -257,12 +272,12 @@ Already installed containers were found on the server. All installed containers VPN protocol - + VPN протокол Servers - + Серверы @@ -270,87 +285,87 @@ Already installed containers were found on the server. All installed containers AmneziaWG settings - + AmneziaWG настройки Port - + Порт Junk packet count - + Junk packet count Junk packet minimum size - + Junk packet minimum size Junk packet maximum size - + Junk packet maximum size Init packet junk size - + Init packet junk size Response packet junk size - + Response packet junk size Init packet magic header - + Init packet magic header Response packet magic header - + Response packet magic header Transport packet magic header - + Transport packet magic header Underload packet magic header - + Underload packet magic header Remove AmneziaWG - + Remove AmneziaWG Remove AmneziaWG from server? - + Удалить AmneziaWG с сервера? All users who you shared a connection with will no longer be able to connect to it. - + Все пользователи, которым вы поделились VPN с этим протоколом, больше не смогут к нему подключаться. Continue - Продолжить + Продолжить Cancel - + Отменить Save and Restart Amnezia - + Сохранить и пререзагрузить Amnezia @@ -358,28 +373,28 @@ Already installed containers were found on the server. All installed containers Cloak settings - + Настройки Cloak Disguised as traffic from - + Замаскировать трафик под Port - + Port Cipher - + Cipher Save and Restart Amnezia - + Сохранить и перезагрузить Amnezia @@ -387,195 +402,195 @@ Already installed containers were found on the server. All installed containers OpenVPN settings - + Настройки OpenVPN VPN Addresses Subnet - + VPN Адреса Подсеть Network protocol - + Сетевой протокол Port - + Порт Auto-negotiate encryption - + Шифрование с автоматическим согласованием Hash - + Хэш SHA512 - + SHA512 SHA384 - + SHA384 SHA256 - + SHA256 SHA3-512 - + SHA3-512 SHA3-384 - + SHA3-384 SHA3-256 - + SHA3-256 whirlpool - + whirlpool BLAKE2b512 - + BLAKE2b512 BLAKE2s256 - + BLAKE2s256 SHA1 - + SHA1 Cipher - + Шифрованаие AES-256-GCM - + AES-256-GCM AES-192-GCM - + AES-192-GCM AES-128-GCM - + AES-128-GCM AES-256-CBC - + AES-256-CBC AES-192-CBC - + AES-192-CBC AES-128-CBC - + AES-128-CBC ChaCha20-Poly1305 - + ChaCha20-Poly1305 ARIA-256-CBC - + ARIA-256-CBC CAMELLIA-256-CBC - + CAMELLIA-256-CBC none - + none TLS auth - + TLS авторизация Block DNS requests outside of VPN - + Блокировать DNS запросы за пределами VPN Additional client configuration commands - + Дополнительные команды конфигурации клиента Commands: - + Commands: Additional server configuration commands - + Дополнительные команды конфигурации сервера Remove OpenVPN - + Удалить OpenVPN Remove OpenVpn from server? - + Удалить OpenVpn с сервера? All users who you shared a connection with will no longer be able to connect to it. - + Все пользователи, которым вы поделились VPN, больше не смогут к нему подключаться. Continue - Продолжить + Продолжить Cancel - + Отменить Save and Restart Amnezia - + Сохранить и перезагрузить @@ -583,42 +598,42 @@ Already installed containers were found on the server. All installed containers settings - + настройки Show connection options - + Показать параметры подключения Connection options %1 - + Параметры подключения %1 Remove - + Удалить Remove %1 from server? - + Удалить %1 с сервера? All users who you shared a connection with will no longer be able to connect to it. - + Все пользователи, которым вы поделились VPN с этим протоколом больше не смогут к нему подключаться. Continue - Продолжить + Продолжить Cancel - + Отменить @@ -626,23 +641,23 @@ Already installed containers were found on the server. All installed containers ShadowSocks settings - + Настройки ShadowSocks Port - + Порт Cipher - + Шифрование Save and Restart Amnezia - + Сохранить и перезагрузить Amnezia @@ -658,32 +673,33 @@ Already installed containers were found on the server. All installed containers A DNS service is installed on your server, and it is only accessible via VPN. - + На вашем сервере устанавливается DNS-сервис, доступ к нему возможен только через VPN. + The DNS address is the same as the address of your server. You can configure DNS in the settings, under the connections tab. - + Адрес DNS совпадает с адресом вашего сервера. Настроить DNS можно в настройках, во вкладке "Соединения". Remove - + Удалить Remove %1 from server? - + Удалить %1 с сервера? Continue - Продолжить + Продолжить Cancel - + Отменить @@ -691,17 +707,17 @@ Already installed containers were found on the server. All installed containers Settings updated successfully - + Настройки успешно обновлены SFTP settings - + Настройки SFTP Host - + Хост @@ -709,69 +725,69 @@ Already installed containers were found on the server. All installed containers Copied - + Скопировано Port - + Порт Login - + Логин Password - + Пароль Mount folder on device - + Смонтировать папку на вашем устройстве In order to mount remote SFTP folder as local drive, perform following steps: <br> - + Чтобы смонтировать SFTP-папку как локальный диск на вашем устройстве, выполните следующие действия <br>1. Install the latest version of - + <br>1. Установите последнюю версию <br>2. Install the latest version of - + <br>2. Установите последнюю версию Detailed instructions - + Подробные инструкции Remove SFTP and all data stored there - + Удалите SFTP-хранилище со всеми данными Remove SFTP and all data stored there? - + Удалить SFTP-хранилище и все хранящиеся на нем данные? Continue - Продолжить + Продолжить Cancel - + Отменить @@ -779,57 +795,57 @@ Already installed containers were found on the server. All installed containers Settings updated successfully - + Настройки успешно обновлены Tor website settings - + Настройки сайта в сети Тоr Website address - + Адрес сайта Copied - + Скопировано Use <a href="https://www.torproject.org/download/" style="color: #FBB26A;">Tor Browser</a> to open this url. - + Используйте <a href="https://www.torproject.org/download/" style="color: #FBB26A;">Tor Browser</a> для открытия этой ссылки. After installation it takes several minutes while your onion site will become available in the Tor Network. - + Через несколько минут после установки ваш Onion сайт станет доступен в сети Tor. When configuring WordPress set the domain as this onion address. - + При настройке WordPress, укажите этот адрес в качестве домена. Remove website - + Удалить сайт The site with all data will be removed from the tor network. - + Сайт со всеми данными будет удален из сети tor. Continue - Продолжить + Продолжить Cancel - + Отменить @@ -837,37 +853,37 @@ Already installed containers were found on the server. All installed containers Settings - + Настройки Servers - + Серверы Connection - + Соединение Application - + Приложение Backup - + Резервное копирование About AmneziaVPN - + Об AmneziaVPN Close application - + Закрыть приложение @@ -875,87 +891,87 @@ Already installed containers were found on the server. All installed containers Support the project with a donation - + Поддержите проект донатами This is a free and open source application. If you like it, support the developers with a donation. - + Это бесплатное приложение с открытым исходным кодом. Если, оно вам нравится - поддержите разработчиков пожертвованием. And if you don’t like the application, all the more reason to support it - the donation will be used for the improving the application. - + А, если оно вам не нравится, тем более поддержите-пожертвование пойдет на улучшение приложения. Card on Patreon - + Картой на Patreon https://www.patreon.com/amneziavpn - + https://www.patreon.com/amneziavpn Show other methods on Github - + Показать другие способы на Github Contacts - + Контакты Telegram group - + Группа в Telegram To discuss features - + Для обсуждений https://t.me/amnezia_vpn_en - + https://t.me/amnezia_vpn Mail - + Почта For reviews and bug reports - + Для отзывов и сообщений об ошибках Github - + Github https://github.com/amnezia-vpn/amnezia-client - + https://github.com/amnezia-vpn/amnezia-client Website - + Веб-сайт https://amnezia.org - + https://amnezia.org Check for updates - + Проверить обновления @@ -963,77 +979,77 @@ Already installed containers were found on the server. All installed containers Application - + Приложение Allow application screenshots - + Разрешить скриншоты Auto start - + Авто-запуск Launch the application every time %1 starts - + Запускать приложение при каждом включении %1 Start minimized - + Запуск в свернутом виде Launch application minimized - + Запуск приложения в свернутом виде Language - + Язык Logging - + Логирование Enabled - + Включено Disabled - + Отключено Reset settings and remove all data from the application - + Сбросить настройки и удалить все данные из приложения Reset settings and remove all data from the application? - + Сбросить настройки и удалить все данные из приложения? All settings will be reset to default. All installed AmneziaVPN services will still remain on the server. - + Все данные из приложения будут удалены Все установленные сервисы AmneziaVPN останутся на сервере. Continue - Продолжить + Продолжить Cancel - + Отменить @@ -1041,68 +1057,68 @@ Already installed containers were found on the server. All installed containers Backup - + Резервное копирование Settings restored from backup file - + Восстановление настроек из бэкап файла Configuration backup - + Бэкап конфигурация You can save your settings to a backup file to restore them the next time you install the application. - + Поможет мгновенно восстановить настройки соединений при следующей установке. Make a backup - + Сделать бэкап Save backup file - + Сохранить бэкап файл Backup files (*.backup) - + Файлы резервного копирования (*.backup) Restore from backup - + Восстановить из бэкапа Open backup file - + Открыть бэкап файл Import settings from a backup file? - + Импортировать настройки из бэкап файла? All current settings will be reset - + Все текущие настройки будут сброшены Continue - Продолжить + Продолжить Cancel - + Отменить @@ -1110,57 +1126,57 @@ Already installed containers were found on the server. All installed containers Connection - + Подключение Auto connect - + Автоподключение Connect to VPN on app start - + Подключение к VPN при запуске приложения Use AmneziaDNS - + Использовать Amnezia DNS If AmneziaDNS is installed on the server - + Если он уставновлен на сервере DNS servers - + DNS сервер If AmneziaDNS is not used or installed - + Эти серверы будут использоваться, если не включен AmneziaDNS Site-based split tunneling - + Раздельное туннелирование сайтов Allows you to select which sites you want to access through the VPN - + Позволяет подключаться к одним сайтам через VPN, а к другим в обход него App-based split tunneling - + Раздельное VPN-туннелирование приложений Allows you to use the VPN only for certain applications - + Позволяет использовать VPN только для определённых приложений @@ -1168,57 +1184,57 @@ Already installed containers were found on the server. All installed containers DNS servers - + DNS сервер If AmneziaDNS is not used or installed - + Эти адреса будут использоваться, если не включен или не установлен AmneziaDNS Primary DNS - + Первичный DNS Secondary DNS - + Вторичный DNS Restore default - + Восстановить по умолчанию Restore default DNS settings? - + Восстановить настройки DNS по умолчанию? Continue - Продолжить + Продолжить Cancel - + Отменить Settings have been reset - + Настройки сброшены Save - + Сохранить Settings saved - + Сохранить настройки @@ -1226,57 +1242,57 @@ Already installed containers were found on the server. All installed containers Logging - + Логирование Save logs - + Сохранить логи Open folder with logs - + Открыть папку с логами Save - + Сохранить Logs files (*.log) - + Logs files (*.log) Save logs to file - + Сохранить логи в файл Clear logs? - + Очистить логи? Continue - Продолжить + Продолжить Cancel - + Отменить Logs have been cleaned up - + Логи удалены Clear logs - + Удалить логи @@ -1284,27 +1300,27 @@ Already installed containers were found on the server. All installed containers All installed containers have been added to the application - + Все установленные протоколы и сервисы были добавлены в приложение Clear Amnezia cache - + Очистить кэш Amnezia на сервере May be needed when changing other settings - + Может понадобиться при изменении других настроек Clear cached profiles? - Очистить закешированные профили + Удалить кэш Amnezia с сервера? No new installed containers found - + Новые установленные протоколы и сервисы не обнаружены @@ -1323,47 +1339,47 @@ Already installed containers were found on the server. All installed containers Cancel - + Отменить Check the server for previously installed Amnezia services - + Проверка сервера на наличие ранее установленных сервисов Amnezia Add them to the application if they were not displayed - + Добавить их в приложение, если они не были отображены Remove server from application - + Удалить сервер из приложения Remove server? - + Удалить сервер? All installed AmneziaVPN services will still remain on the server. - + Все установленные сервисы и протоколы Amnezia всё ещё останутся на сервере. Clear server from Amnezia software - + Очистка сервера от протоколов и сервисов Amnezia Clear server from Amnezia software? - + Удалить все сервисы и протоколы Amnezia с сервера? All containers will be deleted on the server. This means that configuration files, keys and certificates will be deleted. - + На сервере будут удалены все, что связанно с Amnezia: протоколы сервисы конфигурационные файлы, ключи и сертификаты. @@ -1371,27 +1387,27 @@ Already installed containers were found on the server. All installed containers Server name - + Имя сервера Save - + Сохранить Protocols - + Протоколы Services - + Сервисы Data - + Данные @@ -1399,32 +1415,32 @@ Already installed containers were found on the server. All installed containers settings - + настройки Remove - + Удалить Remove %1 from server? - + Удалить %1 с сервера? All users who you shared a connection with will no longer be able to connect to it. - + Все пользователи, которым вы поделились VPN, больше не смогут к нему подключаться. Continue - Продолжить + Продолжить Cancel - + Отменить @@ -1432,7 +1448,7 @@ Already installed containers were found on the server. All installed containers Servers - + Серверы @@ -1440,90 +1456,90 @@ Already installed containers were found on the server. All installed containers Addresses from the list should be accessed via VPN - + Только адреса из списка должны открываться через VPN Addresses from the list should not be accessed via VPN - + Адреса из списка не должны открываться через VPN Split tunneling - + Раздельно VPN-туннелирование Mode - + Режим Remove - + Удалить Continue - Продолжить + Продолжить Cancel - + Отменить Site or IP - + Сайт или IP Import/Export Sites - + Импорт/экспорт Сайтов Import - + Импорт Save site list - + Сохранить список сайтов Save sites - + Сохранить Sites files (*.json) - + Sites files (*.json) Import a list of sites - + Импортировать список с сайтами Replace site list - + Заменить список сайтов Open sites file - + Открыть список с сайтами Add imported sites to existing ones - + Добавление импортированных сайтов к существующим @@ -1531,44 +1547,46 @@ Already installed containers were found on the server. All installed containers Server connection - + Подключение к серверу Do not use connection code from public sources. It may have been created to intercept your data. It's okay as long as it's from someone you trust. - + Не используйте код подключения из публичных источников. Его могли создать, чтобы перехватывать ваши данные.. + +Всё в порядке, если кодом поделился пользователь, которому вы доверяете. What do you have? - + Выберете что у вас есть? File with connection settings - + Файл с настройками подключения File with connection settings or backup - + Файл с настройками подключения или бэкап Open config file - + Открыть файл с конфигурацией QR-code - + QR-код Key as text - + Ключ в виде текста @@ -1576,52 +1594,52 @@ It's okay as long as it's from someone you trust. Server connection - + Подключение к серверу Server IP address [:port] - + Server IP address [:port] 255.255.255.255:88 - + 255.255.255.255:88 Password / SSH private key - + Password / SSH private key Continue - Продолжить + Продолжить Enter the address in the format 255.255.255.255:88 - + Введите адрес в формате 255.255.255.255:88 Login to connect via SSH - + Login to connect via SSH Ip address cannot be empty - + Поле Ip address не может быть пустым Login cannot be empty - + Поле Login не может быть пустым Password/private key cannot be empty - + Поле Password/private key не может быть пустым @@ -1629,27 +1647,27 @@ It's okay as long as it's from someone you trust. What is the level of internet control in your region? - + Какой уровень контроля интеренета в вашем регионе? Set up a VPN yourself - + Настроить VPN самостоятельно I want to choose a VPN protocol - + Выбор VPN-протокола Continue - Продолжить + Продолжить Set up later - + Настроить позднее @@ -1657,33 +1675,33 @@ It's okay as long as it's from someone you trust. The server has already been added to the application - + Сервер уже был добавлен в приложение Amnesia has detected that your server is currently - + Amnesia обнаружила, что ваш сервер в настоящее время busy installing other software. Amnesia installation - + занят установкой других протоколов или сервисов. Установка Amnesia will pause until the server finishes installing other software - + будет приостановлена до тех пор, пока сервер не завершит установку Installing - + Установка Usually it takes no more than 5 minutes - + Обычно это занимает не более 5 минут @@ -1691,32 +1709,32 @@ It's okay as long as it's from someone you trust. Installing %1 - + Установка %1 More detailed - + Подробнее Close - + Закрыть Network protocol - + Сетевой протокол Port - + Порт Install - + Установка @@ -1724,12 +1742,12 @@ It's okay as long as it's from someone you trust. VPN protocol - + VPN протокол Choose the one with the highest priority for you. Later, you can install other protocols and additional services, such as DNS proxy and SFTP. - + Выберите протокол, который вам больше подходит . В дальнейшем можно установить другие протоколы и дополнительные сервисы, такие как DNS-прокси и SFTP. @@ -1737,7 +1755,7 @@ It's okay as long as it's from someone you trust. Point the camera at the QR code and hold for a couple of seconds. - + Наведите камеру на QR-код и удерживайте ее в течение нескольких секунд. @@ -1745,27 +1763,27 @@ It's okay as long as it's from someone you trust. Settings restored from backup file - + Восстановление настроек из бэкап файла Free service for creating a personal VPN on your server. - + Простое и бесплатное приложение для запуска self-hosted VPN с высокими требованиями к приватности. Helps you access blocked content without revealing your privacy, even to VPN providers. - + Помогает получить доступ к заблокированному контенту, не раскрывая вашу конфиденциальность даже провайдерам VPN. I have the data to connect - + У меня есть данные для подключения I have nothing - + У меня ничего нет @@ -1773,27 +1791,27 @@ It's okay as long as it's from someone you trust. Connection key - + Ключ для подключения A line that starts with vpn://... - + Строка, которая начинается с vpn://... Key - + Ключ Insert - + Вставка Continue - Продолжить + Продолжить @@ -1801,27 +1819,27 @@ It's okay as long as it's from someone you trust. New connection - + Новое соединение Do not use connection code from public sources. It could be created to intercept your data. - + Не используйте код подключения из публичных источников. Его могли создать, чтобы перехватывать ваши данные. Collapse content - + Свернуть Show content - + Показать содержимое ключа Connect - + Подключиться @@ -1829,95 +1847,95 @@ It's okay as long as it's from someone you trust. OpenVpn native format - + OpenVpn нативный формат WireGuard native format - + WireGuard нативный формат VPN Access - + VPN-Доступ Connection - + Соединение VPN access without the ability to manage the server - + Доступ к VPN, без возможности управления сервером Server - + Сервер Accessing - + Доступ File with accessing settings to - + Файл с настройками доступа к Connection to - + Подключение к File with connection settings to - + Файл с настройками доступа к Save OpenVPN config - + Сохранить OpenVPN config Save WireGuard config - + Сохранить WireGuard config For the AmneziaVPN app - + Для AmneziaVPN Full access - + Полный доступ Access to server management. The user with whom you share full access to the connection will be able to add and remove your protocols and services to the servers, as well as change settings. - + Доступ к управлению серверами. Пользователь, с которым вы поделились полным доступ к VPN, сможет добавлять и удалять ваши протоколы и сервисы на сервере, а также менять настройки. Protocol - + Протокол Connection format - + Формат подключения Share - + Поделиться @@ -1925,7 +1943,7 @@ It's okay as long as it's from someone you trust. Close - + Закрыть @@ -1933,38 +1951,38 @@ It's okay as long as it's from someone you trust. Password entry not found - + Password entry not found Could not decrypt data - + Could not decrypt data Unknown error - + Unknown error Could not open wallet: %1; %2 - + Could not open wallet: %1; %2 Password not found - + Password not found Could not open keystore - + Could not open keystore Could not remove private key from keystore - + Could not remove private key from keystore @@ -1972,12 +1990,12 @@ It's okay as long as it's from someone you trust. Unknown error - + Unknown error Access to keychain denied - + Access to keychain denied @@ -1985,27 +2003,27 @@ It's okay as long as it's from someone you trust. Could not store data in settings: access error - + Could not store data in settings: access error Could not store data in settings: format error - + Could not store data in settings: format error Could not delete data from settings: access error - + Could not delete data from settings: access error Could not delete data from settings: format error - + Could not delete data from settings: format error Entry not found - + Entry not found @@ -2013,80 +2031,80 @@ It's okay as long as it's from someone you trust. Password entry not found - + Password entry not found Could not decrypt data - + Could not decrypt data D-Bus is not running - + D-Bus is not running Unknown error - + Unknown error No keychain service available - + No keychain service available Could not open wallet: %1; %2 - + Could not open wallet: %1; %2 Access to keychain denied - + Access to keychain denied Could not determine data type: %1; %2 - + Could not determine data type: %1; %2 Entry not found - + Entry not found Unsupported entry type 'Map' - + Unsupported entry type 'Map' Unknown kwallet entry type '%1' - + Unknown kwallet entry type '%1' Password not found - + Password not found Could not open keystore - + Could not open keystore Could not retrieve private key from keystore - + Could not retrieve private key from keystore Could not create decryption cipher - + Could not create decryption cipher @@ -2094,73 +2112,73 @@ It's okay as long as it's from someone you trust. Credential size exceeds maximum size of %1 - + Credential size exceeds maximum size of %1 Credential key exceeds maximum size of %1 - + Credential key exceeds maximum size of %1 Writing credentials failed: Win32 error code %1 - + Writing credentials failed: Win32 error code %1 Encryption failed - + Encryption failed D-Bus is not running - + D-Bus is not running Unknown error - + Unknown error Could not open wallet: %1; %2 - + Could not open wallet: %1; %2 Password not found - + Password not found Could not open keystore - + Could not open keystore Could not create private key generator - + Could not create private key generator Could not generate new private key - + Could not generate new private key Could not retrieve private key from keystore - + Could not retrieve private key from keystore Could not create encryption cipher - + Could not create encryption cipher Could not encrypt data - + Could not encrypt data @@ -2168,374 +2186,378 @@ It's okay as long as it's from someone you trust. No error - + No error Unknown Error - + Unknown Error Function not implemented - + Function not implemented Server check failed - + Server check failed Server port already used. Check for another software - + Server port already used. Check for another software Server error: Docker container missing - + Server error: Docker container missing Server error: Docker failed - + Server error: Docker failed Installation canceled by user - + Installation canceled by user The user does not have permission to use sudo - + The user does not have permission to use sudo Ssh request was denied - + Ssh request was denied Ssh request was interrupted - + Ssh request was interrupted Ssh internal error - + Ssh internal error Invalid private key or invalid passphrase entered - + Invalid private key or invalid passphrase entered The selected private key format is not supported, use openssh ED25519 key types or PEM key types - + The selected private key format is not supported, use openssh ED25519 key types or PEM key types Timeout connecting to server - + Timeout connecting to server Sftp error: End-of-file encountered - + Sftp error: End-of-file encountered Sftp error: File does not exist - + Sftp error: File does not exist Sftp error: Permission denied - + Sftp error: Permission denied Sftp error: Generic failure - + Sftp error: Generic failure Sftp error: Garbage received from server - + Sftp error: Garbage received from server Sftp error: No connection has been set up - + Sftp error: No connection has been set up Sftp error: There was a connection, but we lost it - + Sftp error: There was a connection, but we lost it Sftp error: Operation not supported by libssh yet - + Sftp error: Operation not supported by libssh yet Sftp error: Invalid file handle - + Sftp error: Invalid file handle Sftp error: No such file or directory path exists - + Sftp error: No such file or directory path exists Sftp error: An attempt to create an already existing file or directory has been made - + Sftp error: An attempt to create an already existing file or directory has been made Sftp error: Write-protected filesystem - + Sftp error: Write-protected filesystem Sftp error: No media was in remote drive - + Sftp error: No media was in remote drive Failed to save config to disk - + Failed to save config to disk OpenVPN config missing - + OpenVPN config missing OpenVPN management server error - + OpenVPN management server error OpenVPN executable missing - + OpenVPN executable missing ShadowSocks (ss-local) executable missing - + ShadowSocks (ss-local) executable missing Cloak (ck-client) executable missing - + Cloak (ck-client) executable missing Amnezia helper service error - + Amnezia helper service error OpenSSL failed - + OpenSSL failed Can't connect: another VPN connection is active - + Can't connect: another VPN connection is active Can't setup OpenVPN TAP network adapter - + Can't setup OpenVPN TAP network adapter VPN pool error: no available addresses - + VPN pool error: no available addresses The config does not contain any containers and credentiaks for connecting to the server - + The config does not contain any containers and credentiaks for connecting to the server Internal error - + Internal error IPsec - + IPsec DNS Service - + DNS Сервис Sftp file sharing service - + Сервис обмена файлами Sftp Website in Tor network - + Веб-сайт в сети Tor Amnezia DNS - + Amnezia DNS OpenVPN is the most popular VPN protocol, with flexible configuration options. It uses its own security protocol with SSL/TLS for key exchange. - + OpenVPN - популярный VPN-протокол, с гибкой настройкой. Имеет собственный протокол безопасности с SSL/TLS для обмена ключами. ShadowSocks - masks VPN traffic, making it similar to normal web traffic, but is recognised by analysis systems in some highly censored regions. - + ShadowSocks - маскирует VPN-трафик под обычный веб-трафик, но распознается системами анализа в некоторых регионах с высоким уровнем цензуры. OpenVPN over Cloak - OpenVPN with VPN masquerading as web traffic and protection against active-probbing detection. Ideal for bypassing blocking in regions with the highest levels of censorship. - + OpenVPN over Cloak - OpenVPN с маскировкой VPN под web-трафик и защитой от обнаружения active-probbing. Подходит для регионов с самым высоким уровнем цензуры. - WireGuard - New popular VPN protocol with high performance, high speed and low power consumption. Recommended for regions with low levels of censorship. + WireGuard - Популярный VPN-протокол с высокой производительностью, высокой скоростью и низким энергопотреблением. Для регионов с низким уровнем цензуры. + + + + AmneziaWG - Special protocol from Amnezia, based on WireGuard. It's fast like WireGuard, but very resistant to blockages. Recommended for regions with high levels of censorship. IKEv2 - 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. - + IKEv2 Современный стабильный протокол, немного быстрее других восстанавливает соединение после потери сигнала. Имеет нативную поддержку последних версиий Android и iOS. Deploy a WordPress site on the Tor network in two clicks. - + Разверните сайт на WordPress в сети Tor в два клика. Replace the current DNS server with your own. This will increase your privacy level. - + Замените адрес DNS-сервера на собственный. Это повысит уровень конфиденциальности. Creates a file vault on your server to securely store and transfer files. - + Создайте на сервере файловое хранилище для безопасного хранения и передачи файлов. OpenVPN container - + OpenVPN протокол Container with OpenVpn and ShadowSocks - + Связка протоколов OpenVPN и ShadowSocks Container with OpenVpn and ShadowSocks protocols configured with traffic masking by Cloak plugin - + Протоколы OpenVpn и ShadowSocks, с плагином маскировки трафика Cloak WireGuard container - + WireGuard протокол AmneziaWG container - + AmneziaWG протокол IPsec container - + IPsec протокол Sftp file sharing service - is secure FTP service - + Сервис обмена файлами Sftp - безопасный FTP-сервис Sftp service - + Сервис SFTP Entry not found - + Entry not found Access to keychain denied - + Access to keychain denied No keyring daemon - + No keyring daemon Already unlocked - + Already unlocked No such keyring - + No such keyring Bad arguments - + Bad arguments I/O error - + I/O error Cancelled - + Cancelled Keyring already exists - + Keyring already exists No match - + No match Unknown error - + Unknown error error 0x%1: %2 - + error 0x%1: %2 @@ -2543,7 +2565,7 @@ It's okay as long as it's from someone you trust. Choose language - + Выберете язык @@ -2551,13 +2573,13 @@ It's okay as long as it's from someone you trust. Server #1 - + Server #1 Server - + Server @@ -2565,22 +2587,22 @@ It's okay as long as it's from someone you trust. Software version - + Версия ПО All settings have been reset to default values - + Все настройки были сброшены к значению "По умолчанию" Cached profiles cleared - + Кэш профиля очищен Backup file is corrupted - + Backup файл поврежден @@ -2589,32 +2611,32 @@ It's okay as long as it's from someone you trust. Save AmneziaVPN config - + Сохранить config AmneziaVPN Share - + Поделиться Copy - + Скопировать Copied - + Скопировано Show connection settings - + Показать настройки подключения To read the QR code in the Amnezia app, select "Add server" → "I have data to connect" → "QR code, key or settings file" - + Для считывания QR-кода в приложении Amnezia выберите "Добавить сервер" → "У меня есть данные для подключения" → "QR-код, ключ или файл настроек" @@ -2622,42 +2644,42 @@ It's okay as long as it's from someone you trust. Hostname not look like ip adress or domain name - + Имя хоста не похоже на ip-адрес или доменное имя New site added: %1 - + Добавлен новый сайт %1 Site removed: %1 - + Сайт удален %1 Can't open file: %1 - + Невозможно открыть файл: %1 Failed to parse JSON data from file: %1 - + Не удалось разобрать JSON-данные из файла: %1 The JSON data is not an array in file: %1 - + Данные JSON не являются массивом в файле: %1 Import completed - + Импорт завершен Export completed - + Экспорт завершен @@ -2666,31 +2688,31 @@ It's okay as long as it's from someone you trust. Show - + Показать Connect - + Подключиться Disconnect - + Отключиться Visit Website - + Посетить сайт Quit - + Закрыть @@ -2698,7 +2720,7 @@ It's okay as long as it's from someone you trust. The field can't be empty - + Поле не может быть пустым @@ -2706,7 +2728,7 @@ It's okay as long as it's from someone you trust. Mbps - + Mbps @@ -2714,42 +2736,42 @@ It's okay as long as it's from someone you trust. Unknown - + Неизвестный Disconnected - + Отключен Preparing - + Подготовка Connecting... - + Подключение... Connected - + Подключено Disconnecting... - + Отключение... Reconnecting... - + Переподключение... Error - + Ошибка @@ -2757,45 +2779,65 @@ It's okay as long as it's from someone you trust. Low - + Низкий - High + Medium or High - Medium - - - - - Many foreign websites and VPN providers are blocked - - - - - Some foreign sites are blocked, but VPN providers are not blocked + Extreme - I just want to increase the level of privacy + I just want to increase the level of my privacy. + + + I want to bypass censorship. This option recommended in most cases. + + + + + Most VPN protocols are blocked. Recommended if other options are not working. + + + + High + Высокий + + + Medium + Средний + + + Many foreign websites and VPN providers are blocked + Многие иностранные сайты и VPN-провайдеры заблокированы + + + Some foreign sites are blocked, but VPN providers are not blocked + Некоторые иностранные сайты заблокированы, но VPN-провайдеры не блокируются + + + I just want to increase the level of privacy + Хочу просто повысить уровень приватности + main2 Private key passphrase - + Кодовая фраза для закрытого ключа Save - + Сохранить From 384ce9853b92b99f060a566257f1e0b701f9272d Mon Sep 17 00:00:00 2001 From: ronoaer Date: Sat, 14 Oct 2023 23:00:31 +0800 Subject: [PATCH 051/108] added new drawer2type for replacing drawertype --- client/resources.qrc | 1 + .../ConnectionTypeSelectionDrawer.qml | 2 +- client/ui/qml/Components/QuestionDrawer.qml | 2 +- .../qml/Components/SelectLanguageDrawer.qml | 2 +- .../qml/Components/ShareConnectionDrawer.qml | 11 +- client/ui/qml/Controls2/Drawer2Type.qml | 266 ++++++++++++++++++ client/ui/qml/Controls2/DropDownType.qml | 5 +- .../Pages2/PageProtocolOpenVpnSettings.qml | 7 +- client/ui/qml/Pages2/PageProtocolRaw.qml | 10 +- .../ui/qml/Pages2/PageServiceDnsSettings.qml | 7 +- .../ui/qml/Pages2/PageServiceSftpSettings.qml | 7 +- .../Pages2/PageServiceTorWebsiteSettings.qml | 7 +- .../ui/qml/Pages2/PageSettingsApplication.qml | 8 +- client/ui/qml/Pages2/PageSettingsBackup.qml | 6 +- client/ui/qml/Pages2/PageSettingsDns.qml | 7 +- client/ui/qml/Pages2/PageSettingsLogging.qml | 7 +- .../ui/qml/Pages2/PageSettingsServerData.qml | 12 +- .../ui/qml/Pages2/PageSettingsServerInfo.qml | 6 +- .../qml/Pages2/PageSettingsServerProtocol.qml | 6 +- .../qml/Pages2/PageSettingsSplitTunneling.qml | 15 +- .../PageSetupWizardProtocolSettings.qml | 4 +- client/ui/qml/Pages2/PageSetupWizardStart.qml | 3 +- client/ui/qml/Pages2/PageShare.qml | 1 + client/ui/qml/Pages2/PageStart.qml | 4 +- 24 files changed, 350 insertions(+), 56 deletions(-) create mode 100644 client/ui/qml/Controls2/Drawer2Type.qml diff --git a/client/resources.qrc b/client/resources.qrc index f0494852..d7f8ff7a 100644 --- a/client/resources.qrc +++ b/client/resources.qrc @@ -216,5 +216,6 @@ ui/qml/Pages2/PageServiceDnsSettings.qml ui/qml/Controls2/TopCloseButtonType.qml images/controls/x-circle.svg + ui/qml/Controls2/Drawer2Type.qml diff --git a/client/ui/qml/Components/ConnectionTypeSelectionDrawer.qml b/client/ui/qml/Components/ConnectionTypeSelectionDrawer.qml index ecde1554..a368d45c 100644 --- a/client/ui/qml/Components/ConnectionTypeSelectionDrawer.qml +++ b/client/ui/qml/Components/ConnectionTypeSelectionDrawer.qml @@ -8,7 +8,7 @@ import "../Controls2" import "../Controls2/TextTypes" import "../Config" -DrawerType { +Drawer2Type { id: root width: parent.width diff --git a/client/ui/qml/Components/QuestionDrawer.qml b/client/ui/qml/Components/QuestionDrawer.qml index a79f9140..06f4ae24 100644 --- a/client/ui/qml/Components/QuestionDrawer.qml +++ b/client/ui/qml/Components/QuestionDrawer.qml @@ -5,7 +5,7 @@ import QtQuick.Layouts import "../Controls2" import "../Controls2/TextTypes" -DrawerType { +Drawer2Type { id: root property string headerText diff --git a/client/ui/qml/Components/SelectLanguageDrawer.qml b/client/ui/qml/Components/SelectLanguageDrawer.qml index d318aab8..f27fce6c 100644 --- a/client/ui/qml/Components/SelectLanguageDrawer.qml +++ b/client/ui/qml/Components/SelectLanguageDrawer.qml @@ -5,7 +5,7 @@ import QtQuick.Layouts import "../Controls2" import "../Controls2/TextTypes" -DrawerType { +Drawer2Type { id: root width: parent.width diff --git a/client/ui/qml/Components/ShareConnectionDrawer.qml b/client/ui/qml/Components/ShareConnectionDrawer.qml index 1158dadc..cb74f42e 100644 --- a/client/ui/qml/Components/ShareConnectionDrawer.qml +++ b/client/ui/qml/Components/ShareConnectionDrawer.qml @@ -16,7 +16,7 @@ import "../Controls2/TextTypes" import "../Config" import "../Components" -DrawerType { +Drawer2Type { id: root property alias headerText: header.headerText @@ -30,7 +30,7 @@ DrawerType { width: parent.width height: parent.height * 0.9 - onClosed: { + onClose: { configExtension = ".vpn" configCaption = qsTr("Save AmneziaVPN config") configFileName = "amnezia_config" @@ -126,13 +126,14 @@ DrawerType { text: qsTr("Show connection settings") onClicked: { - configContentDrawer.visible = true + configContentDrawer.open() } } - DrawerType { + Drawer2Type { id: configContentDrawer + parent: root width: parent.width height: parent.height * 0.9 @@ -145,7 +146,7 @@ DrawerType { anchors.topMargin: 16 backButtonFunction: function() { - configContentDrawer.visible = false + configContentDrawer.close() } } diff --git a/client/ui/qml/Controls2/Drawer2Type.qml b/client/ui/qml/Controls2/Drawer2Type.qml new file mode 100644 index 00000000..eae28846 --- /dev/null +++ b/client/ui/qml/Controls2/Drawer2Type.qml @@ -0,0 +1,266 @@ +import QtQuick +import QtQuick.Layouts +import QtQuick.Controls +import QtQuick.Shapes + +Item { + id: root + + Connections { + target: PageController + + function onForceCloseDrawer() { + root.state = "closed" + } + } + + visible: false + + parent: Overlay.overlay + + signal close() + + property bool needCloseButton: true + + property string defaultColor: "#1C1D21" + property string borderColor: "#2C2D30" + property int collapsedHeight: 0 + + property bool needCollapsed: false + + + y: parent.height - root.height + + state: "closed" + + Rectangle { + id: draw2Background + + anchors { left: root.left; right: root.right; top: root.top } + height: root.height + radius: 16 + color: root.defaultColor + border.color: root.borderColor + border.width: 1 + + Rectangle { + width: parent.radius + height: parent.radius + anchors.bottom: parent.bottom + anchors.right: parent.right + anchors.left: parent.left + color: parent.color + } + } + + MouseArea { + anchors.fill: parent + enabled: (root.state === "expanded" || root.state === "opened") + onClicked: { + if (root.state === "expanded") { + root.state = "collapsed" + return + } + + if (root.state === "opened") { + root.state = "closed" + return + } + } + } + + Drag.active: dragArea.drag.active + + MouseArea { + id: dragArea + + anchors.fill: parent + cursorShape: (root.state === "opened" || root.state === "expanded") ? Qt.PointingHandCursor : Qt.ArrowCursor + hoverEnabled: true + + drag.target: parent + drag.axis: Drag.YAxis + drag.maximumY: parent.height + drag.minimumY: parent.height - root.height + + /** If drag area is released at any point other than min or max y, transition to the other state */ + onReleased: { + if (root.state === "closed" && root.y < dragArea.drag.maximumY) { + root.state = "opened" + PageController.drawerOpen() + return + } + + if (root.state === "opened" && root.y > dragArea.drag.minimumY) { + root.state = "closed" + PageController.drawerClose() + return + } + + if (root.state === "collapsed" && root.y < dragArea.drag.maximumY) { + root.state = "expanded" + return + } + if (root.state === "expanded" && root.y > dragArea.drag.minimumY) { + root.state = "collapsed" + return + } + } + + onClicked: { + if (root.state === "opened") { + root.state = "closed" + } + + if (root.state == "expanded") { + root.state == "collapsed" + } + } + } + + onStateChanged: { + if (root.state === "closed" || root.state === "collapsed") { + var initialPageNavigationBarColor = PageController.getInitialPageNavigationBarColor() + if (initialPageNavigationBarColor !== 0xFF1C1D21) { + PageController.updateNavigationBarColor(initialPageNavigationBarColor) + } + + PageController.drawerClose() + return + } + if (root.state === "expanded" || root.state === "opened") { + if (PageController.getInitialPageNavigationBarColor() !== 0xFF1C1D21) { + PageController.updateNavigationBarColor(0xFF1C1D21) + } + PageController.drawerOpen() + return + } + } + + /** Two states of buttonContent, great place to add any future animations for the drawer */ + states: [ + State { + name: "collapsed" + PropertyChanges { + target: root + y: root.height - collapsedHeight + } + }, + State { + name: "expanded" + PropertyChanges { + target: root + y: dragArea.drag.minimumY + } + }, + + State { + name: "closed" + PropertyChanges { + target: root + y: parent.height + } + }, + + State { + name: "opend" + PropertyChanges { + target: root + y: dragArea.drag.minimumY + } + } + ] + + transitions: [ + Transition { + from: "collapsed" + to: "expanded" + PropertyAnimation { + target: root + properties: "y" + duration: 200 + } + }, + Transition { + from: "expanded" + to: "collapsed" + PropertyAnimation { + target: root + properties: "y" + duration: 200 + } + }, + + Transition { + from: "opened" + to: "closed" + PropertyAnimation { + target: root + properties: "y" + duration: 200 + } + }, + + Transition { + from: "closed" + to: "opened" + PropertyAnimation { + target: root + properties: "y" + duration: 200 + } + } + ] + + NumberAnimation { + id: animationVisible + target: root + property: "y" + from: parent.height + to: parent.height - root.height + duration: 200 + } + + function open() { + if (root.visible && root.state !== "closed") { + return + } + + root.state = "opened" + root.visible = true + root.y = parent.height - root.height + + dragArea.drag.maximumY = parent.height + dragArea.drag.minimumY = parent.height - root.height + + + animationVisible.running = true + + if (needCloseButton) { + PageController.drawerOpen() + } + + if (PageController.getInitialPageNavigationBarColor() !== 0xFF1C1D21) { + PageController.updateNavigationBarColor(0xFF1C1D21) + } + } + + function onClose() { + if (needCloseButton) { + PageController.drawerClose() + } + + var initialPageNavigationBarColor = PageController.getInitialPageNavigationBarColor() + if (initialPageNavigationBarColor !== 0xFF1C1D21) { + PageController.updateNavigationBarColor(initialPageNavigationBarColor) + } + + root.visible = false + } + + onVisibleChanged: { + if (!visible) { + close() + } + } +} diff --git a/client/ui/qml/Controls2/DropDownType.qml b/client/ui/qml/Controls2/DropDownType.qml index b91f0b7a..cab2ef4e 100644 --- a/client/ui/qml/Controls2/DropDownType.qml +++ b/client/ui/qml/Controls2/DropDownType.qml @@ -156,17 +156,20 @@ Item { if (rootButtonClickedFunction && typeof rootButtonClickedFunction === "function") { rootButtonClickedFunction() } else { - menu.visible = true + menu.open() } } } + // Drawer2Type { DrawerType { id: menu width: parent.width height: parent.height * drawerHeight + // parent: root.parent.parent + ColumnLayout { id: header diff --git a/client/ui/qml/Pages2/PageProtocolOpenVpnSettings.qml b/client/ui/qml/Pages2/PageProtocolOpenVpnSettings.qml index c8469dcb..f03cfc07 100644 --- a/client/ui/qml/Pages2/PageProtocolOpenVpnSettings.qml +++ b/client/ui/qml/Pages2/PageProtocolOpenVpnSettings.qml @@ -365,14 +365,14 @@ PageType { questionDrawer.noButtonText = qsTr("Cancel") questionDrawer.yesButtonFunction = function() { - questionDrawer.visible = false + questionDrawer.onClose() PageController.goToPage(PageEnum.PageDeinstalling) InstallController.removeCurrentlyProcessedContainer() } questionDrawer.noButtonFunction = function() { - questionDrawer.visible = false + questionDrawer.onClose() } - questionDrawer.visible = true + questionDrawer.open() } } @@ -397,6 +397,7 @@ PageType { QuestionDrawer { id: questionDrawer + parent: root } } } diff --git a/client/ui/qml/Pages2/PageProtocolRaw.qml b/client/ui/qml/Pages2/PageProtocolRaw.qml index 2324c091..3e0fe5ab 100644 --- a/client/ui/qml/Pages2/PageProtocolRaw.qml +++ b/client/ui/qml/Pages2/PageProtocolRaw.qml @@ -90,8 +90,9 @@ PageType { DividerType {} - DrawerType { + Drawer2Type { id: configContentDrawer + parent: root width: parent.width height: parent.height * 0.9 @@ -179,14 +180,14 @@ PageType { questionDrawer.noButtonText = qsTr("Cancel") questionDrawer.yesButtonFunction = function() { - questionDrawer.visible = false + questionDrawer.onClose() PageController.goToPage(PageEnum.PageDeinstalling) InstallController.removeCurrentlyProcessedContainer() } questionDrawer.noButtonFunction = function() { - questionDrawer.visible = false + questionDrawer.onClose() } - questionDrawer.visible = true + questionDrawer.open() } MouseArea { @@ -201,6 +202,7 @@ PageType { QuestionDrawer { id: questionDrawer + parent: root } } } diff --git a/client/ui/qml/Pages2/PageServiceDnsSettings.qml b/client/ui/qml/Pages2/PageServiceDnsSettings.qml index 10fe6f56..70aba8e2 100644 --- a/client/ui/qml/Pages2/PageServiceDnsSettings.qml +++ b/client/ui/qml/Pages2/PageServiceDnsSettings.qml @@ -68,14 +68,14 @@ PageType { questionDrawer.noButtonText = qsTr("Cancel") questionDrawer.yesButtonFunction = function() { - questionDrawer.visible = false + questionDrawer.onClose() PageController.goToPage(PageEnum.PageDeinstalling) InstallController.removeCurrentlyProcessedContainer() } questionDrawer.noButtonFunction = function() { - questionDrawer.visible = false + questionDrawer.onClose() } - questionDrawer.visible = true + questionDrawer.open() } MouseArea { @@ -89,6 +89,7 @@ PageType { QuestionDrawer { id: questionDrawer + parent: root } } } diff --git a/client/ui/qml/Pages2/PageServiceSftpSettings.qml b/client/ui/qml/Pages2/PageServiceSftpSettings.qml index 61ba663d..0af47cdd 100644 --- a/client/ui/qml/Pages2/PageServiceSftpSettings.qml +++ b/client/ui/qml/Pages2/PageServiceSftpSettings.qml @@ -265,14 +265,14 @@ PageType { questionDrawer.noButtonText = qsTr("Cancel") questionDrawer.yesButtonFunction = function() { - questionDrawer.visible = false + questionDrawer.onClose() PageController.goToPage(PageEnum.PageDeinstalling) InstallController.removeCurrentlyProcessedContainer() } questionDrawer.noButtonFunction = function() { - questionDrawer.visible = false + questionDrawer.onClose() } - questionDrawer.visible = true + questionDrawer.open() } } } @@ -282,6 +282,7 @@ PageType { QuestionDrawer { id: questionDrawer + parent: root } } } diff --git a/client/ui/qml/Pages2/PageServiceTorWebsiteSettings.qml b/client/ui/qml/Pages2/PageServiceTorWebsiteSettings.qml index 04d7076c..deff35eb 100644 --- a/client/ui/qml/Pages2/PageServiceTorWebsiteSettings.qml +++ b/client/ui/qml/Pages2/PageServiceTorWebsiteSettings.qml @@ -143,20 +143,21 @@ PageType { questionDrawer.noButtonText = qsTr("Cancel") questionDrawer.yesButtonFunction = function() { - questionDrawer.visible = false + questionDrawer.onClose() PageController.goToPage(PageEnum.PageDeinstalling) InstallController.removeCurrentlyProcessedContainer() } questionDrawer.noButtonFunction = function() { - questionDrawer.visible = false + questionDrawer.onClose() } - questionDrawer.visible = true + questionDrawer.open() } } } QuestionDrawer { id: questionDrawer + parent: root } } } diff --git a/client/ui/qml/Pages2/PageSettingsApplication.qml b/client/ui/qml/Pages2/PageSettingsApplication.qml index c5536fdb..225e2b14 100644 --- a/client/ui/qml/Pages2/PageSettingsApplication.qml +++ b/client/ui/qml/Pages2/PageSettingsApplication.qml @@ -119,6 +119,7 @@ PageType { SelectLanguageDrawer { id: selectLanguageDrawer + parent: root } @@ -151,14 +152,14 @@ PageType { questionDrawer.noButtonText = qsTr("Cancel") questionDrawer.yesButtonFunction = function() { - questionDrawer.visible = false + questionDrawer.onClose() SettingsController.clearSettings() PageController.replaceStartPage() } questionDrawer.noButtonFunction = function() { - questionDrawer.visible = false + questionDrawer.onClose() } - questionDrawer.visible = true + questionDrawer.open() } } @@ -166,6 +167,7 @@ PageType { QuestionDrawer { id: questionDrawer + parent: root } } } diff --git a/client/ui/qml/Pages2/PageSettingsBackup.qml b/client/ui/qml/Pages2/PageSettingsBackup.qml index 96214893..61370dab 100644 --- a/client/ui/qml/Pages2/PageSettingsBackup.qml +++ b/client/ui/qml/Pages2/PageSettingsBackup.qml @@ -138,15 +138,15 @@ PageType { questionDrawer.noButtonText = qsTr("Cancel") questionDrawer.yesButtonFunction = function() { - questionDrawer.visible = false + questionDrawer.onClose() PageController.showBusyIndicator(true) SettingsController.restoreAppConfig(filePath) PageController.showBusyIndicator(false) } questionDrawer.noButtonFunction = function() { - questionDrawer.visible = false + questionDrawer.onClose() } - questionDrawer.visible = true + questionDrawer.open() } QuestionDrawer { diff --git a/client/ui/qml/Pages2/PageSettingsDns.qml b/client/ui/qml/Pages2/PageSettingsDns.qml index 58ec0783..917c6992 100644 --- a/client/ui/qml/Pages2/PageSettingsDns.qml +++ b/client/ui/qml/Pages2/PageSettingsDns.qml @@ -91,7 +91,7 @@ PageType { questionDrawer.noButtonText = qsTr("Cancel") questionDrawer.yesButtonFunction = function() { - questionDrawer.visible = false + questionDrawer.onClose() SettingsController.primaryDns = "1.1.1.1" primaryDns.textFieldText = SettingsController.primaryDns SettingsController.secondaryDns = "1.0.0.1" @@ -99,9 +99,9 @@ PageType { PageController.showNotificationMessage(qsTr("Settings have been reset")) } questionDrawer.noButtonFunction = function() { - questionDrawer.visible = false + questionDrawer.onClose() } - questionDrawer.visible = true + questionDrawer.open() } } @@ -123,6 +123,7 @@ PageType { } QuestionDrawer { id: questionDrawer + parent: root } } } diff --git a/client/ui/qml/Pages2/PageSettingsLogging.qml b/client/ui/qml/Pages2/PageSettingsLogging.qml index 4141f51f..1532d1dc 100644 --- a/client/ui/qml/Pages2/PageSettingsLogging.qml +++ b/client/ui/qml/Pages2/PageSettingsLogging.qml @@ -146,16 +146,16 @@ PageType { questionDrawer.noButtonText = qsTr("Cancel") questionDrawer.yesButtonFunction = function() { - questionDrawer.visible = false + questionDrawer.onClose() PageController.showBusyIndicator(true) SettingsController.clearLogs() PageController.showBusyIndicator(false) PageController.showNotificationMessage(qsTr("Logs have been cleaned up")) } questionDrawer.noButtonFunction = function() { - questionDrawer.visible = false + questionDrawer.onClose() } - questionDrawer.visible = true + questionDrawer.open() } } @@ -171,6 +171,7 @@ PageType { QuestionDrawer { id: questionDrawer + parent: root } } } diff --git a/client/ui/qml/Pages2/PageSettingsServerData.qml b/client/ui/qml/Pages2/PageSettingsServerData.qml index 3eb07ce9..c90e66b3 100644 --- a/client/ui/qml/Pages2/PageSettingsServerData.qml +++ b/client/ui/qml/Pages2/PageSettingsServerData.qml @@ -94,15 +94,15 @@ PageType { questionDrawer.noButtonText = qsTr("Cancel") questionDrawer.yesButtonFunction = function() { - questionDrawer.visible = false + questionDrawer.onClose() PageController.showBusyIndicator(true) SettingsController.clearCachedProfiles() PageController.showBusyIndicator(false) } questionDrawer.noButtonFunction = function() { - questionDrawer.visible = false + questionDrawer.onClose() } - questionDrawer.visible = true + questionDrawer.open() } } @@ -172,7 +172,7 @@ PageType { questionDrawer.noButtonText = qsTr("Cancel") questionDrawer.yesButtonFunction = function() { - questionDrawer.visible = false + questionDrawer.onClose() PageController.goToPage(PageEnum.PageDeinstalling) if (ServersModel.isDefaultServerCurrentlyProcessed() && ConnectionController.isConnected) { ConnectionController.closeConnection() @@ -180,9 +180,9 @@ PageType { InstallController.removeAllContainers() } questionDrawer.noButtonFunction = function() { - questionDrawer.visible = false + questionDrawer.onClose() } - questionDrawer.visible = true + questionDrawer.open() } } diff --git a/client/ui/qml/Pages2/PageSettingsServerInfo.qml b/client/ui/qml/Pages2/PageSettingsServerInfo.qml index e2e7868c..d534b509 100644 --- a/client/ui/qml/Pages2/PageSettingsServerInfo.qml +++ b/client/ui/qml/Pages2/PageSettingsServerInfo.qml @@ -71,13 +71,14 @@ PageType { } actionButtonFunction: function() { - serverNameEditDrawer.visible = true + serverNameEditDrawer.open() } } - DrawerType { + Drawer2Type { id: serverNameEditDrawer + parent: root width: root.width height: root.height * 0.35 @@ -95,6 +96,7 @@ PageType { anchors.leftMargin: 16 anchors.rightMargin: 16 + TextFieldWithHeaderType { id: serverName diff --git a/client/ui/qml/Pages2/PageSettingsServerProtocol.qml b/client/ui/qml/Pages2/PageSettingsServerProtocol.qml index 30758da4..594e4520 100644 --- a/client/ui/qml/Pages2/PageSettingsServerProtocol.qml +++ b/client/ui/qml/Pages2/PageSettingsServerProtocol.qml @@ -119,14 +119,14 @@ PageType { questionDrawer.noButtonText = qsTr("Cancel") questionDrawer.yesButtonFunction = function() { - questionDrawer.visible = false + questionDrawer.onClose() PageController.goToPage(PageEnum.PageDeinstalling) InstallController.removeCurrentlyProcessedContainer() } questionDrawer.noButtonFunction = function() { - questionDrawer.visible = false + questionDrawer.onClose() } - questionDrawer.visible = true + questionDrawer.open() } MouseArea { diff --git a/client/ui/qml/Pages2/PageSettingsSplitTunneling.qml b/client/ui/qml/Pages2/PageSettingsSplitTunneling.qml index b79d5d22..406fae66 100644 --- a/client/ui/qml/Pages2/PageSettingsSplitTunneling.qml +++ b/client/ui/qml/Pages2/PageSettingsSplitTunneling.qml @@ -200,13 +200,13 @@ PageType { questionDrawer.noButtonText = qsTr("Cancel") questionDrawer.yesButtonFunction = function() { - questionDrawer.visible = false + questionDrawer.onClose() SitesController.removeSite(index) } questionDrawer.noButtonFunction = function() { - questionDrawer.visible = false + questionDrawer.onClose() } - questionDrawer.visible = true + questionDrawer.open() } } @@ -214,6 +214,7 @@ PageType { QuestionDrawer { id: questionDrawer + parent: root } } } @@ -259,12 +260,14 @@ PageType { } } - DrawerType { + Drawer2Type { id: moreActionsDrawer width: parent.width height: parent.height * 0.4375 + parent: root + FlickableType { anchors.fill: parent contentHeight: moreActionsDrawerContent.height @@ -324,12 +327,14 @@ PageType { } } - DrawerType { + Drawer2Type { id: importSitesDrawer width: parent.width height: parent.height * 0.4375 + parent: root + BackButtonType { id: importSitesDrawerBackButton diff --git a/client/ui/qml/Pages2/PageSetupWizardProtocolSettings.qml b/client/ui/qml/Pages2/PageSetupWizardProtocolSettings.qml index 7535464a..794ec90b 100644 --- a/client/ui/qml/Pages2/PageSetupWizardProtocolSettings.qml +++ b/client/ui/qml/Pages2/PageSetupWizardProtocolSettings.qml @@ -97,12 +97,14 @@ PageType { } } - DrawerType { + Drawer2Type { id: showDetailsDrawer width: parent.width height: parent.height * 0.9 + parent: root + BackButtonType { id: showDetailsBackButton diff --git a/client/ui/qml/Pages2/PageSetupWizardStart.qml b/client/ui/qml/Pages2/PageSetupWizardStart.qml index 9f5e57a5..17aa860f 100644 --- a/client/ui/qml/Pages2/PageSetupWizardStart.qml +++ b/client/ui/qml/Pages2/PageSetupWizardStart.qml @@ -115,7 +115,7 @@ PageType { text: qsTr("I have the data to connect") onClicked: { - connectionTypeSelection.visible = true + connectionTypeSelection.open() } } @@ -140,6 +140,7 @@ PageType { ConnectionTypeSelectionDrawer { id: connectionTypeSelection + parent: root } } diff --git a/client/ui/qml/Pages2/PageShare.qml b/client/ui/qml/Pages2/PageShare.qml index 2fa5e4a1..6c641ea6 100644 --- a/client/ui/qml/Pages2/PageShare.qml +++ b/client/ui/qml/Pages2/PageShare.qml @@ -371,6 +371,7 @@ PageType { ShareConnectionDrawer { id: shareConnectionDrawer + parent: root } BasicButtonType { diff --git a/client/ui/qml/Pages2/PageStart.qml b/client/ui/qml/Pages2/PageStart.qml index 4af774fa..923d1e79 100644 --- a/client/ui/qml/Pages2/PageStart.qml +++ b/client/ui/qml/Pages2/PageStart.qml @@ -135,6 +135,8 @@ PageType { var pagePath = PageController.getPagePath(PageEnum.PageHome) ServersModel.currentlyProcessedIndex = ServersModel.defaultIndex tabBarStackView.push(pagePath, { "objectName" : pagePath }) + + connectionTypeSelection.parent = tabBarStackView } onWidthChanged: { @@ -243,7 +245,7 @@ PageType { ConnectionTypeSelectionDrawer { id: connectionTypeSelection - onAboutToHide: { + onClose: function() { tabBar.setCurrentIndex(tabBar.previousIndex) } } From 512ac74ee6f1201344fc2b89ce2244e36c758428 Mon Sep 17 00:00:00 2001 From: "vladimir.kuznetsov" Date: Sat, 14 Oct 2023 20:59:03 +0500 Subject: [PATCH 052/108] temporarily disabled the drawer close button --- client/protocols/protocols_defs.cpp | 2 +- client/translations/amneziavpn_ru.ts | 8 ++++---- client/translations/amneziavpn_zh_CN.ts | 8 ++++---- client/ui/qml/Pages2/PageStart.qml | 25 +++++++++++++------------ 4 files changed, 22 insertions(+), 21 deletions(-) diff --git a/client/protocols/protocols_defs.cpp b/client/protocols/protocols_defs.cpp index b7f6b1d8..5964bd87 100644 --- a/client/protocols/protocols_defs.cpp +++ b/client/protocols/protocols_defs.cpp @@ -66,7 +66,7 @@ QMap ProtocolProps::protocolHumanNames() { Proto::ShadowSocks, "ShadowSocks" }, { Proto::Cloak, "Cloak" }, { Proto::WireGuard, "WireGuard" }, - { Proto::WireGuard, "AmneziaWG" }, + { Proto::Awg, "AmneziaWG" }, { Proto::Ikev2, "IKEv2" }, { Proto::L2tp, "L2TP" }, diff --git a/client/translations/amneziavpn_ru.ts b/client/translations/amneziavpn_ru.ts index 94ce0b3a..73a7dead 100644 --- a/client/translations/amneziavpn_ru.ts +++ b/client/translations/amneziavpn_ru.ts @@ -1704,22 +1704,22 @@ It's okay as long as it's from someone you trust. - + Close - + Network protocol - + Port - + Install diff --git a/client/translations/amneziavpn_zh_CN.ts b/client/translations/amneziavpn_zh_CN.ts index 359655f8..2e772823 100644 --- a/client/translations/amneziavpn_zh_CN.ts +++ b/client/translations/amneziavpn_zh_CN.ts @@ -1807,22 +1807,22 @@ It's okay as long as it's from someone you trust. 更多细节 - + Close 关闭 - + Network protocol 网络协议 - + Port 端口 - + Install 安装 diff --git a/client/ui/qml/Pages2/PageStart.qml b/client/ui/qml/Pages2/PageStart.qml index 4af774fa..ab02ace4 100644 --- a/client/ui/qml/Pages2/PageStart.qml +++ b/client/ui/qml/Pages2/PageStart.qml @@ -44,9 +44,9 @@ PageType { tabBar.enabled = !visible } - function onShowTopCloseButton(visible) { - topCloseButton.visible = visible - } +// function onShowTopCloseButton(visible) { +// topCloseButton.visible = visible +// } function onEnableTabBar(enabled) { tabBar.enabled = enabled @@ -137,10 +137,10 @@ PageType { tabBarStackView.push(pagePath, { "objectName" : pagePath }) } - onWidthChanged: { - topCloseButton.x = tabBarStackView.x + tabBarStackView.width - - topCloseButton.buttonWidth - topCloseButton.rightPadding - } +// onWidthChanged: { +// topCloseButton.x = tabBarStackView.x + tabBarStackView.width - +// topCloseButton.buttonWidth - topCloseButton.rightPadding +// } } TabBar { @@ -234,11 +234,12 @@ PageType { z: 1 } - TopCloseButtonType { - id: topCloseButton - x: tabBarStackView.width - topCloseButton.buttonWidth - topCloseButton.rightPadding - z: 1 - } +// TopCloseButtonType { +// id: topCloseButton + +// x: tabBarStackView.width - topCloseButton.buttonWidth - topCloseButton.rightPadding +// z: 1 +// } ConnectionTypeSelectionDrawer { id: connectionTypeSelection From 8885f580b29ef6424df1793aecd8f48a6daefb42 Mon Sep 17 00:00:00 2001 From: "vladimir.kuznetsov" Date: Sat, 14 Oct 2023 21:18:38 +0500 Subject: [PATCH 053/108] added notification after saving backup and logs files --- client/ui/qml/Pages2/PageSettingsBackup.qml | 1 + client/ui/qml/Pages2/PageSettingsLogging.qml | 1 + 2 files changed, 2 insertions(+) diff --git a/client/ui/qml/Pages2/PageSettingsBackup.qml b/client/ui/qml/Pages2/PageSettingsBackup.qml index 96214893..81be0465 100644 --- a/client/ui/qml/Pages2/PageSettingsBackup.qml +++ b/client/ui/qml/Pages2/PageSettingsBackup.qml @@ -103,6 +103,7 @@ PageType { PageController.showBusyIndicator(true) SettingsController.backupAppConfig(fileName) PageController.showBusyIndicator(false) + PageController.showNotificationMessage(qsTr("Backup file saved")) } } } diff --git a/client/ui/qml/Pages2/PageSettingsLogging.qml b/client/ui/qml/Pages2/PageSettingsLogging.qml index 4141f51f..840c41d4 100644 --- a/client/ui/qml/Pages2/PageSettingsLogging.qml +++ b/client/ui/qml/Pages2/PageSettingsLogging.qml @@ -115,6 +115,7 @@ PageType { PageController.showBusyIndicator(true) SettingsController.exportLogsFile(fileName) PageController.showBusyIndicator(false) + PageController.showNotificationMessage(qsTr("Logs file saved")) } } } From f65e4066e3911c1f28b1b6a2973e8f01327880db Mon Sep 17 00:00:00 2001 From: pokamest Date: Sat, 14 Oct 2023 23:59:46 +0100 Subject: [PATCH 054/108] ui fixes --- client/CMakeLists.txt | 1 - client/translations/amneziavpn_ru.ts | 164 +++++++++--------- client/translations/amneziavpn_zh_CN.ts | 127 ++++++++------ .../ConnectionTypeSelectionDrawer.qml | 5 +- client/ui/qml/Config/GlobalConfig.qml | 12 ++ .../ui/qml/Pages2/PageServiceSftpSettings.qml | 20 +-- .../Pages2/PageServiceTorWebsiteSettings.qml | 16 +- client/ui/qml/Pages2/PageSettings.qml | 4 +- .../ui/qml/Pages2/PageSettingsConnection.qml | 1 - 9 files changed, 171 insertions(+), 179 deletions(-) diff --git a/client/CMakeLists.txt b/client/CMakeLists.txt index bcefd30f..6c4f1ae4 100644 --- a/client/CMakeLists.txt +++ b/client/CMakeLists.txt @@ -74,7 +74,6 @@ qt6_add_resources(QRC ${I18NQRC} ${CMAKE_CURRENT_BINARY_DIR}/translations.qrc) # -- i18n end if(IOS) - #execute_process(COMMAND bash ${CMAKE_CURRENT_LIST_DIR}/scripts/run-build-cloak.sh) execute_process(COMMAND bash ${CMAKE_CURRENT_LIST_DIR}/ios/scripts/openvpn.sh args WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR}) endif() diff --git a/client/translations/amneziavpn_ru.ts b/client/translations/amneziavpn_ru.ts index df2e53eb..a6c0464d 100644 --- a/client/translations/amneziavpn_ru.ts +++ b/client/translations/amneziavpn_ru.ts @@ -70,23 +70,18 @@ ConnectionTypeSelectionDrawer - Add server - + Add new connection + Добавить новое соединение - - Select data type - + + Configure your server + Настроить ваш сервер - - Server IP, login and password - - - - - QR code, key or configuration file - + + Open config file, key or QR code + Открыть файл конфига, ключ или QR код @@ -736,49 +731,49 @@ Already installed containers were found on the server. All installed containers Пароль - + Mount folder on device Смонтировать папку на вашем устройстве - + In order to mount remote SFTP folder as local drive, perform following steps: <br> Чтобы смонтировать SFTP-папку как локальный диск на вашем устройстве, выполните следующие действия - - + + <br>1. Install the latest version of <br>1. Установите последнюю версию - - + + <br>2. Install the latest version of <br>2. Установите последнюю версию - + Detailed instructions Подробные инструкции - + Remove SFTP and all data stored there Удалите SFTP-хранилище со всеми данными - + Remove SFTP and all data stored there? Удалить SFTP-хранилище и все хранящиеся на нем данные? - + Continue Продолжить - + Cancel Отменить @@ -806,37 +801,41 @@ Already installed containers were found on the server. All installed containers Скопировано - + Use <a href="https://www.torproject.org/download/" style="color: #FBB26A;">Tor Browser</a> to open this url. Используйте <a href="https://www.torproject.org/download/" style="color: #FBB26A;">Tor Browser</a> для открытия этой ссылки. - + After installation it takes several minutes while your onion site will become available in the Tor Network. Через несколько минут после установки ваш Onion сайт станет доступен в сети Tor. - - When configuring WordPress set the this address as domain. - + + When configuring WordPress set the this onion address as domain. + При настройке WordPress укажите этот onion адрес в качестве домена. - + When configuring WordPress set the this address as domain. + При настройке WordPress укажите этот onion адрес в качестве домена. + + + Remove website Удалить сайт - + The site with all data will be removed from the tor network. Сайт со всеми данными будет удален из сети tor. - + Continue Продолжить - + Cancel Отменить @@ -1079,37 +1078,42 @@ Already installed containers were found on the server. All installed containers - + Backup files (*.backup) Файлы резервного копирования (*.backup) - + + Backup file saved + + + + Restore from backup Восстановить из бэкапа - + Open backup file Открыть бэкап файл - + Import settings from a backup file? Импортировать настройки из бэкап файла? - + All current settings will be reset Все текущие настройки будут сброшены - + Continue Продолжить - + Cancel Отменить @@ -1162,12 +1166,12 @@ Already installed containers were found on the server. All installed containers Позволяет подключаться к одним сайтам через VPN, а к другим в обход него - + App-based split tunneling Раздельное VPN-туннелирование приложений - + Allows you to use the VPN only for certain applications Позволяет использовать VPN только для определённых приложений @@ -1258,32 +1262,37 @@ Already installed containers were found on the server. All installed containers Logs files (*.log) - + + Logs file saved + + + + Save logs to file Сохранить логи в файл - + Clear logs? Очистить логи? - + Continue Продолжить - + Cancel Отменить - + Logs have been cleaned up Логи удалены - + Clear logs Удалить логи @@ -1585,9 +1594,8 @@ It's okay as long as it's from someone you trust. PageSetupWizardCredentials - Server connection - Подключение к серверу + Подключение к серверу @@ -1610,7 +1618,13 @@ It's okay as long as it's from someone you trust. Продолжить - + + All data you enter will remain strictly confidential +and will not be shared or disclosed to the Amnezia or any third parties + Все данные, которые вы вводите, останутся строго конфиденциальными и не будут переданы или раскрыты Amnezia или каким-либо третьим сторонам + + + Enter the address in the format 255.255.255.255:88 Введите адрес в формате 255.255.255.255:88 @@ -1620,17 +1634,22 @@ It's okay as long as it's from someone you trust. Login to connect via SSH - + + Configure your server + Настроить ваш сервер + + + Ip address cannot be empty Поле Ip address не может быть пустым - + Login cannot be empty Поле Login не может быть пустым - + Password/private key cannot be empty Поле Password/private key не может быть пустым @@ -1865,7 +1884,7 @@ It's okay as long as it's from someone you trust. Access to server management. The user with whom you share full access to the connection will be able to add and remove your protocols and services to the server, as well as change settings. - + Доступ к управлению сервером. Пользователь, с которым вы делитесь полным доступом к соединению, сможет добавлять и удалять ваши протоколы и службы на сервере, а также изменять настройки. @@ -2499,11 +2518,6 @@ IKEv2 with IPSec encryption layer. Transmits data over fixed UDP ports 500 and 4 AmneziaWG - Special protocol from Amnezia, based on WireGuard. It's fast like WireGuard, but very resistant to blockages. Recommended for regions with high levels of censorship. - - - AmneziaWG - Special protocol from Amnezia, based on WireGuard. It's fast like WireGuard, but very resistant to blockages. Recommended for regions with high levels of censorship. - - IKEv2 - 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. @@ -2599,16 +2613,6 @@ IKEv2 with IPSec encryption layer. Transmits data over fixed UDP ports 500 and 4 error 0x%1: %2 error 0x%1: %2 - - - WireGuard Configuration Highlighter - - - - - &Randomize colors - - SelectLanguageDrawer @@ -2834,37 +2838,27 @@ IKEv2 with IPSec encryption layer. Transmits data over fixed UDP ports 500 and 4 Medium or High - + Спедний или Высокий Extreme - + Экстремальный I just want to increase the level of my privacy. - + Я просто хочу повысить уровень своей приватности. I want to bypass censorship. This option recommended in most cases. - + Я хочу обойти блокировки. Этот вариант рекомендуется в большинстве случаев. Most VPN protocols are blocked. Recommended if other options are not working. - - - - - I want to bypass censorship. This option recommended in most cases. - - - - - Most VPN protocols are blocked. Recommended if other options are not working. - + Большинство VPN протоколов заблокированы. Рекомендуется, если другие варианты не работают. High diff --git a/client/translations/amneziavpn_zh_CN.ts b/client/translations/amneziavpn_zh_CN.ts index 2e772823..85af4694 100644 --- a/client/translations/amneziavpn_zh_CN.ts +++ b/client/translations/amneziavpn_zh_CN.ts @@ -73,23 +73,26 @@ - Add server + Add new connection - - Select data type + + Configure your server + + + + + Open config file, key or QR code - Server IP, login and password - 服务器IP,用户名和密码 + 服务器IP,用户名和密码 - QR code, key or configuration file - 二维码,授权码或者配置文件 + 二维码,授权码或者配置文件 @@ -775,49 +778,49 @@ Already installed containers were found on the server. All installed containers 密码 - + Mount folder on device 挂载文件夹 - + In order to mount remote SFTP folder as local drive, perform following steps: <br> 为将远程 SFTP 文件夹挂载到本地,请执行以下步骤: <br> - - + + <br>1. Install the latest version of <br>1. 安装最新版的 - - + + <br>2. Install the latest version of <br>2. 安装最新版的 - + Detailed instructions 详细说明 - + Remove SFTP and all data stored there 移除SFTP和其本地所有数据 - + Remove SFTP and all data stored there? 移除SFTP和其本地所有数据? - + Continue 继续 - + Cancel 取消 @@ -845,18 +848,18 @@ Already installed containers were found on the server. All installed containers 已拷贝 - + Use <a href="https://www.torproject.org/download/" style="color: #FBB26A;">Tor Browser</a> to open this url. 用 <a href="https://www.torproject.org/download/" style="color: #FBB26A;">Tor 浏览器</a> 打开上面网址 - + After installation it takes several minutes while your onion site will become available in the Tor Network. 完成安装几分钟后,洋葱站点才会在 Tor 网络中生效。 - - When configuring WordPress set the this address as domain. + + When configuring WordPress set the this onion address as domain. @@ -864,22 +867,22 @@ Already installed containers were found on the server. All installed containers 配置 WordPress 时,将域设置为此洋葱地址。 - + Remove website 移除网站 - + The site with all data will be removed from the tor network. 网站及其所有数据将从 Tor 网络中删除 - + Continue 继续 - + Cancel 取消 @@ -1141,37 +1144,42 @@ And if you don't like the app, all the more support it - the donation will - + Backup files (*.backup) - + + Backup file saved + + + + Restore from backup 从备份还原 - + Open backup file 打开备份文件 - + Import settings from a backup file? 从备份文件导入设置? - + All current settings will be reset 当前所有设置将重置 - + Continue 继续 - + Cancel 取消 @@ -1228,7 +1236,7 @@ And if you don't like the app, all the more support it - the donation will 配置想要通过VPN访问网站 - + App-based split tunneling 基于应用的隧道分离 @@ -1245,7 +1253,7 @@ And if you don't like the app, all the more support it - the donation will 应用级VPN分流 - + Allows you to use the VPN only for certain applications 仅指定应用使用VPN @@ -1336,32 +1344,37 @@ And if you don't like the app, all the more support it - the donation will - + + Logs file saved + + + + Save logs to file 保存日志到文件 - + Clear logs? 清理日志? - + Continue 继续 - + Cancel 取消 - + Logs have been cleaned up 日志已清理 - + Clear logs 清理日志 @@ -1682,9 +1695,13 @@ It's okay as long as it's from someone you trust. PageSetupWizardCredentials - Server connection - 连接服务器 + 连接服务器 + + + + Configure your server + @@ -1712,22 +1729,28 @@ It's okay as long as it's from someone you trust. 继续 - + + All data you enter will remain strictly confidential +and will not be shared or disclosed to the Amnezia or any third parties + + + + Ip address cannot be empty IP不能为空 - + Enter the address in the format 255.255.255.255:88 按照这种格式输入 255.255.255.255:88 - + Login cannot be empty 账号不能为空 - + Password/private key cannot be empty 密码或私钥不能为空 @@ -2727,16 +2750,6 @@ IKEv2 with IPSec encryption layer. Transmits data over fixed UDP ports 500 and 4 error 0x%1: %2 错误 0x%1: %2 - - - WireGuard Configuration Highlighter - - - - - &Randomize colors - - SelectLanguageDrawer diff --git a/client/ui/qml/Components/ConnectionTypeSelectionDrawer.qml b/client/ui/qml/Components/ConnectionTypeSelectionDrawer.qml index ccffe21f..1f7b2f29 100644 --- a/client/ui/qml/Components/ConnectionTypeSelectionDrawer.qml +++ b/client/ui/qml/Components/ConnectionTypeSelectionDrawer.qml @@ -27,8 +27,7 @@ DrawerType { Layout.leftMargin: 16 Layout.bottomMargin: 16 - headerText: qsTr("Add server") - descriptionText: qsTr("Select data type") + headerText: qsTr("Add new connection") } LabelWithButtonType { @@ -50,7 +49,7 @@ DrawerType { LabelWithButtonType { Layout.fillWidth: true - text: qsTr("Open QR code, key or config file") + text: qsTr("Open config file, key or QR code") rightImageSource: "qrc:/images/controls/chevron-right.svg" clickedFunction: function() { diff --git a/client/ui/qml/Config/GlobalConfig.qml b/client/ui/qml/Config/GlobalConfig.qml index a9edd543..0855101c 100644 --- a/client/ui/qml/Config/GlobalConfig.qml +++ b/client/ui/qml/Config/GlobalConfig.qml @@ -26,4 +26,16 @@ Item { } return false } + + TextEdit{ + id: clipboard + visible: false + } + + function copyToClipBoard(text) { + clipboard.text = text + clipboard.selectAll() + clipboard.copy() + clipboard.select(0, 0) + } } diff --git a/client/ui/qml/Pages2/PageServiceSftpSettings.qml b/client/ui/qml/Pages2/PageServiceSftpSettings.qml index 61ba663d..b12302dd 100644 --- a/client/ui/qml/Pages2/PageServiceSftpSettings.qml +++ b/client/ui/qml/Pages2/PageServiceSftpSettings.qml @@ -96,7 +96,7 @@ PageType { rightImageColor: "#D7D8DB" clickedFunction: function() { - col.copyToClipBoard(descriptionText) + GC.copyToClipBoard(descriptionText) PageController.showNotificationMessage(qsTr("Copied")) } } @@ -113,7 +113,7 @@ PageType { rightImageColor: "#D7D8DB" clickedFunction: function() { - col.copyToClipBoard(descriptionText) + GC.copyToClipBoard(descriptionText) PageController.showNotificationMessage(qsTr("Copied")) } } @@ -130,7 +130,7 @@ PageType { rightImageColor: "#D7D8DB" clickedFunction: function() { - col.copyToClipBoard(descriptionText) + GC.copyToClipBoard(descriptionText) PageController.showNotificationMessage(qsTr("Copied")) } } @@ -147,23 +147,11 @@ PageType { rightImageColor: "#D7D8DB" clickedFunction: function() { - col.copyToClipBoard(descriptionText) + GC.copyToClipBoard(descriptionText) PageController.showNotificationMessage(qsTr("Copied")) } } - TextEdit{ - id: clipboard - visible: false - } - - function copyToClipBoard(text) { - clipboard.text = text - clipboard.selectAll() - clipboard.copy() - clipboard.select(0, 0) - } - BasicButtonType { visible: !GC.isMobile() diff --git a/client/ui/qml/Pages2/PageServiceTorWebsiteSettings.qml b/client/ui/qml/Pages2/PageServiceTorWebsiteSettings.qml index 0d5baa3d..3bfa5bb0 100644 --- a/client/ui/qml/Pages2/PageServiceTorWebsiteSettings.qml +++ b/client/ui/qml/Pages2/PageServiceTorWebsiteSettings.qml @@ -78,23 +78,11 @@ PageType { rightImageColor: "#D7D8DB" clickedFunction: function() { - content.copyToClipBoard(descriptionText) + GC.copyToClipBoard(descriptionText) PageController.showNotificationMessage(qsTr("Copied")) } } - TextEdit{ - id: clipboard - visible: false - } - - function copyToClipBoard(text) { - clipboard.text = text - clipboard.selectAll() - clipboard.copy() - clipboard.select(0, 0) - } - ParagraphTextType { Layout.fillWidth: true Layout.topMargin: 40 @@ -121,7 +109,7 @@ PageType { Layout.leftMargin: 16 Layout.rightMargin: 16 - text: qsTr("When configuring WordPress set the this address as domain.") + text: qsTr("When configuring WordPress set the this onion address as domain.") } BasicButtonType { diff --git a/client/ui/qml/Pages2/PageSettings.qml b/client/ui/qml/Pages2/PageSettings.qml index e0ae7195..92575dda 100644 --- a/client/ui/qml/Pages2/PageSettings.qml +++ b/client/ui/qml/Pages2/PageSettings.qml @@ -110,7 +110,7 @@ PageType { DividerType {} LabelWithButtonType { - visible: GC.isMobile() + visible: GC.isDesktop() Layout.fillWidth: true Layout.preferredHeight: about.height @@ -124,7 +124,7 @@ PageType { } DividerType { - visible: GC.isMobile() + visible: GC.isDesktop() } } } diff --git a/client/ui/qml/Pages2/PageSettingsConnection.qml b/client/ui/qml/Pages2/PageSettingsConnection.qml index 6890c7c7..7f0262f9 100644 --- a/client/ui/qml/Pages2/PageSettingsConnection.qml +++ b/client/ui/qml/Pages2/PageSettingsConnection.qml @@ -115,7 +115,6 @@ PageType { visible: !GC.isMobile() Layout.fillWidth: true - visible: false text: qsTr("App-based split tunneling") descriptionText: qsTr("Allows you to use the VPN only for certain applications") From c7cd8e4c8042eaa6005fedb47459f263e6efff7b Mon Sep 17 00:00:00 2001 From: pokamest Date: Sun, 15 Oct 2023 02:30:42 +0100 Subject: [PATCH 055/108] Minor ui fixes and refactoring --- client/containers/containers_defs.cpp | 19 +---- client/containers/containers_defs.h | 1 - client/core/scripts_registry.cpp | 1 - client/protocols/protocols_defs.cpp | 14 ++-- client/protocols/protocols_defs.h | 1 - client/translations/amneziavpn_ru.ts | 80 ++++++++++--------- client/translations/amneziavpn_zh_CN.ts | 78 ++++++++++-------- client/ui/controllers/installController.cpp | 4 +- client/ui/models/protocols_model.cpp | 9 +-- .../qml/Pages2/PageSetupWizardInstalling.qml | 4 +- 10 files changed, 103 insertions(+), 108 deletions(-) diff --git a/client/containers/containers_defs.cpp b/client/containers/containers_defs.cpp index 1c79874c..d4f45ada 100644 --- a/client/containers/containers_defs.cpp +++ b/client/containers/containers_defs.cpp @@ -89,7 +89,6 @@ QMap ContainerProps::containerHumanNames() { DockerContainer::TorWebSite, QObject::tr("Website in Tor network") }, { DockerContainer::Dns, QObject::tr("Amnezia DNS") }, - //{DockerContainer::FileShare, QObject::tr("SMB file sharing service")}, { DockerContainer::Sftp, QObject::tr("Sftp file sharing service") } }; } @@ -119,7 +118,6 @@ QMap ContainerProps::containerDescriptions() { 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::FileShare, QObject::tr("SMB file sharing service - is Window file sharing protocol")}, { DockerContainer::Sftp, QObject::tr("Creates a file vault on your server to securely store and transfer files.") } }; } @@ -190,27 +188,13 @@ QMap ContainerProps::containerDetailedDescriptions() { DockerContainer::TorWebSite, QObject::tr("Website in Tor network") }, { DockerContainer::Dns, QObject::tr("DNS Service") }, - //{DockerContainer::FileShare, QObject::tr("SMB file sharing service - is Window file sharing protocol")}, { DockerContainer::Sftp, QObject::tr("Sftp file sharing service - is secure FTP service") } }; } amnezia::ServiceType ContainerProps::containerService(DockerContainer c) { - switch (c) { - case DockerContainer::None: return ServiceType::None; - case DockerContainer::OpenVpn: return ServiceType::Vpn; - case DockerContainer::Cloak: return ServiceType::Vpn; - case DockerContainer::ShadowSocks: return ServiceType::Vpn; - case DockerContainer::WireGuard: return ServiceType::Vpn; - case DockerContainer::Awg: return ServiceType::Vpn; - case DockerContainer::Ipsec: return ServiceType::Vpn; - case DockerContainer::TorWebSite: return ServiceType::Other; - case DockerContainer::Dns: return ServiceType::Other; - // case DockerContainer::FileShare : return ServiceType::Other; - case DockerContainer::Sftp: return ServiceType::Other; - default: return ServiceType::Other; - } + return ProtocolProps::protocolService(defaultProtocol(c)); } Proto ContainerProps::defaultProtocol(DockerContainer c) @@ -226,7 +210,6 @@ Proto ContainerProps::defaultProtocol(DockerContainer c) case DockerContainer::TorWebSite: return Proto::TorWebSite; case DockerContainer::Dns: return Proto::Dns; - // case DockerContainer::FileShare : return Protocol::FileShare; case DockerContainer::Sftp: return Proto::Sftp; default: return Proto::Any; } diff --git a/client/containers/containers_defs.h b/client/containers/containers_defs.h index ce8a2683..b9cb760d 100644 --- a/client/containers/containers_defs.h +++ b/client/containers/containers_defs.h @@ -26,7 +26,6 @@ namespace amnezia // non-vpn TorWebSite, Dns, - // FileShare, Sftp }; Q_ENUM_NS(DockerContainer) diff --git a/client/core/scripts_registry.cpp b/client/core/scripts_registry.cpp index f209a2b1..61ae8962 100644 --- a/client/core/scripts_registry.cpp +++ b/client/core/scripts_registry.cpp @@ -16,7 +16,6 @@ QString amnezia::scriptFolder(amnezia::DockerContainer container) case DockerContainer::TorWebSite: return QLatin1String("website_tor"); case DockerContainer::Dns: return QLatin1String("dns"); - // case DockerContainer::FileShare: return QLatin1String("file_share"); case DockerContainer::Sftp: return QLatin1String("sftp"); default: return ""; } diff --git a/client/protocols/protocols_defs.cpp b/client/protocols/protocols_defs.cpp index 5964bd87..b3823a11 100644 --- a/client/protocols/protocols_defs.cpp +++ b/client/protocols/protocols_defs.cpp @@ -72,7 +72,6 @@ QMap ProtocolProps::protocolHumanNames() { Proto::TorWebSite, "Website in Tor network" }, { Proto::Dns, "DNS Service" }, - { Proto::FileShare, "File Sharing Service" }, { Proto::Sftp, QObject::tr("Sftp service") } }; } @@ -90,9 +89,11 @@ amnezia::ServiceType ProtocolProps::protocolService(Proto p) case Proto::ShadowSocks: return ServiceType::Vpn; case Proto::WireGuard: return ServiceType::Vpn; case Proto::Awg: return ServiceType::Vpn; + case Proto::Ikev2: return ServiceType::Vpn; + case Proto::TorWebSite: return ServiceType::Other; case Proto::Dns: return ServiceType::Other; - case Proto::FileShare: return ServiceType::Other; + case Proto::Sftp: return ServiceType::Other; default: return ServiceType::Other; } } @@ -111,7 +112,6 @@ int ProtocolProps::defaultPort(Proto p) case Proto::TorWebSite: return -1; case Proto::Dns: return 53; - case Proto::FileShare: return 139; case Proto::Sftp: return 222; default: return -1; } @@ -129,10 +129,10 @@ bool ProtocolProps::defaultPortChangeable(Proto p) case Proto::Ikev2: return false; case Proto::L2tp: return false; - case Proto::TorWebSite: return true; + case Proto::TorWebSite: return false; case Proto::Dns: return false; - case Proto::FileShare: return false; - default: return -1; + case Proto::Sftp: return true; + default: return false; } } @@ -150,7 +150,6 @@ TransportProto ProtocolProps::defaultTransportProto(Proto p) // non-vpn case Proto::TorWebSite: return TransportProto::Tcp; case Proto::Dns: return TransportProto::Udp; - case Proto::FileShare: return TransportProto::Udp; case Proto::Sftp: return TransportProto::Tcp; } } @@ -169,7 +168,6 @@ bool ProtocolProps::defaultTransportProtoChangeable(Proto p) // non-vpn case Proto::TorWebSite: return false; case Proto::Dns: return false; - case Proto::FileShare: return false; case Proto::Sftp: return false; default: return false; } diff --git a/client/protocols/protocols_defs.h b/client/protocols/protocols_defs.h index d6af132b..ed2ed313 100644 --- a/client/protocols/protocols_defs.h +++ b/client/protocols/protocols_defs.h @@ -195,7 +195,6 @@ namespace amnezia // non-vpn TorWebSite, Dns, - FileShare, Sftp }; Q_ENUM_NS(Proto) diff --git a/client/translations/amneziavpn_ru.ts b/client/translations/amneziavpn_ru.ts index a6c0464d..d3eef897 100644 --- a/client/translations/amneziavpn_ru.ts +++ b/client/translations/amneziavpn_ru.ts @@ -165,32 +165,32 @@ Already installed containers were found on the server. All installed containers На сервере обнаружены установленные протоколы и сервисы, все они добавлены в приложение - + Settings updated successfully Настройки успешно обновлены - + Server '%1' was removed Сервер '%1' был удален - + All containers from server '%1' have been removed Все протоклы и сервисы были удалены с сервера '%1' - + %1 has been removed from the server '%2' %1 был удален с сервера '%2' - + Please login as the user Пожалуйста, войдите в систему от имени пользователя - + Server added successfully Сервер успешно добавлен @@ -1690,14 +1690,22 @@ and will not be shared or disclosed to the Amnezia or any third parties Сервер уже был добавлен в приложение - Amnesia has detected that your server is currently - Amnesia обнаружила, что ваш сервер в настоящее время + Amnesia обнаружила, что ваш сервер в настоящее время + + + busy installing other software. Amnesia installation + занят установкой других протоколов или сервисов. Установка Amnesia + + + + Amnezia has detected that your server is currently + - busy installing other software. Amnesia installation - занят установкой других протоколов или сервисов. Установка Amnesia + busy installing other software. Amnezia installation + @@ -2406,7 +2414,7 @@ and will not be shared or disclosed to the Amnezia or any third parties IPsec - + The time-tested most popular VPN protocol. Uses a proprietary security protocol with SSL/TLS for encryption and key exchange and supports various authentication methods, making it suitable for a variety of devices and operating systems. @@ -2418,7 +2426,7 @@ Uses a proprietary security protocol with SSL/TLS for encryption and key exchang - + Based on the SOCKS5 proxy protocol, which protects the connection using the AEAD cipher - roughly along the same lines as SSH tunnelling. A Shadowsocks connection is difficult to identify because it is virtually identical to a normal HTTPS connection. However, some traffic analysis systems can still recognise a ShadowSocks connection, so in countries with high levels of censorship we recommend using OpenVPN in conjunction with Cloak. @@ -2430,7 +2438,7 @@ However, some traffic analysis systems can still recognise a ShadowSocks connect - + This is a combination of the OpenVPN protocol and the Cloak plugin designed specifically for blocking protection. OpenVPN provides a secure VPN connection by encrypting all Internet traffic between the client and the server. @@ -2450,7 +2458,7 @@ If there is a high level of Internet censorship in your region, we advise you to - + A relatively new popular VPN protocol with a simplified architecture. Provides stable VPN connection, high performance on all devices. Uses hard-coded encryption settings. WireGuard compared to OpenVPN has lower latency and better data transfer throughput. * Low power consumption on mobile devices. @@ -2461,7 +2469,7 @@ Provides stable VPN connection, high performance on all devices. Uses hard-coded - + A modern stable protocol. IKEv2 with IPSec encryption layer. Transmits data over fixed UDP ports 500 and 4500 protecting them with strong 3DES and AES crypto algorithms. Allows very fast switching between networks and devices. Due to its security, stability and speed, IKEv2 is currently one of the best VPN solutions for mobile devices. Vulnerable to detection and blocking. @@ -2473,18 +2481,18 @@ IKEv2 with IPSec encryption layer. Transmits data over fixed UDP ports 500 and 4 - + DNS Service DNS Сервис - + Sftp file sharing service Сервис обмена файлами Sftp - + Website in Tor network Веб-сайт в сети Tor @@ -2494,62 +2502,62 @@ IKEv2 with IPSec encryption layer. Transmits data over fixed UDP ports 500 and 4 Amnezia DNS - + OpenVPN is the most popular VPN protocol, with flexible configuration options. It uses its own security protocol with SSL/TLS for key exchange. OpenVPN - популярный VPN-протокол, с гибкой настройкой. Имеет собственный протокол безопасности с SSL/TLS для обмена ключами. - + ShadowSocks - masks VPN traffic, making it similar to normal web traffic, but is recognised by analysis systems in some highly censored regions. ShadowSocks - маскирует VPN-трафик под обычный веб-трафик, но распознается системами анализа в некоторых регионах с высоким уровнем цензуры. - + OpenVPN over Cloak - OpenVPN with VPN masquerading as web traffic and protection against active-probbing detection. Ideal for bypassing blocking in regions with the highest levels of censorship. OpenVPN over Cloak - OpenVPN с маскировкой VPN под web-трафик и защитой от обнаружения active-probbing. Подходит для регионов с самым высоким уровнем цензуры. - + WireGuard - New popular VPN protocol with high performance, high speed and low power consumption. Recommended for regions with low levels of censorship. WireGuard - Популярный VPN-протокол с высокой производительностью, высокой скоростью и низким энергопотреблением. Для регионов с низким уровнем цензуры. - + AmneziaWG - Special protocol from Amnezia, based on WireGuard. It's fast like WireGuard, but very resistant to blockages. Recommended for regions with high levels of censorship. - + IKEv2 - 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. IKEv2 Современный стабильный протокол, немного быстрее других восстанавливает соединение после потери сигнала. Имеет нативную поддержку последних версиий Android и iOS. - + Deploy a WordPress site on the Tor network in two clicks. Разверните сайт на WordPress в сети Tor в два клика. - + Replace the current DNS server with your own. This will increase your privacy level. Замените адрес DNS-сервера на собственный. Это повысит уровень конфиденциальности. - + Creates a file vault on your server to securely store and transfer files. Создайте на сервере файловое хранилище для безопасного хранения и передачи файлов. - + AmneziaWG container AmneziaWG протокол - + Sftp file sharing service - is secure FTP service Сервис обмена файлами Sftp - безопасный FTP-сервис - + Sftp service Сервис SFTP @@ -2831,32 +2839,32 @@ IKEv2 with IPSec encryption layer. Transmits data over fixed UDP ports 500 and 4 amnezia::ContainerProps - + Low Низкий - + Medium or High Спедний или Высокий - + Extreme Экстремальный - + I just want to increase the level of my privacy. Я просто хочу повысить уровень своей приватности. - + I want to bypass censorship. This option recommended in most cases. Я хочу обойти блокировки. Этот вариант рекомендуется в большинстве случаев. - + Most VPN protocols are blocked. Recommended if other options are not working. Большинство VPN протоколов заблокированы. Рекомендуется, если другие варианты не работают. diff --git a/client/translations/amneziavpn_zh_CN.ts b/client/translations/amneziavpn_zh_CN.ts index 85af4694..be519a91 100644 --- a/client/translations/amneziavpn_zh_CN.ts +++ b/client/translations/amneziavpn_zh_CN.ts @@ -183,22 +183,22 @@ Already installed containers were found on the server. All installed containers 在服务上发现已经安装协议并添加至应用 - + Settings updated successfully 配置更新成功 - + Server '%1' was removed 已移除服务器 '%1' - + All containers from server '%1' have been removed 服务器 '%1' 的所有容器已移除 - + %1 has been removed from the server '%2' %1 已从服务器 '%2' 上移除 @@ -219,12 +219,12 @@ Already installed containers were found on the server. All installed containers 协议已从 - + Please login as the user 请以用户身份登录 - + Server added successfully 增加服务器成功 @@ -1798,13 +1798,21 @@ and will not be shared or disclosed to the Amnezia or any third parties - Amnesia has detected that your server is currently - Amnezia 检测到您的服务器当前 + Amnezia has detected that your server is currently + + busy installing other software. Amnezia installation + + + + Amnesia has detected that your server is currently + Amnezia 检测到您的服务器当前 + + busy installing other software. Amnesia installation - 正安装其他软件。Amnezia安装 + 正安装其他软件。Amnezia安装 @@ -2313,7 +2321,7 @@ and will not be shared or disclosed to the Amnezia or any third parties QObject - + Sftp service Sftp 服务 @@ -2529,7 +2537,7 @@ and will not be shared or disclosed to the Amnezia or any third parties - + Website in Tor network 在 Tor 网络中架设网站 @@ -2539,57 +2547,57 @@ and will not be shared or disclosed to the Amnezia or any third parties - + Sftp file sharing service SFTP文件共享服务 - + OpenVPN is the most popular VPN protocol, with flexible configuration options. It uses its own security protocol with SSL/TLS for key exchange. OpenVPN 是最流行的 VPN 协议,具有灵活的配置选项。它使用自己的安全协议与 SSL/TLS 进行密钥交换。 - + ShadowSocks - masks VPN traffic, making it similar to normal web traffic, but is recognised by analysis systems in some highly censored regions. ShadowSocks - 混淆 VPN 流量,使其与正常的 Web 流量相似,但在一些审查力度高的地区可以被分析系统识别。 - + OpenVPN over Cloak - OpenVPN with VPN masquerading as web traffic and protection against active-probbing detection. Ideal for bypassing blocking in regions with the highest levels of censorship. OpenVPN over Cloak - OpenVPN 与 VPN 具有伪装成网络流量和防止主动探测检测的保护。非常适合绕过审查力度特别强的地区的封锁。 - + WireGuard - New popular VPN protocol with high performance, high speed and low power consumption. Recommended for regions with low levels of censorship. WireGuard - 新型流行的VPN协议,具有高性能、高速度和低功耗。建议用于审查力度较低的地区 - + AmneziaWG - Special protocol from Amnezia, based on WireGuard. It's fast like WireGuard, but very resistant to blockages. Recommended for regions with high levels of censorship. - + IKEv2 - 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. IKEv2 - 现代稳定协议,相比其他协议较快一些,在信号丢失后恢复连接。Android 和 iOS最新版原生支持。 - + Deploy a WordPress site on the Tor network in two clicks. 只需点击两次即可架设 WordPress 网站到 Tor 网络 - + Replace the current DNS server with your own. This will increase your privacy level. 将当前的 DNS 服务器替换为您自己的。这将提高您的隐私保护级别。 - + Creates a file vault on your server to securely store and transfer files. 在您的服务器上创建文件仓库,以便安全地存储和传输文件 - + The time-tested most popular VPN protocol. Uses a proprietary security protocol with SSL/TLS for encryption and key exchange and supports various authentication methods, making it suitable for a variety of devices and operating systems. @@ -2601,7 +2609,7 @@ Uses a proprietary security protocol with SSL/TLS for encryption and key exchang - + Based on the SOCKS5 proxy protocol, which protects the connection using the AEAD cipher - roughly along the same lines as SSH tunnelling. A Shadowsocks connection is difficult to identify because it is virtually identical to a normal HTTPS connection. However, some traffic analysis systems can still recognise a ShadowSocks connection, so in countries with high levels of censorship we recommend using OpenVPN in conjunction with Cloak. @@ -2613,7 +2621,7 @@ However, some traffic analysis systems can still recognise a ShadowSocks connect - + This is a combination of the OpenVPN protocol and the Cloak plugin designed specifically for blocking protection. OpenVPN provides a secure VPN connection by encrypting all Internet traffic between the client and the server. @@ -2633,7 +2641,7 @@ If there is a high level of Internet censorship in your region, we advise you to - + A relatively new popular VPN protocol with a simplified architecture. Provides stable VPN connection, high performance on all devices. Uses hard-coded encryption settings. WireGuard compared to OpenVPN has lower latency and better data transfer throughput. * Low power consumption on mobile devices. @@ -2644,7 +2652,7 @@ Provides stable VPN connection, high performance on all devices. Uses hard-coded - + A modern stable protocol. IKEv2 with IPSec encryption layer. Transmits data over fixed UDP ports 500 and 4500 protecting them with strong 3DES and AES crypto algorithms. Allows very fast switching between networks and devices. Due to its security, stability and speed, IKEv2 is currently one of the best VPN solutions for mobile devices. Vulnerable to detection and blocking. @@ -2672,7 +2680,7 @@ IKEv2 with IPSec encryption layer. Transmits data over fixed UDP ports 500 and 4 WireGuard 容器 - + AmneziaWG container @@ -2681,12 +2689,12 @@ IKEv2 with IPSec encryption layer. Transmits data over fixed UDP ports 500 and 4 IPsec 容器 - + DNS Service DNS 服务 - + Sftp file sharing service - is secure FTP service Sftp 文件共享服务 - 安全的 FTP 服务 @@ -2972,32 +2980,32 @@ IKEv2 with IPSec encryption layer. Transmits data over fixed UDP ports 500 and 4 amnezia::ContainerProps - + Low - + Medium or High - + Extreme - + I just want to increase the level of my privacy. - + I want to bypass censorship. This option recommended in most cases. - + Most VPN protocols are blocked. Recommended if other options are not working. diff --git a/client/ui/controllers/installController.cpp b/client/ui/controllers/installController.cpp index 34917cac..6eec9c6b 100644 --- a/client/ui/controllers/installController.cpp +++ b/client/ui/controllers/installController.cpp @@ -183,7 +183,9 @@ void InstallController::installContainer(DockerContainer container, QJsonObject "All installed containers have been added to the application"); } - m_containersModel->setData(m_containersModel->index(0, 0), container, ContainersModel::Roles::IsDefaultRole); + if (ContainerProps::containerService(container) == ServiceType::Vpn) { + m_containersModel->setData(m_containersModel->index(0, 0), container, ContainersModel::Roles::IsDefaultRole); + } emit installContainerFinished(finishMessage, ContainerProps::containerService(container) == ServiceType::Other); return; } diff --git a/client/ui/models/protocols_model.cpp b/client/ui/models/protocols_model.cpp index 8c999470..5826025e 100644 --- a/client/ui/models/protocols_model.cpp +++ b/client/ui/models/protocols_model.cpp @@ -78,12 +78,11 @@ PageLoader::PageEnum ProtocolsModel::protocolPage(Proto protocol) const case Proto::ShadowSocks: return PageLoader::PageEnum::PageProtocolShadowSocksSettings; case Proto::WireGuard: return PageLoader::PageEnum::PageProtocolWireGuardSettings; case Proto::Ikev2: return PageLoader::PageEnum::PageProtocolIKev2Settings; - case Proto::L2tp: return PageLoader::PageEnum::PageProtocolOpenVpnSettings; + case Proto::L2tp: return PageLoader::PageEnum::PageProtocolIKev2Settings; // non-vpn - case Proto::TorWebSite: return PageLoader::PageEnum::PageProtocolOpenVpnSettings; - case Proto::Dns: return PageLoader::PageEnum::PageProtocolOpenVpnSettings; - case Proto::FileShare: return PageLoader::PageEnum::PageProtocolOpenVpnSettings; - case Proto::Sftp: return PageLoader::PageEnum::PageProtocolOpenVpnSettings; + case Proto::TorWebSite: return PageLoader::PageEnum::PageServiceTorWebsiteSettings; + case Proto::Dns: return PageLoader::PageEnum::PageServiceDnsSettings; + case Proto::Sftp: return PageLoader::PageEnum::PageServiceSftpSettings; default: return PageLoader::PageEnum::PageProtocolOpenVpnSettings; } } diff --git a/client/ui/qml/Pages2/PageSetupWizardInstalling.qml b/client/ui/qml/Pages2/PageSetupWizardInstalling.qml index 84f6be89..bd1fd7e6 100644 --- a/client/ui/qml/Pages2/PageSetupWizardInstalling.qml +++ b/client/ui/qml/Pages2/PageSetupWizardInstalling.qml @@ -59,8 +59,8 @@ PageType { function onServerIsBusy(isBusy) { if (isBusy) { - root.progressBarText = qsTr("Amnesia has detected that your server is currently ") + - qsTr("busy installing other software. Amnesia installation ") + + root.progressBarText = qsTr("Amnezia has detected that your server is currently ") + + qsTr("busy installing other software. Amnezia installation ") + qsTr("will pause until the server finishes installing other software") root.isTimerRunning = false } else { From 8c1835950bf64ebdf188769359bc908d501ba6d1 Mon Sep 17 00:00:00 2001 From: ronoaer Date: Sun, 15 Oct 2023 15:17:04 +0800 Subject: [PATCH 056/108] added transparent-background, for blocking clicked event --- .../ConnectionTypeSelectionDrawer.qml | 5 +- client/ui/qml/Components/QuestionDrawer.qml | 7 +- .../qml/Components/SelectLanguageDrawer.qml | 6 +- .../qml/Components/ShareConnectionDrawer.qml | 16 ++++- client/ui/qml/Controls2/Drawer2Type.qml | 64 ++++++++++++++----- client/ui/qml/Controls2/DropDownType.qml | 17 +++-- .../qml/Pages2/PageProtocolCloakSettings.qml | 2 + .../Pages2/PageProtocolOpenVpnSettings.qml | 4 ++ client/ui/qml/Pages2/PageProtocolRaw.qml | 5 +- .../PageProtocolShadowSocksSettings.qml | 2 + .../ui/qml/Pages2/PageSettingsServerData.qml | 8 ++- .../ui/qml/Pages2/PageSettingsServerInfo.qml | 5 +- .../qml/Pages2/PageSettingsSplitTunneling.qml | 14 +++- .../PageSetupWizardProtocolSettings.qml | 7 +- client/ui/qml/Pages2/PageShare.qml | 6 ++ 15 files changed, 134 insertions(+), 34 deletions(-) diff --git a/client/ui/qml/Components/ConnectionTypeSelectionDrawer.qml b/client/ui/qml/Components/ConnectionTypeSelectionDrawer.qml index a368d45c..ac04e444 100644 --- a/client/ui/qml/Components/ConnectionTypeSelectionDrawer.qml +++ b/client/ui/qml/Components/ConnectionTypeSelectionDrawer.qml @@ -12,9 +12,12 @@ Drawer2Type { id: root width: parent.width - height: parent.height * 0.4375 + height: parent.height + contentHeight: parent.height * 0.4375 ColumnLayout { + parent: root.contentParent + anchors.top: parent.top anchors.left: parent.left anchors.right: parent.right diff --git a/client/ui/qml/Components/QuestionDrawer.qml b/client/ui/qml/Components/QuestionDrawer.qml index 06f4ae24..edc8df9e 100644 --- a/client/ui/qml/Components/QuestionDrawer.qml +++ b/client/ui/qml/Components/QuestionDrawer.qml @@ -17,9 +17,12 @@ Drawer2Type { property var noButtonFunction width: parent.width - height: parent.height * 0.5 + height: parent.height + contentHeight: parent.height * 0.5 ColumnLayout { + parent: root.contentParent + anchors.top: parent.top anchors.left: parent.left anchors.right: parent.right @@ -27,6 +30,8 @@ Drawer2Type { anchors.rightMargin: 16 anchors.leftMargin: 16 + // visible: false + spacing: 8 Header2TextType { diff --git a/client/ui/qml/Components/SelectLanguageDrawer.qml b/client/ui/qml/Components/SelectLanguageDrawer.qml index f27fce6c..e6fdc2b5 100644 --- a/client/ui/qml/Components/SelectLanguageDrawer.qml +++ b/client/ui/qml/Components/SelectLanguageDrawer.qml @@ -9,11 +9,14 @@ Drawer2Type { id: root width: parent.width - height: parent.height * 0.9 + height: parent.height + contentHeight: parent.height * 0.9 ColumnLayout { id: backButton + parent: root.contentParent + anchors.top: parent.top anchors.left: parent.left anchors.right: parent.right @@ -28,6 +31,7 @@ Drawer2Type { } FlickableType { + parent: root.contentParent anchors.top: backButton.bottom anchors.left: parent.left anchors.right: parent.right diff --git a/client/ui/qml/Components/ShareConnectionDrawer.qml b/client/ui/qml/Components/ShareConnectionDrawer.qml index cb74f42e..22c567a8 100644 --- a/client/ui/qml/Components/ShareConnectionDrawer.qml +++ b/client/ui/qml/Components/ShareConnectionDrawer.qml @@ -28,7 +28,8 @@ Drawer2Type { property string configFileName: "amnezia_config.vpn" width: parent.width - height: parent.height * 0.9 + height: parent.height + contentHeight: parent.height * 0.9 onClose: { configExtension = ".vpn" @@ -41,6 +42,9 @@ Drawer2Type { Header2Type { id: header + + parent: root.contentParent + anchors.top: parent.top anchors.left: parent.left anchors.right: parent.right @@ -50,6 +54,8 @@ Drawer2Type { } FlickableType { + parent: root.contentParent + anchors.top: header.bottom anchors.bottom: parent.bottom contentHeight: content.height + 32 @@ -135,11 +141,15 @@ Drawer2Type { parent: root width: parent.width - height: parent.height * 0.9 + height: parent.height + + contentHeight: parent.height * 0.9 BackButtonType { id: backButton + parent: configContentDrawer.contentParent + anchors.top: parent.top anchors.left: parent.left anchors.right: parent.right @@ -151,6 +161,8 @@ Drawer2Type { } FlickableType { + parent: configContentDrawer.contentParent + anchors.top: backButton.bottom anchors.left: parent.left anchors.right: parent.right diff --git a/client/ui/qml/Controls2/Drawer2Type.qml b/client/ui/qml/Controls2/Drawer2Type.qml index eae28846..3f877900 100644 --- a/client/ui/qml/Controls2/Drawer2Type.qml +++ b/client/ui/qml/Controls2/Drawer2Type.qml @@ -16,8 +16,6 @@ Item { visible: false - parent: Overlay.overlay - signal close() property bool needCloseButton: true @@ -27,7 +25,10 @@ Item { property int collapsedHeight: 0 property bool needCollapsed: false - + property double scaely + property int contentHeight: 0 + property Item contentParent: contentArea + // property bool inContentArea: false y: parent.height - root.height @@ -37,23 +38,49 @@ Item { id: draw2Background anchors { left: root.left; right: root.right; top: root.top } - height: root.height + height: root.parent.height + width: parent.width radius: 16 - color: root.defaultColor - border.color: root.borderColor + color: "transparent" + border.color: "transparent" //"green" border.width: 1 + visible: true Rectangle { - width: parent.radius - height: parent.radius - anchors.bottom: parent.bottom + id: semiArea + anchors.top: parent.top + height: parent.height - contentHeight anchors.right: parent.right anchors.left: parent.left - color: parent.color + visible: true + color: "transparent" + } + + Rectangle { + id: contentArea + anchors.top: semiArea.bottom + height: contentHeight + radius: 16 + color: root.defaultColor + border.width: 1 + border.color: root.borderColor + width: parent.width + visible: true + + Rectangle { + width: parent.radius + height: parent.radius + anchors.bottom: parent.bottom + anchors.right: parent.right + anchors.left: parent.left + color: parent.color + } } } + MouseArea { + id: fullArea anchors.fill: parent enabled: (root.state === "expanded" || root.state === "opened") onClicked: { @@ -75,6 +102,7 @@ Item { id: dragArea anchors.fill: parent + cursorShape: (root.state === "opened" || root.state === "expanded") ? Qt.PointingHandCursor : Qt.ArrowCursor hoverEnabled: true @@ -108,12 +136,14 @@ Item { } onClicked: { - if (root.state === "opened") { - root.state = "closed" + if (root.state === "expanded") { + root.state = "collapsed" + return } - if (root.state == "expanded") { - root.state == "collapsed" + if (root.state === "opened") { + root.state = "closed" + return } } } @@ -217,7 +247,7 @@ Item { target: root property: "y" from: parent.height - to: parent.height - root.height + to: 0 duration: 200 } @@ -226,9 +256,11 @@ Item { return } + root.y = 0 root.state = "opened" root.visible = true - root.y = parent.height - root.height + root.height = parent.height + contentArea.height = contentHeight dragArea.drag.maximumY = parent.height dragArea.drag.minimumY = parent.height - root.height diff --git a/client/ui/qml/Controls2/DropDownType.qml b/client/ui/qml/Controls2/DropDownType.qml index cab2ef4e..83518bef 100644 --- a/client/ui/qml/Controls2/DropDownType.qml +++ b/client/ui/qml/Controls2/DropDownType.qml @@ -40,6 +40,8 @@ Item { property alias menuVisible: menu.visible + property Item drawerParent: root + implicitWidth: rootButtonContent.implicitWidth implicitHeight: rootButtonContent.implicitHeight @@ -161,18 +163,21 @@ Item { } } - // Drawer2Type { - DrawerType { + //DrawerType { + Drawer2Type { id: menu - width: parent.width - height: parent.height * drawerHeight + parent: drawerParent - // parent: root.parent.parent + width: parent.width + height: parent.height + contentHeight: parent.height * drawerHeight ColumnLayout { id: header + parent: menu.contentParent + anchors.top: parent.top anchors.left: parent.left anchors.right: parent.right @@ -187,6 +192,8 @@ Item { } FlickableType { + parent: menu.contentParent + anchors.top: header.bottom anchors.topMargin: 16 contentHeight: col.implicitHeight diff --git a/client/ui/qml/Pages2/PageProtocolCloakSettings.qml b/client/ui/qml/Pages2/PageProtocolCloakSettings.qml index 78e666a7..b0f36971 100644 --- a/client/ui/qml/Pages2/PageProtocolCloakSettings.qml +++ b/client/ui/qml/Pages2/PageProtocolCloakSettings.qml @@ -117,6 +117,8 @@ PageType { Layout.fillWidth: true Layout.topMargin: 16 + drawerParent: root + descriptionText: qsTr("Cipher") headerText: qsTr("Cipher") diff --git a/client/ui/qml/Pages2/PageProtocolOpenVpnSettings.qml b/client/ui/qml/Pages2/PageProtocolOpenVpnSettings.qml index f03cfc07..2861ece3 100644 --- a/client/ui/qml/Pages2/PageProtocolOpenVpnSettings.qml +++ b/client/ui/qml/Pages2/PageProtocolOpenVpnSettings.qml @@ -156,6 +156,8 @@ PageType { Layout.fillWidth: true Layout.topMargin: 20 + drawerParent: root + enabled: !autoNegotiateEncryprionSwitcher.checked descriptionText: qsTr("Hash") @@ -202,6 +204,8 @@ PageType { Layout.fillWidth: true Layout.topMargin: 16 + drawerParent: root + enabled: !autoNegotiateEncryprionSwitcher.checked descriptionText: qsTr("Cipher") diff --git a/client/ui/qml/Pages2/PageProtocolRaw.qml b/client/ui/qml/Pages2/PageProtocolRaw.qml index 3e0fe5ab..f2a17686 100644 --- a/client/ui/qml/Pages2/PageProtocolRaw.qml +++ b/client/ui/qml/Pages2/PageProtocolRaw.qml @@ -95,11 +95,14 @@ PageType { parent: root width: parent.width - height: parent.height * 0.9 + height: parent.height + contentHeight: parent.height * 0.9 BackButtonType { id: backButton + parent: configContentDrawer.contentParent + anchors.top: parent.top anchors.left: parent.left anchors.right: parent.right diff --git a/client/ui/qml/Pages2/PageProtocolShadowSocksSettings.qml b/client/ui/qml/Pages2/PageProtocolShadowSocksSettings.qml index 2453281f..75853d1f 100644 --- a/client/ui/qml/Pages2/PageProtocolShadowSocksSettings.qml +++ b/client/ui/qml/Pages2/PageProtocolShadowSocksSettings.qml @@ -95,6 +95,8 @@ PageType { Layout.fillWidth: true Layout.topMargin: 20 + drawerParent: root + descriptionText: qsTr("Cipher") headerText: qsTr("Cipher") diff --git a/client/ui/qml/Pages2/PageSettingsServerData.qml b/client/ui/qml/Pages2/PageSettingsServerData.qml index c90e66b3..5e3f1939 100644 --- a/client/ui/qml/Pages2/PageSettingsServerData.qml +++ b/client/ui/qml/Pages2/PageSettingsServerData.qml @@ -141,7 +141,7 @@ PageType { questionDrawer.noButtonText = qsTr("Cancel") questionDrawer.yesButtonFunction = function() { - questionDrawer.visible = false + questionDrawer.close() PageController.showBusyIndicator(true) if (ServersModel.isDefaultServerCurrentlyProcessed() && ConnectionController.isConnected) { ConnectionController.closeConnection() @@ -150,9 +150,9 @@ PageType { PageController.showBusyIndicator(false) } questionDrawer.noButtonFunction = function() { - questionDrawer.visible = false + questionDrawer.close() } - questionDrawer.visible = true + questionDrawer.open() } } @@ -192,6 +192,8 @@ PageType { QuestionDrawer { id: questionDrawer + + parent: root } } } diff --git a/client/ui/qml/Pages2/PageSettingsServerInfo.qml b/client/ui/qml/Pages2/PageSettingsServerInfo.qml index d534b509..f6d569dd 100644 --- a/client/ui/qml/Pages2/PageSettingsServerInfo.qml +++ b/client/ui/qml/Pages2/PageSettingsServerInfo.qml @@ -80,7 +80,8 @@ PageType { parent: root width: root.width - height: root.height * 0.35 + height: root.height // * 0.35 + contentHeight: root.height * 0.35 onVisibleChanged: { if (serverNameEditDrawer.visible) { @@ -89,6 +90,8 @@ PageType { } ColumnLayout { + parent: serverNameEditDrawer.contentParent + anchors.top: parent.top anchors.left: parent.left anchors.right: parent.right diff --git a/client/ui/qml/Pages2/PageSettingsSplitTunneling.qml b/client/ui/qml/Pages2/PageSettingsSplitTunneling.qml index 406fae66..a88c576b 100644 --- a/client/ui/qml/Pages2/PageSettingsSplitTunneling.qml +++ b/client/ui/qml/Pages2/PageSettingsSplitTunneling.qml @@ -108,6 +108,8 @@ PageType { DropDownType { id: selector + drawerParent: root + Layout.fillWidth: true Layout.topMargin: 32 Layout.leftMargin: 16 @@ -264,11 +266,14 @@ PageType { id: moreActionsDrawer width: parent.width - height: parent.height * 0.4375 + height: parent.height + contentHeight: parent.height * 0.4375 parent: root FlickableType { + parent: moreActionsDrawer.contentParent + anchors.fill: parent contentHeight: moreActionsDrawerContent.height ColumnLayout { @@ -331,13 +336,16 @@ PageType { id: importSitesDrawer width: parent.width - height: parent.height * 0.4375 + height: parent.height + contentHeight: parent.height * 0.4375 parent: root BackButtonType { id: importSitesDrawerBackButton + parent: importSitesDrawer.contentParent + anchors.top: parent.top anchors.left: parent.left anchors.right: parent.right @@ -349,6 +357,8 @@ PageType { } FlickableType { + parent: importSitesDrawer.contentParent + anchors.top: importSitesDrawerBackButton.bottom anchors.left: parent.left anchors.right: parent.right diff --git a/client/ui/qml/Pages2/PageSetupWizardProtocolSettings.qml b/client/ui/qml/Pages2/PageSetupWizardProtocolSettings.qml index 794ec90b..6cdda364 100644 --- a/client/ui/qml/Pages2/PageSetupWizardProtocolSettings.qml +++ b/client/ui/qml/Pages2/PageSetupWizardProtocolSettings.qml @@ -101,13 +101,16 @@ PageType { id: showDetailsDrawer width: parent.width - height: parent.height * 0.9 + height: parent.height + contentHeight: parent.height * 0.9 parent: root BackButtonType { id: showDetailsBackButton + parent: showDetailsDrawer.contentParent + anchors.top: parent.top anchors.left: parent.left anchors.right: parent.right @@ -119,6 +122,8 @@ PageType { } FlickableType { + parent: showDetailsDrawer.contentParent + anchors.top: showDetailsBackButton.bottom anchors.left: parent.left anchors.right: parent.right diff --git a/client/ui/qml/Pages2/PageShare.qml b/client/ui/qml/Pages2/PageShare.qml index 6c641ea6..96399153 100644 --- a/client/ui/qml/Pages2/PageShare.qml +++ b/client/ui/qml/Pages2/PageShare.qml @@ -179,6 +179,8 @@ PageType { DropDownType { id: serverSelector + drawerParent: root + signal severSelectorIndexChanged property int currentIndex: 0 @@ -241,6 +243,8 @@ PageType { DropDownType { id: protocolSelector + drawerParent: root + visible: accessTypeSelector.currentIndex === 0 Layout.fillWidth: true @@ -330,6 +334,8 @@ PageType { DropDownType { id: exportTypeSelector + drawerParent: root + property int currentIndex: 0 Layout.fillWidth: true From a75bd07cd8b604bbe5f6894ac8e861f57efe8df5 Mon Sep 17 00:00:00 2001 From: ronoaer Date: Sun, 15 Oct 2023 15:54:05 +0800 Subject: [PATCH 057/108] fixed the clicked event --- client/ui/qml/Controls2/Drawer2Type.qml | 170 +++++++++++++----------- 1 file changed, 89 insertions(+), 81 deletions(-) diff --git a/client/ui/qml/Controls2/Drawer2Type.qml b/client/ui/qml/Controls2/Drawer2Type.qml index 3f877900..2f10ec5d 100644 --- a/client/ui/qml/Controls2/Drawer2Type.qml +++ b/client/ui/qml/Controls2/Drawer2Type.qml @@ -34,6 +34,8 @@ Item { state: "closed" + Drag.active: dragArea.drag.active + Rectangle { id: draw2Background @@ -46,104 +48,110 @@ Item { border.width: 1 visible: true - Rectangle { - id: semiArea - anchors.top: parent.top - height: parent.height - contentHeight - anchors.right: parent.right - anchors.left: parent.left - visible: true - color: "transparent" - } + MouseArea { + id: fullArea + anchors.fill: parent + enabled: (root.state === "expanded" || root.state === "opened") + onClicked: { + if (root.state === "expanded") { + root.state = "collapsed" + return + } - Rectangle { - id: contentArea - anchors.top: semiArea.bottom - height: contentHeight - radius: 16 - color: root.defaultColor - border.width: 1 - border.color: root.borderColor - width: parent.width - visible: true + if (root.state === "opened") { + root.state = "closed" + return + } + } Rectangle { - width: parent.radius - height: parent.radius - anchors.bottom: parent.bottom + id: semiArea + anchors.top: parent.top + height: parent.height - contentHeight anchors.right: parent.right anchors.left: parent.left - color: parent.color - } - } - } - - - MouseArea { - id: fullArea - anchors.fill: parent - enabled: (root.state === "expanded" || root.state === "opened") - onClicked: { - if (root.state === "expanded") { - root.state = "collapsed" - return + visible: true + color: "transparent" } - if (root.state === "opened") { - root.state = "closed" - return - } - } - } + Rectangle { + id: contentArea - Drag.active: dragArea.drag.active + anchors.top: semiArea.bottom + height: contentHeight + radius: 16 + color: root.defaultColor + border.width: 1 + border.color: root.borderColor + width: parent.width + visible: true - MouseArea { - id: dragArea + Rectangle { + width: parent.radius + height: parent.radius + anchors.bottom: parent.bottom + anchors.right: parent.right + anchors.left: parent.left + color: parent.color + } - anchors.fill: parent + MouseArea { + id: dragArea - cursorShape: (root.state === "opened" || root.state === "expanded") ? Qt.PointingHandCursor : Qt.ArrowCursor - hoverEnabled: true + anchors.fill: parent - drag.target: parent - drag.axis: Drag.YAxis - drag.maximumY: parent.height - drag.minimumY: parent.height - root.height + cursorShape: (root.state === "opened" || root.state === "expanded") ? Qt.PointingHandCursor : Qt.ArrowCursor + hoverEnabled: true - /** If drag area is released at any point other than min or max y, transition to the other state */ - onReleased: { - if (root.state === "closed" && root.y < dragArea.drag.maximumY) { - root.state = "opened" - PageController.drawerOpen() - return - } + drag.target: root + drag.axis: Drag.YAxis + drag.maximumY: root.height + drag.minimumY: root.height - root.height - if (root.state === "opened" && root.y > dragArea.drag.minimumY) { - root.state = "closed" - PageController.drawerClose() - return - } + /** If drag area is released at any point other than min or max y, transition to the other state */ + onReleased: { + if (root.state === "closed" && root.y < dragArea.drag.maximumY) { + root.state = "opened" + PageController.drawerOpen() + return + } - if (root.state === "collapsed" && root.y < dragArea.drag.maximumY) { - root.state = "expanded" - return - } - if (root.state === "expanded" && root.y > dragArea.drag.minimumY) { - root.state = "collapsed" - return - } - } + if (root.state === "opened" && root.y > dragArea.drag.minimumY) { + root.state = "closed" + PageController.drawerClose() + return + } - onClicked: { - if (root.state === "expanded") { - root.state = "collapsed" - return - } + if (root.state === "collapsed" && root.y < dragArea.drag.maximumY) { + root.state = "expanded" + return + } + if (root.state === "expanded" && root.y > dragArea.drag.minimumY) { + root.state = "collapsed" + return + } + } - if (root.state === "opened") { - root.state = "closed" - return + onClicked: { + if (root.state === "expanded") { + root.state = "collapsed" + return + } + + if (root.state === "opened") { + root.state = "closed" + return + } + } + +// onEntered: { +// fullArea.enabled = false +// } + +// onExited: { +// fullArea.enabled = true +// } + } } } } From d0f83584313d60c4c0507b60d5d78118ffb9cbdf Mon Sep 17 00:00:00 2001 From: ronoaer Date: Sun, 15 Oct 2023 17:29:22 +0800 Subject: [PATCH 058/108] removed invalid code, and fixed top button hidden-shown --- client/ui/qml/Controls2/Drawer2Type.qml | 67 +++++++++---------- .../Pages2/PageProtocolOpenVpnSettings.qml | 4 +- client/ui/qml/Pages2/PageProtocolRaw.qml | 4 +- .../ui/qml/Pages2/PageServiceDnsSettings.qml | 4 +- .../ui/qml/Pages2/PageServiceSftpSettings.qml | 4 +- .../Pages2/PageServiceTorWebsiteSettings.qml | 4 +- .../ui/qml/Pages2/PageSettingsApplication.qml | 4 +- client/ui/qml/Pages2/PageSettingsBackup.qml | 4 +- client/ui/qml/Pages2/PageSettingsDns.qml | 4 +- client/ui/qml/Pages2/PageSettingsLogging.qml | 4 +- .../ui/qml/Pages2/PageSettingsServerData.qml | 8 +-- .../qml/Pages2/PageSettingsServerProtocol.qml | 4 +- .../qml/Pages2/PageSettingsSplitTunneling.qml | 4 +- client/ui/qml/Pages2/PageStart.qml | 2 +- 14 files changed, 58 insertions(+), 63 deletions(-) diff --git a/client/ui/qml/Controls2/Drawer2Type.qml b/client/ui/qml/Controls2/Drawer2Type.qml index 2f10ec5d..2daae742 100644 --- a/client/ui/qml/Controls2/Drawer2Type.qml +++ b/client/ui/qml/Controls2/Drawer2Type.qml @@ -14,9 +14,9 @@ Item { } } - visible: false + signal closed - signal close() + visible: false property bool needCloseButton: true @@ -28,7 +28,6 @@ Item { property double scaely property int contentHeight: 0 property Item contentParent: contentArea - // property bool inContentArea: false y: parent.height - root.height @@ -44,7 +43,7 @@ Item { width: parent.width radius: 16 color: "transparent" - border.color: "transparent" //"green" + border.color: "transparent" border.width: 1 visible: true @@ -52,6 +51,8 @@ Item { id: fullArea anchors.fill: parent enabled: (root.state === "expanded" || root.state === "opened") + hoverEnabled: true + onClicked: { if (root.state === "expanded") { root.state = "collapsed" @@ -65,7 +66,7 @@ Item { } Rectangle { - id: semiArea + id: placeAreaHolder anchors.top: parent.top height: parent.height - contentHeight anchors.right: parent.right @@ -77,7 +78,7 @@ Item { Rectangle { id: contentArea - anchors.top: semiArea.bottom + anchors.top: placeAreaHolder.bottom height: contentHeight radius: 16 color: root.defaultColor @@ -112,13 +113,13 @@ Item { onReleased: { if (root.state === "closed" && root.y < dragArea.drag.maximumY) { root.state = "opened" - PageController.drawerOpen() + // PageController.drawerOpen() return } if (root.state === "opened" && root.y > dragArea.drag.minimumY) { root.state = "closed" - PageController.drawerClose() + // PageController.drawerClose() return } @@ -134,23 +135,17 @@ Item { onClicked: { if (root.state === "expanded") { + // PageController.drawerOpen() root.state = "collapsed" return } if (root.state === "opened") { + // PageController.drawerClose() root.state = "closed" return } } - -// onEntered: { -// fullArea.enabled = false -// } - -// onExited: { -// fullArea.enabled = true -// } } } } @@ -163,14 +158,23 @@ Item { PageController.updateNavigationBarColor(initialPageNavigationBarColor) } - PageController.drawerClose() + if (needCloseButton) { + PageController.drawerClose() + } + + closed() + return } if (root.state === "expanded" || root.state === "opened") { if (PageController.getInitialPageNavigationBarColor() !== 0xFF1C1D21) { PageController.updateNavigationBarColor(0xFF1C1D21) } - PageController.drawerOpen() + + if (needCloseButton) { + PageController.drawerOpen() + } + return } } @@ -275,31 +279,22 @@ Item { animationVisible.running = true - - if (needCloseButton) { - PageController.drawerOpen() - } - - if (PageController.getInitialPageNavigationBarColor() !== 0xFF1C1D21) { - PageController.updateNavigationBarColor(0xFF1C1D21) - } } - function onClose() { - if (needCloseButton) { - PageController.drawerClose() - } - - var initialPageNavigationBarColor = PageController.getInitialPageNavigationBarColor() - if (initialPageNavigationBarColor !== 0xFF1C1D21) { - PageController.updateNavigationBarColor(initialPageNavigationBarColor) - } - + function close() { root.visible = false + root.state = "closed" } onVisibleChanged: { + // e.g cancel, ...... if (!visible) { + if (root.state === "opened") { + if (needCloseButton) { + PageController.drawerClose() + } + } + close() } } diff --git a/client/ui/qml/Pages2/PageProtocolOpenVpnSettings.qml b/client/ui/qml/Pages2/PageProtocolOpenVpnSettings.qml index 2861ece3..3e75474b 100644 --- a/client/ui/qml/Pages2/PageProtocolOpenVpnSettings.qml +++ b/client/ui/qml/Pages2/PageProtocolOpenVpnSettings.qml @@ -369,12 +369,12 @@ PageType { questionDrawer.noButtonText = qsTr("Cancel") questionDrawer.yesButtonFunction = function() { - questionDrawer.onClose() + questionDrawer.close() PageController.goToPage(PageEnum.PageDeinstalling) InstallController.removeCurrentlyProcessedContainer() } questionDrawer.noButtonFunction = function() { - questionDrawer.onClose() + questionDrawer.close() } questionDrawer.open() } diff --git a/client/ui/qml/Pages2/PageProtocolRaw.qml b/client/ui/qml/Pages2/PageProtocolRaw.qml index f2a17686..23f192c7 100644 --- a/client/ui/qml/Pages2/PageProtocolRaw.qml +++ b/client/ui/qml/Pages2/PageProtocolRaw.qml @@ -183,12 +183,12 @@ PageType { questionDrawer.noButtonText = qsTr("Cancel") questionDrawer.yesButtonFunction = function() { - questionDrawer.onClose() + questionDrawer.close() PageController.goToPage(PageEnum.PageDeinstalling) InstallController.removeCurrentlyProcessedContainer() } questionDrawer.noButtonFunction = function() { - questionDrawer.onClose() + questionDrawer.close() } questionDrawer.open() } diff --git a/client/ui/qml/Pages2/PageServiceDnsSettings.qml b/client/ui/qml/Pages2/PageServiceDnsSettings.qml index 70aba8e2..9ad3b289 100644 --- a/client/ui/qml/Pages2/PageServiceDnsSettings.qml +++ b/client/ui/qml/Pages2/PageServiceDnsSettings.qml @@ -68,12 +68,12 @@ PageType { questionDrawer.noButtonText = qsTr("Cancel") questionDrawer.yesButtonFunction = function() { - questionDrawer.onClose() + questionDrawer.close() PageController.goToPage(PageEnum.PageDeinstalling) InstallController.removeCurrentlyProcessedContainer() } questionDrawer.noButtonFunction = function() { - questionDrawer.onClose() + questionDrawer.close() } questionDrawer.open() } diff --git a/client/ui/qml/Pages2/PageServiceSftpSettings.qml b/client/ui/qml/Pages2/PageServiceSftpSettings.qml index 0af47cdd..189267af 100644 --- a/client/ui/qml/Pages2/PageServiceSftpSettings.qml +++ b/client/ui/qml/Pages2/PageServiceSftpSettings.qml @@ -265,12 +265,12 @@ PageType { questionDrawer.noButtonText = qsTr("Cancel") questionDrawer.yesButtonFunction = function() { - questionDrawer.onClose() + questionDrawer.close() PageController.goToPage(PageEnum.PageDeinstalling) InstallController.removeCurrentlyProcessedContainer() } questionDrawer.noButtonFunction = function() { - questionDrawer.onClose() + questionDrawer.close() } questionDrawer.open() } diff --git a/client/ui/qml/Pages2/PageServiceTorWebsiteSettings.qml b/client/ui/qml/Pages2/PageServiceTorWebsiteSettings.qml index deff35eb..b69f5f63 100644 --- a/client/ui/qml/Pages2/PageServiceTorWebsiteSettings.qml +++ b/client/ui/qml/Pages2/PageServiceTorWebsiteSettings.qml @@ -143,12 +143,12 @@ PageType { questionDrawer.noButtonText = qsTr("Cancel") questionDrawer.yesButtonFunction = function() { - questionDrawer.onClose() + questionDrawer.close() PageController.goToPage(PageEnum.PageDeinstalling) InstallController.removeCurrentlyProcessedContainer() } questionDrawer.noButtonFunction = function() { - questionDrawer.onClose() + questionDrawer.close() } questionDrawer.open() } diff --git a/client/ui/qml/Pages2/PageSettingsApplication.qml b/client/ui/qml/Pages2/PageSettingsApplication.qml index 225e2b14..bd602636 100644 --- a/client/ui/qml/Pages2/PageSettingsApplication.qml +++ b/client/ui/qml/Pages2/PageSettingsApplication.qml @@ -152,12 +152,12 @@ PageType { questionDrawer.noButtonText = qsTr("Cancel") questionDrawer.yesButtonFunction = function() { - questionDrawer.onClose() + questionDrawer.close() SettingsController.clearSettings() PageController.replaceStartPage() } questionDrawer.noButtonFunction = function() { - questionDrawer.onClose() + questionDrawer.close() } questionDrawer.open() } diff --git a/client/ui/qml/Pages2/PageSettingsBackup.qml b/client/ui/qml/Pages2/PageSettingsBackup.qml index 61370dab..1fb160a1 100644 --- a/client/ui/qml/Pages2/PageSettingsBackup.qml +++ b/client/ui/qml/Pages2/PageSettingsBackup.qml @@ -138,13 +138,13 @@ PageType { questionDrawer.noButtonText = qsTr("Cancel") questionDrawer.yesButtonFunction = function() { - questionDrawer.onClose() + questionDrawer.close() PageController.showBusyIndicator(true) SettingsController.restoreAppConfig(filePath) PageController.showBusyIndicator(false) } questionDrawer.noButtonFunction = function() { - questionDrawer.onClose() + questionDrawer.close() } questionDrawer.open() } diff --git a/client/ui/qml/Pages2/PageSettingsDns.qml b/client/ui/qml/Pages2/PageSettingsDns.qml index 917c6992..553eeacd 100644 --- a/client/ui/qml/Pages2/PageSettingsDns.qml +++ b/client/ui/qml/Pages2/PageSettingsDns.qml @@ -91,7 +91,7 @@ PageType { questionDrawer.noButtonText = qsTr("Cancel") questionDrawer.yesButtonFunction = function() { - questionDrawer.onClose() + questionDrawer.close() SettingsController.primaryDns = "1.1.1.1" primaryDns.textFieldText = SettingsController.primaryDns SettingsController.secondaryDns = "1.0.0.1" @@ -99,7 +99,7 @@ PageType { PageController.showNotificationMessage(qsTr("Settings have been reset")) } questionDrawer.noButtonFunction = function() { - questionDrawer.onClose() + questionDrawer.close() } questionDrawer.open() } diff --git a/client/ui/qml/Pages2/PageSettingsLogging.qml b/client/ui/qml/Pages2/PageSettingsLogging.qml index 1532d1dc..9b9899ab 100644 --- a/client/ui/qml/Pages2/PageSettingsLogging.qml +++ b/client/ui/qml/Pages2/PageSettingsLogging.qml @@ -146,14 +146,14 @@ PageType { questionDrawer.noButtonText = qsTr("Cancel") questionDrawer.yesButtonFunction = function() { - questionDrawer.onClose() + questionDrawer.close() PageController.showBusyIndicator(true) SettingsController.clearLogs() PageController.showBusyIndicator(false) PageController.showNotificationMessage(qsTr("Logs have been cleaned up")) } questionDrawer.noButtonFunction = function() { - questionDrawer.onClose() + questionDrawer.close() } questionDrawer.open() } diff --git a/client/ui/qml/Pages2/PageSettingsServerData.qml b/client/ui/qml/Pages2/PageSettingsServerData.qml index 5e3f1939..b130eef9 100644 --- a/client/ui/qml/Pages2/PageSettingsServerData.qml +++ b/client/ui/qml/Pages2/PageSettingsServerData.qml @@ -94,13 +94,13 @@ PageType { questionDrawer.noButtonText = qsTr("Cancel") questionDrawer.yesButtonFunction = function() { - questionDrawer.onClose() + questionDrawer.close() PageController.showBusyIndicator(true) SettingsController.clearCachedProfiles() PageController.showBusyIndicator(false) } questionDrawer.noButtonFunction = function() { - questionDrawer.onClose() + questionDrawer.close() } questionDrawer.open() } @@ -172,7 +172,7 @@ PageType { questionDrawer.noButtonText = qsTr("Cancel") questionDrawer.yesButtonFunction = function() { - questionDrawer.onClose() + questionDrawer.close() PageController.goToPage(PageEnum.PageDeinstalling) if (ServersModel.isDefaultServerCurrentlyProcessed() && ConnectionController.isConnected) { ConnectionController.closeConnection() @@ -180,7 +180,7 @@ PageType { InstallController.removeAllContainers() } questionDrawer.noButtonFunction = function() { - questionDrawer.onClose() + questionDrawer.close() } questionDrawer.open() } diff --git a/client/ui/qml/Pages2/PageSettingsServerProtocol.qml b/client/ui/qml/Pages2/PageSettingsServerProtocol.qml index 594e4520..d1c8b22b 100644 --- a/client/ui/qml/Pages2/PageSettingsServerProtocol.qml +++ b/client/ui/qml/Pages2/PageSettingsServerProtocol.qml @@ -119,12 +119,12 @@ PageType { questionDrawer.noButtonText = qsTr("Cancel") questionDrawer.yesButtonFunction = function() { - questionDrawer.onClose() + questionDrawer.close() PageController.goToPage(PageEnum.PageDeinstalling) InstallController.removeCurrentlyProcessedContainer() } questionDrawer.noButtonFunction = function() { - questionDrawer.onClose() + questionDrawer.close() } questionDrawer.open() } diff --git a/client/ui/qml/Pages2/PageSettingsSplitTunneling.qml b/client/ui/qml/Pages2/PageSettingsSplitTunneling.qml index a88c576b..5bbd1003 100644 --- a/client/ui/qml/Pages2/PageSettingsSplitTunneling.qml +++ b/client/ui/qml/Pages2/PageSettingsSplitTunneling.qml @@ -202,11 +202,11 @@ PageType { questionDrawer.noButtonText = qsTr("Cancel") questionDrawer.yesButtonFunction = function() { - questionDrawer.onClose() + questionDrawer.close() SitesController.removeSite(index) } questionDrawer.noButtonFunction = function() { - questionDrawer.onClose() + questionDrawer.close() } questionDrawer.open() } diff --git a/client/ui/qml/Pages2/PageStart.qml b/client/ui/qml/Pages2/PageStart.qml index 923d1e79..55795465 100644 --- a/client/ui/qml/Pages2/PageStart.qml +++ b/client/ui/qml/Pages2/PageStart.qml @@ -245,7 +245,7 @@ PageType { ConnectionTypeSelectionDrawer { id: connectionTypeSelection - onClose: function() { + onClosed: { tabBar.setCurrentIndex(tabBar.previousIndex) } } From 29b4966119a57bb4631bb8ea289a5a27444471d6 Mon Sep 17 00:00:00 2001 From: ronoaer Date: Sun, 15 Oct 2023 17:34:35 +0800 Subject: [PATCH 059/108] shown ConnectionTypeSelectionDrawer on top level alway --- client/ui/qml/Pages2/PageStart.qml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/client/ui/qml/Pages2/PageStart.qml b/client/ui/qml/Pages2/PageStart.qml index 55795465..8afad392 100644 --- a/client/ui/qml/Pages2/PageStart.qml +++ b/client/ui/qml/Pages2/PageStart.qml @@ -245,6 +245,8 @@ PageType { ConnectionTypeSelectionDrawer { id: connectionTypeSelection + z: 1 + onClosed: { tabBar.setCurrentIndex(tabBar.previousIndex) } From 6d05b6845edbe1b32de680c4c5dd57f3d822e13d Mon Sep 17 00:00:00 2001 From: pokamest Date: Sun, 15 Oct 2023 10:53:09 +0100 Subject: [PATCH 060/108] VPN protocol descriptions updated --- client/containers/containers_defs.cpp | 97 ++++++++----- client/translations/amneziavpn_ru.ts | 175 +++++++++++++----------- client/translations/amneziavpn_zh_CN.ts | 95 +++++++------ 3 files changed, 211 insertions(+), 156 deletions(-) diff --git a/client/containers/containers_defs.cpp b/client/containers/containers_defs.cpp index d4f45ada..b6f1b111 100644 --- a/client/containers/containers_defs.cpp +++ b/client/containers/containers_defs.cpp @@ -127,24 +127,30 @@ QMap ContainerProps::containerDetailedDescriptions() return { { DockerContainer::OpenVpn, QObject::tr( - "The time-tested most popular VPN protocol.\n\n" - "Uses a proprietary security protocol with SSL/TLS for encryption and key exchange and supports " - "various authentication methods, making it suitable for a variety of devices and operating " - "systems.\n\n" - "* Normal power consumption on mobile devices\n" - "* Flexible customisation to suit user needs to work with different operating systems and devices.\n" - "* Recognised by DPI analysis systems and therefore susceptible to blocking.\n" - "* Can operate over both TCP and UDP network protocols.") }, + "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, " + "catering to a wide range of devices and operating systems. " + "Due to its open-source nature, OpenVPN benefits from extensive scrutiny by the global community, " + "which continually reinforces its security. " + "With a strong balance of performance, security, and compatibility, " + "OpenVPN remains a top choice for privacy-conscious individuals and businesses alike.\n\n" + "* Available in the AmneziaVPN across all platforms\n" + "* Normal power consumption on mobile devices\n" + "* Flexible customisation to suit user needs to work with different operating systems and devices\n" + "* Recognised by DPI analysis systems and therefore susceptible to blocking\n" + "* Can operate over both TCP and UDP network protocols.") }, { DockerContainer::ShadowSocks, - QObject::tr("Based on the SOCKS5 proxy protocol, which protects the connection using the AEAD cipher - " - "roughly along the same lines as SSH tunnelling. A Shadowsocks connection is difficult to " - "identify because it is virtually identical to a normal HTTPS connection.\n\n" - "However, some traffic analysis systems can still recognise a ShadowSocks connection, so in " - "countries with high levels of censorship we recommend using OpenVPN in conjunction with Cloak.\n" - "* Average power consumption on mobile devices (higher than OpenVPN).\n" - "* It is possible to configure the encryption protocol.\n" - "* Recognised by some DPI analysis systems\n" - "* Works only via TCP network protocol\n") }, + 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." + "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" + "* Normal power consumption on mobile devices\n\n" + "* Configurable encryption protocol\n" + "* Detectable by some DPI systems\n" + "* Works over TCP network protocol.") }, { DockerContainer::Cloak, QObject::tr("This is a combination of the OpenVPN protocol and the Cloak plugin designed specifically for " "blocking protection.\n\n" @@ -157,34 +163,53 @@ QMap ContainerProps::containerDetailedDescriptions() "Immediately after receiving the first data packet, Cloak authenticates the incoming connection. " "If authentication fails, the plugin masks the server as a fake website and your VPN becomes " "invisible to analysis systems.\n\n" - "If there is a high level of Internet censorship in your region, we advise you to use only " - "OpenVPN over Cloak from the first connection\n" + "If there is a extreme level of Internet censorship in your region, we advise you to use only " + "OpenVPN over Cloak from the first connection\n\n" + "* Available in the AmneziaVPN across all platforms\n" "* High power consumption on mobile devices\n" "* Flexible settings\n" "* Not recognised by DPI analysis systems\n" - "* Works via TCP network protocol\n") }, + "* Works over TCP network protocol, 443 port.\n") }, { DockerContainer::WireGuard, QObject::tr("A relatively new popular VPN protocol with a simplified architecture.\n" "Provides stable VPN connection, high performance on all devices. Uses hard-coded encryption " "settings. WireGuard compared to OpenVPN has lower latency and better data transfer throughput.\n" - - "* Low power consumption on mobile devices.\n" - "* Minimum number of settings.\n" - "* Easily recognised by DPI analysis systems, susceptible to blocking.\n" - "* Works via UDP network protocol.\n") }, - { DockerContainer::Awg, QObject::tr("AmneziaWG container") }, + "WireGuard is very susceptible to blocking due to its distinct packet signatures. " + "Unlike some other VPN protocols that employ obfuscation techniques, " + "the consistent signature patterns of WireGuard packets can be more easily identified and " + "thus blocked by advanced Deep Packet Inspection (DPI) systems and other network monitoring tools.\n\n" + "* Available in the AmneziaVPN across all platforms\n" + "* Low power consumption\n" + "* Minimum number of settings\n" + "* Easily recognised by DPI analysis systems, susceptible to blocking\n" + "* Works over UDP network protocol.") }, + { DockerContainer::Awg, + QObject::tr("A modern iteration of the popular VPN protocol, " + "AmneziaWG builds upon the foundation set by WireGuard, " + "retaining its simplified architecture and high-performance capabilities across devices.\n" + "While WireGuard is known for its efficiency, " + "it had issues with being easily detected due to its distinct packet signatures. " + "AmneziaWG solves this problem by using better obfuscation methods, " + "making its traffic blend in with regular internet traffic.\n" + "This means that AmneziaWG keeps the fast performance of the original " + "while adding an extra layer of stealth, " + "making it a great choice for those wanting a fast and discreet VPN connection.\n\n" + "* Available in the AmneziaVPN across all platforms\n" + "* Low power consumption\n" + "* Minimum number of settings\n" + "* Not recognised by DPI analysis systems, resistant to blocking\n" + "* Works over UDP network protocol.") }, { DockerContainer::Ipsec, - QObject::tr("A modern stable protocol.\n\n" - - "IKEv2 with IPSec encryption layer. Transmits data over fixed UDP ports 500 and 4500 protecting " - "them with strong 3DES and AES crypto algorithms. Allows very fast switching between networks " - "and devices. Due to its security, stability and speed, IKEv2 is currently one of the best VPN " - "solutions for mobile devices. Vulnerable to detection and blocking.\n" - + 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, " + "making it particularly adaptive in dynamic network environments. \n" + "While it offers a blend of security, stability, and speed, " + "it's essential to note that IKEv2 can be easily detected and is susceptible to blocking.\n\n" + "* Available in the AmneziaVPN only on Windows\n" "* Low power consumption, on mobile devices\n" - "* Minimal configuration.\n" - "* Recognised by DPI analysis systems.\n" - "* Works only over UDP network protocol\n") }, + "* Minimal configuration\n" + "* Recognised by DPI analysis systems\n" + "* Works over UDP network protocol, ports 500 and 4500.") }, { DockerContainer::TorWebSite, QObject::tr("Website in Tor network") }, { DockerContainer::Dns, QObject::tr("DNS Service") }, diff --git a/client/translations/amneziavpn_ru.ts b/client/translations/amneziavpn_ru.ts index d3eef897..7ba02dcb 100644 --- a/client/translations/amneziavpn_ru.ts +++ b/client/translations/amneziavpn_ru.ts @@ -2414,74 +2414,7 @@ and will not be shared or disclosed to the Amnezia or any third parties IPsec - - The time-tested most popular VPN protocol. - -Uses a proprietary security protocol with SSL/TLS for encryption and key exchange and supports various authentication methods, making it suitable for a variety of devices and operating systems. - -* Normal power consumption on mobile devices -* Flexible customisation to suit user needs to work with different operating systems and devices. -* Recognised by DPI analysis systems and therefore susceptible to blocking. -* Can operate over both TCP and UDP network protocols. - - - - - Based on the SOCKS5 proxy protocol, which protects the connection using the AEAD cipher - roughly along the same lines as SSH tunnelling. A Shadowsocks connection is difficult to identify because it is virtually identical to a normal HTTPS connection. - -However, some traffic analysis systems can still recognise a ShadowSocks connection, so in countries with high levels of censorship we recommend using OpenVPN in conjunction with Cloak. -* Average power consumption on mobile devices (higher than OpenVPN). -* It is possible to configure the encryption protocol. -* Recognised by some DPI analysis systems -* Works only via TCP network protocol - - - - - - This is a combination of the OpenVPN protocol and the Cloak plugin designed specifically for blocking protection. - -OpenVPN provides a secure VPN connection by encrypting all Internet traffic between the client and the server. - -Cloak protects OpenVPN from detection and blocking. - -Cloak can modify packet metadata so that it completely masks VPN traffic as normal web traffic, and also protects the VPN from detection by Active Probing. This makes it very resistant to being detected - -Immediately after receiving the first data packet, Cloak authenticates the incoming connection. If authentication fails, the plugin masks the server as a fake website and your VPN becomes invisible to analysis systems. - -If there is a high level of Internet censorship in your region, we advise you to use only OpenVPN over Cloak from the first connection -* High power consumption on mobile devices -* Flexible settings -* Not recognised by DPI analysis systems -* Works via TCP network protocol - - - - - - A relatively new popular VPN protocol with a simplified architecture. -Provides stable VPN connection, high performance on all devices. Uses hard-coded encryption settings. WireGuard compared to OpenVPN has lower latency and better data transfer throughput. -* Low power consumption on mobile devices. -* Minimum number of settings. -* Easily recognised by DPI analysis systems, susceptible to blocking. -* Works via UDP network protocol. - - - - - - A modern stable protocol. - -IKEv2 with IPSec encryption layer. Transmits data over fixed UDP ports 500 and 4500 protecting them with strong 3DES and AES crypto algorithms. Allows very fast switching between networks and devices. Due to its security, stability and speed, IKEv2 is currently one of the best VPN solutions for mobile devices. Vulnerable to detection and blocking. -* Low power consumption, on mobile devices -* Minimal configuration. -* Recognised by DPI analysis systems. -* Works only over UDP network protocol - - - - - + DNS Service DNS Сервис @@ -2492,7 +2425,7 @@ IKEv2 with IPSec encryption layer. Transmits data over fixed UDP ports 500 and 4 - + Website in Tor network Веб-сайт в сети Tor @@ -2547,12 +2480,96 @@ IKEv2 with IPSec encryption layer. Transmits data over fixed UDP ports 500 and 4 Создайте на сервере файловое хранилище для безопасного хранения и передачи файлов. - - AmneziaWG container - AmneziaWG протокол + + OpenVPN stands as one of the most popular and time-tested VPN protocols available. +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, catering to a wide range of devices and operating systems. Due to its open-source nature, OpenVPN benefits from extensive scrutiny by the global community, which continually reinforces its security. With a strong balance of performance, security, and compatibility, OpenVPN remains a top choice for privacy-conscious individuals and businesses alike. + +* Available in the AmneziaVPN across all platforms +* Normal power consumption on mobile devices +* Flexible customisation to suit user needs to work with different operating systems and devices +* Recognised by DPI analysis systems and therefore susceptible to blocking +* Can operate over both TCP and UDP network protocols. + - + + 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.However, certain traffic analysis systems might still detect a Shadowsocks connection. Due to limited support in Amnezia, it's recommended to use AmneziaWG protocol. + +* Available in the AmneziaVPN only on desktop platforms +* Normal power consumption on mobile devices + +* Configurable encryption protocol +* Detectable by some DPI systems +* Works over TCP network protocol. + + + + + This is a combination of the OpenVPN protocol and the Cloak plugin designed specifically for blocking protection. + +OpenVPN provides a secure VPN connection by encrypting all Internet traffic between the client and the server. + +Cloak protects OpenVPN from detection and blocking. + +Cloak can modify packet metadata so that it completely masks VPN traffic as normal web traffic, and also protects the VPN from detection by Active Probing. This makes it very resistant to being detected + +Immediately after receiving the first data packet, Cloak authenticates the incoming connection. If authentication fails, the plugin masks the server as a fake website and your VPN becomes invisible to analysis systems. + +If there is a extreme level of Internet censorship in your region, we advise you to use only OpenVPN over Cloak from the first connection + +* Available in the AmneziaVPN across all platforms +* High power consumption on mobile devices +* Flexible settings +* Not recognised by DPI analysis systems +* Works over TCP network protocol, 443 port. + + + + + + A relatively new popular VPN protocol with a simplified architecture. +Provides stable VPN connection, high performance on all devices. Uses hard-coded encryption settings. WireGuard compared to OpenVPN has lower latency and better data transfer throughput. +WireGuard is very susceptible to blocking due to its distinct packet signatures. Unlike some other VPN protocols that employ obfuscation techniques, the consistent signature patterns of WireGuard packets can be more easily identified and thus blocked by advanced Deep Packet Inspection (DPI) systems and other network monitoring tools. + +* Available in the AmneziaVPN across all platforms +* Low power consumption +* Minimum number of settings +* Easily recognised by DPI analysis systems, susceptible to blocking +* Works over UDP network protocol. + + + + + A modern iteration of the popular VPN protocol, AmneziaWG builds upon the foundation set by WireGuard, retaining its simplified architecture and high-performance capabilities across devices. +While WireGuard is known for its efficiency, it had issues with being easily detected due to its distinct packet signatures. AmneziaWG solves this problem by using better obfuscation methods, making its traffic blend in with regular internet traffic. +This means that AmneziaWG keeps the fast performance of the original while adding an extra layer of stealth, making it a great choice for those wanting a fast and discreet VPN connection. + +* Available in the AmneziaVPN across all platforms +* Low power consumption +* Minimum number of settings +* Not recognised by DPI analysis systems, resistant to blocking +* Works over UDP network protocol. + + + + + A modern stable protocol. + +IKEv2 with IPSec encryption layer. Transmits data over fixed UDP ports 500 and 4500 protecting them with strong 3DES and AES crypto algorithms. Allows very fast switching between networks and devices. Due to its security, stability and speed, IKEv2 is currently one of the best VPN solutions for mobile devices. Vulnerable to detection and blocking. + +* Available in the AmneziaVPN only on Windows +* Low power consumption, on mobile devices +* Minimal configuration +* Recognised by DPI analysis systems +* Works over UDP network protocol + + + + AmneziaWG container + AmneziaWG протокол + + + Sftp file sharing service - is secure FTP service Сервис обмена файлами Sftp - безопасный FTP-сервис @@ -2839,32 +2856,32 @@ IKEv2 with IPSec encryption layer. Transmits data over fixed UDP ports 500 and 4 amnezia::ContainerProps - + Low Низкий - + Medium or High Спедний или Высокий - + Extreme Экстремальный - + I just want to increase the level of my privacy. Я просто хочу повысить уровень своей приватности. - + I want to bypass censorship. This option recommended in most cases. Я хочу обойти блокировки. Этот вариант рекомендуется в большинстве случаев. - + Most VPN protocols are blocked. Recommended if other options are not working. Большинство VPN протоколов заблокированы. Рекомендуется, если другие варианты не работают. diff --git a/client/translations/amneziavpn_zh_CN.ts b/client/translations/amneziavpn_zh_CN.ts index be519a91..d68981c4 100644 --- a/client/translations/amneziavpn_zh_CN.ts +++ b/client/translations/amneziavpn_zh_CN.ts @@ -2537,7 +2537,7 @@ and will not be shared or disclosed to the Amnezia or any third parties - + Website in Tor network 在 Tor 网络中架设网站 @@ -2598,30 +2598,30 @@ and will not be shared or disclosed to the Amnezia or any third parties - The time-tested most popular VPN protocol. - -Uses a proprietary security protocol with SSL/TLS for encryption and key exchange and supports various authentication methods, making it suitable for a variety of devices and operating systems. + OpenVPN stands as one of the most popular and time-tested VPN protocols available. +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, catering to a wide range of devices and operating systems. Due to its open-source nature, OpenVPN benefits from extensive scrutiny by the global community, which continually reinforces its security. With a strong balance of performance, security, and compatibility, OpenVPN remains a top choice for privacy-conscious individuals and businesses alike. +* Available in the AmneziaVPN across all platforms * Normal power consumption on mobile devices -* Flexible customisation to suit user needs to work with different operating systems and devices. -* Recognised by DPI analysis systems and therefore susceptible to blocking. +* Flexible customisation to suit user needs to work with different operating systems and devices +* Recognised by DPI analysis systems and therefore susceptible to blocking * Can operate over both TCP and UDP network protocols. - - Based on the SOCKS5 proxy protocol, which protects the connection using the AEAD cipher - roughly along the same lines as SSH tunnelling. A Shadowsocks connection is difficult to identify because it is virtually identical to a normal HTTPS connection. + + 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.However, certain traffic analysis systems might still detect a Shadowsocks connection. Due to limited support in Amnezia, it's recommended to use AmneziaWG protocol. -However, some traffic analysis systems can still recognise a ShadowSocks connection, so in countries with high levels of censorship we recommend using OpenVPN in conjunction with Cloak. -* Average power consumption on mobile devices (higher than OpenVPN). -* It is possible to configure the encryption protocol. -* Recognised by some DPI analysis systems -* Works only via TCP network protocol - +* Available in the AmneziaVPN only on desktop platforms +* Normal power consumption on mobile devices + +* Configurable encryption protocol +* Detectable by some DPI systems +* Works over TCP network protocol. - + This is a combination of the OpenVPN protocol and the Cloak plugin designed specifically for blocking protection. OpenVPN provides a secure VPN connection by encrypting all Internet traffic between the client and the server. @@ -2632,35 +2632,53 @@ Cloak can modify packet metadata so that it completely masks VPN traffic as norm Immediately after receiving the first data packet, Cloak authenticates the incoming connection. If authentication fails, the plugin masks the server as a fake website and your VPN becomes invisible to analysis systems. -If there is a high level of Internet censorship in your region, we advise you to use only OpenVPN over Cloak from the first connection +If there is a extreme level of Internet censorship in your region, we advise you to use only OpenVPN over Cloak from the first connection + +* Available in the AmneziaVPN across all platforms * High power consumption on mobile devices * Flexible settings * Not recognised by DPI analysis systems -* Works via TCP network protocol +* Works over TCP network protocol, 443 port. - + A relatively new popular VPN protocol with a simplified architecture. Provides stable VPN connection, high performance on all devices. Uses hard-coded encryption settings. WireGuard compared to OpenVPN has lower latency and better data transfer throughput. -* Low power consumption on mobile devices. -* Minimum number of settings. -* Easily recognised by DPI analysis systems, susceptible to blocking. -* Works via UDP network protocol. - +WireGuard is very susceptible to blocking due to its distinct packet signatures. Unlike some other VPN protocols that employ obfuscation techniques, the consistent signature patterns of WireGuard packets can be more easily identified and thus blocked by advanced Deep Packet Inspection (DPI) systems and other network monitoring tools. + +* Available in the AmneziaVPN across all platforms +* Low power consumption +* Minimum number of settings +* Easily recognised by DPI analysis systems, susceptible to blocking +* Works over UDP network protocol. - + + A modern iteration of the popular VPN protocol, AmneziaWG builds upon the foundation set by WireGuard, retaining its simplified architecture and high-performance capabilities across devices. +While WireGuard is known for its efficiency, it had issues with being easily detected due to its distinct packet signatures. AmneziaWG solves this problem by using better obfuscation methods, making its traffic blend in with regular internet traffic. +This means that AmneziaWG keeps the fast performance of the original while adding an extra layer of stealth, making it a great choice for those wanting a fast and discreet VPN connection. + +* Available in the AmneziaVPN across all platforms +* Low power consumption +* Minimum number of settings +* Not recognised by DPI analysis systems, resistant to blocking +* Works over UDP network protocol. + + + + A modern stable protocol. IKEv2 with IPSec encryption layer. Transmits data over fixed UDP ports 500 and 4500 protecting them with strong 3DES and AES crypto algorithms. Allows very fast switching between networks and devices. Due to its security, stability and speed, IKEv2 is currently one of the best VPN solutions for mobile devices. Vulnerable to detection and blocking. + +* Available in the AmneziaVPN only on Windows * Low power consumption, on mobile devices -* Minimal configuration. -* Recognised by DPI analysis systems. -* Works only over UDP network protocol - +* Minimal configuration +* Recognised by DPI analysis systems +* Works over UDP network protocol @@ -2679,22 +2697,17 @@ IKEv2 with IPSec encryption layer. Transmits data over fixed UDP ports 500 and 4 WireGuard container WireGuard 容器 - - - AmneziaWG container - - IPsec container IPsec 容器 - + DNS Service DNS 服务 - + Sftp file sharing service - is secure FTP service Sftp 文件共享服务 - 安全的 FTP 服务 @@ -2980,32 +2993,32 @@ IKEv2 with IPSec encryption layer. Transmits data over fixed UDP ports 500 and 4 amnezia::ContainerProps - + Low - + Medium or High - + Extreme - + I just want to increase the level of my privacy. - + I want to bypass censorship. This option recommended in most cases. - + Most VPN protocols are blocked. Recommended if other options are not working. From 4c81cdb4a2397ab9a0dc1e45975feca75ca0155b Mon Sep 17 00:00:00 2001 From: pokamest Date: Sun, 15 Oct 2023 12:29:41 +0100 Subject: [PATCH 061/108] Update translation --- client/translations/amneziavpn_ru.ts | 58 ++++++++++++++-------------- 1 file changed, 29 insertions(+), 29 deletions(-) diff --git a/client/translations/amneziavpn_ru.ts b/client/translations/amneziavpn_ru.ts index d2ad31b7..3d7766a3 100644 --- a/client/translations/amneziavpn_ru.ts +++ b/client/translations/amneziavpn_ru.ts @@ -340,7 +340,7 @@ Already installed containers were found on the server. All installed containers Remove AmneziaWG - Remove AmneziaWG + Удалить AmneziaWG @@ -350,7 +350,7 @@ Already installed containers were found on the server. All installed containers All users who you shared a connection with will no longer be able to connect to it. - Все пользователи, которым вы поделились VPN с этим протоколом, больше не смогут к нему подключаться. + Все пользователи, с которыми вы поделились этим VPN-протоколом, больше не смогут к нему подключаться. @@ -383,13 +383,13 @@ Already installed containers were found on the server. All installed containers Port - Port + Порт Cipher - Cipher + Шифрование @@ -484,7 +484,7 @@ Already installed containers were found on the server. All installed containers Cipher - Шифрованаие + Шифрование @@ -575,7 +575,7 @@ Already installed containers were found on the server. All installed containers All users who you shared a connection with will no longer be able to connect to it. - Все пользователи, которым вы поделились VPN, больше не смогут к нему подключаться. + Все пользователи, с которыми вы поделились этим VPN-протоколом, больше не смогут к нему подключаться. @@ -623,7 +623,7 @@ Already installed containers were found on the server. All installed containers All users who you shared a connection with will no longer be able to connect to it. - Все пользователи, которым вы поделились VPN с этим протоколом больше не смогут к нему подключаться. + Все пользователи, с которыми вы поделились этим VPN-протоколом, больше не смогут к нему подключаться. @@ -679,7 +679,7 @@ Already installed containers were found on the server. All installed containers The DNS address is the same as the address of your server. You can configure DNS in the settings, under the connections tab. - Адрес DNS совпадает с адресом вашего сервера. Настроить DNS можно в настройках, во вкладке "Соединения". + Адрес DNS совпадает с адресом вашего сервера. Настроить DNS можно во вкладке "Соединения" настроек приложения @@ -772,7 +772,7 @@ Already installed containers were found on the server. All installed containers Remove SFTP and all data stored there - Удалите SFTP-хранилище со всеми данными + Удалить SFTP-хранилище со всеми данными @@ -820,7 +820,7 @@ Already installed containers were found on the server. All installed containers After installation it takes several minutes while your onion site will become available in the Tor Network. - Через несколько минут после установки ваш Onion сайт станет доступен в сети Tor. + Через несколько минут после установки ваш Onion сайт станет доступен в сети Tor. @@ -835,7 +835,7 @@ Already installed containers were found on the server. All installed containers The site with all data will be removed from the tor network. - Сайт со всеми данными будет удален из сети tor. + Сайт со всеми данными будет удален из сети Tor. @@ -891,7 +891,7 @@ Already installed containers were found on the server. All installed containers Support the project with a donation - Поддержите проект донатами + Поддержите проект пожертвованием @@ -999,12 +999,12 @@ Already installed containers were found on the server. All installed containers Start minimized - Запуск в свернутом виде + Запускать в свернутом виде Launch application minimized - Запуск приложения в свернутом виде + Запускать приложение в свернутом виде @@ -1039,7 +1039,7 @@ Already installed containers were found on the server. All installed containers All settings will be reset to default. All installed AmneziaVPN services will still remain on the server. - Все данные из приложения будут удалены Все установленные сервисы AmneziaVPN останутся на сервере. + Все данные из приложения будут удалены, все установленные сервисы AmneziaVPN останутся на сервере. @@ -1267,7 +1267,7 @@ Already installed containers were found on the server. All installed containers Save logs to file - Сохранить логи в файл + Сохранять логи в файл @@ -1344,7 +1344,7 @@ Already installed containers were found on the server. All installed containers Check the server for previously installed Amnezia services - Проверка сервера на наличие ранее установленных сервисов Amnezia + Проверить сервер на наличие ранее установленных сервисов Amnezia @@ -1369,7 +1369,7 @@ Already installed containers were found on the server. All installed containers Clear server from Amnezia software - Очистка сервера от протоколов и сервисов Amnezia + Очистить сервер от протоколов и сервисов Amnezia @@ -1379,7 +1379,7 @@ Already installed containers were found on the server. All installed containers All containers will be deleted on the server. This means that configuration files, keys and certificates will be deleted. - На сервере будут удалены все, что связанно с Amnezia: протоколы сервисы конфигурационные файлы, ключи и сертификаты. + На сервере будут удалены все данные, связанные с Amnezia: протоколы, сервисы, конфигурационные файлы, ключи и сертификаты. @@ -1466,7 +1466,7 @@ Already installed containers were found on the server. All installed containers Split tunneling - Раздельно VPN-туннелирование + Раздельное VPN-туннелирование @@ -1539,7 +1539,7 @@ Already installed containers were found on the server. All installed containers Add imported sites to existing ones - Добавление импортированных сайтов к существующим + Добавить импортированные сайты к существующим @@ -1561,7 +1561,7 @@ It's okay as long as it's from someone you trust. What do you have? - Выберете что у вас есть? + Выберете что у вас есть @@ -1657,7 +1657,7 @@ It's okay as long as it's from someone you trust. I want to choose a VPN protocol - Выбор VPN-протокола + Выбрать VPN-протокол @@ -1709,7 +1709,7 @@ It's okay as long as it's from someone you trust. Installing %1 - Установка %1 + Установить %1 @@ -1734,7 +1734,7 @@ It's okay as long as it's from someone you trust. Install - Установка + Установить @@ -1747,7 +1747,7 @@ It's okay as long as it's from someone you trust. Choose the one with the highest priority for you. Later, you can install other protocols and additional services, such as DNS proxy and SFTP. - Выберите протокол, который вам больше подходит . В дальнейшем можно установить другие протоколы и дополнительные сервисы, такие как DNS-прокси и SFTP. + Выберите протокол, который вам больше подходит. В дальнейшем можно установить другие протоколы и дополнительные сервисы, такие как DNS-прокси, TOR-сайт и SFTP. @@ -1806,7 +1806,7 @@ It's okay as long as it's from someone you trust. Insert - Вставка + Вставить @@ -2452,7 +2452,7 @@ It's okay as long as it's from someone you trust. Replace the current DNS server with your own. This will increase your privacy level. - Замените адрес DNS-сервера на собственный. Это повысит уровень конфиденциальности. + Замените DNS-сервер на Amnezia DNS. Это повысит уровень конфиденциальности. @@ -2565,7 +2565,7 @@ It's okay as long as it's from someone you trust. Choose language - Выберете язык + Выберите язык From 5f5435c6458fc879fe9ee99333c1ab8a47fac4fd Mon Sep 17 00:00:00 2001 From: pokamest Date: Sun, 15 Oct 2023 12:41:01 +0100 Subject: [PATCH 062/108] Updated ru ts --- client/translations/amneziavpn_ru.ts | 44 ++++++++++++------------- client/translations/amneziavpn_zh_CN.ts | 26 +++++++-------- 2 files changed, 35 insertions(+), 35 deletions(-) diff --git a/client/translations/amneziavpn_ru.ts b/client/translations/amneziavpn_ru.ts index 6f80bfc3..7bb59a7e 100644 --- a/client/translations/amneziavpn_ru.ts +++ b/client/translations/amneziavpn_ru.ts @@ -2414,7 +2414,20 @@ and will not be shared or disclosed to the Amnezia or any third parties IPsec - + + IKEv2, paired with the IPSec encryption layer, stands as a modern and stable VPN protocol. +One of its distinguishing features is its ability to swiftly switch between networks and devices, making it particularly adaptive in dynamic network environments. +While it offers a blend of security, stability, and speed, it's essential to note that IKEv2 can be easily detected and is susceptible to blocking. + +* Available in the AmneziaVPN only on Windows +* Low power consumption, on mobile devices +* Minimal configuration +* Recognised by DPI analysis systems +* Works over UDP network protocol, ports 500 and 4500. + + + + DNS Service DNS Сервис @@ -2425,7 +2438,7 @@ and will not be shared or disclosed to the Amnezia or any third parties - + Website in Tor network Веб-сайт в сети Tor @@ -2551,25 +2564,12 @@ This means that AmneziaWG keeps the fast performance of the original while addin * Works over UDP network protocol. - - - A modern stable protocol. - -IKEv2 with IPSec encryption layer. Transmits data over fixed UDP ports 500 and 4500 protecting them with strong 3DES and AES crypto algorithms. Allows very fast switching between networks and devices. Due to its security, stability and speed, IKEv2 is currently one of the best VPN solutions for mobile devices. Vulnerable to detection and blocking. - -* Available in the AmneziaVPN only on Windows -* Low power consumption, on mobile devices -* Minimal configuration -* Recognised by DPI analysis systems -* Works over UDP network protocol - - AmneziaWG container AmneziaWG протокол - + Sftp file sharing service - is secure FTP service Сервис обмена файлами Sftp - безопасный FTP-сервис @@ -2856,32 +2856,32 @@ IKEv2 with IPSec encryption layer. Transmits data over fixed UDP ports 500 and 4 amnezia::ContainerProps - + Low Низкий - + Medium or High Спедний или Высокий - + Extreme Экстремальный - + I just want to increase the level of my privacy. Я просто хочу повысить уровень своей приватности. - + I want to bypass censorship. This option recommended in most cases. Я хочу обойти блокировки. Этот вариант рекомендуется в большинстве случаев. - + Most VPN protocols are blocked. Recommended if other options are not working. Большинство VPN протоколов заблокированы. Рекомендуется, если другие варианты не работают. diff --git a/client/translations/amneziavpn_zh_CN.ts b/client/translations/amneziavpn_zh_CN.ts index d68981c4..576112de 100644 --- a/client/translations/amneziavpn_zh_CN.ts +++ b/client/translations/amneziavpn_zh_CN.ts @@ -2537,7 +2537,7 @@ and will not be shared or disclosed to the Amnezia or any third parties - + Website in Tor network 在 Tor 网络中架设网站 @@ -2670,15 +2670,15 @@ This means that AmneziaWG keeps the fast performance of the original while addin - A modern stable protocol. - -IKEv2 with IPSec encryption layer. Transmits data over fixed UDP ports 500 and 4500 protecting them with strong 3DES and AES crypto algorithms. Allows very fast switching between networks and devices. Due to its security, stability and speed, IKEv2 is currently one of the best VPN solutions for mobile devices. Vulnerable to detection and blocking. + IKEv2, paired with the IPSec encryption layer, stands as a modern and stable VPN protocol. +One of its distinguishing features is its ability to swiftly switch between networks and devices, making it particularly adaptive in dynamic network environments. +While it offers a blend of security, stability, and speed, it's essential to note that IKEv2 can be easily detected and is susceptible to blocking. * Available in the AmneziaVPN only on Windows * Low power consumption, on mobile devices * Minimal configuration * Recognised by DPI analysis systems -* Works over UDP network protocol +* Works over UDP network protocol, ports 500 and 4500. @@ -2702,12 +2702,12 @@ IKEv2 with IPSec encryption layer. Transmits data over fixed UDP ports 500 and 4 IPsec 容器 - + DNS Service DNS 服务 - + Sftp file sharing service - is secure FTP service Sftp 文件共享服务 - 安全的 FTP 服务 @@ -2993,32 +2993,32 @@ IKEv2 with IPSec encryption layer. Transmits data over fixed UDP ports 500 and 4 amnezia::ContainerProps - + Low - + Medium or High - + Extreme - + I just want to increase the level of my privacy. - + I want to bypass censorship. This option recommended in most cases. - + Most VPN protocols are blocked. Recommended if other options are not working. From a01ba5909c965324beab6e0e365d6aef0378f09d Mon Sep 17 00:00:00 2001 From: pokamest Date: Sun, 15 Oct 2023 12:53:44 +0100 Subject: [PATCH 063/108] Version bump --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index af4ae898..85d7d0ce 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -2,7 +2,7 @@ cmake_minimum_required(VERSION 3.25.0 FATAL_ERROR) set(PROJECT AmneziaVPN) -project(${PROJECT} VERSION 4.0.8.1 +project(${PROJECT} VERSION 4.0.8.2 DESCRIPTION "AmneziaVPN" HOMEPAGE_URL "https://amnezia.org/" ) From cb5c09d9679753785ecf3159e23a66bd877c9773 Mon Sep 17 00:00:00 2001 From: ronoaer Date: Sun, 15 Oct 2023 21:29:01 +0800 Subject: [PATCH 064/108] adapted questionDrawer --- client/ui/qml/Components/QuestionDrawer.qml | 3 ++- client/ui/qml/Components/ShareConnectionDrawer.qml | 2 +- client/ui/qml/Pages2/PageSettingsBackup.qml | 1 + client/ui/qml/Pages2/PageSettingsServerData.qml | 2 ++ client/ui/qml/Pages2/PageSettingsServerProtocol.qml | 1 + 5 files changed, 7 insertions(+), 2 deletions(-) diff --git a/client/ui/qml/Components/QuestionDrawer.qml b/client/ui/qml/Components/QuestionDrawer.qml index edc8df9e..72067f97 100644 --- a/client/ui/qml/Components/QuestionDrawer.qml +++ b/client/ui/qml/Components/QuestionDrawer.qml @@ -15,10 +15,11 @@ Drawer2Type { property var yesButtonFunction property var noButtonFunction + property real drawerHeight: 0.5 width: parent.width height: parent.height - contentHeight: parent.height * 0.5 + contentHeight: parent.height * drawerHeight ColumnLayout { parent: root.contentParent diff --git a/client/ui/qml/Components/ShareConnectionDrawer.qml b/client/ui/qml/Components/ShareConnectionDrawer.qml index 22c567a8..ae0df0e2 100644 --- a/client/ui/qml/Components/ShareConnectionDrawer.qml +++ b/client/ui/qml/Components/ShareConnectionDrawer.qml @@ -31,7 +31,7 @@ Drawer2Type { height: parent.height contentHeight: parent.height * 0.9 - onClose: { + onClosed: { configExtension = ".vpn" configCaption = qsTr("Save AmneziaVPN config") configFileName = "amnezia_config" diff --git a/client/ui/qml/Pages2/PageSettingsBackup.qml b/client/ui/qml/Pages2/PageSettingsBackup.qml index 1fb160a1..2caaf914 100644 --- a/client/ui/qml/Pages2/PageSettingsBackup.qml +++ b/client/ui/qml/Pages2/PageSettingsBackup.qml @@ -151,5 +151,6 @@ PageType { QuestionDrawer { id: questionDrawer + parent: root } } diff --git a/client/ui/qml/Pages2/PageSettingsServerData.qml b/client/ui/qml/Pages2/PageSettingsServerData.qml index b130eef9..2e401c67 100644 --- a/client/ui/qml/Pages2/PageSettingsServerData.qml +++ b/client/ui/qml/Pages2/PageSettingsServerData.qml @@ -193,6 +193,8 @@ PageType { QuestionDrawer { id: questionDrawer + drawerHeight: 0.8 + parent: root } } diff --git a/client/ui/qml/Pages2/PageSettingsServerProtocol.qml b/client/ui/qml/Pages2/PageSettingsServerProtocol.qml index d1c8b22b..a518167c 100644 --- a/client/ui/qml/Pages2/PageSettingsServerProtocol.qml +++ b/client/ui/qml/Pages2/PageSettingsServerProtocol.qml @@ -141,6 +141,7 @@ PageType { QuestionDrawer { id: questionDrawer + parent: root } } } From 7bd1340190abd10964731d66228ba671b3f87aaf Mon Sep 17 00:00:00 2001 From: "vladimir.kuznetsov" Date: Sun, 15 Oct 2023 20:41:49 +0500 Subject: [PATCH 065/108] fixed display of sites on page split tunneling --- client/amnezia_application.cpp | 2 +- client/translations/amneziavpn_ru.ts | 44 ++++++++++++------- client/translations/amneziavpn_zh_CN.ts | 44 ++++++++++++------- client/ui/models/sites_model.cpp | 22 +++++++++- client/ui/models/sites_model.h | 4 ++ .../ui/qml/Pages2/PageSettingsConnection.qml | 2 +- .../qml/Pages2/PageSettingsSplitTunneling.qml | 15 ++----- 7 files changed, 85 insertions(+), 48 deletions(-) diff --git a/client/amnezia_application.cpp b/client/amnezia_application.cpp index 4e6bce2b..229aa7b8 100644 --- a/client/amnezia_application.cpp +++ b/client/amnezia_application.cpp @@ -297,7 +297,7 @@ void AmneziaApplication::initModels() connect(m_containersModel.get(), &ContainersModel::defaultContainerChanged, this, [this]() { if (m_containersModel->getDefaultContainer() == DockerContainer::WireGuard && m_sitesModel->getRouteMode() != Settings::RouteMode::VpnAllSites) { - m_sitesModel->setRouteMode(Settings::RouteMode::VpnAllSites); + m_sitesModel->toggleSplitTunneling(false); emit m_pageController->showNotificationMessage( tr("Split tunneling for WireGuard is not implemented, the option was disabled")); } diff --git a/client/translations/amneziavpn_ru.ts b/client/translations/amneziavpn_ru.ts index d3eef897..14973fbd 100644 --- a/client/translations/amneziavpn_ru.ts +++ b/client/translations/amneziavpn_ru.ts @@ -1471,75 +1471,75 @@ Already installed containers were found on the server. All installed containers Раздельно VPN-туннелирование - + Mode Режим - + Remove Удалить - + Continue Продолжить - + Cancel Отменить - + Site or IP Сайт или IP - + Import/Export Sites Импорт/экспорт Сайтов - + Import Импорт - + Save site list Сохранить список сайтов - + Save sites Сохранить - - - + + + Sites files (*.json) Sites files (*.json) - + Import a list of sites Импортировать список с сайтами - + Replace site list Заменить список сайтов - - + + Open sites file Открыть список с сайтами - + Add imported sites to existing ones Добавление импортированных сайтов к существующим @@ -2621,6 +2621,16 @@ IKEv2 with IPSec encryption layer. Transmits data over fixed UDP ports 500 and 4 error 0x%1: %2 error 0x%1: %2 + + + WireGuard Configuration Highlighter + + + + + &Randomize colors + + SelectLanguageDrawer diff --git a/client/translations/amneziavpn_zh_CN.ts b/client/translations/amneziavpn_zh_CN.ts index be519a91..b439deaa 100644 --- a/client/translations/amneziavpn_zh_CN.ts +++ b/client/translations/amneziavpn_zh_CN.ts @@ -1573,75 +1573,75 @@ And if you don't like the app, all the more support it - the donation will 隧道分离 - + Mode 规则 - + Remove 移除 - + Continue 继续 - + Cancel 取消 - + Site or IP 网站或IP地址 - + Import/Export Sites 导入/导出网站 - + Import 导入 - + Save site list 保存网址 - + Save sites 保存网址 - - - + + + Sites files (*.json) - + Import a list of sites 导入网址列表 - + Replace site list 替换网址列表 - - + + Open sites file 打开网址文件 - + Add imported sites to existing ones 将导入的网址添加到现有网址中 @@ -2758,6 +2758,16 @@ IKEv2 with IPSec encryption layer. Transmits data over fixed UDP ports 500 and 4 error 0x%1: %2 错误 0x%1: %2 + + + WireGuard Configuration Highlighter + + + + + &Randomize colors + + SelectLanguageDrawer diff --git a/client/ui/models/sites_model.cpp b/client/ui/models/sites_model.cpp index 5fd9a38b..1e0f1692 100644 --- a/client/ui/models/sites_model.cpp +++ b/client/ui/models/sites_model.cpp @@ -3,7 +3,13 @@ SitesModel::SitesModel(std::shared_ptr settings, QObject *parent) : QAbstractListModel(parent), m_settings(settings) { - m_currentRouteMode = m_settings->routeMode(); + auto routeMode = m_settings->routeMode(); + if (routeMode == Settings::RouteMode::VpnAllSites) { + m_isSplitTunnelingEnabled = false; + m_currentRouteMode = Settings::RouteMode::VpnOnlyForwardSites; + } else { + m_currentRouteMode = routeMode; + } fillSites(); } @@ -93,6 +99,20 @@ void SitesModel::setRouteMode(int routeMode) emit routeModeChanged(); } +bool SitesModel::isSplitTunnelingEnabled() +{ + return m_isSplitTunnelingEnabled; +} + +void SitesModel::toggleSplitTunneling(bool enabled) +{ + if (enabled) { + setRouteMode(m_currentRouteMode); + } else { + m_settings->setRouteMode(Settings::RouteMode::VpnAllSites); + } +} + QVector > SitesModel::getCurrentSites() { return m_sites; diff --git a/client/ui/models/sites_model.h b/client/ui/models/sites_model.h index 70def0ec..ad16b7a3 100644 --- a/client/ui/models/sites_model.h +++ b/client/ui/models/sites_model.h @@ -31,6 +31,9 @@ public slots: int getRouteMode(); void setRouteMode(int routeMode); + bool isSplitTunnelingEnabled(); + void toggleSplitTunneling(bool enabled); + QVector> getCurrentSites(); signals: @@ -44,6 +47,7 @@ private: std::shared_ptr m_settings; + bool m_isSplitTunnelingEnabled; Settings::RouteMode m_currentRouteMode; QVector> m_sites; diff --git a/client/ui/qml/Pages2/PageSettingsConnection.qml b/client/ui/qml/Pages2/PageSettingsConnection.qml index 7f0262f9..b5b1bd97 100644 --- a/client/ui/qml/Pages2/PageSettingsConnection.qml +++ b/client/ui/qml/Pages2/PageSettingsConnection.qml @@ -112,7 +112,7 @@ PageType { } LabelWithButtonType { - visible: !GC.isMobile() + visible: false//!GC.isMobile() Layout.fillWidth: true diff --git a/client/ui/qml/Pages2/PageSettingsSplitTunneling.qml b/client/ui/qml/Pages2/PageSettingsSplitTunneling.qml index cc4973f1..d7f77871 100644 --- a/client/ui/qml/Pages2/PageSettingsSplitTunneling.qml +++ b/client/ui/qml/Pages2/PageSettingsSplitTunneling.qml @@ -93,22 +93,15 @@ PageType { SwitcherType { id: switcher - property int lastActiveRouteMode: routeMode.onlyForwardSites - enabled: root.pageEnabled Layout.fillWidth: true Layout.rightMargin: 16 - checked: SitesModel.routeMode !== routeMode.allSites - onToggled: { - if (checked) { - SitesModel.routeMode = lastActiveRouteMode - } else { - lastActiveRouteMode = SitesModel.routeMode - selector.text = root.routeModesModel[getRouteModesModelIndex()].name - SitesModel.routeMode = routeMode.allSites - } + checked: SitesModel.isSplitTunnelingEnabled() + onToggled: { + SitesModel.toggleSplitTunneling(checked) + selector.text = root.routeModesModel[getRouteModesModelIndex()].name } } } From 2a4a01a4bec1e73dbfd7a9be6fc1cacfa0ede2b8 Mon Sep 17 00:00:00 2001 From: "vladimir.kuznetsov" Date: Mon, 16 Oct 2023 13:28:37 +0500 Subject: [PATCH 066/108] removed split site tunneling page blocking when switcher is turned off --- client/ui/qml/Pages2/PageSettingsSplitTunneling.qml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/client/ui/qml/Pages2/PageSettingsSplitTunneling.qml b/client/ui/qml/Pages2/PageSettingsSplitTunneling.qml index d7f77871..873ae997 100644 --- a/client/ui/qml/Pages2/PageSettingsSplitTunneling.qml +++ b/client/ui/qml/Pages2/PageSettingsSplitTunneling.qml @@ -116,7 +116,7 @@ PageType { drawerHeight: 0.4375 - enabled: switcher.checked && root.pageEnabled + enabled: root.pageEnabled headerText: qsTr("Mode") @@ -158,7 +158,7 @@ PageType { anchors.topMargin: 16 contentHeight: col.implicitHeight + addSiteButton.implicitHeight + addSiteButton.anchors.bottomMargin + addSiteButton.anchors.topMargin - enabled: switcher.checked && root.pageEnabled + enabled: root.pageEnabled Column { id: col From 221d45f564d10347e50b612813c60e38eee6168c Mon Sep 17 00:00:00 2001 From: "vladimir.kuznetsov" Date: Mon, 16 Oct 2023 13:32:56 +0500 Subject: [PATCH 067/108] fixed pageSettingsDns width --- client/ui/qml/Pages2/PageSettingsDns.qml | 1 + 1 file changed, 1 insertion(+) diff --git a/client/ui/qml/Pages2/PageSettingsDns.qml b/client/ui/qml/Pages2/PageSettingsDns.qml index 58ec0783..5670464f 100644 --- a/client/ui/qml/Pages2/PageSettingsDns.qml +++ b/client/ui/qml/Pages2/PageSettingsDns.qml @@ -46,6 +46,7 @@ PageType { } ParagraphTextType { + Layout.fillWidth: true text: qsTr("If AmneziaDNS is not used or installed") } From 8e0eef3316c5f0ed90cd044dea514c4b284821a6 Mon Sep 17 00:00:00 2001 From: "vladimir.kuznetsov" Date: Mon, 16 Oct 2023 13:40:43 +0500 Subject: [PATCH 068/108] fixed selection of default container after installing a new container --- client/ui/controllers/installController.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/ui/controllers/installController.cpp b/client/ui/controllers/installController.cpp index 6eec9c6b..bb10d39c 100644 --- a/client/ui/controllers/installController.cpp +++ b/client/ui/controllers/installController.cpp @@ -184,7 +184,7 @@ void InstallController::installContainer(DockerContainer container, QJsonObject } if (ContainerProps::containerService(container) == ServiceType::Vpn) { - m_containersModel->setData(m_containersModel->index(0, 0), container, ContainersModel::Roles::IsDefaultRole); + m_containersModel->setData(m_containersModel->index(container), true, ContainersModel::Roles::IsDefaultRole); } emit installContainerFinished(finishMessage, ContainerProps::containerService(container) == ServiceType::Other); return; From cdb18de305771e6a5c2f6e1c48ad1ab1db0392f7 Mon Sep 17 00:00:00 2001 From: "vladimir.kuznetsov" Date: Mon, 16 Oct 2023 13:43:27 +0500 Subject: [PATCH 069/108] brought back the ability to share wireguard native format configs --- client/ui/qml/Pages2/PageShare.qml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/ui/qml/Pages2/PageShare.qml b/client/ui/qml/Pages2/PageShare.qml index aa04a1fe..25aad3de 100644 --- a/client/ui/qml/Pages2/PageShare.qml +++ b/client/ui/qml/Pages2/PageShare.qml @@ -320,7 +320,7 @@ PageType { if (index === ContainerProps.containerFromString("amnezia-openvpn")) { root.connectionTypesModel.push(openVpnConnectionFormat) - } else if (index === ContainerProps.containerFromString("amnezia-awg")) { + } else if (index === ContainerProps.containerFromString("amnezia-wireguard")) { root.connectionTypesModel.push(wireGuardConnectionFormat) } } From e01b1db706501d499f29c7f832d8791db2cd3f45 Mon Sep 17 00:00:00 2001 From: "vladimir.kuznetsov" Date: Mon, 16 Oct 2023 14:34:03 +0500 Subject: [PATCH 070/108] text corrections --- client/translations/amneziavpn_ru.ts | 38 +++++++++++++------ client/translations/amneziavpn_zh_CN.ts | 38 +++++++++++++------ .../ui/qml/Pages2/PageSettingsApplication.qml | 2 +- 3 files changed, 53 insertions(+), 25 deletions(-) diff --git a/client/translations/amneziavpn_ru.ts b/client/translations/amneziavpn_ru.ts index 7bb59a7e..8d9e5e92 100644 --- a/client/translations/amneziavpn_ru.ts +++ b/client/translations/amneziavpn_ru.ts @@ -984,9 +984,13 @@ Already installed containers were found on the server. All installed containers Авто-запуск - Launch the application every time %1 starts - Запускать приложение при каждом включении %1 + Запускать приложение при каждом включении %1 + + + + Launch the application every time the device is starts + Запускать приложение при каждом включении устройства @@ -1184,52 +1188,52 @@ Already installed containers were found on the server. All installed containers DNS сервер - + If AmneziaDNS is not used or installed Эти адреса будут использоваться, если не включен или не установлен AmneziaDNS - + Primary DNS Первичный DNS - + Secondary DNS Вторичный DNS - + Restore default Восстановить по умолчанию - + Restore default DNS settings? Восстановить настройки DNS по умолчанию? - + Continue Продолжить - + Cancel Отменить - + Settings have been reset Настройки сброшены - + Save Сохранить - + Settings saved Сохранить настройки @@ -2638,6 +2642,16 @@ This means that AmneziaWG keeps the fast performance of the original while addin error 0x%1: %2 error 0x%1: %2 + + + WireGuard Configuration Highlighter + + + + + &Randomize colors + + SelectLanguageDrawer diff --git a/client/translations/amneziavpn_zh_CN.ts b/client/translations/amneziavpn_zh_CN.ts index 576112de..60e03307 100644 --- a/client/translations/amneziavpn_zh_CN.ts +++ b/client/translations/amneziavpn_zh_CN.ts @@ -1046,9 +1046,13 @@ And if you don't like the app, all the more support it - the donation will 启动时自动运行运用程序 - Launch the application every time %1 starts - 运行应用软件在%1系统启动时 + 运行应用软件在%1系统启动时 + + + + Launch the application every time the device is starts + @@ -1266,52 +1270,52 @@ And if you don't like the app, all the more support it - the donation will DNS服务器 - + If AmneziaDNS is not used or installed 如果未使用或未安装AmneziaDNS - + Primary DNS 首选 DNS - + Secondary DNS 备用 DNS - + Restore default 恢复默认配置 - + Restore default DNS settings? 是否恢复默认DNS配置? - + Continue 继续 - + Cancel 取消 - + Settings have been reset 已重置 - + Save 保存 - + Settings saved 配置已保存 @@ -2771,6 +2775,16 @@ While it offers a blend of security, stability, and speed, it's essential t error 0x%1: %2 错误 0x%1: %2 + + + WireGuard Configuration Highlighter + + + + + &Randomize colors + + SelectLanguageDrawer diff --git a/client/ui/qml/Pages2/PageSettingsApplication.qml b/client/ui/qml/Pages2/PageSettingsApplication.qml index 49e3a5d9..05e468f0 100644 --- a/client/ui/qml/Pages2/PageSettingsApplication.qml +++ b/client/ui/qml/Pages2/PageSettingsApplication.qml @@ -70,7 +70,7 @@ PageType { Layout.margins: 16 text: qsTr("Auto start") - descriptionText: qsTr("Launch the application every time %1 starts").arg(Qt.platform.os) + descriptionText: qsTr("Launch the application every time the device is starts") checked: SettingsController.isAutoStartEnabled() onCheckedChanged: { From 9cf5590371876be5f084fbbc1622f60455f803a3 Mon Sep 17 00:00:00 2001 From: "vladimir.kuznetsov" Date: Mon, 16 Oct 2023 15:17:09 +0500 Subject: [PATCH 071/108] disabled split site tunneling for awg --- client/amnezia_application.cpp | 15 +++++++++------ client/translations/amneziavpn_ru.ts | 8 ++++++-- client/translations/amneziavpn_zh_CN.ts | 8 ++++++-- client/ui/models/sites_model.cpp | 1 + client/ui/qml/Pages2/PageSettingsConnection.qml | 2 +- 5 files changed, 23 insertions(+), 11 deletions(-) diff --git a/client/amnezia_application.cpp b/client/amnezia_application.cpp index 904ffaa6..da00dae7 100644 --- a/client/amnezia_application.cpp +++ b/client/amnezia_application.cpp @@ -139,7 +139,8 @@ void AmneziaApplication::init() &ConnectionController::openConnection); connect(m_notificationHandler.get(), &NotificationHandler::disconnectRequested, m_connectionController.get(), &ConnectionController::closeConnection); - connect(this, &AmneziaApplication::translationsUpdated, m_notificationHandler.get(), &NotificationHandler::onTranslationsUpdated); + connect(this, &AmneziaApplication::translationsUpdated, m_notificationHandler.get(), + &NotificationHandler::onTranslationsUpdated); m_engine->load(url); m_systemController->setQmlRoot(m_engine->rootObjects().value(0)); @@ -226,14 +227,13 @@ void AmneziaApplication::loadTranslator() updateTranslator(locale); } - void AmneziaApplication::updateTranslator(const QLocale &locale) { if (!m_translator->isEmpty()) { QCoreApplication::removeTranslator(m_translator.get()); } - QString strFileName = QString(":/translations/amneziavpn")+QLatin1String("_")+locale.name()+".qm"; + QString strFileName = QString(":/translations/amneziavpn") + QLatin1String("_") + locale.name() + ".qm"; if (m_translator->load(strFileName)) { if (QCoreApplication::installTranslator(m_translator.get())) { m_settings->setAppLanguage(locale); @@ -295,11 +295,13 @@ void AmneziaApplication::initModels() m_sitesModel.reset(new SitesModel(m_settings, this)); m_engine->rootContext()->setContextProperty("SitesModel", m_sitesModel.get()); connect(m_containersModel.get(), &ContainersModel::defaultContainerChanged, this, [this]() { - if (m_containersModel->getDefaultContainer() == DockerContainer::WireGuard + if ((m_containersModel->getDefaultContainer() == DockerContainer::WireGuard + || m_containersModel->getDefaultContainer() == DockerContainer::Awg) && m_sitesModel->isSplitTunnelingEnabled()) { m_sitesModel->toggleSplitTunneling(false); emit m_pageController->showNotificationMessage( - tr("Split tunneling for WireGuard is not implemented, the option was disabled")); + tr("Split tunneling for %1 is not implemented, the option was disabled") + .arg(ContainerProps::containerHumanNames().value(m_containersModel->getDefaultContainer()))); } }); @@ -335,7 +337,8 @@ void AmneziaApplication::initControllers() m_connectionController.reset(new ConnectionController(m_serversModel, m_containersModel, m_vpnConnection)); m_engine->rootContext()->setContextProperty("ConnectionController", m_connectionController.get()); - connect(this, &AmneziaApplication::translationsUpdated, m_connectionController.get(), &ConnectionController::onTranslationsUpdated); + connect(this, &AmneziaApplication::translationsUpdated, m_connectionController.get(), + &ConnectionController::onTranslationsUpdated); m_pageController.reset(new PageController(m_serversModel, m_settings)); m_engine->rootContext()->setContextProperty("PageController", m_pageController.get()); diff --git a/client/translations/amneziavpn_ru.ts b/client/translations/amneziavpn_ru.ts index de026ce1..acb7ac09 100644 --- a/client/translations/amneziavpn_ru.ts +++ b/client/translations/amneziavpn_ru.ts @@ -4,9 +4,13 @@ AmneziaApplication - Split tunneling for WireGuard is not implemented, the option was disabled - Раздельное туннелирование для "Wireguard" не реализовано,опция отключена + Раздельное туннелирование для "Wireguard" не реализовано,опция отключена + + + + Split tunneling for %1 is not implemented, the option was disabled + Раздельное туннелирование для %1 не реализовано, опция отключена diff --git a/client/translations/amneziavpn_zh_CN.ts b/client/translations/amneziavpn_zh_CN.ts index 77879a50..658a2c15 100644 --- a/client/translations/amneziavpn_zh_CN.ts +++ b/client/translations/amneziavpn_zh_CN.ts @@ -4,9 +4,13 @@ AmneziaApplication - Split tunneling for WireGuard is not implemented, the option was disabled - 未启用选项,还未实现基于WireGuard协议的VPN分离 + 未启用选项,还未实现基于WireGuard协议的VPN分离 + + + + Split tunneling for %1 is not implemented, the option was disabled + diff --git a/client/ui/models/sites_model.cpp b/client/ui/models/sites_model.cpp index 1e0f1692..61748bfc 100644 --- a/client/ui/models/sites_model.cpp +++ b/client/ui/models/sites_model.cpp @@ -111,6 +111,7 @@ void SitesModel::toggleSplitTunneling(bool enabled) } else { m_settings->setRouteMode(Settings::RouteMode::VpnAllSites); } + m_isSplitTunnelingEnabled = enabled; } QVector > SitesModel::getCurrentSites() diff --git a/client/ui/qml/Pages2/PageSettingsConnection.qml b/client/ui/qml/Pages2/PageSettingsConnection.qml index b5b1bd97..f6ecafd7 100644 --- a/client/ui/qml/Pages2/PageSettingsConnection.qml +++ b/client/ui/qml/Pages2/PageSettingsConnection.qml @@ -125,7 +125,7 @@ PageType { } DividerType { - visible: !GC.isMobile() + visible: false//!GC.isMobile() } } } From 7cc0f39d3ca12fd05fde3d7b6c06030d66e01c55 Mon Sep 17 00:00:00 2001 From: ronoaer Date: Mon, 16 Oct 2023 22:21:01 +0800 Subject: [PATCH 072/108] adapted pagehome by new custom drawer type --- client/resources.qrc | 1 + .../qml/Components/HomeContainersListView.qml | 2 +- .../ui/qml/Components/HomeRootMenuButton.qml | 140 ++++++++++ client/ui/qml/Controls2/Drawer2Type.qml | 68 +---- client/ui/qml/Controls2/DropDownType.qml | 9 +- client/ui/qml/Pages2/PageHome.qml | 242 +++--------------- 6 files changed, 194 insertions(+), 268 deletions(-) create mode 100644 client/ui/qml/Components/HomeRootMenuButton.qml diff --git a/client/resources.qrc b/client/resources.qrc index d7f8ff7a..ac6e5a6d 100644 --- a/client/resources.qrc +++ b/client/resources.qrc @@ -217,5 +217,6 @@ ui/qml/Controls2/TopCloseButtonType.qml images/controls/x-circle.svg ui/qml/Controls2/Drawer2Type.qml + ui/qml/Components/HomeRootMenuButton.qml diff --git a/client/ui/qml/Components/HomeContainersListView.qml b/client/ui/qml/Components/HomeContainersListView.qml index 86a755c1..1436c747 100644 --- a/client/ui/qml/Components/HomeContainersListView.qml +++ b/client/ui/qml/Components/HomeContainersListView.qml @@ -69,7 +69,7 @@ ListView { isDefault = true menuContent.currentIndex = index - containersDropDown.menuVisible = false + containersDropDown.menu.state = "closed" if (needReconnected && diff --git a/client/ui/qml/Components/HomeRootMenuButton.qml b/client/ui/qml/Components/HomeRootMenuButton.qml new file mode 100644 index 00000000..b2ca98dc --- /dev/null +++ b/client/ui/qml/Components/HomeRootMenuButton.qml @@ -0,0 +1,140 @@ +import QtQuick +import QtQuick.Controls +import QtQuick.Layouts + +import "../Controls2/TextTypes" +import "../Controls2" + +Item { + id: root + + property string text + property int textMaximumLineCount: 2 + property int textElide: Qt.ElideRight + + property string descriptionText + + property var clickedFunction + + property string rightImageSource + + property string textColor: "#d7d8db" + property string descriptionColor: "#878B91" + property real textOpacity: 1.0 + + property string rightImageColor: "#d7d8db" + + property bool descriptionOnTop: false + + property string defaultServerHostName + property string defaultContainerName + + implicitWidth: content.implicitWidth + content.anchors.topMargin + content.anchors.bottomMargin + implicitHeight: content.implicitHeight + content.anchors.leftMargin + content.anchors.rightMargin + + ColumnLayout { + id: content + + anchors.right: parent.right + anchors.left: parent.left + anchors.bottom: parent.bottom + + RowLayout { + Layout.topMargin: 24 + Layout.leftMargin: 24 + Layout.rightMargin: 24 + Layout.alignment: Qt.AlignHCenter | Qt.AlignVCenter + + Header1TextType { + Layout.maximumWidth: root.width - 48 - 18 - 12 // todo + + maximumLineCount: 2 + elide: Qt.ElideRight + + text: root.text + Layout.alignment: Qt.AlignLeft + } + + + ImageButtonType { + id: rightImage + + hoverEnabled: false + image: rightImageSource + imageColor: rightImageColor + visible: rightImageSource ? true : false + +// implicitSize: 18 +// backGroudRadius: 5 + horizontalPadding: 0 + padding: 0 + spacing: 0 + + + Rectangle { + id: rightImageBackground + anchors.fill: parent + radius: 16 + color: "transparent" + + Behavior on color { + PropertyAnimation { duration: 200 } + } + } + } + } + + LabelTextType { + Layout.bottomMargin: 44 + Layout.alignment: Qt.AlignHCenter | Qt.AlignVCenter + + text: { + var description = "" + if (ServersModel.isDefaultServerHasWriteAccess()) { + if (SettingsController.isAmneziaDnsEnabled() + && ContainersModel.isAmneziaDnsContainerInstalled(ServersModel.getDefaultServerIndex())) { + description += "Amnezia DNS | " + } + } else { + if (ServersModel.isDefaultServerConfigContainsAmneziaDns()) { + description += "Amnezia DNS | " + } + } + + description += root.defaultContainerName + " | " + root.defaultServerHostName + return description + } + } + } + + + MouseArea { + anchors.fill: parent + cursorShape: Qt.PointingHandCursor + hoverEnabled: true + + onEntered: { + rightImageBackground.color = rightImage.hoveredColor + + root.textOpacity = 0.8 + } + + onExited: { + rightImageBackground.color = rightImage.defaultColor + + root.textOpacity = 1 + } + + onPressedChanged: { + rightImageBackground.color = pressed ? rightImage.pressedColor : entered ? rightImage.hoveredColor : rightImage.defaultColor + + root.textOpacity = 0.7 + } + + onClicked: { + if (clickedFunction && typeof clickedFunction === "function") { + clickedFunction() + } + } + } +} diff --git a/client/ui/qml/Controls2/Drawer2Type.qml b/client/ui/qml/Controls2/Drawer2Type.qml index 2daae742..3f3cf54b 100644 --- a/client/ui/qml/Controls2/Drawer2Type.qml +++ b/client/ui/qml/Controls2/Drawer2Type.qml @@ -22,10 +22,9 @@ Item { property string defaultColor: "#1C1D21" property string borderColor: "#2C2D30" - property int collapsedHeight: 0 property bool needCollapsed: false - property double scaely + property int contentHeight: 0 property Item contentParent: contentArea @@ -50,15 +49,10 @@ Item { MouseArea { id: fullArea anchors.fill: parent - enabled: (root.state === "expanded" || root.state === "opened") + enabled: (root.state === "opened") hoverEnabled: true onClicked: { - if (root.state === "expanded") { - root.state = "collapsed" - return - } - if (root.state === "opened") { root.state = "closed" return @@ -101,7 +95,7 @@ Item { anchors.fill: parent - cursorShape: (root.state === "opened" || root.state === "expanded") ? Qt.PointingHandCursor : Qt.ArrowCursor + cursorShape: (root.state === "opened") ? Qt.PointingHandCursor : Qt.ArrowCursor hoverEnabled: true drag.target: root @@ -113,35 +107,17 @@ Item { onReleased: { if (root.state === "closed" && root.y < dragArea.drag.maximumY) { root.state = "opened" - // PageController.drawerOpen() return } if (root.state === "opened" && root.y > dragArea.drag.minimumY) { root.state = "closed" - // PageController.drawerClose() - return - } - - if (root.state === "collapsed" && root.y < dragArea.drag.maximumY) { - root.state = "expanded" - return - } - if (root.state === "expanded" && root.y > dragArea.drag.minimumY) { - root.state = "collapsed" return } } onClicked: { - if (root.state === "expanded") { - // PageController.drawerOpen() - root.state = "collapsed" - return - } - if (root.state === "opened") { - // PageController.drawerClose() root.state = "closed" return } @@ -152,7 +128,7 @@ Item { } onStateChanged: { - if (root.state === "closed" || root.state === "collapsed") { + if (root.state === "closed") { var initialPageNavigationBarColor = PageController.getInitialPageNavigationBarColor() if (initialPageNavigationBarColor !== 0xFF1C1D21) { PageController.updateNavigationBarColor(initialPageNavigationBarColor) @@ -166,7 +142,7 @@ Item { return } - if (root.state === "expanded" || root.state === "opened") { + if (root.state === "opened") { if (PageController.getInitialPageNavigationBarColor() !== 0xFF1C1D21) { PageController.updateNavigationBarColor(0xFF1C1D21) } @@ -181,21 +157,6 @@ Item { /** Two states of buttonContent, great place to add any future animations for the drawer */ states: [ - State { - name: "collapsed" - PropertyChanges { - target: root - y: root.height - collapsedHeight - } - }, - State { - name: "expanded" - PropertyChanges { - target: root - y: dragArea.drag.minimumY - } - }, - State { name: "closed" PropertyChanges { @@ -214,25 +175,6 @@ Item { ] transitions: [ - Transition { - from: "collapsed" - to: "expanded" - PropertyAnimation { - target: root - properties: "y" - duration: 200 - } - }, - Transition { - from: "expanded" - to: "collapsed" - PropertyAnimation { - target: root - properties: "y" - duration: 200 - } - }, - Transition { from: "opened" to: "closed" diff --git a/client/ui/qml/Controls2/DropDownType.qml b/client/ui/qml/Controls2/DropDownType.qml index 83518bef..0506bdc7 100644 --- a/client/ui/qml/Controls2/DropDownType.qml +++ b/client/ui/qml/Controls2/DropDownType.qml @@ -42,6 +42,8 @@ Item { property Item drawerParent: root + property Drawer2Type menu: menu + implicitWidth: rootButtonContent.implicitWidth implicitHeight: rootButtonContent.implicitHeight @@ -157,13 +159,12 @@ Item { onClicked: { if (rootButtonClickedFunction && typeof rootButtonClickedFunction === "function") { rootButtonClickedFunction() - } else { - menu.open() } + + menu.open() } } - //DrawerType { Drawer2Type { id: menu @@ -186,7 +187,7 @@ Item { BackButtonType { backButtonImage: root.headerBackButtonImage backButtonFunction: function() { - root.menuVisible = false + menu.state = "closed" } } } diff --git a/client/ui/qml/Pages2/PageHome.qml b/client/ui/qml/Pages2/PageHome.qml index 519c17a5..dafa3bdc 100644 --- a/client/ui/qml/Pages2/PageHome.qml +++ b/client/ui/qml/Pages2/PageHome.qml @@ -30,13 +30,13 @@ PageType { target: PageController function onRestorePageHomeState(isContainerInstalled) { - buttonContent.state = "expanded" + menu.close() if (isContainerInstalled) { containersDropDown.menuVisible = true } } function onForceCloseDrawer() { - buttonContent.state = "collapsed" + menu.close() } } @@ -69,79 +69,27 @@ PageType { } } - collapsedServerMenuDescription.text = description + root.defaultContainerName + " | " + root.defaultServerHostName + // collapsedServerMenuDescription.text = description + root.defaultContainerName + " | " + root.defaultServerHostName expandedServersMenuDescription.text = description + root.defaultServerHostName } - Component.onCompleted: updateDescriptions() - - MouseArea { - anchors.fill: parent - enabled: buttonContent.state === "expanded" - onClicked: { - buttonContent.state = "collapsed" - } + Component.onCompleted: { + updateDescriptions() } Item { anchors.fill: parent - anchors.bottomMargin: buttonContent.collapsedHeight + anchors.bottomMargin: defaultServerInfo.implicitHeight ConnectButton { anchors.centerIn: parent } } - MouseArea { - id: dragArea - - anchors.fill: buttonBackground - cursorShape: buttonContent.state === "collapsed" ? Qt.PointingHandCursor : Qt.ArrowCursor - hoverEnabled: true - - drag.target: buttonContent - drag.axis: Drag.YAxis - drag.maximumY: root.height - buttonContent.collapsedHeight - drag.minimumY: root.height - root.height * 0.9 - - /** If drag area is released at any point other than min or max y, transition to the other state */ - onReleased: { - if (buttonContent.state === "collapsed" && buttonContent.y < dragArea.drag.maximumY) { - buttonContent.state = "expanded" - return - } - if (buttonContent.state === "expanded" && buttonContent.y > dragArea.drag.minimumY) { - buttonContent.state = "collapsed" - return - } - } - - onEntered: { - collapsedButtonChevron.backgroundColor = collapsedButtonChevron.hoveredColor - collapsedButtonHeader.opacity = 0.8 - } - onExited: { - collapsedButtonChevron.backgroundColor = collapsedButtonChevron.defaultColor - collapsedButtonHeader.opacity = 1 - } - onPressedChanged: { - collapsedButtonChevron.backgroundColor = pressed ? collapsedButtonChevron.pressedColor : entered ? collapsedButtonChevron.hoveredColor : collapsedButtonChevron.defaultColor - collapsedButtonHeader.opacity = 0.7 - } - - - onClicked: { - if (buttonContent.state === "collapsed") { - buttonContent.state = "expanded" - } - } - } - Rectangle { id: buttonBackground + anchors.fill: defaultServerInfo - anchors { left: buttonContent.left; right: buttonContent.right; top: buttonContent.top } - height: root.height radius: 16 color: root.defaultColor border.color: root.borderColor @@ -157,151 +105,40 @@ PageType { } } - ColumnLayout { - id: buttonContent + HomeRootMenuButton { + id: defaultServerInfo + anchors.right: parent.right + anchors.left: parent.left + anchors.bottom: parent.bottom - /** Initial height of button content */ - property int collapsedHeight: 0 - /** True when expanded objects should be visible */ - property bool expandedVisibility: buttonContent.state === "expanded" || (buttonContent.state === "collapsed" && dragArea.drag.active === true) - /** True when collapsed objects should be visible */ - property bool collapsedVisibility: buttonContent.state === "collapsed" && dragArea.drag.active === false + text: root.defaultServerName + rightImageSource: "qrc:/images/controls/chevron-down.svg" - Drag.active: dragArea.drag.active - anchors.right: root.right - anchors.left: root.left - y: root.height - buttonContent.height + defaultContainerName: root.defaultContainerName + defaultServerHostName: root.defaultServerHostName - Component.onCompleted: { - buttonContent.state = "collapsed" + clickedFunction: function() { + menu.open() } + } - /** Set once based on first implicit height change once all children are layed out */ - onImplicitHeightChanged: { - if (buttonContent.state === "collapsed" && collapsedHeight == 0) { - collapsedHeight = implicitHeight - } - } + Drawer2Type { + id: menu + parent: root - onStateChanged: { - if (buttonContent.state === "collapsed") { - var initialPageNavigationBarColor = PageController.getInitialPageNavigationBarColor() - if (initialPageNavigationBarColor !== 0xFF1C1D21) { - PageController.updateNavigationBarColor(initialPageNavigationBarColor) - } - PageController.drawerClose() - return - } - if (buttonContent.state === "expanded") { - if (PageController.getInitialPageNavigationBarColor() !== 0xFF1C1D21) { - PageController.updateNavigationBarColor(0xFF1C1D21) - } - PageController.drawerOpen() - return - } - } + width: parent.width + height: parent.height + contentHeight: parent.height * 0.9 - /** Two states of buttonContent, great place to add any future animations for the drawer */ - states: [ - State { - name: "collapsed" - PropertyChanges { - target: buttonContent - y: root.height - collapsedHeight - } - }, - State { - name: "expanded" - PropertyChanges { - target: buttonContent - y: dragArea.drag.minimumY - - } - } - ] - - transitions: [ - Transition { - from: "collapsed" - to: "expanded" - PropertyAnimation { - target: buttonContent - properties: "y" - duration: 200 - } - }, - Transition { - from: "expanded" - to: "collapsed" - PropertyAnimation { - target: buttonContent - properties: "y" - duration: 200 - } - } - ] - - RowLayout { - Layout.topMargin: 24 - Layout.leftMargin: 24 - Layout.rightMargin: 24 - Layout.alignment: Qt.AlignHCenter | Qt.AlignVCenter - visible: buttonContent.collapsedVisibility - - spacing: 0 - - Header1TextType { - id: collapsedButtonHeader - Layout.maximumWidth: buttonContent.width - 48 - 18 - 12 // todo - - maximumLineCount: 2 - elide: Qt.ElideRight - - text: root.defaultServerName - horizontalAlignment: Qt.AlignHCenter - - Behavior on opacity { - PropertyAnimation { duration: 200 } - } - } - - ImageButtonType { - id: collapsedButtonChevron - - Layout.leftMargin: 8 - - hoverEnabled: false - image: "qrc:/images/controls/chevron-down.svg" - imageColor: "#d7d8db" - - icon.width: 18 - icon.height: 18 - backgroundRadius: 16 - horizontalPadding: 4 - topPadding: 4 - bottomPadding: 3 - - onClicked: { - if (buttonContent.state === "collapsed") { - buttonContent.state = "expanded" - } - } - } - } - - LabelTextType { - id: collapsedServerMenuDescription - Layout.bottomMargin: 44 - Layout.alignment: Qt.AlignHCenter | Qt.AlignVCenter - visible: buttonContent.collapsedVisibility - } ColumnLayout { id: serversMenuHeader - Layout.alignment: Qt.AlignTop | Qt.AlignHCenter - Layout.fillWidth: true - visible: buttonContent.expandedVisibility + parent: menu.contentParent + + anchors.top: parent.top + anchors.right: parent.right + anchors.left: parent.left Header1TextType { Layout.fillWidth: true @@ -330,6 +167,8 @@ PageType { DropDownType { id: containersDropDown + drawerParent: root + rootButtonImageColor: "#0E0E11" rootButtonBackgroundColor: "#D7D8DB" rootButtonBackgroundHoveredColor: Qt.rgba(215, 216, 219, 0.8) @@ -383,7 +222,6 @@ PageType { Layout.topMargin: 48 Layout.leftMargin: 16 Layout.rightMargin: 16 - visible: buttonContent.expandedVisibility headerText: qsTr("Servers") } @@ -391,12 +229,16 @@ PageType { Flickable { id: serversContainer - Layout.alignment: Qt.AlignTop | Qt.AlignHCenter - Layout.fillWidth: true - Layout.topMargin: 16 + + parent: menu.contentParent + + anchors.top: serversMenuHeader.bottom + anchors.right: parent.right + anchors.left: parent.left + anchors.bottom: parent.bottom + anchors.topMargin: 16 contentHeight: col.implicitHeight - implicitHeight: root.height - (root.height * 0.1) - serversMenuHeader.implicitHeight - 52 //todo 52 is tabbar height - visible: buttonContent.expandedVisibility + clip: true ScrollBar.vertical: ScrollBar { @@ -500,7 +342,7 @@ PageType { onClicked: function() { ServersModel.currentlyProcessedIndex = index PageController.goToPage(PageEnum.PageSettingsServerInfo) - buttonContent.state = "collapsed" + menu.close() } } } From 36ba3758db6b3f16e4c5dc11e8e8f581177a33ca Mon Sep 17 00:00:00 2001 From: pokamest Date: Mon, 16 Oct 2023 15:27:26 +0100 Subject: [PATCH 073/108] Translation updates --- client/translations/amneziavpn_ru.ts | 101 ++++++++++++++++-------- client/translations/amneziavpn_zh_CN.ts | 10 --- 2 files changed, 70 insertions(+), 41 deletions(-) diff --git a/client/translations/amneziavpn_ru.ts b/client/translations/amneziavpn_ru.ts index 8d9e5e92..857d390f 100644 --- a/client/translations/amneziavpn_ru.ts +++ b/client/translations/amneziavpn_ru.ts @@ -611,7 +611,7 @@ Already installed containers were found on the server. All installed containers All users who you shared a connection with will no longer be able to connect to it. - Все пользователи, с которыми вы поделились этим VPN-протоколом, больше не смогут к нему подключаться. + Все пользователи, с которыми вы поделились этим VPN-протоколом, больше не смогут к нему подключаться. @@ -765,7 +765,7 @@ Already installed containers were found on the server. All installed containers Remove SFTP and all data stored there? - Удалить SFTP-хранилище и все хранящиеся на нем данные? + Удалить SFTP-хранилище и все хранящиеся на нем данные? @@ -983,14 +983,10 @@ Already installed containers were found on the server. All installed containers Auto start Авто-запуск - - Launch the application every time %1 starts - Запускать приложение при каждом включении %1 - Launch the application every time the device is starts - Запускать приложение при каждом включении устройства + Запускать приложение при каждом включении @@ -1089,7 +1085,7 @@ Already installed containers were found on the server. All installed containers Backup file saved - + Бэкап файл сохранен @@ -1248,7 +1244,7 @@ Already installed containers were found on the server. All installed containers Save logs - Сохранить логи + Сохранять логи @@ -1268,7 +1264,7 @@ Already installed containers were found on the server. All installed containers Logs file saved - + Файл с логами сохранен @@ -1704,12 +1700,12 @@ and will not be shared or disclosed to the Amnezia or any third parties Amnezia has detected that your server is currently - + Amnezia обнаружила, что ваш сервер в настоящее время busy installing other software. Amnezia installation - + занят установкой другого программного обеспечения. Установка Amnezia @@ -2428,7 +2424,15 @@ While it offers a blend of security, stability, and speed, it's essential t * Minimal configuration * Recognised by DPI analysis systems * Works over UDP network protocol, ports 500 and 4500. - + IKEv2 в сочетании с уровнем шифрования IPSec это современный и стабильный протокол VPN. +Он может быстро переключаться между сетями и устройствами, что делает его особенно адаптивным в динамичных сетевых средах. +Несмотря на сочетание безопасности, стабильности и скорости, необходимо отметить, что IKEv2 легко обнаруживается и подвержен блокировке. + +* Доступно в AmneziaVPN только для Windows. +* Низкое энергопотребление, на мобильных устройствах +* Минимальная конфигурация +* Распознается системами DPI-анализа +* Работает по сетевому протоколу UDP, порты 500 и 4500. @@ -2474,7 +2478,7 @@ While it offers a blend of security, stability, and speed, it's essential t AmneziaWG - Special protocol from Amnezia, based on WireGuard. It's fast like WireGuard, but very resistant to blockages. Recommended for regions with high levels of censorship. - + AmneziaWG - Специальный протокол от Amnezia, основанный на протоколе WireGuard. Он такой же быстрый, как WireGuard, но очень устойчив к блокировкам. Рекомендуется для регионов с высоким уровнем цензуры. @@ -2506,7 +2510,14 @@ It employs its unique security protocol, leveraging the strength of SSL/TLS for * Flexible customisation to suit user needs to work with different operating systems and devices * Recognised by DPI analysis systems and therefore susceptible to blocking * Can operate over both TCP and UDP network protocols. - + OpenVPN однин из самых популярных и проверенных временем VPN-протоколов. +В нем используется уникальный протокол безопасности, опирающийся на протокол SSL/TLS для шифрования и обмена ключами. Кроме того, поддержка OpenVPN множества методов аутентификации делает его универсальным и адаптируемым к широкому спектру устройств и операционных систем. Благодаря открытому исходному коду OpenVPN подвергается тщательному анализу со стороны мирового сообщества, что постоянно повышает его безопасность. Благодаря оптимальному соотношению производительности, безопасности и совместимости OpenVPN остается лучшим выбором как для частных лиц, так и для компаний, заботящихся о конфиденциальности. + +* Доступность AmneziaVPN для всех платформ +* Нормальное энергопотребление на мобильных устройствах +* Гибкая настройка под нужды пользователя для работы с различными операционными системами и устройствами +* Распознается системами DPI-анализа и поэтому подвержен блокировке +* Может работать по сетевым протоколам TCP и UDP. @@ -2518,7 +2529,12 @@ It employs its unique security protocol, leveraging the strength of SSL/TLS for * Configurable encryption protocol * Detectable by some DPI systems * Works over TCP network protocol. - + Shadowsocks, создан на основе протокола SOCKS5, защищает соединение с помощью шифра AEAD. Несмотря на то, что протокол Shadowsocks разработан таким образом, чтобы быть незаметным и сложным для идентификации, он не идентичен стандартному HTTPS-соединению. Однако некоторые системы анализа трафика все же могут обнаружить соединение Shadowsocks. В связи с ограниченной поддержкой в Amnezia рекомендуется использовать протокол AmneziaWG, или OpenVPN over Cloak. + +* Доступен в AmneziaVPN только на ПК ноутбуках. +* Настраиваемый протокол шифрования +* Обнаруживается некоторыми DPI-системами +* Работает по сетевому протоколу TCP. @@ -2540,7 +2556,24 @@ If there is a extreme level of Internet censorship in your region, we advise you * Not recognised by DPI analysis systems * Works over TCP network protocol, 443 port. - + OpenVPN over Cloak - это комбинация протокола OpenVPN и плагина Cloak, разработанного специально для защиты от блокировок. + +OpenVPN обеспечивает безопасное VPN-соединение за счет шифрования всего интернет-трафика между клиентом и сервером. + +Cloak защищает OpenVPN от обнаружения и блокировок. + +Cloak может изменять метаданные пакетов. Он полностью маскирует VPN-трафик под обычный веб-трафик, а также защищает VPN от обнаружения с помощью Active Probing. Это делает ее очень устойчивой к обнаружению + +Сразу же после получения первого пакета данных Cloak проверяет подлинность входящего соединения. Если аутентификация не проходит, плагин маскирует сервер под поддельный сайт, и ваша VPN становится невидимой для аналитических систем. + +Если в вашем регионе существует экстремальный уровень цензуры в Интернете, мы советуем вам при первом подключении использовать только OpenVPN через Cloak + +* Доступность AmneziaVPN на всех платформах +* Высокое энергопотребление на мобильных устройствах +* Гибкие настройки +* Не распознается системами DPI-анализа +* Работает по сетевому протоколу TCP, 443 порт. + @@ -2553,7 +2586,15 @@ WireGuard is very susceptible to blocking due to its distinct packet signatures. * Minimum number of settings * Easily recognised by DPI analysis systems, susceptible to blocking * Works over UDP network protocol. - + WireGuard - относительно новый популярный VPN-протокол с упрощенной архитектурой. +Обеспечивает стабильное VPN-соединение, высокую производительность на всех устройствах. Использует жестко заданные настройки шифрования. WireGuard по сравнению с OpenVPN имеет меньшую задержку и лучшую пропускную способность при передаче данных. +WireGuard очень восприимчив к блокированию из-за особенностей сигнатур пакетов. В отличие от некоторых других VPN-протоколов, использующих методы обфускации, последовательные сигнатуры пакетов WireGuard легче выявляются и, соответственно, блокируются современными системами глубокой проверки пакетов (DPI) и другими средствами сетевого мониторинга. + +* Доступность AmneziaVPN для всех платформ +* Низкое энергопотребление +* Минимальное количество настроек +* Легко распознается системами DPI-анализа, подвержен блокировке +* Работает по сетевому протоколу UDP. @@ -2566,7 +2607,15 @@ This means that AmneziaWG keeps the fast performance of the original while addin * Minimum number of settings * Not recognised by DPI analysis systems, resistant to blocking * Works over UDP network protocol. - + AmneziaWG - усовершенствованная версия популярного VPN-протокола Wireguard. AmneziaWG опирается на фундамент, заложенный WireGuard, сохраняя упрощенную архитектуру и высокопроизводительные возможности работы на разных устройствах. +Хотя WireGuard известен своей эффективностью, у него были проблемы с обнаружением из-за характерных сигнатур пакетов. AmneziaWG решает эту проблему за счет использования более совершенных методов обфускации, благодаря чему его трафик сливается с обычным интернет-трафиком. +Таким образом, AmneziaWG сохраняет высокую производительность оригинала, добавляя при этом дополнительный уровень скрытности, что делает его отличным выбором для тех, кому нужно быстрое и незаметное VPN-соединение. + +* Доступность AmneziaVPN на всех платформах +* Низкое энергопотребление +* Минимальное количество настроек +* Не распознается системами DPI-анализа, устойчив к блокировке +* Работает по сетевому протоколу UDP. AmneziaWG container @@ -2642,16 +2691,6 @@ This means that AmneziaWG keeps the fast performance of the original while addin error 0x%1: %2 error 0x%1: %2 - - - WireGuard Configuration Highlighter - - - - - &Randomize colors - - SelectLanguageDrawer @@ -2877,7 +2916,7 @@ This means that AmneziaWG keeps the fast performance of the original while addin Medium or High - Спедний или Высокий + Средний или Высокий @@ -2925,7 +2964,7 @@ This means that AmneziaWG keeps the fast performance of the original while addin Private key passphrase - Кодовая фраза для закрытого ключа + Кодовая фраза для закрытого ключа diff --git a/client/translations/amneziavpn_zh_CN.ts b/client/translations/amneziavpn_zh_CN.ts index 60e03307..b908bf56 100644 --- a/client/translations/amneziavpn_zh_CN.ts +++ b/client/translations/amneziavpn_zh_CN.ts @@ -2775,16 +2775,6 @@ While it offers a blend of security, stability, and speed, it's essential t error 0x%1: %2 错误 0x%1: %2 - - - WireGuard Configuration Highlighter - - - - - &Randomize colors - - SelectLanguageDrawer From 9eb23e38bd9b31cc50794312bd7cbd8793fdce3a Mon Sep 17 00:00:00 2001 From: "vladimir.kuznetsov" Date: Mon, 16 Oct 2023 22:57:12 +0500 Subject: [PATCH 074/108] disabled the ability to change the protocol/server when a vpn connection is active --- client/translations/amneziavpn_ru.ts | 13 ++++++-- client/translations/amneziavpn_zh_CN.ts | 13 ++++++-- .../qml/Components/HomeContainersListView.qml | 30 +++++++------------ client/ui/qml/Controls2/CardType.qml | 2 ++ client/ui/qml/Pages2/PageHome.qml | 6 ++++ 5 files changed, 41 insertions(+), 23 deletions(-) diff --git a/client/translations/amneziavpn_ru.ts b/client/translations/amneziavpn_ru.ts index 8d9e5e92..ad2ebfbe 100644 --- a/client/translations/amneziavpn_ru.ts +++ b/client/translations/amneziavpn_ru.ts @@ -119,13 +119,17 @@ HomeContainersListView + Unable change protocol while there is an active connection + + + + The selected protocol is not supported on the current platform Выбранный протокол не поддерживается на данном устройстве - Reconnect via VPN Procotol: - Переподключение через VPN протокол: + Переподключение через VPN протокол: @@ -267,6 +271,11 @@ Already installed containers were found on the server. All installed containers Servers Серверы + + + Unable change server while there is an active connection + + PageProtocolAwgSettings diff --git a/client/translations/amneziavpn_zh_CN.ts b/client/translations/amneziavpn_zh_CN.ts index 60e03307..0def921b 100644 --- a/client/translations/amneziavpn_zh_CN.ts +++ b/client/translations/amneziavpn_zh_CN.ts @@ -130,13 +130,17 @@ HomeContainersListView + Unable change protocol while there is an active connection + Невозможно изменить протокол при наличии активного соединения + + + The selected protocol is not supported on the current platform 当前平台不支持所选协议 - Reconnect via VPN Procotol: - 重连VPN基于协议: + 重连VPN基于协议: @@ -301,6 +305,11 @@ Already installed containers were found on the server. All installed containers Servers 服务器 + + + Unable change server while there is an active connection + Невозможно изменить сервер при наличии активного соединения + PageProtocolAwgSettings diff --git a/client/ui/qml/Components/HomeContainersListView.qml b/client/ui/qml/Components/HomeContainersListView.qml index 2304427f..f05b90d6 100644 --- a/client/ui/qml/Components/HomeContainersListView.qml +++ b/client/ui/qml/Components/HomeContainersListView.qml @@ -50,34 +50,26 @@ ListView { imageSource: "qrc:/images/controls/download.svg" showImage: !isInstalled - checkable: isInstalled + checkable: isInstalled && !ConnectionController.isConnected && isSupported checked: isDefault - onPressed: function(mouse) { - if (!isSupported) { - PageController.showErrorMessage(qsTr("The selected protocol is not supported on the current platform")) - } - } - onClicked: { - if (checked) { - var needReconnected = false - if (!isDefault) { - needReconnected = true - } + if (ConnectionController.isConnected && isInstalled) { + PageController.showNotificationMessage(qsTr("Unable change protocol while there is an active connection")) + return + } + if (checked) { isDefault = true menuContent.currentIndex = index containersDropDown.menuVisible = false - - - if (needReconnected && (ConnectionController.isConnected || ConnectionController.isConnectionInProgress)) { - PageController.showNotificationMessage(qsTr("Reconnect via VPN Procotol: ") + name) - PageController.goToPageHome() - ConnectionController.openConnection() - } } else { + if (!isSupported && isInstalled) { + PageController.showErrorMessage(qsTr("The selected protocol is not supported on the current platform")) + return + } + ContainersModel.setCurrentlyProcessedContainerIndex(proxyContainersModel.mapToSource(index)) InstallController.setShouldCreateServer(false) PageController.goToPage(PageEnum.PageSetupWizardProtocolSettings) diff --git a/client/ui/qml/Controls2/CardType.qml b/client/ui/qml/Controls2/CardType.qml index 8429acb8..32f89122 100644 --- a/client/ui/qml/Controls2/CardType.qml +++ b/client/ui/qml/Controls2/CardType.qml @@ -81,6 +81,7 @@ RadioButton { Text { text: root.headerText + wrapMode: Text.WordWrap color: "#D7D8DB" font.pixelSize: 25 font.weight: 700 @@ -110,6 +111,7 @@ RadioButton { Text { text: root.footerText + wrapMode: Text.WordWrap visible: root.footerText !== "" color: "#878B91" font.pixelSize: 13 diff --git a/client/ui/qml/Pages2/PageHome.qml b/client/ui/qml/Pages2/PageHome.qml index 519c17a5..d89d6be1 100644 --- a/client/ui/qml/Pages2/PageHome.qml +++ b/client/ui/qml/Pages2/PageHome.qml @@ -471,10 +471,16 @@ PageType { } checked: index === serversMenuContent.currentIndex + checkable: !ConnectionController.isConnected ButtonGroup.group: serversRadioButtonGroup onClicked: { + if (ConnectionController.isConnected) { + PageController.showNotificationMessage(qsTr("Unable change server while there is an active connection")) + return + } + serversMenuContent.currentIndex = index ServersModel.currentlyProcessedIndex = index From 5369e68267828ce243e32b1aca70a0de218e34f1 Mon Sep 17 00:00:00 2001 From: ronoaer Date: Tue, 17 Oct 2023 14:30:59 +0800 Subject: [PATCH 075/108] updated Chinese translations for updating source strings --- client/translations/amneziavpn_zh_CN.ts | 105 ++++++++++++++++++------ 1 file changed, 80 insertions(+), 25 deletions(-) diff --git a/client/translations/amneziavpn_zh_CN.ts b/client/translations/amneziavpn_zh_CN.ts index b908bf56..e1f8a13a 100644 --- a/client/translations/amneziavpn_zh_CN.ts +++ b/client/translations/amneziavpn_zh_CN.ts @@ -74,17 +74,17 @@ Add new connection - + 添加新连接 Configure your server - + 配置您的服务器 Open config file, key or QR code - + 配置文件,授权码或二维码 Server IP, login and password @@ -860,7 +860,7 @@ Already installed containers were found on the server. All installed containers When configuring WordPress set the this onion address as domain. - + 配置 WordPress 时,将此洋葱地址设置为域。 When configuring WordPress set the domain as this onion address. @@ -1052,7 +1052,7 @@ And if you don't like the app, all the more support it - the donation will Launch the application every time the device is starts - + 每次设备启动时启动应用程序 @@ -1155,7 +1155,7 @@ And if you don't like the app, all the more support it - the donation will Backup file saved - + 备份文件已保存 @@ -1350,7 +1350,7 @@ And if you don't like the app, all the more support it - the donation will Logs file saved - + 日志文件已保存 @@ -1705,7 +1705,7 @@ It's okay as long as it's from someone you trust. Configure your server - + 配置服务器 @@ -1720,7 +1720,7 @@ It's okay as long as it's from someone you trust. Login to connect via SSH - ssh账号 + 用户 @@ -1736,7 +1736,8 @@ It's okay as long as it's from someone you trust. All data you enter will remain strictly confidential and will not be shared or disclosed to the Amnezia or any third parties - + 您输入的所有数据将严格保密 +不会向 Amnezia 或任何第三方分享或披露 @@ -1803,12 +1804,12 @@ and will not be shared or disclosed to the Amnezia or any third parties Amnezia has detected that your server is currently - + Amnezia 检测到您的服务器当前 busy installing other software. Amnezia installation - + 正安装其他软件。Amnezia安装 Amnesia has detected that your server is currently @@ -2017,7 +2018,7 @@ and will not be shared or disclosed to the Amnezia or any third parties Access to server management. The user with whom you share full access to the connection will be able to add and remove your protocols and services to the server, as well as change settings. - + 除访问VPN外,用户还能添加和删除协议、服务以及更改配置信息 Access to server management. The user with whom you share full access to the connection will be able to add and remove your protocols and services to the servers, as well as change settings. @@ -2578,7 +2579,7 @@ and will not be shared or disclosed to the Amnezia or any third parties AmneziaWG - Special protocol from Amnezia, based on WireGuard. It's fast like WireGuard, but very resistant to blockages. Recommended for regions with high levels of censorship. - + AmneziaWG - Amnezia 的特殊协议,基于 WireGuard。它的速度像 WireGuard 一样快,但非常抗堵塞。推荐用于审查较严的地区。 @@ -2610,7 +2611,14 @@ It employs its unique security protocol, leveraging the strength of SSL/TLS for * Flexible customisation to suit user needs to work with different operating systems and devices * Recognised by DPI analysis systems and therefore susceptible to blocking * Can operate over both TCP and UDP network protocols. - + OpenVPN 是最流行且经过时间考验的 VPN 协议之一。 +它采用其独特的安全协议,利用 SSL/TLS 的优势进行加密和密钥交换。此外,OpenVPN 支持多种身份验证方法,使其具有多功能性和适应性,可适应各种设备和操作系统。由于其开源性质,OpenVPN 受益于全球社区的广泛审查,这不断增强了其安全性。凭借性能、安全性和兼容性的强大平衡,OpenVPN 仍然是注重隐私的个人和企业的首选。 + +* 可在所有平台的 AmneziaVPN 中使用 +* 移动设备的正常功耗 +* 灵活定制,满足用户使用不同操作系统和设备的需求 +* 被DPI分析系统识别,因此容易被阻塞 +* 可以通过 TCP 和 UDP 网络协议运行 @@ -2622,7 +2630,14 @@ It employs its unique security protocol, leveraging the strength of SSL/TLS for * Configurable encryption protocol * Detectable by some DPI systems * Works over TCP network protocol. - + Shadowsocks 受到 SOCKS5 协议的启发,使用 AEAD 密码保护连接。尽管 Shadowsocks 设计得谨慎且难以识别,但它与标准 HTTPS 连接并不相同。但是,某些流量分析系统可能仍会检测到 Shadowsocks 连接。由于Amnezia支持有限,建议使用AmneziaWG协议。 + +* 仅在桌面平台上的 AmneziaVPN 中可用 +* 移动设备的正常功耗 + +* 可配置的加密协议 +* 可以被某些 DPI 系统检测到 +* 通过 TCP 网络协议工作。 @@ -2644,7 +2659,23 @@ If there is a extreme level of Internet censorship in your region, we advise you * Not recognised by DPI analysis systems * Works over TCP network protocol, 443 port. - + 这是 OpenVPN 协议和专门用于阻止保护的 Cloak 插件的组合。 + +OpenVPN 通过加密客户端和服务器之间的所有 Internet 流量来提供安全的 VPN 连接。 + +Cloak 可保护 OpenVPN 免遭检测和阻止。 + +Cloak 可以修改数据包元数据,以便将 VPN 流量完全屏蔽为正常 Web 流量,并且还可以保护 VPN 免受主动探测的检测。这使得它非常难以被发现 + +收到第一个数据包后,Cloak 立即对传入连接进行身份验证。如果身份验证失败,该插件会将服务器伪装成虚假网站,并且您的 VPN 对分析系统来说将变得不可见。 + +如果您所在地区的互联网审查非常严格,我们建议您在第一次连接时仅使用 OpenVPN over Cloak + +* 可在所有平台的 AmneziaVPN 中使用 +* 移动设备功耗高 +* 配置灵活 +* 不被 DPI 分析系统识别 +* 通过 TCP 网络协议、443 端口工作。 @@ -2657,7 +2688,15 @@ WireGuard is very susceptible to blocking due to its distinct packet signatures. * Minimum number of settings * Easily recognised by DPI analysis systems, susceptible to blocking * Works over UDP network protocol. - + 一种相对较新的流行 VPN 协议,具有简化的架构。 +在所有设备上提供稳定的 VPN 连接和高性能。使用硬编码的加密设置。 WireGuard 与 OpenVPN 相比具有更低的延迟和更好的数据传输吞吐量。 +由于其独特的数据包签名,WireGuard 非常容易受到阻塞。与其他一些采用混淆技术的 VPN 协议不同,WireGuard 数据包的一致签名模式可以更容易地被高级深度数据包检测 (DPI) 系统和其他网络监控工具识别并阻止。 + +* 可在所有平台的 AmneziaVPN 中使用 +* 低功耗 +* 配置简单 +* 容易被DPI分析系统识别,容易被阻塞 +* 通过 UDP 网络协议工作。 @@ -2670,7 +2709,15 @@ This means that AmneziaWG keeps the fast performance of the original while addin * Minimum number of settings * Not recognised by DPI analysis systems, resistant to blocking * Works over UDP network protocol. - + AmneziaWG 是流行 VPN 协议的现代迭代,它建立在 WireGuard 的基础上,保留了其简化的架构和跨设备的高性能功能。 +虽然 WireGuard 以其高效而闻名,但由于其独特的数据包签名,它存在容易被检测到的问题。 AmneziaWG 通过使用更好的混淆方法解决了这个问题,使其流量与常规互联网流量融合在一起。 +这意味着 AmneziaWG 保留了原始版本的快速性能,同时添加了额外的隐秘层,使其成为那些想要快速且谨慎的 VPN 连接的人的绝佳选择。 + +* 可在所有平台的 AmneziaVPN 中使用 +* 低功耗 +* 配置简单 +* 不被DPI分析系统识别,抗阻塞 +* 通过 UDP 网络协议工作。 @@ -2683,7 +2730,15 @@ While it offers a blend of security, stability, and speed, it's essential t * Minimal configuration * Recognised by DPI analysis systems * Works over UDP network protocol, ports 500 and 4500. - + IKEv2 与 IPSec 加密层配合使用,是一种现代且稳定的 VPN 协议。 +其显着特征之一是能够在网络和设备之间快速切换,使其特别适应动态网络环境。 +虽然 IKEv2 兼具安全性、稳定性和速度,但必须注意的是,IKEv2 很容易被检测到,并且容易受到阻止。 + +* 仅在 Windows 上的 AmneziaVPN 中可用 +* 低功耗,在移动设备上 +* 最低配置 +* 获得DPI分析系统认可 +* 通过 UDP 网络协议、端口 500 和 4500 工作。 OpenVPN container @@ -3004,27 +3059,27 @@ While it offers a blend of security, stability, and speed, it's essential t Medium or High - + 中或高 Extreme - + 极度 I just want to increase the level of my privacy. - + 只是想提高隐私保护级别。 I want to bypass censorship. This option recommended in most cases. - + 想要绕过审查制度。大多数情况下推荐使用此选项。 Most VPN protocols are blocked. Recommended if other options are not working. - + 大多数 VPN 协议都被阻止。如果其他选项不起作用,推荐此选项。 High From 03171e474331eec48be2717851a77359663c3139 Mon Sep 17 00:00:00 2001 From: ronoaer Date: Tue, 17 Oct 2023 19:34:34 +0800 Subject: [PATCH 076/108] update background color and drag-effect, moved dulicated code --- .../qml/Components/HomeContainersListView.qml | 2 +- client/ui/qml/Controls2/Drawer2Type.qml | 27 ++++++++++--------- client/ui/qml/Controls2/DropDownType.qml | 2 +- 3 files changed, 17 insertions(+), 14 deletions(-) diff --git a/client/ui/qml/Components/HomeContainersListView.qml b/client/ui/qml/Components/HomeContainersListView.qml index 1436c747..c6c4125a 100644 --- a/client/ui/qml/Components/HomeContainersListView.qml +++ b/client/ui/qml/Components/HomeContainersListView.qml @@ -69,7 +69,7 @@ ListView { isDefault = true menuContent.currentIndex = index - containersDropDown.menu.state = "closed" + containersDropDown.menu.close() if (needReconnected && diff --git a/client/ui/qml/Controls2/Drawer2Type.qml b/client/ui/qml/Controls2/Drawer2Type.qml index 3f3cf54b..fcd773a8 100644 --- a/client/ui/qml/Controls2/Drawer2Type.qml +++ b/client/ui/qml/Controls2/Drawer2Type.qml @@ -10,7 +10,7 @@ Item { target: PageController function onForceCloseDrawer() { - root.state = "closed" + close() } } @@ -32,8 +32,6 @@ Item { state: "closed" - Drag.active: dragArea.drag.active - Rectangle { id: draw2Background @@ -41,7 +39,7 @@ Item { height: root.parent.height width: parent.width radius: 16 - color: "transparent" + color: "#90000000" border.color: "transparent" border.width: 1 visible: true @@ -54,6 +52,7 @@ Item { onClicked: { if (root.state === "opened") { + draw2Background.color = "transparent" root.state = "closed" return } @@ -61,14 +60,16 @@ Item { Rectangle { id: placeAreaHolder - anchors.top: parent.top height: parent.height - contentHeight anchors.right: parent.right anchors.left: parent.left visible: true color: "transparent" + + Drag.active: dragArea.drag.active } + Rectangle { id: contentArea @@ -98,27 +99,27 @@ Item { cursorShape: (root.state === "opened") ? Qt.PointingHandCursor : Qt.ArrowCursor hoverEnabled: true - drag.target: root + drag.target: placeAreaHolder drag.axis: Drag.YAxis drag.maximumY: root.height drag.minimumY: root.height - root.height /** If drag area is released at any point other than min or max y, transition to the other state */ onReleased: { - if (root.state === "closed" && root.y < dragArea.drag.maximumY) { + if (root.state === "closed" && placeAreaHolder.y < dragArea.drag.maximumY) { root.state = "opened" return } - if (root.state === "opened" && root.y > dragArea.drag.minimumY) { - root.state = "closed" + if (root.state === "opened" && placeAreaHolder.y > dragArea.drag.minimumY) { + close() return } } onClicked: { if (root.state === "opened") { - root.state = "closed" + close() return } } @@ -209,22 +210,24 @@ Item { if (root.visible && root.state !== "closed") { return } + draw2Background.color = "#90000000" root.y = 0 root.state = "opened" root.visible = true root.height = parent.height contentArea.height = contentHeight + placeAreaHolder.height = parent.height - contentHeight + placeAreaHolder.y = parent.height - root.height dragArea.drag.maximumY = parent.height dragArea.drag.minimumY = parent.height - root.height - animationVisible.running = true } function close() { - root.visible = false + draw2Background.color = "transparent" root.state = "closed" } diff --git a/client/ui/qml/Controls2/DropDownType.qml b/client/ui/qml/Controls2/DropDownType.qml index 0506bdc7..c666408a 100644 --- a/client/ui/qml/Controls2/DropDownType.qml +++ b/client/ui/qml/Controls2/DropDownType.qml @@ -187,7 +187,7 @@ Item { BackButtonType { backButtonImage: root.headerBackButtonImage backButtonFunction: function() { - menu.state = "closed" + menu.close() } } } From 61ddfe01a10f3149711e8405a2218264ea8ee534 Mon Sep 17 00:00:00 2001 From: pokamest Date: Tue, 17 Oct 2023 06:39:49 -0700 Subject: [PATCH 077/108] macos build script updated [no ci] --- deploy/build_macos.sh | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/deploy/build_macos.sh b/deploy/build_macos.sh index 700198e7..13214d6d 100755 --- a/deploy/build_macos.sh +++ b/deploy/build_macos.sh @@ -96,16 +96,16 @@ if [ "${MAC_CERT_PW+x}" ]; then security find-identity -p codesigning echo "Signing App bundle..." - /usr/bin/codesign --deep --force --verbose --timestamp -o runtime --sign "Developer ID Application: Privacy Technologies OU (X7UJ388FXK)" $BUNDLE_DIR + /usr/bin/codesign --deep --force --verbose --timestamp -o runtime --sign "$MAC_SIGNER_ID" $BUNDLE_DIR /usr/bin/codesign --verify -vvvv $BUNDLE_DIR || true spctl -a -vvvv $BUNDLE_DIR || true if [ "${NOTARIZE_APP+x}" ]; then echo "Notarizing App bundle..." /usr/bin/ditto -c -k --keepParent $BUNDLE_DIR $PROJECT_DIR/Bundle_to_notarize.zip - xcrun altool --notarize-app -f $PROJECT_DIR/Bundle_to_notarize.zip -t osx --primary-bundle-id "$APP_DOMAIN" -u "$APPLE_DEV_EMAIL" -p $APPLE_DEV_PASSWORD + xcrun notarytool submit $PROJECT_DIR/Bundle_to_notarize.zip --apple-id $APPLE_DEV_EMAIL --team-id $MAC_TEAM_ID --password $APPLE_DEV_PASSWORD rm $PROJECT_DIR/Bundle_to_notarize.zip - sleep 600 + sleep 300 xcrun stapler staple $BUNDLE_DIR xcrun stapler validate $BUNDLE_DIR spctl -a -vvvv $BUNDLE_DIR || true @@ -130,15 +130,15 @@ $QIF_BIN_DIR/binarycreator --offline-only -v -c $BUILD_DIR/installer/config/maco if [ "${MAC_CERT_PW+x}" ]; then echo "Signing installer bundle..." security unlock-keychain -p $TEMP_PASS $KEYCHAIN - /usr/bin/codesign --deep --force --verbose --timestamp -o runtime --sign "Developer ID Application: Privacy Technologies OU (X7UJ388FXK)" $INSTALLER_BUNDLE_DIR + /usr/bin/codesign --deep --force --verbose --timestamp -o runtime --sign "$MAC_SIGNER_ID" $INSTALLER_BUNDLE_DIR /usr/bin/codesign --verify -vvvv $INSTALLER_BUNDLE_DIR || true if [ "${NOTARIZE_APP+x}" ]; then echo "Notarizing installer bundle..." /usr/bin/ditto -c -k --keepParent $INSTALLER_BUNDLE_DIR $PROJECT_DIR/Installer_bundle_to_notarize.zip - xcrun altool --notarize-app -f $PROJECT_DIR/Installer_bundle_to_notarize.zip -t osx --primary-bundle-id "$APP_DOMAIN" -u "$APPLE_DEV_EMAIL" -p $APPLE_DEV_PASSWORD + xcrun notarytool submit $PROJECT_DIR/Installer_bundle_to_notarize.zip --apple-id $APPLE_DEV_EMAIL --team-id $MAC_TEAM_ID --password $APPLE_DEV_PASSWORD rm $PROJECT_DIR/Installer_bundle_to_notarize.zip - sleep 600 + sleep 300 xcrun stapler staple $INSTALLER_BUNDLE_DIR xcrun stapler validate $INSTALLER_BUNDLE_DIR spctl -a -vvvv $INSTALLER_BUNDLE_DIR || true @@ -151,13 +151,13 @@ hdiutil create -volname AmneziaVPN -srcfolder $BUILD_DIR/installer/$APP_NAME.app if [ "${MAC_CERT_PW+x}" ]; then echo "Signing DMG installer..." security unlock-keychain -p $TEMP_PASS $KEYCHAIN - /usr/bin/codesign --deep --force --verbose --timestamp -o runtime --sign "Developer ID Application: Privacy Technologies OU (X7UJ388FXK)" $DMG_FILENAME + /usr/bin/codesign --deep --force --verbose --timestamp -o runtime --sign "$MAC_SIGNER_ID" $DMG_FILENAME /usr/bin/codesign --verify -vvvv $DMG_FILENAME || true if [ "${NOTARIZE_APP+x}" ]; then echo "Notarizing DMG installer..." - xcrun altool --notarize-app -f $DMG_FILENAME -t osx --primary-bundle-id $APP_DOMAIN -u $APPLE_DEV_EMAIL -p $APPLE_DEV_PASSWORD - sleep 600 + xcrun notarytool submit $DMG_FILENAME --apple-id $APPLE_DEV_EMAIL --team-id $MAC_TEAM_ID --password $APPLE_DEV_PASSWORD + sleep 300 xcrun stapler staple $DMG_FILENAME xcrun stapler validate $DMG_FILENAME fi From 94304b5777a6e74546f6aaa3f1d61126a019f940 Mon Sep 17 00:00:00 2001 From: pokamest Date: Tue, 17 Oct 2023 14:47:31 +0100 Subject: [PATCH 078/108] Version bump --- CMakeLists.txt | 2 +- client/ui/qml/Pages2/PageSettingsConnection.qml | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 85d7d0ce..028aacd3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -2,7 +2,7 @@ cmake_minimum_required(VERSION 3.25.0 FATAL_ERROR) set(PROJECT AmneziaVPN) -project(${PROJECT} VERSION 4.0.8.2 +project(${PROJECT} VERSION 4.0.8.3 DESCRIPTION "AmneziaVPN" HOMEPAGE_URL "https://amnezia.org/" ) diff --git a/client/ui/qml/Pages2/PageSettingsConnection.qml b/client/ui/qml/Pages2/PageSettingsConnection.qml index 7f0262f9..565ae7db 100644 --- a/client/ui/qml/Pages2/PageSettingsConnection.qml +++ b/client/ui/qml/Pages2/PageSettingsConnection.qml @@ -94,7 +94,7 @@ PageType { DividerType {} LabelWithButtonType { - visible: !GC.isMobile() + visible: GC.isDesktop() Layout.fillWidth: true @@ -108,11 +108,11 @@ PageType { } DividerType { - visible: !GC.isMobile() + visible: GC.isDesktop() } LabelWithButtonType { - visible: !GC.isMobile() + visible: false Layout.fillWidth: true @@ -125,7 +125,7 @@ PageType { } DividerType { - visible: !GC.isMobile() + visible: false } } } From a83cd29f725136094bfb5d8855b9167b761bb125 Mon Sep 17 00:00:00 2001 From: ronoaer Date: Tue, 17 Oct 2023 22:00:19 +0800 Subject: [PATCH 079/108] fixed the cursorShape, and some minor issues --- client/ui/qml/Controls2/Drawer2Type.qml | 47 ++++++++++++++----------- 1 file changed, 27 insertions(+), 20 deletions(-) diff --git a/client/ui/qml/Controls2/Drawer2Type.qml b/client/ui/qml/Controls2/Drawer2Type.qml index fcd773a8..988b4172 100644 --- a/client/ui/qml/Controls2/Drawer2Type.qml +++ b/client/ui/qml/Controls2/Drawer2Type.qml @@ -28,15 +28,13 @@ Item { property int contentHeight: 0 property Item contentParent: contentArea - y: parent.height - root.height - state: "closed" Rectangle { id: draw2Background - anchors { left: root.left; right: root.right; top: root.top } - height: root.parent.height + anchors.fill: parent + height: parent.height width: parent.width radius: 16 color: "#90000000" @@ -45,15 +43,14 @@ Item { visible: true MouseArea { - id: fullArea + id: fullMouseArea anchors.fill: parent enabled: (root.state === "opened") hoverEnabled: true onClicked: { if (root.state === "opened") { - draw2Background.color = "transparent" - root.state = "closed" + close() return } } @@ -106,15 +103,17 @@ Item { /** If drag area is released at any point other than min or max y, transition to the other state */ onReleased: { - if (root.state === "closed" && placeAreaHolder.y < dragArea.drag.maximumY) { + if (root.state === "closed" && placeAreaHolder.y < root.height * 0.9) { root.state = "opened" return } - if (root.state === "opened" && placeAreaHolder.y > dragArea.drag.minimumY) { + if (root.state === "opened" && placeAreaHolder.y > (root.height - root.height * 0.9)) { close() return } + + placeAreaHolder.y = 0 } onClicked: { @@ -161,15 +160,15 @@ Item { State { name: "closed" PropertyChanges { - target: root + target: placeAreaHolder y: parent.height } }, State { - name: "opend" + name: "opened" PropertyChanges { - target: root + target: placeAreaHolder y: dragArea.drag.minimumY } } @@ -180,7 +179,7 @@ Item { from: "opened" to: "closed" PropertyAnimation { - target: root + target: placeAreaHolder properties: "y" duration: 200 } @@ -190,7 +189,7 @@ Item { from: "closed" to: "opened" PropertyAnimation { - target: root + target: placeAreaHolder properties: "y" duration: 200 } @@ -199,7 +198,7 @@ Item { NumberAnimation { id: animationVisible - target: root + target: placeAreaHolder property: "y" from: parent.height to: 0 @@ -212,21 +211,29 @@ Item { } draw2Background.color = "#90000000" + fullMouseArea.visible = true + dragArea.visible = true + root.y = 0 root.state = "opened" root.visible = true root.height = parent.height - contentArea.height = contentHeight - placeAreaHolder.height = parent.height - contentHeight - placeAreaHolder.y = parent.height - root.height - dragArea.drag.maximumY = parent.height - dragArea.drag.minimumY = parent.height - root.height + contentArea.height = contentHeight + + placeAreaHolder.height = root.height - contentHeight + placeAreaHolder.y = root.height - root.height + + dragArea.drag.maximumY = root.height + dragArea.drag.minimumY = 0 animationVisible.running = true } function close() { + fullMouseArea.visible = false + dragArea.visible = false + draw2Background.color = "transparent" root.state = "closed" } From 160d88f002ee612ec93e15d09e0b963ef5bcf646 Mon Sep 17 00:00:00 2001 From: lunardunno <126363523+lunardunno@users.noreply.github.com> Date: Tue, 17 Oct 2023 21:26:50 +0400 Subject: [PATCH 080/108] Restoring autostart and enable docker for CentOS 7 --- client/server_scripts/install_docker.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/server_scripts/install_docker.sh b/client/server_scripts/install_docker.sh index e780dac5..58f92540 100644 --- a/client/server_scripts/install_docker.sh +++ b/client/server_scripts/install_docker.sh @@ -8,7 +8,7 @@ if ! command -v sudo > /dev/null 2>&1; then $pm update -yq; $pm install -yq sudo if ! command -v fuser > /dev/null 2>&1; then sudo $pm install -yq psmisc; fi;\ if ! command -v lsof > /dev/null 2>&1; then sudo $pm install -yq lsof; fi;\ if ! command -v docker > /dev/null 2>&1; then sudo $pm update -yq; sudo $pm install -yq $docker_pkg;\ - if [ "$dist" = "fedora" ] || [ "$dist" = "debian" ]; then sudo systemctl enable docker && sudo systemctl start docker; fi;\ + if [ "$dist" = "fedora" ] || [ "$dist" = "centos" ] || [ "$dist" = "debian" ]; then sudo systemctl enable docker && sudo systemctl start docker; fi;\ fi;\ if [ "$dist" = "debian" ]; then \ docker_service=$(systemctl list-units --full --all | grep docker.service | grep -v inactive | grep -v dead | grep -v failed);\ From 2f0c1eeecc11165c1928a6b07e75859e6ec4e629 Mon Sep 17 00:00:00 2001 From: "vladimir.kuznetsov" Date: Wed, 18 Oct 2023 00:36:40 +0500 Subject: [PATCH 081/108] fixed selection of default container after installing a new server --- client/amnezia_application.cpp | 2 ++ client/ui/controllers/installController.cpp | 2 ++ client/ui/models/servers_model.cpp | 2 +- client/ui/models/servers_model.h | 2 +- client/ui/qml/Components/ConnectButton.qml | 1 + 5 files changed, 7 insertions(+), 2 deletions(-) diff --git a/client/amnezia_application.cpp b/client/amnezia_application.cpp index 4e6bce2b..bbd48c96 100644 --- a/client/amnezia_application.cpp +++ b/client/amnezia_application.cpp @@ -286,6 +286,8 @@ void AmneziaApplication::initModels() m_engine->rootContext()->setContextProperty("ServersModel", m_serversModel.get()); connect(m_serversModel.get(), &ServersModel::currentlyProcessedServerIndexChanged, m_containersModel.get(), &ContainersModel::setCurrentlyProcessedServerIndex); + connect(m_serversModel.get(), &ServersModel::defaultServerIndexChanged, m_containersModel.get(), + &ContainersModel::setCurrentlyProcessedServerIndex); m_languageModel.reset(new LanguageModel(m_settings, this)); m_engine->rootContext()->setContextProperty("LanguageModel", m_languageModel.get()); diff --git a/client/ui/controllers/installController.cpp b/client/ui/controllers/installController.cpp index bb10d39c..db2f9409 100644 --- a/client/ui/controllers/installController.cpp +++ b/client/ui/controllers/installController.cpp @@ -475,6 +475,8 @@ void InstallController::addEmptyServer() server.insert(config_key::port, m_currentlyInstalledServerCredentials.port); server.insert(config_key::description, m_settings->nextAvailableServerName()); + server.insert(config_key::defaultContainer, ContainerProps::containerToString(DockerContainer::None)); + m_serversModel->addServer(server); m_serversModel->setDefaultServerIndex(m_serversModel->getServersCount() - 1); diff --git a/client/ui/models/servers_model.cpp b/client/ui/models/servers_model.cpp index 7eea94e5..a2a28630 100644 --- a/client/ui/models/servers_model.cpp +++ b/client/ui/models/servers_model.cpp @@ -96,7 +96,7 @@ void ServersModel::setDefaultServerIndex(const int index) { m_settings->setDefaultServer(index); m_defaultServerIndex = m_settings->defaultServerIndex(); - emit defaultServerIndexChanged(); + emit defaultServerIndexChanged(m_defaultServerIndex); } const int ServersModel::getDefaultServerIndex() diff --git a/client/ui/models/servers_model.h b/client/ui/models/servers_model.h index d7b15844..ad1d5a83 100644 --- a/client/ui/models/servers_model.h +++ b/client/ui/models/servers_model.h @@ -64,7 +64,7 @@ protected: signals: void currentlyProcessedServerIndexChanged(const int index); - void defaultServerIndexChanged(); + void defaultServerIndexChanged(const int index); void defaultServerNameChanged(); private: diff --git a/client/ui/qml/Components/ConnectButton.qml b/client/ui/qml/Components/ConnectButton.qml index 76e83da5..c2ec186d 100644 --- a/client/ui/qml/Components/ConnectButton.qml +++ b/client/ui/qml/Components/ConnectButton.qml @@ -142,6 +142,7 @@ Button { PageController.setTriggeredBtConnectButton(true) ServersModel.currentlyProcessedIndex = ServersModel.getDefaultServerIndex() + InstallController.setShouldCreateServer(false) PageController.goToPage(PageEnum.PageSetupWizardEasy) return From 4b64bfaec029aca8355ed627aeaa8356ba243706 Mon Sep 17 00:00:00 2001 From: "vladimir.kuznetsov" Date: Wed, 18 Oct 2023 00:37:15 +0500 Subject: [PATCH 082/108] fixed questionDrawer height --- client/translations/amneziavpn_ru.ts | 14 ++++++++++++-- client/translations/amneziavpn_zh_CN.ts | 14 ++++++++++++-- client/ui/qml/Components/QuestionDrawer.qml | 4 +++- 3 files changed, 27 insertions(+), 5 deletions(-) diff --git a/client/translations/amneziavpn_ru.ts b/client/translations/amneziavpn_ru.ts index 1617413a..4d3ae6c9 100644 --- a/client/translations/amneziavpn_ru.ts +++ b/client/translations/amneziavpn_ru.ts @@ -4,7 +4,7 @@ AmneziaApplication - + Split tunneling for WireGuard is not implemented, the option was disabled Раздельное туннелирование для "Wireguard" не реализовано,опция отключена @@ -194,7 +194,7 @@ Already installed containers were found on the server. All installed containers Пожалуйста, войдите в систему от имени пользователя - + Server added successfully Сервер успешно добавлен @@ -2700,6 +2700,16 @@ This means that AmneziaWG keeps the fast performance of the original while addin error 0x%1: %2 error 0x%1: %2 + + + WireGuard Configuration Highlighter + + + + + &Randomize colors + + SelectLanguageDrawer diff --git a/client/translations/amneziavpn_zh_CN.ts b/client/translations/amneziavpn_zh_CN.ts index 09198c9c..ae25e41c 100644 --- a/client/translations/amneziavpn_zh_CN.ts +++ b/client/translations/amneziavpn_zh_CN.ts @@ -4,7 +4,7 @@ AmneziaApplication - + Split tunneling for WireGuard is not implemented, the option was disabled 未启用选项,还未实现基于WireGuard协议的VPN分离 @@ -228,7 +228,7 @@ Already installed containers were found on the server. All installed containers 请以用户身份登录 - + Server added successfully 增加服务器成功 @@ -2839,6 +2839,16 @@ While it offers a blend of security, stability, and speed, it's essential t error 0x%1: %2 错误 0x%1: %2 + + + WireGuard Configuration Highlighter + + + + + &Randomize colors + + SelectLanguageDrawer diff --git a/client/ui/qml/Components/QuestionDrawer.qml b/client/ui/qml/Components/QuestionDrawer.qml index a79f9140..16cdcb39 100644 --- a/client/ui/qml/Components/QuestionDrawer.qml +++ b/client/ui/qml/Components/QuestionDrawer.qml @@ -17,9 +17,11 @@ DrawerType { property var noButtonFunction width: parent.width - height: parent.height * 0.5 + height: content.implicitHeight + 32 ColumnLayout { + id: content + anchors.top: parent.top anchors.left: parent.left anchors.right: parent.right From a46e55d5c2b938f06ddd03e510e6f9470a538504 Mon Sep 17 00:00:00 2001 From: "vladimir.kuznetsov" Date: Wed, 18 Oct 2023 01:11:41 +0500 Subject: [PATCH 083/108] added a dash for drawerType --- client/translations/amneziavpn_ru.ts | 6 +++--- client/translations/amneziavpn_zh_CN.ts | 6 +++--- client/ui/qml/Controls2/DrawerType.qml | 14 ++++++++++++++ client/ui/qml/Pages2/PageHome.qml | 14 ++++++++++++-- 4 files changed, 32 insertions(+), 8 deletions(-) diff --git a/client/translations/amneziavpn_ru.ts b/client/translations/amneziavpn_ru.ts index 4d3ae6c9..db27afbc 100644 --- a/client/translations/amneziavpn_ru.ts +++ b/client/translations/amneziavpn_ru.ts @@ -262,17 +262,17 @@ Already installed containers were found on the server. All installed containers PageHome - + VPN protocol VPN протокол - + Servers Серверы - + Unable change server while there is an active connection diff --git a/client/translations/amneziavpn_zh_CN.ts b/client/translations/amneziavpn_zh_CN.ts index ae25e41c..59bef770 100644 --- a/client/translations/amneziavpn_zh_CN.ts +++ b/client/translations/amneziavpn_zh_CN.ts @@ -296,17 +296,17 @@ Already installed containers were found on the server. All installed containers PageHome - + VPN protocol VPN协议 - + Servers 服务器 - + Unable change server while there is an active connection Невозможно изменить сервер при наличии активного соединения diff --git a/client/ui/qml/Controls2/DrawerType.qml b/client/ui/qml/Controls2/DrawerType.qml index 72765d78..830f59f9 100644 --- a/client/ui/qml/Controls2/DrawerType.qml +++ b/client/ui/qml/Controls2/DrawerType.qml @@ -1,6 +1,8 @@ import QtQuick import QtQuick.Controls +import "../Config" + Drawer { id: drawer property bool needCloseButton: true @@ -39,6 +41,18 @@ Drawer { border.color: "#2C2D30" border.width: 1 + + Rectangle { + visible: GC.isMobile() + + anchors.top: parent.top + anchors.horizontalCenter: parent.horizontalCenter + anchors.topMargin: 10 + + width: 20 + height: 2 + color: "#2C2D30" + } } Overlay.modal: Rectangle { diff --git a/client/ui/qml/Pages2/PageHome.qml b/client/ui/qml/Pages2/PageHome.qml index d89d6be1..3a71adac 100644 --- a/client/ui/qml/Pages2/PageHome.qml +++ b/client/ui/qml/Pages2/PageHome.qml @@ -241,8 +241,18 @@ PageType { } ] + DividerType { + Layout.topMargin: 10 + Layout.fillWidth: false + Layout.preferredWidth: 20 + Layout.preferredHeight: 2 + Layout.alignment: Qt.AlignHCenter | Qt.AlignVCenter + + visible: GC.isMobile() && (buttonContent.collapsedVisibility || buttonContent.expandedVisibility) + } + RowLayout { - Layout.topMargin: 24 + Layout.topMargin: 14 Layout.leftMargin: 24 Layout.rightMargin: 24 Layout.alignment: Qt.AlignHCenter | Qt.AlignVCenter @@ -305,7 +315,7 @@ PageType { Header1TextType { Layout.fillWidth: true - Layout.topMargin: 24 + Layout.topMargin: 14 Layout.leftMargin: 16 Layout.rightMargin: 16 From f5f72f87a6246ee320aa027348e18edfae97cacc Mon Sep 17 00:00:00 2001 From: "vladimir.kuznetsov" Date: Wed, 18 Oct 2023 12:17:24 +0500 Subject: [PATCH 084/108] fixed switcher status display for page split site tunneling --- client/ui/models/sites_model.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/client/ui/models/sites_model.cpp b/client/ui/models/sites_model.cpp index 1e0f1692..5f4afe1a 100644 --- a/client/ui/models/sites_model.cpp +++ b/client/ui/models/sites_model.cpp @@ -8,6 +8,7 @@ SitesModel::SitesModel(std::shared_ptr settings, QObject *parent) m_isSplitTunnelingEnabled = false; m_currentRouteMode = Settings::RouteMode::VpnOnlyForwardSites; } else { + m_isSplitTunnelingEnabled = true; m_currentRouteMode = routeMode; } fillSites(); From c461e00c5c378e5ed6ade5291b2233947a94fe60 Mon Sep 17 00:00:00 2001 From: ronoaer Date: Wed, 18 Oct 2023 16:17:57 +0800 Subject: [PATCH 085/108] keeping parent's cusorshape and Drawer2Type's close-animation --- client/ui/qml/Controls2/Drawer2Type.qml | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/client/ui/qml/Controls2/Drawer2Type.qml b/client/ui/qml/Controls2/Drawer2Type.qml index 988b4172..b34390ac 100644 --- a/client/ui/qml/Controls2/Drawer2Type.qml +++ b/client/ui/qml/Controls2/Drawer2Type.qml @@ -183,6 +183,12 @@ Item { properties: "y" duration: 200 } + + onRunningChanged: { + if (!running) { + visibledMouseArea(false) + } + } }, Transition { @@ -211,8 +217,7 @@ Item { } draw2Background.color = "#90000000" - fullMouseArea.visible = true - dragArea.visible = true + visibledMouseArea(true) root.y = 0 root.state = "opened" @@ -231,9 +236,6 @@ Item { } function close() { - fullMouseArea.visible = false - dragArea.visible = false - draw2Background.color = "transparent" root.state = "closed" } @@ -250,4 +252,9 @@ Item { close() } } + + function visibledMouseArea(visbile) { + fullMouseArea.visible = visbile + dragArea.visible = visbile + } } From e16c425f875d209f4f35fe7f94714b46593352e0 Mon Sep 17 00:00:00 2001 From: pokamest Date: Wed, 18 Oct 2023 12:04:39 +0100 Subject: [PATCH 086/108] PageHome.qml fix --- CMakeLists.txt | 2 +- client/translations/amneziavpn_ru.ts | 10 ---------- client/translations/amneziavpn_zh_CN.ts | 10 ---------- client/ui/qml/Pages2/PageHome.qml | 2 +- 4 files changed, 2 insertions(+), 22 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 028aacd3..68de51fb 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -2,7 +2,7 @@ cmake_minimum_required(VERSION 3.25.0 FATAL_ERROR) set(PROJECT AmneziaVPN) -project(${PROJECT} VERSION 4.0.8.3 +project(${PROJECT} VERSION 4.0.8.4 DESCRIPTION "AmneziaVPN" HOMEPAGE_URL "https://amnezia.org/" ) diff --git a/client/translations/amneziavpn_ru.ts b/client/translations/amneziavpn_ru.ts index db27afbc..a26758b7 100644 --- a/client/translations/amneziavpn_ru.ts +++ b/client/translations/amneziavpn_ru.ts @@ -2700,16 +2700,6 @@ This means that AmneziaWG keeps the fast performance of the original while addin error 0x%1: %2 error 0x%1: %2 - - - WireGuard Configuration Highlighter - - - - - &Randomize colors - - SelectLanguageDrawer diff --git a/client/translations/amneziavpn_zh_CN.ts b/client/translations/amneziavpn_zh_CN.ts index 59bef770..a10fb449 100644 --- a/client/translations/amneziavpn_zh_CN.ts +++ b/client/translations/amneziavpn_zh_CN.ts @@ -2839,16 +2839,6 @@ While it offers a blend of security, stability, and speed, it's essential t error 0x%1: %2 错误 0x%1: %2 - - - WireGuard Configuration Highlighter - - - - - &Randomize colors - - SelectLanguageDrawer diff --git a/client/ui/qml/Pages2/PageHome.qml b/client/ui/qml/Pages2/PageHome.qml index 3a71adac..cc49e4f0 100644 --- a/client/ui/qml/Pages2/PageHome.qml +++ b/client/ui/qml/Pages2/PageHome.qml @@ -248,7 +248,7 @@ PageType { Layout.preferredHeight: 2 Layout.alignment: Qt.AlignHCenter | Qt.AlignVCenter - visible: GC.isMobile() && (buttonContent.collapsedVisibility || buttonContent.expandedVisibility) + visible: (buttonContent.collapsedVisibility || buttonContent.expandedVisibility) } RowLayout { From e2ae341ba96b375e381b2a6346563e5a1dddd0a2 Mon Sep 17 00:00:00 2001 From: pokamest Date: Wed, 18 Oct 2023 14:01:06 +0100 Subject: [PATCH 087/108] AndroidManifest fix --- client/android/AndroidManifest.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/client/android/AndroidManifest.xml b/client/android/AndroidManifest.xml index 4ec807e9..1115b74d 100644 --- a/client/android/AndroidManifest.xml +++ b/client/android/AndroidManifest.xml @@ -45,6 +45,7 @@ android:label="-- %%INSERT_APP_NAME%% --" android:screenOrientation="unspecified" android:launchMode="singleInstance" + android:windowSoftInputMode="adjustResize" android:exported="true"> From 79e1761c1f476e2608ad2c93ff024f829509dce5 Mon Sep 17 00:00:00 2001 From: "vladimir.kuznetsov" Date: Thu, 19 Oct 2023 01:14:09 +0500 Subject: [PATCH 088/108] added generation of random values for awg parameters --- client/core/servercontroller.cpp | 37 +++++++-------------- client/translations/amneziavpn_ru.ts | 34 ++++++++++++------- client/translations/amneziavpn_zh_CN.ts | 34 ++++++++++++------- client/ui/controllers/installController.cpp | 31 +++++++++++++++++ 4 files changed, 87 insertions(+), 49 deletions(-) diff --git a/client/core/servercontroller.cpp b/client/core/servercontroller.cpp index 60691759..443cd5a3 100644 --- a/client/core/servercontroller.cpp +++ b/client/core/servercontroller.cpp @@ -337,7 +337,7 @@ bool ServerController::isReinstallContainerRequired(DockerContainer container, c != newProtoConfig.value(config_key::port).toString(protocols::shadowsocks::defaultPort)) return true; } - + if (container == DockerContainer::Awg) { return true; } @@ -490,8 +490,7 @@ ServerController::Vars ServerController::genVarsForScript(const ServerCredential const QJsonObject &cloakConfig = config.value(ProtocolProps::protoToString(Proto::Cloak)).toObject(); const QJsonObject &ssConfig = config.value(ProtocolProps::protoToString(Proto::ShadowSocks)).toObject(); const QJsonObject &wireguarConfig = config.value(ProtocolProps::protoToString(Proto::WireGuard)).toObject(); - const QJsonObject &amneziaWireguarConfig = - config.value(ProtocolProps::protoToString(Proto::Awg)).toObject(); + const QJsonObject &amneziaWireguarConfig = config.value(ProtocolProps::protoToString(Proto::Awg)).toObject(); const QJsonObject &sftpConfig = config.value(ProtocolProps::protoToString(Proto::Sftp)).toObject(); Vars vars; @@ -591,33 +590,21 @@ ServerController::Vars ServerController::genVarsForScript(const ServerCredential // Amnezia wireguard vars vars.append({ { "$AWG_SERVER_PORT", amneziaWireguarConfig.value(config_key::port).toString(protocols::awg::defaultPort) } }); - vars.append({ { "$JUNK_PACKET_COUNT", - amneziaWireguarConfig.value(config_key::junkPacketCount) - .toString(protocols::awg::defaultJunkPacketCount) } }); - vars.append({ { "$JUNK_PACKET_MIN_SIZE", - amneziaWireguarConfig.value(config_key::junkPacketMinSize) - .toString(protocols::awg::defaultJunkPacketMinSize) } }); - vars.append({ { "$JUNK_PACKET_MAX_SIZE", - amneziaWireguarConfig.value(config_key::junkPacketMaxSize) - .toString(protocols::awg::defaultJunkPacketMaxSize) } }); - vars.append({ { "$INIT_PACKET_JUNK_SIZE", - amneziaWireguarConfig.value(config_key::initPacketJunkSize) - .toString(protocols::awg::defaultInitPacketJunkSize) } }); + + vars.append({ { "$JUNK_PACKET_COUNT", amneziaWireguarConfig.value(config_key::junkPacketCount).toString() } }); + vars.append({ { "$JUNK_PACKET_MIN_SIZE", amneziaWireguarConfig.value(config_key::junkPacketMinSize).toString() } }); + vars.append({ { "$JUNK_PACKET_MAX_SIZE", amneziaWireguarConfig.value(config_key::junkPacketMaxSize).toString() } }); + vars.append({ { "$INIT_PACKET_JUNK_SIZE", amneziaWireguarConfig.value(config_key::initPacketJunkSize).toString() } }); vars.append({ { "$RESPONSE_PACKET_JUNK_SIZE", - amneziaWireguarConfig.value(config_key::responsePacketJunkSize) - .toString(protocols::awg::defaultResponsePacketJunkSize) } }); + amneziaWireguarConfig.value(config_key::responsePacketJunkSize).toString() } }); vars.append({ { "$INIT_PACKET_MAGIC_HEADER", - amneziaWireguarConfig.value(config_key::initPacketMagicHeader) - .toString(protocols::awg::defaultInitPacketMagicHeader) } }); + amneziaWireguarConfig.value(config_key::initPacketMagicHeader).toString() } }); vars.append({ { "$RESPONSE_PACKET_MAGIC_HEADER", - amneziaWireguarConfig.value(config_key::responsePacketMagicHeader) - .toString(protocols::awg::defaultResponsePacketMagicHeader) } }); + amneziaWireguarConfig.value(config_key::responsePacketMagicHeader).toString() } }); vars.append({ { "$UNDERLOAD_PACKET_MAGIC_HEADER", - amneziaWireguarConfig.value(config_key::underloadPacketMagicHeader) - .toString(protocols::awg::defaultUnderloadPacketMagicHeader) } }); + amneziaWireguarConfig.value(config_key::underloadPacketMagicHeader).toString() } }); vars.append({ { "$TRANSPORT_PACKET_MAGIC_HEADER", - amneziaWireguarConfig.value(config_key::transportPacketMagicHeader) - .toString(protocols::awg::defaultTransportPacketMagicHeader) } }); + amneziaWireguarConfig.value(config_key::transportPacketMagicHeader).toString() } }); QString serverIp = Utils::getIPAddress(credentials.hostName); if (!serverIp.isEmpty()) { diff --git a/client/translations/amneziavpn_ru.ts b/client/translations/amneziavpn_ru.ts index a26758b7..733c374d 100644 --- a/client/translations/amneziavpn_ru.ts +++ b/client/translations/amneziavpn_ru.ts @@ -143,58 +143,58 @@ InstallController - - + + %1 installed successfully. %1 успешно установлен. - - + + %1 is already installed on the server. %1 уже установлен на сервер. - + Added containers that were already installed on the server В приложение добавлены обнаруженные на сервере протоклы и сервисы - + Already installed containers were found on the server. All installed containers have been added to the application На сервере обнаружены установленные протоколы и сервисы, все они добавлены в приложение - + Settings updated successfully Настройки успешно обновлены - + Server '%1' was removed Сервер '%1' был удален - + All containers from server '%1' have been removed Все протоклы и сервисы были удалены с сервера '%1' - + %1 has been removed from the server '%2' %1 был удален с сервера '%2' - + Please login as the user Пожалуйста, войдите в систему от имени пользователя - + Server added successfully Сервер успешно добавлен @@ -2700,6 +2700,16 @@ This means that AmneziaWG keeps the fast performance of the original while addin error 0x%1: %2 error 0x%1: %2 + + + WireGuard Configuration Highlighter + + + + + &Randomize colors + + SelectLanguageDrawer diff --git a/client/translations/amneziavpn_zh_CN.ts b/client/translations/amneziavpn_zh_CN.ts index a10fb449..64faa6f4 100644 --- a/client/translations/amneziavpn_zh_CN.ts +++ b/client/translations/amneziavpn_zh_CN.ts @@ -162,47 +162,47 @@ 已安装在服务器上 - - + + %1 installed successfully. %1 安装成功。 - - + + %1 is already installed on the server. 服务器上已经安装 %1。 - + Added containers that were already installed on the server 添加已安装在服务器上的容器 - + Already installed containers were found on the server. All installed containers have been added to the application 在服务上发现已经安装协议并添加至应用 - + Settings updated successfully 配置更新成功 - + Server '%1' was removed 已移除服务器 '%1' - + All containers from server '%1' have been removed 服务器 '%1' 的所有容器已移除 - + %1 has been removed from the server '%2' %1 已从服务器 '%2' 上移除 @@ -223,12 +223,12 @@ Already installed containers were found on the server. All installed containers 协议已从 - + Please login as the user 请以用户身份登录 - + Server added successfully 增加服务器成功 @@ -2839,6 +2839,16 @@ While it offers a blend of security, stability, and speed, it's essential t error 0x%1: %2 错误 0x%1: %2 + + + WireGuard Configuration Highlighter + + + + + &Randomize colors + + SelectLanguageDrawer diff --git a/client/ui/controllers/installController.cpp b/client/ui/controllers/installController.cpp index db2f9409..8efe368b 100644 --- a/client/ui/controllers/installController.cpp +++ b/client/ui/controllers/installController.cpp @@ -5,6 +5,7 @@ #include #include #include +#include #include "core/errorstrings.h" #include "core/servercontroller.h" @@ -73,6 +74,36 @@ void InstallController::install(DockerContainer container, int port, TransportPr containerConfig.insert(config_key::transport_proto, ProtocolProps::transportProtoToString(transportProto, protocol)); + if (container == DockerContainer::Awg) { + QString defaultJunkPacketCount = QString::number(QRandomGenerator::global()->bounded(3, 10)); + QString defaultJunkPacketMinSize = QString::number(50); + QString defaultJunkPacketMaxSize = QString::number(1000); + QString defaultInitPacketJunkSize = QString::number(QRandomGenerator::global()->bounded(15, 150)); + QString defaultResponsePacketJunkSize = QString::number(QRandomGenerator::global()->bounded(15, 150)); + + QSet headersValue; + while (headersValue.size() != 4) { + headersValue.insert(QString::number(QRandomGenerator::global()->bounded(1, std::numeric_limits::max()))); + } + + auto headersValueList = headersValue.values(); + + QString defaultInitPacketMagicHeader = headersValueList.at(0); + QString defaultResponsePacketMagicHeader = headersValueList.at(1); + QString defaultUnderloadPacketMagicHeader = headersValueList.at(2); + QString defaultTransportPacketMagicHeader = headersValueList.at(3); + + containerConfig[config_key::junkPacketCount] = defaultJunkPacketCount; + containerConfig[config_key::junkPacketMinSize] = defaultJunkPacketMinSize; + containerConfig[config_key::junkPacketMaxSize] = defaultJunkPacketMaxSize; + containerConfig[config_key::initPacketJunkSize] = defaultInitPacketJunkSize; + containerConfig[config_key::responsePacketJunkSize] = defaultResponsePacketJunkSize; + containerConfig[config_key::initPacketMagicHeader] = defaultInitPacketMagicHeader; + containerConfig[config_key::responsePacketMagicHeader] = defaultResponsePacketMagicHeader; + containerConfig[config_key::underloadPacketMagicHeader] = defaultUnderloadPacketMagicHeader; + containerConfig[config_key::transportPacketMagicHeader] = defaultTransportPacketMagicHeader; + } + if (container == DockerContainer::Sftp) { containerConfig.insert(config_key::userName, protocols::sftp::defaultUserName); containerConfig.insert(config_key::password, Utils::getRandomString(10)); From 338499247dd64ac81c5eb8ac55192da3aad01fc0 Mon Sep 17 00:00:00 2001 From: "vladimir.kuznetsov" Date: Thu, 19 Oct 2023 01:16:36 +0500 Subject: [PATCH 089/108] changed the display order of containers --- client/containers/containers_defs.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/client/containers/containers_defs.h b/client/containers/containers_defs.h index b9cb760d..92ca4f18 100644 --- a/client/containers/containers_defs.h +++ b/client/containers/containers_defs.h @@ -16,11 +16,11 @@ namespace amnezia Q_NAMESPACE enum DockerContainer { None = 0, - OpenVpn, - ShadowSocks, - Cloak, - WireGuard, Awg, + WireGuard, + OpenVpn, + Cloak, + ShadowSocks, Ipsec, // non-vpn From 366e27a321050119df3e1c8ca912a5bd113c7497 Mon Sep 17 00:00:00 2001 From: ronoaer Date: Thu, 19 Oct 2023 09:27:39 +0800 Subject: [PATCH 090/108] re-adatped pagehome --- client/resources.qrc | 1 - .../ui/qml/Components/HomeRootMenuButton.qml | 140 --------- client/ui/qml/Controls2/Drawer2Type.qml | 279 +++++++++++++----- client/ui/qml/Pages2/PageHome.qml | 121 ++++++-- client/ui/qml/Pages2/PageStart.qml | 2 +- 5 files changed, 298 insertions(+), 245 deletions(-) delete mode 100644 client/ui/qml/Components/HomeRootMenuButton.qml diff --git a/client/resources.qrc b/client/resources.qrc index ac6e5a6d..d7f8ff7a 100644 --- a/client/resources.qrc +++ b/client/resources.qrc @@ -217,6 +217,5 @@ ui/qml/Controls2/TopCloseButtonType.qml images/controls/x-circle.svg ui/qml/Controls2/Drawer2Type.qml - ui/qml/Components/HomeRootMenuButton.qml diff --git a/client/ui/qml/Components/HomeRootMenuButton.qml b/client/ui/qml/Components/HomeRootMenuButton.qml deleted file mode 100644 index b2ca98dc..00000000 --- a/client/ui/qml/Components/HomeRootMenuButton.qml +++ /dev/null @@ -1,140 +0,0 @@ -import QtQuick -import QtQuick.Controls -import QtQuick.Layouts - -import "../Controls2/TextTypes" -import "../Controls2" - -Item { - id: root - - property string text - property int textMaximumLineCount: 2 - property int textElide: Qt.ElideRight - - property string descriptionText - - property var clickedFunction - - property string rightImageSource - - property string textColor: "#d7d8db" - property string descriptionColor: "#878B91" - property real textOpacity: 1.0 - - property string rightImageColor: "#d7d8db" - - property bool descriptionOnTop: false - - property string defaultServerHostName - property string defaultContainerName - - implicitWidth: content.implicitWidth + content.anchors.topMargin + content.anchors.bottomMargin - implicitHeight: content.implicitHeight + content.anchors.leftMargin + content.anchors.rightMargin - - ColumnLayout { - id: content - - anchors.right: parent.right - anchors.left: parent.left - anchors.bottom: parent.bottom - - RowLayout { - Layout.topMargin: 24 - Layout.leftMargin: 24 - Layout.rightMargin: 24 - Layout.alignment: Qt.AlignHCenter | Qt.AlignVCenter - - Header1TextType { - Layout.maximumWidth: root.width - 48 - 18 - 12 // todo - - maximumLineCount: 2 - elide: Qt.ElideRight - - text: root.text - Layout.alignment: Qt.AlignLeft - } - - - ImageButtonType { - id: rightImage - - hoverEnabled: false - image: rightImageSource - imageColor: rightImageColor - visible: rightImageSource ? true : false - -// implicitSize: 18 -// backGroudRadius: 5 - horizontalPadding: 0 - padding: 0 - spacing: 0 - - - Rectangle { - id: rightImageBackground - anchors.fill: parent - radius: 16 - color: "transparent" - - Behavior on color { - PropertyAnimation { duration: 200 } - } - } - } - } - - LabelTextType { - Layout.bottomMargin: 44 - Layout.alignment: Qt.AlignHCenter | Qt.AlignVCenter - - text: { - var description = "" - if (ServersModel.isDefaultServerHasWriteAccess()) { - if (SettingsController.isAmneziaDnsEnabled() - && ContainersModel.isAmneziaDnsContainerInstalled(ServersModel.getDefaultServerIndex())) { - description += "Amnezia DNS | " - } - } else { - if (ServersModel.isDefaultServerConfigContainsAmneziaDns()) { - description += "Amnezia DNS | " - } - } - - description += root.defaultContainerName + " | " + root.defaultServerHostName - return description - } - } - } - - - MouseArea { - anchors.fill: parent - cursorShape: Qt.PointingHandCursor - hoverEnabled: true - - onEntered: { - rightImageBackground.color = rightImage.hoveredColor - - root.textOpacity = 0.8 - } - - onExited: { - rightImageBackground.color = rightImage.defaultColor - - root.textOpacity = 1 - } - - onPressedChanged: { - rightImageBackground.color = pressed ? rightImage.pressedColor : entered ? rightImage.hoveredColor : rightImage.defaultColor - - root.textOpacity = 0.7 - } - - onClicked: { - if (clickedFunction && typeof clickedFunction === "function") { - clickedFunction() - } - } - } -} diff --git a/client/ui/qml/Controls2/Drawer2Type.qml b/client/ui/qml/Controls2/Drawer2Type.qml index b34390ac..fc486744 100644 --- a/client/ui/qml/Controls2/Drawer2Type.qml +++ b/client/ui/qml/Controls2/Drawer2Type.qml @@ -10,11 +10,18 @@ Item { target: PageController function onForceCloseDrawer() { - close() + if (root.opened()) { + close() + return + } + + if (root.expanded()) { + collapse() + } } } - signal closed + signal drawerClosed visible: false @@ -28,6 +35,13 @@ Item { property int contentHeight: 0 property Item contentParent: contentArea + property bool dragActive: dragArea.drag.active + + /** Initial height of button content */ + property int collapsedHeight: 0 + + property bool fullMouseAreaVisible: true + state: "closed" Rectangle { @@ -37,7 +51,7 @@ Item { height: parent.height width: parent.width radius: 16 - color: "#90000000" + color: "transparent" //"#90000000" border.color: "transparent" border.width: 1 visible: true @@ -45,90 +59,119 @@ Item { MouseArea { id: fullMouseArea anchors.fill: parent - enabled: (root.state === "opened") + enabled: (root.opened() || root.expanded()) hoverEnabled: true + visible: fullMouseAreaVisible onClicked: { - if (root.state === "opened") { + if (root.opened()) { close() return } + + if (root.expanded()) { + collapse() + } } + } + + Rectangle { + id: placeAreaHolder + height: (!root.opened()) ? 0 : parent.height - contentHeight + anchors.right: parent.right + anchors.left: parent.left + visible: true + color: "transparent" + + Drag.active: dragArea.drag.active + } + + + Rectangle { + id: contentArea + + anchors.top: placeAreaHolder.bottom + height: contentHeight + radius: 16 + color: root.defaultColor + border.width: 1 + border.color: root.borderColor + width: parent.width + visible: true Rectangle { - id: placeAreaHolder - height: parent.height - contentHeight + width: parent.radius + height: parent.radius + anchors.bottom: parent.bottom anchors.right: parent.right anchors.left: parent.left - visible: true - color: "transparent" - - Drag.active: dragArea.drag.active + color: parent.color } + MouseArea { + id: dragArea - Rectangle { - id: contentArea + anchors.fill: parent - anchors.top: placeAreaHolder.bottom - height: contentHeight - radius: 16 - color: root.defaultColor - border.width: 1 - border.color: root.borderColor - width: parent.width - visible: true + cursorShape: root.collapsed() ? Qt.PointingHandCursor : Qt.ArrowCursor // ? + hoverEnabled: true - Rectangle { - width: parent.radius - height: parent.radius - anchors.bottom: parent.bottom - anchors.right: parent.right - anchors.left: parent.left - color: parent.color - } + drag.target: placeAreaHolder + drag.axis: Drag.YAxis + drag.maximumY: (root.collapsed() || root.expanded()) ? (root.height - collapsedHeight) : root.height + drag.minimumY: (root.collapsed() || root.expanded()) ? (root.height - root.height * 0.9) : (root.height - root.height) - MouseArea { - id: dragArea - - anchors.fill: parent - - cursorShape: (root.state === "opened") ? Qt.PointingHandCursor : Qt.ArrowCursor - hoverEnabled: true - - drag.target: placeAreaHolder - drag.axis: Drag.YAxis - drag.maximumY: root.height - drag.minimumY: root.height - root.height - - /** If drag area is released at any point other than min or max y, transition to the other state */ - onReleased: { - if (root.state === "closed" && placeAreaHolder.y < root.height * 0.9) { - root.state = "opened" - return - } - - if (root.state === "opened" && placeAreaHolder.y > (root.height - root.height * 0.9)) { - close() - return - } - - placeAreaHolder.y = 0 + /** If drag area is released at any point other than min or max y, transition to the other state */ + onReleased: { + if (root.closed() && placeAreaHolder.y < root.height * 0.9) { + root.state = "opened" + return } - onClicked: { - if (root.state === "opened") { - close() - return - } + if (root.opened() && placeAreaHolder.y > (root.height - root.height * 0.9)) { + close() + return + } + + + if (root.collapsed() && placeAreaHolder.y < (root.height - collapsedHeight)) { + root.state = "expanded" + return + } + + if (root.expanded() && placeAreaHolder.y > (root.height - root.height * 0.9)) { + root.state = "collapsed" + return + } + + + if (root.opened()) { + placeAreaHolder.y = 0 + } + } + + onClicked: { + if (root.opened()) { + close() + return + } + + if (root.expanded()) { + collapse() + return + } + + if (root.collapsed()) { + root.state = "expanded" } } } } + } onStateChanged: { - if (root.state === "closed") { + if (root.closed() || root.collapsed()) { var initialPageNavigationBarColor = PageController.getInitialPageNavigationBarColor() if (initialPageNavigationBarColor !== 0xFF1C1D21) { PageController.updateNavigationBarColor(initialPageNavigationBarColor) @@ -138,11 +181,12 @@ Item { PageController.drawerClose() } - closed() + drawerClosed() return } - if (root.state === "opened") { + + if (root.opened() || root.expanded()) { if (PageController.getInitialPageNavigationBarColor() !== 0xFF1C1D21) { PageController.updateNavigationBarColor(0xFF1C1D21) } @@ -161,7 +205,7 @@ Item { name: "closed" PropertyChanges { target: placeAreaHolder - y: parent.height + y: root.height } }, @@ -171,6 +215,22 @@ Item { target: placeAreaHolder y: dragArea.drag.minimumY } + }, + + State { + name: "collapsed" + PropertyChanges { + target: placeAreaHolder + y: root.height - collapsedHeight + } + }, + + State { + name: "expanded" + PropertyChanges { + target: placeAreaHolder + y: root.height - root.height * 0.9 + } } ] @@ -199,6 +259,40 @@ Item { properties: "y" duration: 200 } + }, + + Transition { + from: "expanded" + to: "collapsed" + PropertyAnimation { + target: placeAreaHolder + properties: "y" + duration: 200 + } + + onRunningChanged: { + if (!running) { + draw2Background.color = "transparent" + fullMouseArea.visible = false + } + } + }, + + Transition { + from: "collapsed" + to: "expanded" + PropertyAnimation { + target: placeAreaHolder + properties: "y" + duration: 200 + } + + onRunningChanged: { + if (!running) { + draw2Background.color = "#90000000" + visibledMouseArea(true) + } + } } ] @@ -212,9 +306,11 @@ Item { } function open() { - if (root.visible && root.state !== "closed") { + //if (root.visible && !root.closed()) { + if (root.opened()) { return } + draw2Background.color = "#90000000" visibledMouseArea(true) @@ -240,21 +336,52 @@ Item { root.state = "closed" } - onVisibleChanged: { - // e.g cancel, ...... - if (!visible) { - if (root.state === "opened") { - if (needCloseButton) { - PageController.drawerClose() - } - } - - close() - } + function collapse() { + draw2Background.color = "transparent" + root.state = "collapsed" } + function visibledMouseArea(visbile) { fullMouseArea.visible = visbile dragArea.visible = visbile } + + function opened() { + return root.state === "opened" ? true : false + } + + function expanded() { + return root.state === "expanded" ? true : false + } + + function closed() { + return root.state === "closed" ? true : false + } + + function collapsed() { + return root.state === "collapsed" ? true : false + } + + + onVisibleChanged: { + // e.g cancel, ...... + if (!visible) { + if (root.opened()) { + if (needCloseButton) { + PageController.drawerClose() + } + + close() + } + + if (root.expanded()) { + if (needCloseButton) { + PageController.drawerClose() + } + + collapse() + } + } + } } diff --git a/client/ui/qml/Pages2/PageHome.qml b/client/ui/qml/Pages2/PageHome.qml index dafa3bdc..a3a3ed9d 100644 --- a/client/ui/qml/Pages2/PageHome.qml +++ b/client/ui/qml/Pages2/PageHome.qml @@ -30,13 +30,13 @@ PageType { target: PageController function onRestorePageHomeState(isContainerInstalled) { - menu.close() + buttonContent.collapse() if (isContainerInstalled) { containersDropDown.menuVisible = true } } function onForceCloseDrawer() { - menu.close() + buttonContent.collapse() } } @@ -69,7 +69,7 @@ PageType { } } - // collapsedServerMenuDescription.text = description + root.defaultContainerName + " | " + root.defaultServerHostName + collapsedServerMenuDescription.text = description + root.defaultContainerName + " | " + root.defaultServerHostName expandedServersMenuDescription.text = description + root.defaultServerHostName } @@ -79,7 +79,7 @@ PageType { Item { anchors.fill: parent - anchors.bottomMargin: defaultServerInfo.implicitHeight + anchors.bottomMargin: buttonContent.collapsedHeight ConnectButton { anchors.centerIn: parent @@ -88,7 +88,7 @@ PageType { Rectangle { id: buttonBackground - anchors.fill: defaultServerInfo + anchors { left: buttonContent.left; right: buttonContent.right; top: buttonContent.top } radius: 16 color: root.defaultColor @@ -105,41 +105,105 @@ PageType { } } - HomeRootMenuButton { - id: defaultServerInfo - anchors.right: parent.right - anchors.left: parent.left - anchors.bottom: parent.bottom - - text: root.defaultServerName - rightImageSource: "qrc:/images/controls/chevron-down.svg" - - defaultContainerName: root.defaultContainerName - defaultServerHostName: root.defaultServerHostName - - clickedFunction: function() { - menu.open() - } - } - Drawer2Type { - id: menu - parent: root + id: buttonContent + visible: true + + fullMouseAreaVisible: false + + /** True when expanded objects should be visible */ + property bool expandedVisibility: buttonContent.expanded() || (buttonContent.collapsed() && buttonContent.dragActive) + /** True when collapsed objects should be visible */ + property bool collapsedVisibility: buttonContent.collapsed() && !buttonContent.dragActive width: parent.width height: parent.height contentHeight: parent.height * 0.9 + ColumnLayout { + id: content + + parent: buttonContent.contentParent + + visible: buttonContent.collapsedVisibility + + anchors.right: parent.right + anchors.left: parent.left + anchors.top: parent.top + + onImplicitHeightChanged: { + if (buttonContent.collapsed() && buttonContent.collapsedHeight === 0) { + buttonContent.collapsedHeight = implicitHeight + } + } + + RowLayout { + Layout.topMargin: 24 + Layout.leftMargin: 24 + Layout.rightMargin: 24 + Layout.alignment: Qt.AlignHCenter | Qt.AlignVCenter + + Header1TextType { + id: collapsedButtonHeader + Layout.maximumWidth: root.width - 48 - 18 - 12 // todo + + maximumLineCount: 2 + elide: Qt.ElideRight + + text: root.defaultServerName + + Layout.alignment: Qt.AlignLeft + } + + + ImageButtonType { + id: collapsedButtonChevron + + hoverEnabled: false + image: "qrc:/images/controls/chevron-down.svg" + imageColor: "#d7d8db" + + horizontalPadding: 0 + padding: 0 + spacing: 0 + + Rectangle { + id: rightImageBackground + anchors.fill: parent + radius: 16 + color: "transparent" + + Behavior on color { + PropertyAnimation { duration: 200 } + } + } + } + } + + LabelTextType { + id: collapsedServerMenuDescription + Layout.bottomMargin: 44 + Layout.alignment: Qt.AlignHCenter | Qt.AlignVCenter + visible: buttonContent.collapsedVisibility + } + } + + Component.onCompleted: { + buttonContent.collapse() + } + ColumnLayout { id: serversMenuHeader - parent: menu.contentParent + parent: buttonContent.contentParent anchors.top: parent.top anchors.right: parent.right anchors.left: parent.left + visible: buttonContent.expandedVisibility + Header1TextType { Layout.fillWidth: true Layout.topMargin: 24 @@ -222,6 +286,7 @@ PageType { Layout.topMargin: 48 Layout.leftMargin: 16 Layout.rightMargin: 16 + visible: buttonContent.expandedVisibility headerText: qsTr("Servers") } @@ -230,7 +295,7 @@ PageType { Flickable { id: serversContainer - parent: menu.contentParent + parent: buttonContent.contentParent anchors.top: serversMenuHeader.bottom anchors.right: parent.right @@ -239,6 +304,8 @@ PageType { anchors.topMargin: 16 contentHeight: col.implicitHeight + visible: buttonContent.expandedVisibility + clip: true ScrollBar.vertical: ScrollBar { @@ -342,7 +409,7 @@ PageType { onClicked: function() { ServersModel.currentlyProcessedIndex = index PageController.goToPage(PageEnum.PageSettingsServerInfo) - menu.close() + buttonContent.collapse() } } } diff --git a/client/ui/qml/Pages2/PageStart.qml b/client/ui/qml/Pages2/PageStart.qml index 8afad392..4ccd40d8 100644 --- a/client/ui/qml/Pages2/PageStart.qml +++ b/client/ui/qml/Pages2/PageStart.qml @@ -247,7 +247,7 @@ PageType { z: 1 - onClosed: { + onDrawerClosed: { tabBar.setCurrentIndex(tabBar.previousIndex) } } From 6ec773079cef7fd8b39711801296f1120bdc0d06 Mon Sep 17 00:00:00 2001 From: ronoaer Date: Thu, 19 Oct 2023 11:22:52 +0800 Subject: [PATCH 091/108] added hovering effect of button --- .../qml/Components/ShareConnectionDrawer.qml | 2 +- client/ui/qml/Controls2/Drawer2Type.qml | 32 +++++++++++++------ client/ui/qml/Pages2/PageHome.qml | 25 ++++++++++++++- 3 files changed, 48 insertions(+), 11 deletions(-) diff --git a/client/ui/qml/Components/ShareConnectionDrawer.qml b/client/ui/qml/Components/ShareConnectionDrawer.qml index ae0df0e2..03e7b500 100644 --- a/client/ui/qml/Components/ShareConnectionDrawer.qml +++ b/client/ui/qml/Components/ShareConnectionDrawer.qml @@ -31,7 +31,7 @@ Drawer2Type { height: parent.height contentHeight: parent.height * 0.9 - onClosed: { + onDrawerClosed: { configExtension = ".vpn" configCaption = qsTr("Save AmneziaVPN config") configFileName = "amnezia_config" diff --git a/client/ui/qml/Controls2/Drawer2Type.qml b/client/ui/qml/Controls2/Drawer2Type.qml index fc486744..f10fac21 100644 --- a/client/ui/qml/Controls2/Drawer2Type.qml +++ b/client/ui/qml/Controls2/Drawer2Type.qml @@ -22,6 +22,11 @@ Item { } signal drawerClosed + signal collapsedEntered + signal collapsedExited + signal collapsedEnter + signal collapsedPressChanged + visible: false @@ -41,6 +46,7 @@ Item { property int collapsedHeight: 0 property bool fullMouseAreaVisible: true + property MouseArea drawerDragArea: dragArea state: "closed" @@ -165,6 +171,18 @@ Item { root.state = "expanded" } } + + onExited: { + collapsedExited() + } + + onEntered: { + collapsedEnter() + } + + onPressedChanged: { + collapsedPressChanged() + } } } @@ -306,7 +324,6 @@ Item { } function open() { - //if (root.visible && !root.closed()) { if (root.opened()) { return } @@ -341,6 +358,11 @@ Item { root.state = "collapsed" } + function expand() { + draw2Background.color = "#90000000" + root.state = "expanded" + } + function visibledMouseArea(visbile) { fullMouseArea.visible = visbile @@ -374,14 +396,6 @@ Item { close() } - - if (root.expanded()) { - if (needCloseButton) { - PageController.drawerClose() - } - - collapse() - } } } } diff --git a/client/ui/qml/Pages2/PageHome.qml b/client/ui/qml/Pages2/PageHome.qml index a3a3ed9d..13148a80 100644 --- a/client/ui/qml/Pages2/PageHome.qml +++ b/client/ui/qml/Pages2/PageHome.qml @@ -122,7 +122,7 @@ PageType { ColumnLayout { - id: content + id: collapsedButtonContent parent: buttonContent.contentParent @@ -178,6 +178,12 @@ PageType { PropertyAnimation { duration: 200 } } } + + onClicked: { + if (buttonContent.collapsed()) { + buttonContent.expand() + } + } } } @@ -424,5 +430,22 @@ PageType { } } } + + onCollapsedEnter: { + collapsedButtonChevron.backgroundColor = collapsedButtonChevron.hoveredColor + collapsedButtonHeader.opacity = 0.8 + } + + onCollapsedExited: { + collapsedButtonChevron.backgroundColor = collapsedButtonChevron.defaultColor + collapsedButtonHeader.opacity = 1 + } + + onCollapsedPressChanged: { + collapsedButtonChevron.backgroundColor = buttonContent.drawerDragArea.pressed ? + collapsedButtonChevron.pressedColor : buttonContent.drawerDragArea.entered ? + collapsedButtonChevron.hoveredColor : collapsedButtonChevron.defaultColor + collapsedButtonHeader.opacity = 0.7 + } } } From f7bed04ab217baad98a72854c57578592718a812 Mon Sep 17 00:00:00 2001 From: ronoaer Date: Thu, 19 Oct 2023 19:32:15 +0800 Subject: [PATCH 092/108] removed invalid function code --- client/ui/qml/Controls2/Drawer2Type.qml | 22 ++++++++-------------- 1 file changed, 8 insertions(+), 14 deletions(-) diff --git a/client/ui/qml/Controls2/Drawer2Type.qml b/client/ui/qml/Controls2/Drawer2Type.qml index f10fac21..fd6406ee 100644 --- a/client/ui/qml/Controls2/Drawer2Type.qml +++ b/client/ui/qml/Controls2/Drawer2Type.qml @@ -34,6 +34,7 @@ Item { property string defaultColor: "#1C1D21" property string borderColor: "#2C2D30" + property string semitransparentColor: "#90000000" property bool needCollapsed: false @@ -57,7 +58,7 @@ Item { height: parent.height width: parent.width radius: 16 - color: "transparent" //"#90000000" + color: "transparent" border.color: "transparent" border.width: 1 visible: true @@ -264,7 +265,7 @@ Item { onRunningChanged: { if (!running) { - visibledMouseArea(false) + fullMouseArea.visible = false } } }, @@ -307,8 +308,8 @@ Item { onRunningChanged: { if (!running) { - draw2Background.color = "#90000000" - visibledMouseArea(true) + draw2Background.color = semitransparentColor + fullMouseArea.visible = true } } } @@ -328,9 +329,8 @@ Item { return } - draw2Background.color = "#90000000" - - visibledMouseArea(true) + draw2Background.color = semitransparentColor + fullMouseArea.visible = true root.y = 0 root.state = "opened" @@ -359,16 +359,10 @@ Item { } function expand() { - draw2Background.color = "#90000000" + draw2Background.color = semitransparentColor root.state = "expanded" } - - function visibledMouseArea(visbile) { - fullMouseArea.visible = visbile - dragArea.visible = visbile - } - function opened() { return root.state === "opened" ? true : false } From a6949bd3aefeb3e90852d85be5a5028d0aff4b50 Mon Sep 17 00:00:00 2001 From: ronoaer Date: Thu, 19 Oct 2023 19:45:22 +0800 Subject: [PATCH 093/108] resized questiondrawer of page serverdata --- client/ui/qml/Pages2/PageSettingsServerData.qml | 6 ++++-- client/ui/qml/Pages2/PageSettingsServerInfo.qml | 1 + 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/client/ui/qml/Pages2/PageSettingsServerData.qml b/client/ui/qml/Pages2/PageSettingsServerData.qml index 2e401c67..09066ccb 100644 --- a/client/ui/qml/Pages2/PageSettingsServerData.qml +++ b/client/ui/qml/Pages2/PageSettingsServerData.qml @@ -14,6 +14,8 @@ import "../Components" PageType { id: root + property Item questionDrawerParent + Connections { target: InstallController @@ -193,9 +195,9 @@ PageType { QuestionDrawer { id: questionDrawer - drawerHeight: 0.8 + drawerHeight: 0.5 - parent: root + parent: questionDrawerParent } } } diff --git a/client/ui/qml/Pages2/PageSettingsServerInfo.qml b/client/ui/qml/Pages2/PageSettingsServerInfo.qml index f6d569dd..e14c6ab5 100644 --- a/client/ui/qml/Pages2/PageSettingsServerInfo.qml +++ b/client/ui/qml/Pages2/PageSettingsServerInfo.qml @@ -169,6 +169,7 @@ PageType { } PageSettingsServerData { stackView: root.stackView + questionDrawerParent: root } } } From 6c78b4ec8f8bad64ee2f936096dd421c47192af6 Mon Sep 17 00:00:00 2001 From: ronoaer Date: Thu, 19 Oct 2023 23:01:03 +0800 Subject: [PATCH 094/108] enabled drag-pagehome-drawer in tabBar --- client/ui/qml/Pages2/PageStart.qml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/client/ui/qml/Pages2/PageStart.qml b/client/ui/qml/Pages2/PageStart.qml index 4ccd40d8..12c83e06 100644 --- a/client/ui/qml/Pages2/PageStart.qml +++ b/client/ui/qml/Pages2/PageStart.qml @@ -176,6 +176,12 @@ PageType { strokeColor: "#2C2D30" fillColor: "#1C1D21" } + + MouseArea { + id: noPropagateMouseEvent + anchors.fill: parent + enabled: true + } } TabImageButtonType { From 2da1025f2695c8a8ba2b1f0d82bdcacd0437b473 Mon Sep 17 00:00:00 2001 From: pokamest Date: Fri, 20 Oct 2023 02:25:40 +0100 Subject: [PATCH 095/108] Random port on install --- client/protocols/protocols_defs.cpp | 25 +++++++++--- client/protocols/protocols_defs.h | 2 + client/ui/controllers/installController.cpp | 40 ++++++++++--------- .../PageSetupWizardProtocolSettings.qml | 2 +- 4 files changed, 44 insertions(+), 25 deletions(-) diff --git a/client/protocols/protocols_defs.cpp b/client/protocols/protocols_defs.cpp index b3823a11..a451014c 100644 --- a/client/protocols/protocols_defs.cpp +++ b/client/protocols/protocols_defs.cpp @@ -1,5 +1,7 @@ #include "protocols_defs.h" +#include + using namespace amnezia; QDebug operator<<(QDebug debug, const amnezia::ProtocolEnumNS::Proto &p) @@ -98,15 +100,28 @@ amnezia::ServiceType ProtocolProps::protocolService(Proto p) } } +int ProtocolProps::getPortForInstall(Proto p) +{ + switch (p) { + case Awg: + case WireGuard: + case ShadowSocks: + case OpenVpn: + return QRandomGenerator::global()->bounded(30000, 50000); + default: + return defaultPort(p); + } +} + int ProtocolProps::defaultPort(Proto p) { switch (p) { case Proto::Any: return -1; - case Proto::OpenVpn: return 1194; - case Proto::Cloak: return 443; - case Proto::ShadowSocks: return 6789; - case Proto::WireGuard: return 51820; - case Proto::Awg: return 55424; + case Proto::OpenVpn: return QString(protocols::openvpn::defaultPort).toInt(); + case Proto::Cloak: return QString(protocols::cloak::defaultPort).toInt(); + case Proto::ShadowSocks: return QString(protocols::shadowsocks::defaultPort).toInt(); + case Proto::WireGuard: return QString(protocols::wireguard::defaultPort).toInt(); + case Proto::Awg: return QString(protocols::awg::defaultPort).toInt(); case Proto::Ikev2: return -1; case Proto::L2tp: return -1; diff --git a/client/protocols/protocols_defs.h b/client/protocols/protocols_defs.h index ed2ed313..ab9cac1b 100644 --- a/client/protocols/protocols_defs.h +++ b/client/protocols/protocols_defs.h @@ -228,6 +228,8 @@ namespace amnezia Q_INVOKABLE static ServiceType protocolService(Proto p); + Q_INVOKABLE static int getPortForInstall(Proto p); + Q_INVOKABLE static int defaultPort(Proto p); Q_INVOKABLE static bool defaultPortChangeable(Proto p); diff --git a/client/ui/controllers/installController.cpp b/client/ui/controllers/installController.cpp index 8efe368b..8853f108 100644 --- a/client/ui/controllers/installController.cpp +++ b/client/ui/controllers/installController.cpp @@ -75,33 +75,35 @@ void InstallController::install(DockerContainer container, int port, TransportPr ProtocolProps::transportProtoToString(transportProto, protocol)); if (container == DockerContainer::Awg) { - QString defaultJunkPacketCount = QString::number(QRandomGenerator::global()->bounded(3, 10)); - QString defaultJunkPacketMinSize = QString::number(50); - QString defaultJunkPacketMaxSize = QString::number(1000); - QString defaultInitPacketJunkSize = QString::number(QRandomGenerator::global()->bounded(15, 150)); - QString defaultResponsePacketJunkSize = QString::number(QRandomGenerator::global()->bounded(15, 150)); + QString junkPacketCount = QString::number(QRandomGenerator::global()->bounded(3, 10)); + QString junkPacketMinSize = QString::number(50); + QString junkPacketMaxSize = QString::number(1000); + QString initPacketJunkSize = QString::number(QRandomGenerator::global()->bounded(15, 150)); + QString responsePacketJunkSize = QString::number(QRandomGenerator::global()->bounded(15, 150)); QSet headersValue; while (headersValue.size() != 4) { - headersValue.insert(QString::number(QRandomGenerator::global()->bounded(1, std::numeric_limits::max()))); + + auto max = (std::numeric_limits::max)(); + headersValue.insert(QString::number(QRandomGenerator::global()->bounded(1, max))); } auto headersValueList = headersValue.values(); - QString defaultInitPacketMagicHeader = headersValueList.at(0); - QString defaultResponsePacketMagicHeader = headersValueList.at(1); - QString defaultUnderloadPacketMagicHeader = headersValueList.at(2); - QString defaultTransportPacketMagicHeader = headersValueList.at(3); + QString initPacketMagicHeader = headersValueList.at(0); + QString responsePacketMagicHeader = headersValueList.at(1); + QString underloadPacketMagicHeader = headersValueList.at(2); + QString transportPacketMagicHeader = headersValueList.at(3); - containerConfig[config_key::junkPacketCount] = defaultJunkPacketCount; - containerConfig[config_key::junkPacketMinSize] = defaultJunkPacketMinSize; - containerConfig[config_key::junkPacketMaxSize] = defaultJunkPacketMaxSize; - containerConfig[config_key::initPacketJunkSize] = defaultInitPacketJunkSize; - containerConfig[config_key::responsePacketJunkSize] = defaultResponsePacketJunkSize; - containerConfig[config_key::initPacketMagicHeader] = defaultInitPacketMagicHeader; - containerConfig[config_key::responsePacketMagicHeader] = defaultResponsePacketMagicHeader; - containerConfig[config_key::underloadPacketMagicHeader] = defaultUnderloadPacketMagicHeader; - containerConfig[config_key::transportPacketMagicHeader] = defaultTransportPacketMagicHeader; + containerConfig[config_key::junkPacketCount] = junkPacketCount; + containerConfig[config_key::junkPacketMinSize] = junkPacketMinSize; + containerConfig[config_key::junkPacketMaxSize] = junkPacketMaxSize; + containerConfig[config_key::initPacketJunkSize] = initPacketJunkSize; + containerConfig[config_key::responsePacketJunkSize] = responsePacketJunkSize; + containerConfig[config_key::initPacketMagicHeader] = initPacketMagicHeader; + containerConfig[config_key::responsePacketMagicHeader] = responsePacketMagicHeader; + containerConfig[config_key::underloadPacketMagicHeader] = underloadPacketMagicHeader; + containerConfig[config_key::transportPacketMagicHeader] = transportPacketMagicHeader; } if (container == DockerContainer::Sftp) { diff --git a/client/ui/qml/Pages2/PageSetupWizardProtocolSettings.qml b/client/ui/qml/Pages2/PageSetupWizardProtocolSettings.qml index 2b97f044..7698c755 100644 --- a/client/ui/qml/Pages2/PageSetupWizardProtocolSettings.qml +++ b/client/ui/qml/Pages2/PageSetupWizardProtocolSettings.qml @@ -224,7 +224,7 @@ PageType { if (ProtocolProps.defaultPort(defaultContainerProto) < 0) { port.visible = false } else { - port.textFieldText = ProtocolProps.defaultPort(defaultContainerProto) + port.textFieldText = ProtocolProps.getPortForInstall(defaultContainerProto) } transportProtoSelector.currentIndex = ProtocolProps.defaultTransportProto(defaultContainerProto) From 0a15f44193fb7be45dd57e3a19babfb295175a95 Mon Sep 17 00:00:00 2001 From: ronoaer Date: Fri, 20 Oct 2023 10:38:12 +0800 Subject: [PATCH 096/108] removed states 'opened', 'closed' --- client/ui/qml/Controls2/Drawer2Type.qml | 131 +++++------------------- 1 file changed, 25 insertions(+), 106 deletions(-) diff --git a/client/ui/qml/Controls2/Drawer2Type.qml b/client/ui/qml/Controls2/Drawer2Type.qml index fd6406ee..fa393982 100644 --- a/client/ui/qml/Controls2/Drawer2Type.qml +++ b/client/ui/qml/Controls2/Drawer2Type.qml @@ -10,11 +10,6 @@ Item { target: PageController function onForceCloseDrawer() { - if (root.opened()) { - close() - return - } - if (root.expanded()) { collapse() } @@ -43,13 +38,12 @@ Item { property bool dragActive: dragArea.drag.active - /** Initial height of button content */ property int collapsedHeight: 0 property bool fullMouseAreaVisible: true property MouseArea drawerDragArea: dragArea - state: "closed" + state: "collapsed" Rectangle { id: draw2Background @@ -66,16 +60,11 @@ Item { MouseArea { id: fullMouseArea anchors.fill: parent - enabled: (root.opened() || root.expanded()) + enabled: root.expanded() hoverEnabled: true visible: fullMouseAreaVisible onClicked: { - if (root.opened()) { - close() - return - } - if (root.expanded()) { collapse() } @@ -84,7 +73,10 @@ Item { Rectangle { id: placeAreaHolder - height: (!root.opened()) ? 0 : parent.height - contentHeight + + // for apdating home drawer, normal drawer will reset it + height: 0 + anchors.right: parent.right anchors.left: parent.left visible: true @@ -120,49 +112,27 @@ Item { anchors.fill: parent - cursorShape: root.collapsed() ? Qt.PointingHandCursor : Qt.ArrowCursor // ? + cursorShape: root.collapsed() ? Qt.PointingHandCursor : Qt.ArrowCursor hoverEnabled: true drag.target: placeAreaHolder drag.axis: Drag.YAxis - drag.maximumY: (root.collapsed() || root.expanded()) ? (root.height - collapsedHeight) : root.height - drag.minimumY: (root.collapsed() || root.expanded()) ? (root.height - root.height * 0.9) : (root.height - root.height) + drag.maximumY: root.height - root.collapsedHeight + drag.minimumY: root.collapsedHeight > 0 ? root.height - root.height * 0.9 : 0 /** If drag area is released at any point other than min or max y, transition to the other state */ onReleased: { - if (root.closed() && placeAreaHolder.y < root.height * 0.9) { - root.state = "opened" - return - } - - if (root.opened() && placeAreaHolder.y > (root.height - root.height * 0.9)) { - close() - return - } - - - if (root.collapsed() && placeAreaHolder.y < (root.height - collapsedHeight)) { + if (root.collapsed() && placeAreaHolder.y < drag.maximumY) { root.state = "expanded" return } - - if (root.expanded() && placeAreaHolder.y > (root.height - root.height * 0.9)) { + if (root.expanded() && placeAreaHolder.y > drag.minimumY) { root.state = "collapsed" return } - - - if (root.opened()) { - placeAreaHolder.y = 0 - } } onClicked: { - if (root.opened()) { - close() - return - } - if (root.expanded()) { collapse() return @@ -186,11 +156,10 @@ Item { } } } - } onStateChanged: { - if (root.closed() || root.collapsed()) { + if (root.collapsed()) { var initialPageNavigationBarColor = PageController.getInitialPageNavigationBarColor() if (initialPageNavigationBarColor !== 0xFF1C1D21) { PageController.updateNavigationBarColor(initialPageNavigationBarColor) @@ -205,7 +174,7 @@ Item { return } - if (root.opened() || root.expanded()) { + if (root.expanded()) { if (PageController.getInitialPageNavigationBarColor() !== 0xFF1C1D21) { PageController.updateNavigationBarColor(0xFF1C1D21) } @@ -220,27 +189,11 @@ Item { /** Two states of buttonContent, great place to add any future animations for the drawer */ states: [ - State { - name: "closed" - PropertyChanges { - target: placeAreaHolder - y: root.height - } - }, - - State { - name: "opened" - PropertyChanges { - target: placeAreaHolder - y: dragArea.drag.minimumY - } - }, - State { name: "collapsed" PropertyChanges { target: placeAreaHolder - y: root.height - collapsedHeight + y: dragArea.drag.maximumY } }, @@ -248,38 +201,12 @@ Item { name: "expanded" PropertyChanges { target: placeAreaHolder - y: root.height - root.height * 0.9 + y: dragArea.drag.minimumY } } ] transitions: [ - Transition { - from: "opened" - to: "closed" - PropertyAnimation { - target: placeAreaHolder - properties: "y" - duration: 200 - } - - onRunningChanged: { - if (!running) { - fullMouseArea.visible = false - } - } - }, - - Transition { - from: "closed" - to: "opened" - PropertyAnimation { - target: placeAreaHolder - properties: "y" - duration: 200 - } - }, - Transition { from: "expanded" to: "collapsed" @@ -324,33 +251,32 @@ Item { duration: 200 } + // for normal drawer function open() { - if (root.opened()) { + if (root.expanded()) { return } draw2Background.color = semitransparentColor fullMouseArea.visible = true + collapsedHeight = 0 + root.y = 0 - root.state = "opened" + root.state = "expanded" root.visible = true root.height = parent.height contentArea.height = contentHeight - placeAreaHolder.height = root.height - contentHeight - placeAreaHolder.y = root.height - root.height - - dragArea.drag.maximumY = root.height - dragArea.drag.minimumY = 0 + placeAreaHolder.y = 0 + placeAreaHolder.height = root.height - contentHeight animationVisible.running = true } function close() { - draw2Background.color = "transparent" - root.state = "closed" + collapse() } function collapse() { @@ -358,23 +284,16 @@ Item { root.state = "collapsed" } + // for page home function expand() { draw2Background.color = semitransparentColor root.state = "expanded" } - function opened() { - return root.state === "opened" ? true : false - } - function expanded() { return root.state === "expanded" ? true : false } - function closed() { - return root.state === "closed" ? true : false - } - function collapsed() { return root.state === "collapsed" ? true : false } @@ -383,7 +302,7 @@ Item { onVisibleChanged: { // e.g cancel, ...... if (!visible) { - if (root.opened()) { + if (root.expanded()) { if (needCloseButton) { PageController.drawerClose() } From 58ad7dc16135a8cbe3fcb1ef55a1406dbdd191dc Mon Sep 17 00:00:00 2001 From: "vladimir.kuznetsov" Date: Fri, 20 Oct 2023 14:10:04 +0500 Subject: [PATCH 097/108] removed the "remove protocol" buttons from where they shouldn't be --- client/ui/qml/Controls2/SwitcherType.qml | 11 ++++------- client/ui/qml/Pages2/PageProtocolOpenVpnSettings.qml | 5 +++++ client/ui/qml/Pages2/PageProtocolRaw.qml | 2 ++ 3 files changed, 11 insertions(+), 7 deletions(-) diff --git a/client/ui/qml/Controls2/SwitcherType.qml b/client/ui/qml/Controls2/SwitcherType.qml index ee7372f5..1dbd0e84 100644 --- a/client/ui/qml/Controls2/SwitcherType.qml +++ b/client/ui/qml/Controls2/SwitcherType.qml @@ -30,17 +30,13 @@ Switch { property string hoveredIndicatorBackgroundColor: Qt.rgba(1, 1, 1, 0.08) property string defaultIndicatorBackgroundColor: "transparent" - implicitWidth: content.implicitWidth + switcher.implicitWidth - implicitHeight: content.implicitHeight - hoverEnabled: enabled ? true : false indicator: Rectangle { id: switcher - anchors.left: content.right + anchors.right: parent.right anchors.verticalCenter: parent.verticalCenter - anchors.leftMargin: 4 implicitWidth: 52 implicitHeight: 32 @@ -90,11 +86,11 @@ Switch { contentItem: ColumnLayout { id: content - anchors.fill: parent - anchors.rightMargin: switcher.implicitWidth + anchors.verticalCenter: parent.verticalCenter ListItemTitleType { Layout.fillWidth: true + rightPadding: indicator.width text: root.text color: root.enabled ? root.textColor : root.textDisabledColor @@ -104,6 +100,7 @@ Switch { id: description Layout.fillWidth: true + rightPadding: indicator.width color: root.enabled ? root.descriptionTextColor : root.descriptionTextDisabledColor diff --git a/client/ui/qml/Pages2/PageProtocolOpenVpnSettings.qml b/client/ui/qml/Pages2/PageProtocolOpenVpnSettings.qml index c8469dcb..cd2dd51d 100644 --- a/client/ui/qml/Pages2/PageProtocolOpenVpnSettings.qml +++ b/client/ui/qml/Pages2/PageProtocolOpenVpnSettings.qml @@ -5,6 +5,7 @@ import QtQuick.Layouts import SortFilterProxyModel 0.2 import PageEnum 1.0 +import ContainerEnum 1.0 import "./" import "../Controls2" @@ -252,6 +253,8 @@ PageType { ColumnLayout { id: checkboxLayout + + anchors.fill: parent CheckBoxType { Layout.fillWidth: true @@ -351,6 +354,8 @@ PageType { Layout.leftMargin: -8 implicitHeight: 32 + visible: ContainersModel.getCurrentlyProcessedContainerIndex() === ContainerEnum.OpenVpn + defaultColor: "transparent" hoveredColor: Qt.rgba(1, 1, 1, 0.08) pressedColor: Qt.rgba(1, 1, 1, 0.12) diff --git a/client/ui/qml/Pages2/PageProtocolRaw.qml b/client/ui/qml/Pages2/PageProtocolRaw.qml index f0959143..f3621d96 100644 --- a/client/ui/qml/Pages2/PageProtocolRaw.qml +++ b/client/ui/qml/Pages2/PageProtocolRaw.qml @@ -169,6 +169,8 @@ PageType { width: parent.width + visible: ServersModel.isCurrentlyProcessedServerHasWriteAccess() + text: qsTr("Remove ") + ContainersModel.getCurrentlyProcessedContainerName() textColor: "#EB5757" From da1cdfd6faef78dfbc566c79961b00de0cebbbd2 Mon Sep 17 00:00:00 2001 From: ronoaer Date: Fri, 20 Oct 2023 18:01:57 +0800 Subject: [PATCH 098/108] translated new source strings to chinese --- client/translations/amneziavpn_zh_CN.ts | 40 ++++++++++--------------- 1 file changed, 15 insertions(+), 25 deletions(-) diff --git a/client/translations/amneziavpn_zh_CN.ts b/client/translations/amneziavpn_zh_CN.ts index 64faa6f4..76a4feac 100644 --- a/client/translations/amneziavpn_zh_CN.ts +++ b/client/translations/amneziavpn_zh_CN.ts @@ -131,7 +131,7 @@ Unable change protocol while there is an active connection - Невозможно изменить протокол при наличии активного соединения + 已建立连接时无法更改服务器配置 @@ -162,47 +162,47 @@ 已安装在服务器上 - - + + %1 installed successfully. %1 安装成功。 - - + + %1 is already installed on the server. 服务器上已经安装 %1。 - + Added containers that were already installed on the server 添加已安装在服务器上的容器 - + Already installed containers were found on the server. All installed containers have been added to the application 在服务上发现已经安装协议并添加至应用 - + Settings updated successfully 配置更新成功 - + Server '%1' was removed 已移除服务器 '%1' - + All containers from server '%1' have been removed 服务器 '%1' 的所有容器已移除 - + %1 has been removed from the server '%2' %1 已从服务器 '%2' 上移除 @@ -223,12 +223,12 @@ Already installed containers were found on the server. All installed containers 协议已从 - + Please login as the user 请以用户身份登录 - + Server added successfully 增加服务器成功 @@ -308,7 +308,7 @@ Already installed containers were found on the server. All installed containers Unable change server while there is an active connection - Невозможно изменить сервер при наличии активного соединения + 已建立连接时无法更改服务器配置 @@ -2335,7 +2335,7 @@ and will not be shared or disclosed to the Amnezia or any third parties QObject - + Sftp service Sftp 服务 @@ -2839,16 +2839,6 @@ While it offers a blend of security, stability, and speed, it's essential t error 0x%1: %2 错误 0x%1: %2 - - - WireGuard Configuration Highlighter - - - - - &Randomize colors - - SelectLanguageDrawer From 3d60ac751eefa101bbeb8ae5fcf3bb1cd57a969f Mon Sep 17 00:00:00 2001 From: "vladimir.kuznetsov" Date: Fri, 20 Oct 2023 20:52:14 +0500 Subject: [PATCH 099/108] removed the default protocol/server change if connected to VPN --- client/translations/amneziavpn_ru.ts | 130 +++++++++--------- client/translations/amneziavpn_zh_CN.ts | 130 +++++++++--------- client/ui/controllers/importController.cpp | 2 - client/ui/controllers/installController.cpp | 5 - client/ui/models/containers_model.cpp | 9 +- client/ui/models/containers_model.h | 1 + .../qml/Pages2/PageSetupWizardInstalling.qml | 8 ++ .../qml/Pages2/PageSetupWizardViewConfig.qml | 4 + 8 files changed, 151 insertions(+), 138 deletions(-) diff --git a/client/translations/amneziavpn_ru.ts b/client/translations/amneziavpn_ru.ts index 733c374d..8c72f093 100644 --- a/client/translations/amneziavpn_ru.ts +++ b/client/translations/amneziavpn_ru.ts @@ -135,7 +135,7 @@ ImportController - + Scanned %1 of %2. Отсканировано %1 из%2. @@ -144,13 +144,13 @@ InstallController - + %1 installed successfully. %1 успешно установлен. - + %1 is already installed on the server. %1 уже установлен на сервер. @@ -162,39 +162,39 @@ Added containers that were already installed on the server В приложение добавлены обнаруженные на сервере протоклы и сервисы - + Already installed containers were found on the server. All installed containers have been added to the application На сервере обнаружены установленные протоколы и сервисы, все они добавлены в приложение - + Settings updated successfully Настройки успешно обновлены - + Server '%1' was removed Сервер '%1' был удален - + All containers from server '%1' have been removed Все протоклы и сервисы были удалены с сервера '%1' - + %1 has been removed from the server '%2' %1 был удален с сервера '%2' - + Please login as the user Пожалуйста, войдите в систему от имени пользователя - + Server added successfully Сервер успешно добавлен @@ -397,195 +397,195 @@ Already installed containers were found on the server. All installed containers PageProtocolOpenVpnSettings - + OpenVPN settings Настройки OpenVPN - + VPN Addresses Subnet VPN Адреса Подсеть - + Network protocol Сетевой протокол - + Port Порт - + Auto-negotiate encryption Шифрование с автоматическим согласованием - + Hash Хэш - + SHA512 SHA512 - + SHA384 SHA384 - + SHA256 SHA256 - + SHA3-512 SHA3-512 - + SHA3-384 SHA3-384 - + SHA3-256 SHA3-256 - + whirlpool whirlpool - + BLAKE2b512 BLAKE2b512 - + BLAKE2s256 BLAKE2s256 - + SHA1 SHA1 - + Cipher Шифрование - + AES-256-GCM AES-256-GCM - + AES-192-GCM AES-192-GCM - + AES-128-GCM AES-128-GCM - + AES-256-CBC AES-256-CBC - + AES-192-CBC AES-192-CBC - + AES-128-CBC AES-128-CBC - + ChaCha20-Poly1305 ChaCha20-Poly1305 - + ARIA-256-CBC ARIA-256-CBC - + CAMELLIA-256-CBC CAMELLIA-256-CBC - + none none - + TLS auth TLS авторизация - + Block DNS requests outside of VPN Блокировать DNS запросы за пределами VPN - + Additional client configuration commands Дополнительные команды конфигурации клиента - - + + Commands: Commands: - + Additional server configuration commands Дополнительные команды конфигурации сервера - + Remove OpenVPN Удалить OpenVPN - + Remove OpenVpn from server? Удалить OpenVpn с сервера? - + All users who you shared a connection with will no longer be able to connect to it. Все пользователи, с которыми вы поделились этим VPN-протоколом, больше не смогут к нему подключаться. - + Continue Продолжить - + Cancel Отменить - + Save and Restart Amnezia Сохранить и перезагрузить @@ -608,27 +608,27 @@ Already installed containers were found on the server. All installed containers Параметры подключения %1 - + Remove Удалить - + Remove %1 from server? Удалить %1 с сервера? - + All users who you shared a connection with will no longer be able to connect to it. Все пользователи, с которыми вы поделились этим VPN-протоколом, больше не смогут к нему подключаться. - + Continue Продолжить - + Cancel Отменить @@ -1694,7 +1694,7 @@ and will not be shared or disclosed to the Amnezia or any third parties PageSetupWizardInstalling - + The server has already been added to the application Сервер уже был добавлен в приложение @@ -1707,28 +1707,28 @@ and will not be shared or disclosed to the Amnezia or any third parties занят установкой других протоколов или сервисов. Установка Amnesia - + Amnezia has detected that your server is currently Amnezia обнаружила, что ваш сервер в настоящее время - + busy installing other software. Amnezia installation занят установкой другого программного обеспечения. Установка Amnezia - + will pause until the server finishes installing other software будет приостановлена до тех пор, пока сервер не завершит установку - + Installing Установка - + Usually it takes no more than 5 minutes Обычно это занимает не более 5 минут @@ -1846,27 +1846,27 @@ and will not be shared or disclosed to the Amnezia or any third parties PageSetupWizardViewConfig - + New connection Новое соединение - + Do not use connection code from public sources. It could be created to intercept your data. Не используйте код подключения из публичных источников. Его могли создать, чтобы перехватывать ваши данные. - + Collapse content Свернуть - + Show content Показать содержимое ключа - + Connect Подключиться diff --git a/client/translations/amneziavpn_zh_CN.ts b/client/translations/amneziavpn_zh_CN.ts index 64faa6f4..10064ce2 100644 --- a/client/translations/amneziavpn_zh_CN.ts +++ b/client/translations/amneziavpn_zh_CN.ts @@ -146,7 +146,7 @@ ImportController - + Scanned %1 of %2. 扫描 %1 of %2. @@ -163,13 +163,13 @@ - + %1 installed successfully. %1 安装成功。 - + %1 is already installed on the server. 服务器上已经安装 %1。 @@ -180,29 +180,29 @@ Added containers that were already installed on the server 添加已安装在服务器上的容器 - + Already installed containers were found on the server. All installed containers have been added to the application 在服务上发现已经安装协议并添加至应用 - + Settings updated successfully 配置更新成功 - + Server '%1' was removed 已移除服务器 '%1' - + All containers from server '%1' have been removed 服务器 '%1' 的所有容器已移除 - + %1 has been removed from the server '%2' %1 已从服务器 '%2' 上移除 @@ -223,12 +223,12 @@ Already installed containers were found on the server. All installed containers 协议已从 - + Please login as the user 请以用户身份登录 - + Server added successfully 增加服务器成功 @@ -431,180 +431,180 @@ Already installed containers were found on the server. All installed containers PageProtocolOpenVpnSettings - + OpenVPN settings OpenVPN 配置 - + VPN Addresses Subnet VPN子网掩码 - + Network protocol 网络协议 - + Port 端口 - + Auto-negotiate encryption 自定义加密方式 - + Hash - + SHA512 - + SHA384 - + SHA256 - + SHA3-512 - + SHA3-384 - + SHA3-256 - + whirlpool - + BLAKE2b512 - + BLAKE2s256 - + SHA1 - + Cipher - + AES-256-GCM - + AES-192-GCM - + AES-128-GCM - + AES-256-CBC - + AES-192-CBC - + AES-128-CBC - + ChaCha20-Poly1305 - + ARIA-256-CBC - + CAMELLIA-256-CBC - + none - + TLS auth TLS认证 - + Block DNS requests outside of VPN 阻止VPN外的DNS请求 - + Additional client configuration commands 附加客户端配置命令 - - + + Commands: 命令: - + Additional server configuration commands 附加服务器端配置命令 - + Remove OpenVPN 移除OpenVPN - + Remove OpenVpn from server? 从服务器移除OpenVPN吗? - + All users who you shared a connection with will no longer be able to connect to it. 使用此共享连接的所有用户,将无法再连接它。 @@ -613,17 +613,17 @@ Already installed containers were found on the server. All installed containers 与您共享连接的所有用户将无法再连接到此链接 - + Continue 继续 - + Cancel 取消 - + Save and Restart Amnezia 保存并重启Amnezia @@ -650,17 +650,17 @@ Already installed containers were found on the server. All installed containers %1 连接选项 - + Remove 移除 - + Remove %1 from server? 从服务器移除 %1 ? - + All users who you shared a connection with will no longer be able to connect to it. 使用此共享连接的所有用户,将无法再连接它。 @@ -673,12 +673,12 @@ Already installed containers were found on the server. All installed containers 与您共享连接的所有用户将无法再连接到此链接 - + Continue 继续 - + Cancel 取消 @@ -1801,22 +1801,22 @@ and will not be shared or disclosed to the Amnezia or any third parties PageSetupWizardInstalling - + Usually it takes no more than 5 minutes 通常不超过5分钟 - + The server has already been added to the application 服务器已添加到应用软件中 - + Amnezia has detected that your server is currently Amnezia 检测到您的服务器当前 - + busy installing other software. Amnezia installation 正安装其他软件。Amnezia安装 @@ -1829,12 +1829,12 @@ and will not be shared or disclosed to the Amnezia or any third parties 正安装其他软件。Amnezia安装 - + will pause until the server finishes installing other software 将暂停,直到其他软件安装完成。 - + Installing 安装中 @@ -1952,27 +1952,27 @@ and will not be shared or disclosed to the Amnezia or any third parties PageSetupWizardViewConfig - + New connection 新连接 - + Do not use connection code from public sources. It could be created to intercept your data. 请勿使用公共来源的连接码。它可以被创建来拦截您的数据。 - + Collapse content 折叠内容 - + Show content 显示内容 - + Connect 连接 diff --git a/client/ui/controllers/importController.cpp b/client/ui/controllers/importController.cpp index 08b662ec..bd924087 100644 --- a/client/ui/controllers/importController.cpp +++ b/client/ui/controllers/importController.cpp @@ -144,8 +144,6 @@ void ImportController::importConfig() if (credentials.isValid() || m_config.contains(config_key::containers)) { m_serversModel->addServer(m_config); - m_serversModel->setDefaultServerIndex(m_serversModel->getServersCount() - 1); - emit importFinished(); } else { qDebug() << "Failed to import profile"; diff --git a/client/ui/controllers/installController.cpp b/client/ui/controllers/installController.cpp index 8efe368b..2aa4e81b 100644 --- a/client/ui/controllers/installController.cpp +++ b/client/ui/controllers/installController.cpp @@ -163,7 +163,6 @@ void InstallController::installServer(DockerContainer container, QJsonObject &co server.insert(config_key::defaultContainer, ContainerProps::containerToString(container)); m_serversModel->addServer(server); - m_serversModel->setDefaultServerIndex(m_serversModel->getServersCount() - 1); emit installServerFinished(finishMessage); return; @@ -214,9 +213,6 @@ void InstallController::installContainer(DockerContainer container, QJsonObject "All installed containers have been added to the application"); } - if (ContainerProps::containerService(container) == ServiceType::Vpn) { - m_containersModel->setData(m_containersModel->index(container), true, ContainersModel::Roles::IsDefaultRole); - } emit installContainerFinished(finishMessage, ContainerProps::containerService(container) == ServiceType::Other); return; } @@ -509,7 +505,6 @@ void InstallController::addEmptyServer() server.insert(config_key::defaultContainer, ContainerProps::containerToString(DockerContainer::None)); m_serversModel->addServer(server); - m_serversModel->setDefaultServerIndex(m_serversModel->getServersCount() - 1); emit installServerFinished(tr("Server added successfully")); } diff --git a/client/ui/models/containers_model.cpp b/client/ui/models/containers_model.cpp index 0c99041e..780809c5 100644 --- a/client/ui/models/containers_model.cpp +++ b/client/ui/models/containers_model.cpp @@ -41,7 +41,7 @@ bool ContainersModel::setData(const QModelIndex &index, const QVariant &value, i // return container; case IsInstalledRole: // return m_settings->containers(m_currentlyProcessedServerIndex).contains(container); - case IsDefaultRole: { + case IsDefaultRole: { //todo remove m_settings->setDefaultContainer(m_currentlyProcessedServerIndex, container); m_defaultContainerIndex = container; emit defaultContainerChanged(); @@ -117,6 +117,13 @@ QString ContainersModel::getDefaultContainerName() return ContainerProps::containerHumanNames().value(m_defaultContainerIndex); } +void ContainersModel::setDefaultContainer(DockerContainer container) +{ + m_settings->setDefaultContainer(m_currentlyProcessedServerIndex, container); + m_defaultContainerIndex = container; + emit defaultContainerChanged(); +} + int ContainersModel::getCurrentlyProcessedContainerIndex() { return m_currentlyProcessedContainerIndex; diff --git a/client/ui/models/containers_model.h b/client/ui/models/containers_model.h index cc549bb3..4ba85749 100644 --- a/client/ui/models/containers_model.h +++ b/client/ui/models/containers_model.h @@ -46,6 +46,7 @@ public: public slots: DockerContainer getDefaultContainer(); QString getDefaultContainerName(); + void setDefaultContainer(DockerContainer container); void setCurrentlyProcessedServerIndex(const int index); diff --git a/client/ui/qml/Pages2/PageSetupWizardInstalling.qml b/client/ui/qml/Pages2/PageSetupWizardInstalling.qml index bd1fd7e6..50aad294 100644 --- a/client/ui/qml/Pages2/PageSetupWizardInstalling.qml +++ b/client/ui/qml/Pages2/PageSetupWizardInstalling.qml @@ -24,6 +24,10 @@ PageType { target: InstallController function onInstallContainerFinished(finishedMessage, isServiceInstall) { + if (!ConnectionController.isConnected && !isServiceInstall) { + ContainersModel.setDefaultContainer(ContainersModel.getCurrentlyProcessedContainerIndex) + } + PageController.goToStartPage() if (stackView.currentItem.objectName === PageController.getPagePath(PageEnum.PageHome)) { PageController.restorePageHomeState(true) @@ -41,6 +45,10 @@ PageType { } function onInstallServerFinished(finishedMessage) { + if (!ConnectionController.isConnected) { + ServersModel.setDefaultServerIndex(ServersModel.getServersCount() - 1); + } + PageController.goToStartPage() if (stackView.currentItem.objectName === PageController.getPagePath(PageEnum.PageSetupWizardStart)) { PageController.replaceStartPage() diff --git a/client/ui/qml/Pages2/PageSetupWizardViewConfig.qml b/client/ui/qml/Pages2/PageSetupWizardViewConfig.qml index 83132bd9..ac35651f 100644 --- a/client/ui/qml/Pages2/PageSetupWizardViewConfig.qml +++ b/client/ui/qml/Pages2/PageSetupWizardViewConfig.qml @@ -24,6 +24,10 @@ PageType { } function onImportFinished() { + if (ConnectionController.isConnected) { + ServersModel.setDefaultServerIndex(ServersModel.getServersCount() - 1); + } + PageController.goToStartPage() if (stackView.currentItem.objectName === PageController.getPagePath(PageEnum.PageSetupWizardStart)) { PageController.replaceStartPage() From 09305724fa35b3524d527b170284a2d1d367e527 Mon Sep 17 00:00:00 2001 From: Mykola Baibuz Date: Fri, 20 Oct 2023 16:44:30 -0400 Subject: [PATCH 100/108] Fix MTU len for Win WG/AWG --- CMakeLists.txt | 2 +- client/3rd-prebuilt | 2 +- client/android/build.gradle | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 68de51fb..12fc8dce 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -2,7 +2,7 @@ cmake_minimum_required(VERSION 3.25.0 FATAL_ERROR) set(PROJECT AmneziaVPN) -project(${PROJECT} VERSION 4.0.8.4 +project(${PROJECT} VERSION 4.0.8.5 DESCRIPTION "AmneziaVPN" HOMEPAGE_URL "https://amnezia.org/" ) diff --git a/client/3rd-prebuilt b/client/3rd-prebuilt index 15b0ff39..ac32d335 160000 --- a/client/3rd-prebuilt +++ b/client/3rd-prebuilt @@ -1 +1 @@ -Subproject commit 15b0ff395d9d372339c5ea8ea35cb2715b975ea9 +Subproject commit ac32d33555bd62f0b0af314b1e5119d6d78a1a4e diff --git a/client/android/build.gradle b/client/android/build.gradle index 49e378a0..a6b3f651 100644 --- a/client/android/build.gradle +++ b/client/android/build.gradle @@ -138,7 +138,7 @@ android { resConfig "en" minSdkVersion = 24 targetSdkVersion = 34 - versionCode 36 // Change to a higher number + versionCode 37 // Change to a higher number versionName "4.0.8" // Change to a higher number javaCompileOptions.annotationProcessorOptions.arguments = [ From d98fdbdc5cd4a6b5cc2b15f33a910b300b8bc167 Mon Sep 17 00:00:00 2001 From: pokamest Date: Sat, 21 Oct 2023 14:17:45 +0100 Subject: [PATCH 101/108] Revert "added new drawer2type for replacing drawertype" --- client/resources.qrc | 1 - .../ConnectionTypeSelectionDrawer.qml | 7 +- .../qml/Components/HomeContainersListView.qml | 2 +- client/ui/qml/Components/QuestionDrawer.qml | 10 +- .../qml/Components/SelectLanguageDrawer.qml | 8 +- .../qml/Components/ShareConnectionDrawer.qml | 27 +- client/ui/qml/Controls2/Drawer2Type.qml | 314 ---------------- client/ui/qml/Controls2/DropDownType.qml | 21 +- client/ui/qml/Pages2/PageHome.qml | 340 +++++++++++------- .../qml/Pages2/PageProtocolCloakSettings.qml | 2 - .../Pages2/PageProtocolOpenVpnSettings.qml | 11 +- client/ui/qml/Pages2/PageProtocolRaw.qml | 15 +- .../PageProtocolShadowSocksSettings.qml | 2 - .../ui/qml/Pages2/PageServiceDnsSettings.qml | 7 +- .../ui/qml/Pages2/PageServiceSftpSettings.qml | 7 +- .../Pages2/PageServiceTorWebsiteSettings.qml | 7 +- .../ui/qml/Pages2/PageSettingsApplication.qml | 8 +- client/ui/qml/Pages2/PageSettingsBackup.qml | 7 +- client/ui/qml/Pages2/PageSettingsDns.qml | 7 +- client/ui/qml/Pages2/PageSettingsLogging.qml | 7 +- .../ui/qml/Pages2/PageSettingsServerData.qml | 24 +- .../ui/qml/Pages2/PageSettingsServerInfo.qml | 12 +- .../qml/Pages2/PageSettingsServerProtocol.qml | 7 +- .../qml/Pages2/PageSettingsSplitTunneling.qml | 29 +- .../PageSetupWizardProtocolSettings.qml | 11 +- client/ui/qml/Pages2/PageSetupWizardStart.qml | 3 +- client/ui/qml/Pages2/PageShare.qml | 7 - client/ui/qml/Pages2/PageStart.qml | 12 +- 28 files changed, 276 insertions(+), 639 deletions(-) delete mode 100644 client/ui/qml/Controls2/Drawer2Type.qml diff --git a/client/resources.qrc b/client/resources.qrc index 91578418..4c63383c 100644 --- a/client/resources.qrc +++ b/client/resources.qrc @@ -216,7 +216,6 @@ ui/qml/Pages2/PageServiceDnsSettings.qml ui/qml/Controls2/TopCloseButtonType.qml images/controls/x-circle.svg - ui/qml/Controls2/Drawer2Type.qml ui/qml/Pages2/PageProtocolAwgSettings.qml server_scripts/awg/template.conf server_scripts/awg/start.sh diff --git a/client/ui/qml/Components/ConnectionTypeSelectionDrawer.qml b/client/ui/qml/Components/ConnectionTypeSelectionDrawer.qml index 71ec889f..1f7b2f29 100644 --- a/client/ui/qml/Components/ConnectionTypeSelectionDrawer.qml +++ b/client/ui/qml/Components/ConnectionTypeSelectionDrawer.qml @@ -8,16 +8,13 @@ import "../Controls2" import "../Controls2/TextTypes" import "../Config" -Drawer2Type { +DrawerType { id: root width: parent.width - height: parent.height - contentHeight: parent.height * 0.4375 + height: parent.height * 0.4375 ColumnLayout { - parent: root.contentParent - anchors.top: parent.top anchors.left: parent.left anchors.right: parent.right diff --git a/client/ui/qml/Components/HomeContainersListView.qml b/client/ui/qml/Components/HomeContainersListView.qml index d410f252..f05b90d6 100644 --- a/client/ui/qml/Components/HomeContainersListView.qml +++ b/client/ui/qml/Components/HomeContainersListView.qml @@ -63,7 +63,7 @@ ListView { isDefault = true menuContent.currentIndex = index - containersDropDown.menu.close() + containersDropDown.menuVisible = false } else { if (!isSupported && isInstalled) { PageController.showErrorMessage(qsTr("The selected protocol is not supported on the current platform")) diff --git a/client/ui/qml/Components/QuestionDrawer.qml b/client/ui/qml/Components/QuestionDrawer.qml index 72067f97..16cdcb39 100644 --- a/client/ui/qml/Components/QuestionDrawer.qml +++ b/client/ui/qml/Components/QuestionDrawer.qml @@ -5,7 +5,7 @@ import QtQuick.Layouts import "../Controls2" import "../Controls2/TextTypes" -Drawer2Type { +DrawerType { id: root property string headerText @@ -15,14 +15,12 @@ Drawer2Type { property var yesButtonFunction property var noButtonFunction - property real drawerHeight: 0.5 width: parent.width - height: parent.height - contentHeight: parent.height * drawerHeight + height: content.implicitHeight + 32 ColumnLayout { - parent: root.contentParent + id: content anchors.top: parent.top anchors.left: parent.left @@ -31,8 +29,6 @@ Drawer2Type { anchors.rightMargin: 16 anchors.leftMargin: 16 - // visible: false - spacing: 8 Header2TextType { diff --git a/client/ui/qml/Components/SelectLanguageDrawer.qml b/client/ui/qml/Components/SelectLanguageDrawer.qml index e6fdc2b5..d318aab8 100644 --- a/client/ui/qml/Components/SelectLanguageDrawer.qml +++ b/client/ui/qml/Components/SelectLanguageDrawer.qml @@ -5,18 +5,15 @@ import QtQuick.Layouts import "../Controls2" import "../Controls2/TextTypes" -Drawer2Type { +DrawerType { id: root width: parent.width - height: parent.height - contentHeight: parent.height * 0.9 + height: parent.height * 0.9 ColumnLayout { id: backButton - parent: root.contentParent - anchors.top: parent.top anchors.left: parent.left anchors.right: parent.right @@ -31,7 +28,6 @@ Drawer2Type { } FlickableType { - parent: root.contentParent anchors.top: backButton.bottom anchors.left: parent.left anchors.right: parent.right diff --git a/client/ui/qml/Components/ShareConnectionDrawer.qml b/client/ui/qml/Components/ShareConnectionDrawer.qml index 03e7b500..1158dadc 100644 --- a/client/ui/qml/Components/ShareConnectionDrawer.qml +++ b/client/ui/qml/Components/ShareConnectionDrawer.qml @@ -16,7 +16,7 @@ import "../Controls2/TextTypes" import "../Config" import "../Components" -Drawer2Type { +DrawerType { id: root property alias headerText: header.headerText @@ -28,10 +28,9 @@ Drawer2Type { property string configFileName: "amnezia_config.vpn" width: parent.width - height: parent.height - contentHeight: parent.height * 0.9 + height: parent.height * 0.9 - onDrawerClosed: { + onClosed: { configExtension = ".vpn" configCaption = qsTr("Save AmneziaVPN config") configFileName = "amnezia_config" @@ -42,9 +41,6 @@ Drawer2Type { Header2Type { id: header - - parent: root.contentParent - anchors.top: parent.top anchors.left: parent.left anchors.right: parent.right @@ -54,8 +50,6 @@ Drawer2Type { } FlickableType { - parent: root.contentParent - anchors.top: header.bottom anchors.bottom: parent.bottom contentHeight: content.height + 32 @@ -132,37 +126,30 @@ Drawer2Type { text: qsTr("Show connection settings") onClicked: { - configContentDrawer.open() + configContentDrawer.visible = true } } - Drawer2Type { + DrawerType { id: configContentDrawer - parent: root width: parent.width - height: parent.height - - contentHeight: parent.height * 0.9 + height: parent.height * 0.9 BackButtonType { id: backButton - parent: configContentDrawer.contentParent - anchors.top: parent.top anchors.left: parent.left anchors.right: parent.right anchors.topMargin: 16 backButtonFunction: function() { - configContentDrawer.close() + configContentDrawer.visible = false } } FlickableType { - parent: configContentDrawer.contentParent - anchors.top: backButton.bottom anchors.left: parent.left anchors.right: parent.right diff --git a/client/ui/qml/Controls2/Drawer2Type.qml b/client/ui/qml/Controls2/Drawer2Type.qml deleted file mode 100644 index fa393982..00000000 --- a/client/ui/qml/Controls2/Drawer2Type.qml +++ /dev/null @@ -1,314 +0,0 @@ -import QtQuick -import QtQuick.Layouts -import QtQuick.Controls -import QtQuick.Shapes - -Item { - id: root - - Connections { - target: PageController - - function onForceCloseDrawer() { - if (root.expanded()) { - collapse() - } - } - } - - signal drawerClosed - signal collapsedEntered - signal collapsedExited - signal collapsedEnter - signal collapsedPressChanged - - - visible: false - - property bool needCloseButton: true - - property string defaultColor: "#1C1D21" - property string borderColor: "#2C2D30" - property string semitransparentColor: "#90000000" - - property bool needCollapsed: false - - property int contentHeight: 0 - property Item contentParent: contentArea - - property bool dragActive: dragArea.drag.active - - property int collapsedHeight: 0 - - property bool fullMouseAreaVisible: true - property MouseArea drawerDragArea: dragArea - - state: "collapsed" - - Rectangle { - id: draw2Background - - anchors.fill: parent - height: parent.height - width: parent.width - radius: 16 - color: "transparent" - border.color: "transparent" - border.width: 1 - visible: true - - MouseArea { - id: fullMouseArea - anchors.fill: parent - enabled: root.expanded() - hoverEnabled: true - visible: fullMouseAreaVisible - - onClicked: { - if (root.expanded()) { - collapse() - } - } - } - - Rectangle { - id: placeAreaHolder - - // for apdating home drawer, normal drawer will reset it - height: 0 - - anchors.right: parent.right - anchors.left: parent.left - visible: true - color: "transparent" - - Drag.active: dragArea.drag.active - } - - - Rectangle { - id: contentArea - - anchors.top: placeAreaHolder.bottom - height: contentHeight - radius: 16 - color: root.defaultColor - border.width: 1 - border.color: root.borderColor - width: parent.width - visible: true - - Rectangle { - width: parent.radius - height: parent.radius - anchors.bottom: parent.bottom - anchors.right: parent.right - anchors.left: parent.left - color: parent.color - } - - MouseArea { - id: dragArea - - anchors.fill: parent - - cursorShape: root.collapsed() ? Qt.PointingHandCursor : Qt.ArrowCursor - hoverEnabled: true - - drag.target: placeAreaHolder - drag.axis: Drag.YAxis - drag.maximumY: root.height - root.collapsedHeight - drag.minimumY: root.collapsedHeight > 0 ? root.height - root.height * 0.9 : 0 - - /** If drag area is released at any point other than min or max y, transition to the other state */ - onReleased: { - if (root.collapsed() && placeAreaHolder.y < drag.maximumY) { - root.state = "expanded" - return - } - if (root.expanded() && placeAreaHolder.y > drag.minimumY) { - root.state = "collapsed" - return - } - } - - onClicked: { - if (root.expanded()) { - collapse() - return - } - - if (root.collapsed()) { - root.state = "expanded" - } - } - - onExited: { - collapsedExited() - } - - onEntered: { - collapsedEnter() - } - - onPressedChanged: { - collapsedPressChanged() - } - } - } - } - - onStateChanged: { - if (root.collapsed()) { - var initialPageNavigationBarColor = PageController.getInitialPageNavigationBarColor() - if (initialPageNavigationBarColor !== 0xFF1C1D21) { - PageController.updateNavigationBarColor(initialPageNavigationBarColor) - } - - if (needCloseButton) { - PageController.drawerClose() - } - - drawerClosed() - - return - } - - if (root.expanded()) { - if (PageController.getInitialPageNavigationBarColor() !== 0xFF1C1D21) { - PageController.updateNavigationBarColor(0xFF1C1D21) - } - - if (needCloseButton) { - PageController.drawerOpen() - } - - return - } - } - - /** Two states of buttonContent, great place to add any future animations for the drawer */ - states: [ - State { - name: "collapsed" - PropertyChanges { - target: placeAreaHolder - y: dragArea.drag.maximumY - } - }, - - State { - name: "expanded" - PropertyChanges { - target: placeAreaHolder - y: dragArea.drag.minimumY - } - } - ] - - transitions: [ - Transition { - from: "expanded" - to: "collapsed" - PropertyAnimation { - target: placeAreaHolder - properties: "y" - duration: 200 - } - - onRunningChanged: { - if (!running) { - draw2Background.color = "transparent" - fullMouseArea.visible = false - } - } - }, - - Transition { - from: "collapsed" - to: "expanded" - PropertyAnimation { - target: placeAreaHolder - properties: "y" - duration: 200 - } - - onRunningChanged: { - if (!running) { - draw2Background.color = semitransparentColor - fullMouseArea.visible = true - } - } - } - ] - - NumberAnimation { - id: animationVisible - target: placeAreaHolder - property: "y" - from: parent.height - to: 0 - duration: 200 - } - - // for normal drawer - function open() { - if (root.expanded()) { - return - } - - draw2Background.color = semitransparentColor - fullMouseArea.visible = true - - collapsedHeight = 0 - - root.y = 0 - root.state = "expanded" - root.visible = true - root.height = parent.height - - contentArea.height = contentHeight - - placeAreaHolder.y = 0 - placeAreaHolder.height = root.height - contentHeight - - animationVisible.running = true - } - - function close() { - collapse() - } - - function collapse() { - draw2Background.color = "transparent" - root.state = "collapsed" - } - - // for page home - function expand() { - draw2Background.color = semitransparentColor - root.state = "expanded" - } - - function expanded() { - return root.state === "expanded" ? true : false - } - - function collapsed() { - return root.state === "collapsed" ? true : false - } - - - onVisibleChanged: { - // e.g cancel, ...... - if (!visible) { - if (root.expanded()) { - if (needCloseButton) { - PageController.drawerClose() - } - - close() - } - } - } -} diff --git a/client/ui/qml/Controls2/DropDownType.qml b/client/ui/qml/Controls2/DropDownType.qml index c666408a..b91f0b7a 100644 --- a/client/ui/qml/Controls2/DropDownType.qml +++ b/client/ui/qml/Controls2/DropDownType.qml @@ -40,10 +40,6 @@ Item { property alias menuVisible: menu.visible - property Item drawerParent: root - - property Drawer2Type menu: menu - implicitWidth: rootButtonContent.implicitWidth implicitHeight: rootButtonContent.implicitHeight @@ -159,26 +155,21 @@ Item { onClicked: { if (rootButtonClickedFunction && typeof rootButtonClickedFunction === "function") { rootButtonClickedFunction() + } else { + menu.visible = true } - - menu.open() } } - Drawer2Type { + DrawerType { id: menu - parent: drawerParent - width: parent.width - height: parent.height - contentHeight: parent.height * drawerHeight + height: parent.height * drawerHeight ColumnLayout { id: header - parent: menu.contentParent - anchors.top: parent.top anchors.left: parent.left anchors.right: parent.right @@ -187,14 +178,12 @@ Item { BackButtonType { backButtonImage: root.headerBackButtonImage backButtonFunction: function() { - menu.close() + root.menuVisible = false } } } FlickableType { - parent: menu.contentParent - anchors.top: header.bottom anchors.topMargin: 16 contentHeight: col.implicitHeight diff --git a/client/ui/qml/Pages2/PageHome.qml b/client/ui/qml/Pages2/PageHome.qml index 414d604b..cc49e4f0 100644 --- a/client/ui/qml/Pages2/PageHome.qml +++ b/client/ui/qml/Pages2/PageHome.qml @@ -30,13 +30,13 @@ PageType { target: PageController function onRestorePageHomeState(isContainerInstalled) { - buttonContent.collapse() + buttonContent.state = "expanded" if (isContainerInstalled) { containersDropDown.menuVisible = true } } function onForceCloseDrawer() { - buttonContent.collapse() + buttonContent.state = "collapsed" } } @@ -73,8 +73,14 @@ PageType { expandedServersMenuDescription.text = description + root.defaultServerHostName } - Component.onCompleted: { - updateDescriptions() + Component.onCompleted: updateDescriptions() + + MouseArea { + anchors.fill: parent + enabled: buttonContent.state === "expanded" + onClicked: { + buttonContent.state = "collapsed" + } } Item { @@ -86,10 +92,56 @@ PageType { } } + MouseArea { + id: dragArea + + anchors.fill: buttonBackground + cursorShape: buttonContent.state === "collapsed" ? Qt.PointingHandCursor : Qt.ArrowCursor + hoverEnabled: true + + drag.target: buttonContent + drag.axis: Drag.YAxis + drag.maximumY: root.height - buttonContent.collapsedHeight + drag.minimumY: root.height - root.height * 0.9 + + /** If drag area is released at any point other than min or max y, transition to the other state */ + onReleased: { + if (buttonContent.state === "collapsed" && buttonContent.y < dragArea.drag.maximumY) { + buttonContent.state = "expanded" + return + } + if (buttonContent.state === "expanded" && buttonContent.y > dragArea.drag.minimumY) { + buttonContent.state = "collapsed" + return + } + } + + onEntered: { + collapsedButtonChevron.backgroundColor = collapsedButtonChevron.hoveredColor + collapsedButtonHeader.opacity = 0.8 + } + onExited: { + collapsedButtonChevron.backgroundColor = collapsedButtonChevron.defaultColor + collapsedButtonHeader.opacity = 1 + } + onPressedChanged: { + collapsedButtonChevron.backgroundColor = pressed ? collapsedButtonChevron.pressedColor : entered ? collapsedButtonChevron.hoveredColor : collapsedButtonChevron.defaultColor + collapsedButtonHeader.opacity = 0.7 + } + + + onClicked: { + if (buttonContent.state === "collapsed") { + buttonContent.state = "expanded" + } + } + } + Rectangle { id: buttonBackground - anchors { left: buttonContent.left; right: buttonContent.right; top: buttonContent.top } + anchors { left: buttonContent.left; right: buttonContent.right; top: buttonContent.top } + height: root.height radius: 16 color: root.defaultColor border.color: root.borderColor @@ -105,126 +157,161 @@ PageType { } } - Drawer2Type { + ColumnLayout { id: buttonContent - visible: true - - fullMouseAreaVisible: false + /** Initial height of button content */ + property int collapsedHeight: 0 /** True when expanded objects should be visible */ - property bool expandedVisibility: buttonContent.expanded() || (buttonContent.collapsed() && buttonContent.dragActive) + property bool expandedVisibility: buttonContent.state === "expanded" || (buttonContent.state === "collapsed" && dragArea.drag.active === true) /** True when collapsed objects should be visible */ - property bool collapsedVisibility: buttonContent.collapsed() && !buttonContent.dragActive + property bool collapsedVisibility: buttonContent.state === "collapsed" && dragArea.drag.active === false - width: parent.width - height: parent.height - contentHeight: parent.height * 0.9 + Drag.active: dragArea.drag.active + anchors.right: root.right + anchors.left: root.left + y: root.height - buttonContent.height + Component.onCompleted: { + buttonContent.state = "collapsed" + } - ColumnLayout { - id: collapsedButtonContent - - parent: buttonContent.contentParent - - visible: buttonContent.collapsedVisibility - - anchors.right: parent.right - anchors.left: parent.left - anchors.top: parent.top - - onImplicitHeightChanged: { - if (buttonContent.collapsed() && buttonContent.collapsedHeight === 0) { - buttonContent.collapsedHeight = implicitHeight - } - } - - DividerType { - Layout.topMargin: 10 - Layout.fillWidth: false - Layout.preferredWidth: 20 - Layout.preferredHeight: 2 - Layout.alignment: Qt.AlignHCenter | Qt.AlignVCenter - } - - RowLayout { - Layout.topMargin: 14 - Layout.leftMargin: 24 - Layout.rightMargin: 24 - Layout.alignment: Qt.AlignHCenter | Qt.AlignVCenter - - Header1TextType { - id: collapsedButtonHeader - Layout.maximumWidth: root.width - 48 - 18 - 12 // todo - - maximumLineCount: 2 - elide: Qt.ElideRight - - text: root.defaultServerName - - Layout.alignment: Qt.AlignLeft - } - - - ImageButtonType { - id: collapsedButtonChevron - - hoverEnabled: false - image: "qrc:/images/controls/chevron-down.svg" - imageColor: "#d7d8db" - - horizontalPadding: 0 - padding: 0 - spacing: 0 - - Rectangle { - id: rightImageBackground - anchors.fill: parent - radius: 16 - color: "transparent" - - Behavior on color { - PropertyAnimation { duration: 200 } - } - } - - onClicked: { - if (buttonContent.collapsed()) { - buttonContent.expand() - } - } - } - } - - LabelTextType { - id: collapsedServerMenuDescription - Layout.bottomMargin: 44 - Layout.alignment: Qt.AlignHCenter | Qt.AlignVCenter - visible: buttonContent.collapsedVisibility + /** Set once based on first implicit height change once all children are layed out */ + onImplicitHeightChanged: { + if (buttonContent.state === "collapsed" && collapsedHeight == 0) { + collapsedHeight = implicitHeight } } - Component.onCompleted: { - buttonContent.collapse() + onStateChanged: { + if (buttonContent.state === "collapsed") { + var initialPageNavigationBarColor = PageController.getInitialPageNavigationBarColor() + if (initialPageNavigationBarColor !== 0xFF1C1D21) { + PageController.updateNavigationBarColor(initialPageNavigationBarColor) + } + PageController.drawerClose() + return + } + if (buttonContent.state === "expanded") { + if (PageController.getInitialPageNavigationBarColor() !== 0xFF1C1D21) { + PageController.updateNavigationBarColor(0xFF1C1D21) + } + PageController.drawerOpen() + return + } + } + + /** Two states of buttonContent, great place to add any future animations for the drawer */ + states: [ + State { + name: "collapsed" + PropertyChanges { + target: buttonContent + y: root.height - collapsedHeight + } + }, + State { + name: "expanded" + PropertyChanges { + target: buttonContent + y: dragArea.drag.minimumY + + } + } + ] + + transitions: [ + Transition { + from: "collapsed" + to: "expanded" + PropertyAnimation { + target: buttonContent + properties: "y" + duration: 200 + } + }, + Transition { + from: "expanded" + to: "collapsed" + PropertyAnimation { + target: buttonContent + properties: "y" + duration: 200 + } + } + ] + + DividerType { + Layout.topMargin: 10 + Layout.fillWidth: false + Layout.preferredWidth: 20 + Layout.preferredHeight: 2 + Layout.alignment: Qt.AlignHCenter | Qt.AlignVCenter + + visible: (buttonContent.collapsedVisibility || buttonContent.expandedVisibility) + } + + RowLayout { + Layout.topMargin: 14 + Layout.leftMargin: 24 + Layout.rightMargin: 24 + Layout.alignment: Qt.AlignHCenter | Qt.AlignVCenter + visible: buttonContent.collapsedVisibility + + spacing: 0 + + Header1TextType { + id: collapsedButtonHeader + Layout.maximumWidth: buttonContent.width - 48 - 18 - 12 // todo + + maximumLineCount: 2 + elide: Qt.ElideRight + + text: root.defaultServerName + horizontalAlignment: Qt.AlignHCenter + + Behavior on opacity { + PropertyAnimation { duration: 200 } + } + } + + ImageButtonType { + id: collapsedButtonChevron + + Layout.leftMargin: 8 + + hoverEnabled: false + image: "qrc:/images/controls/chevron-down.svg" + imageColor: "#d7d8db" + + icon.width: 18 + icon.height: 18 + backgroundRadius: 16 + horizontalPadding: 4 + topPadding: 4 + bottomPadding: 3 + + onClicked: { + if (buttonContent.state === "collapsed") { + buttonContent.state = "expanded" + } + } + } + } + + LabelTextType { + id: collapsedServerMenuDescription + Layout.bottomMargin: 44 + Layout.alignment: Qt.AlignHCenter | Qt.AlignVCenter + visible: buttonContent.collapsedVisibility } ColumnLayout { id: serversMenuHeader - parent: buttonContent.contentParent - - anchors.top: parent.top - anchors.right: parent.right - anchors.left: parent.left - + Layout.alignment: Qt.AlignTop | Qt.AlignHCenter + Layout.fillWidth: true visible: buttonContent.expandedVisibility - - DividerType { - Layout.topMargin: 10 - Layout.fillWidth: false - Layout.preferredWidth: 20 - Layout.preferredHeight: 2 - Layout.alignment: Qt.AlignHCenter | Qt.AlignVCenter - } Header1TextType { Layout.fillWidth: true @@ -253,8 +340,6 @@ PageType { DropDownType { id: containersDropDown - drawerParent: root - rootButtonImageColor: "#0E0E11" rootButtonBackgroundColor: "#D7D8DB" rootButtonBackgroundHoveredColor: Qt.rgba(215, 216, 219, 0.8) @@ -316,18 +401,12 @@ PageType { Flickable { id: serversContainer - - parent: buttonContent.contentParent - - anchors.top: serversMenuHeader.bottom - anchors.right: parent.right - anchors.left: parent.left - anchors.bottom: parent.bottom - anchors.topMargin: 16 + Layout.alignment: Qt.AlignTop | Qt.AlignHCenter + Layout.fillWidth: true + Layout.topMargin: 16 contentHeight: col.implicitHeight - + implicitHeight: root.height - (root.height * 0.1) - serversMenuHeader.implicitHeight - 52 //todo 52 is tabbar height visible: buttonContent.expandedVisibility - clip: true ScrollBar.vertical: ScrollBar { @@ -437,7 +516,7 @@ PageType { onClicked: function() { ServersModel.currentlyProcessedIndex = index PageController.goToPage(PageEnum.PageSettingsServerInfo) - buttonContent.collapse() + buttonContent.state = "collapsed" } } } @@ -452,22 +531,5 @@ PageType { } } } - - onCollapsedEnter: { - collapsedButtonChevron.backgroundColor = collapsedButtonChevron.hoveredColor - collapsedButtonHeader.opacity = 0.8 - } - - onCollapsedExited: { - collapsedButtonChevron.backgroundColor = collapsedButtonChevron.defaultColor - collapsedButtonHeader.opacity = 1 - } - - onCollapsedPressChanged: { - collapsedButtonChevron.backgroundColor = buttonContent.drawerDragArea.pressed ? - collapsedButtonChevron.pressedColor : buttonContent.drawerDragArea.entered ? - collapsedButtonChevron.hoveredColor : collapsedButtonChevron.defaultColor - collapsedButtonHeader.opacity = 0.7 - } } } diff --git a/client/ui/qml/Pages2/PageProtocolCloakSettings.qml b/client/ui/qml/Pages2/PageProtocolCloakSettings.qml index b0f36971..78e666a7 100644 --- a/client/ui/qml/Pages2/PageProtocolCloakSettings.qml +++ b/client/ui/qml/Pages2/PageProtocolCloakSettings.qml @@ -117,8 +117,6 @@ PageType { Layout.fillWidth: true Layout.topMargin: 16 - drawerParent: root - descriptionText: qsTr("Cipher") headerText: qsTr("Cipher") diff --git a/client/ui/qml/Pages2/PageProtocolOpenVpnSettings.qml b/client/ui/qml/Pages2/PageProtocolOpenVpnSettings.qml index 8ce5e554..cd2dd51d 100644 --- a/client/ui/qml/Pages2/PageProtocolOpenVpnSettings.qml +++ b/client/ui/qml/Pages2/PageProtocolOpenVpnSettings.qml @@ -157,8 +157,6 @@ PageType { Layout.fillWidth: true Layout.topMargin: 20 - drawerParent: root - enabled: !autoNegotiateEncryprionSwitcher.checked descriptionText: qsTr("Hash") @@ -205,8 +203,6 @@ PageType { Layout.fillWidth: true Layout.topMargin: 16 - drawerParent: root - enabled: !autoNegotiateEncryprionSwitcher.checked descriptionText: qsTr("Cipher") @@ -374,14 +370,14 @@ PageType { questionDrawer.noButtonText = qsTr("Cancel") questionDrawer.yesButtonFunction = function() { - questionDrawer.close() + questionDrawer.visible = false PageController.goToPage(PageEnum.PageDeinstalling) InstallController.removeCurrentlyProcessedContainer() } questionDrawer.noButtonFunction = function() { - questionDrawer.close() + questionDrawer.visible = false } - questionDrawer.open() + questionDrawer.visible = true } } @@ -406,7 +402,6 @@ PageType { QuestionDrawer { id: questionDrawer - parent: root } } } diff --git a/client/ui/qml/Pages2/PageProtocolRaw.qml b/client/ui/qml/Pages2/PageProtocolRaw.qml index accfd0bd..f3621d96 100644 --- a/client/ui/qml/Pages2/PageProtocolRaw.qml +++ b/client/ui/qml/Pages2/PageProtocolRaw.qml @@ -90,19 +90,15 @@ PageType { DividerType {} - Drawer2Type { + DrawerType { id: configContentDrawer - parent: root width: parent.width - height: parent.height - contentHeight: parent.height * 0.9 + height: parent.height * 0.9 BackButtonType { id: backButton - parent: configContentDrawer.contentParent - anchors.top: parent.top anchors.left: parent.left anchors.right: parent.right @@ -185,14 +181,14 @@ PageType { questionDrawer.noButtonText = qsTr("Cancel") questionDrawer.yesButtonFunction = function() { - questionDrawer.close() + questionDrawer.visible = false PageController.goToPage(PageEnum.PageDeinstalling) InstallController.removeCurrentlyProcessedContainer() } questionDrawer.noButtonFunction = function() { - questionDrawer.close() + questionDrawer.visible = false } - questionDrawer.open() + questionDrawer.visible = true } MouseArea { @@ -207,7 +203,6 @@ PageType { QuestionDrawer { id: questionDrawer - parent: root } } } diff --git a/client/ui/qml/Pages2/PageProtocolShadowSocksSettings.qml b/client/ui/qml/Pages2/PageProtocolShadowSocksSettings.qml index 75853d1f..2453281f 100644 --- a/client/ui/qml/Pages2/PageProtocolShadowSocksSettings.qml +++ b/client/ui/qml/Pages2/PageProtocolShadowSocksSettings.qml @@ -95,8 +95,6 @@ PageType { Layout.fillWidth: true Layout.topMargin: 20 - drawerParent: root - descriptionText: qsTr("Cipher") headerText: qsTr("Cipher") diff --git a/client/ui/qml/Pages2/PageServiceDnsSettings.qml b/client/ui/qml/Pages2/PageServiceDnsSettings.qml index 9ad3b289..10fe6f56 100644 --- a/client/ui/qml/Pages2/PageServiceDnsSettings.qml +++ b/client/ui/qml/Pages2/PageServiceDnsSettings.qml @@ -68,14 +68,14 @@ PageType { questionDrawer.noButtonText = qsTr("Cancel") questionDrawer.yesButtonFunction = function() { - questionDrawer.close() + questionDrawer.visible = false PageController.goToPage(PageEnum.PageDeinstalling) InstallController.removeCurrentlyProcessedContainer() } questionDrawer.noButtonFunction = function() { - questionDrawer.close() + questionDrawer.visible = false } - questionDrawer.open() + questionDrawer.visible = true } MouseArea { @@ -89,7 +89,6 @@ PageType { QuestionDrawer { id: questionDrawer - parent: root } } } diff --git a/client/ui/qml/Pages2/PageServiceSftpSettings.qml b/client/ui/qml/Pages2/PageServiceSftpSettings.qml index 1a591268..b12302dd 100644 --- a/client/ui/qml/Pages2/PageServiceSftpSettings.qml +++ b/client/ui/qml/Pages2/PageServiceSftpSettings.qml @@ -253,14 +253,14 @@ PageType { questionDrawer.noButtonText = qsTr("Cancel") questionDrawer.yesButtonFunction = function() { - questionDrawer.close() + questionDrawer.visible = false PageController.goToPage(PageEnum.PageDeinstalling) InstallController.removeCurrentlyProcessedContainer() } questionDrawer.noButtonFunction = function() { - questionDrawer.close() + questionDrawer.visible = false } - questionDrawer.open() + questionDrawer.visible = true } } } @@ -270,7 +270,6 @@ PageType { QuestionDrawer { id: questionDrawer - parent: root } } } diff --git a/client/ui/qml/Pages2/PageServiceTorWebsiteSettings.qml b/client/ui/qml/Pages2/PageServiceTorWebsiteSettings.qml index 9771c4db..3bfa5bb0 100644 --- a/client/ui/qml/Pages2/PageServiceTorWebsiteSettings.qml +++ b/client/ui/qml/Pages2/PageServiceTorWebsiteSettings.qml @@ -131,21 +131,20 @@ PageType { questionDrawer.noButtonText = qsTr("Cancel") questionDrawer.yesButtonFunction = function() { - questionDrawer.close() + questionDrawer.visible = false PageController.goToPage(PageEnum.PageDeinstalling) InstallController.removeCurrentlyProcessedContainer() } questionDrawer.noButtonFunction = function() { - questionDrawer.close() + questionDrawer.visible = false } - questionDrawer.open() + questionDrawer.visible = true } } } QuestionDrawer { id: questionDrawer - parent: root } } } diff --git a/client/ui/qml/Pages2/PageSettingsApplication.qml b/client/ui/qml/Pages2/PageSettingsApplication.qml index 31f59438..05e468f0 100644 --- a/client/ui/qml/Pages2/PageSettingsApplication.qml +++ b/client/ui/qml/Pages2/PageSettingsApplication.qml @@ -119,7 +119,6 @@ PageType { SelectLanguageDrawer { id: selectLanguageDrawer - parent: root } @@ -152,14 +151,14 @@ PageType { questionDrawer.noButtonText = qsTr("Cancel") questionDrawer.yesButtonFunction = function() { - questionDrawer.close() + questionDrawer.visible = false SettingsController.clearSettings() PageController.replaceStartPage() } questionDrawer.noButtonFunction = function() { - questionDrawer.close() + questionDrawer.visible = false } - questionDrawer.open() + questionDrawer.visible = true } } @@ -167,7 +166,6 @@ PageType { QuestionDrawer { id: questionDrawer - parent: root } } } diff --git a/client/ui/qml/Pages2/PageSettingsBackup.qml b/client/ui/qml/Pages2/PageSettingsBackup.qml index eabf1f48..81be0465 100644 --- a/client/ui/qml/Pages2/PageSettingsBackup.qml +++ b/client/ui/qml/Pages2/PageSettingsBackup.qml @@ -139,19 +139,18 @@ PageType { questionDrawer.noButtonText = qsTr("Cancel") questionDrawer.yesButtonFunction = function() { - questionDrawer.close() + questionDrawer.visible = false PageController.showBusyIndicator(true) SettingsController.restoreAppConfig(filePath) PageController.showBusyIndicator(false) } questionDrawer.noButtonFunction = function() { - questionDrawer.close() + questionDrawer.visible = false } - questionDrawer.open() + questionDrawer.visible = true } QuestionDrawer { id: questionDrawer - parent: root } } diff --git a/client/ui/qml/Pages2/PageSettingsDns.qml b/client/ui/qml/Pages2/PageSettingsDns.qml index 8afb9bcc..5670464f 100644 --- a/client/ui/qml/Pages2/PageSettingsDns.qml +++ b/client/ui/qml/Pages2/PageSettingsDns.qml @@ -92,7 +92,7 @@ PageType { questionDrawer.noButtonText = qsTr("Cancel") questionDrawer.yesButtonFunction = function() { - questionDrawer.close() + questionDrawer.visible = false SettingsController.primaryDns = "1.1.1.1" primaryDns.textFieldText = SettingsController.primaryDns SettingsController.secondaryDns = "1.0.0.1" @@ -100,9 +100,9 @@ PageType { PageController.showNotificationMessage(qsTr("Settings have been reset")) } questionDrawer.noButtonFunction = function() { - questionDrawer.close() + questionDrawer.visible = false } - questionDrawer.open() + questionDrawer.visible = true } } @@ -124,7 +124,6 @@ PageType { } QuestionDrawer { id: questionDrawer - parent: root } } } diff --git a/client/ui/qml/Pages2/PageSettingsLogging.qml b/client/ui/qml/Pages2/PageSettingsLogging.qml index d282d0f0..840c41d4 100644 --- a/client/ui/qml/Pages2/PageSettingsLogging.qml +++ b/client/ui/qml/Pages2/PageSettingsLogging.qml @@ -147,16 +147,16 @@ PageType { questionDrawer.noButtonText = qsTr("Cancel") questionDrawer.yesButtonFunction = function() { - questionDrawer.close() + questionDrawer.visible = false PageController.showBusyIndicator(true) SettingsController.clearLogs() PageController.showBusyIndicator(false) PageController.showNotificationMessage(qsTr("Logs have been cleaned up")) } questionDrawer.noButtonFunction = function() { - questionDrawer.close() + questionDrawer.visible = false } - questionDrawer.open() + questionDrawer.visible = true } } @@ -172,7 +172,6 @@ PageType { QuestionDrawer { id: questionDrawer - parent: root } } } diff --git a/client/ui/qml/Pages2/PageSettingsServerData.qml b/client/ui/qml/Pages2/PageSettingsServerData.qml index 09066ccb..3eb07ce9 100644 --- a/client/ui/qml/Pages2/PageSettingsServerData.qml +++ b/client/ui/qml/Pages2/PageSettingsServerData.qml @@ -14,8 +14,6 @@ import "../Components" PageType { id: root - property Item questionDrawerParent - Connections { target: InstallController @@ -96,15 +94,15 @@ PageType { questionDrawer.noButtonText = qsTr("Cancel") questionDrawer.yesButtonFunction = function() { - questionDrawer.close() + questionDrawer.visible = false PageController.showBusyIndicator(true) SettingsController.clearCachedProfiles() PageController.showBusyIndicator(false) } questionDrawer.noButtonFunction = function() { - questionDrawer.close() + questionDrawer.visible = false } - questionDrawer.open() + questionDrawer.visible = true } } @@ -143,7 +141,7 @@ PageType { questionDrawer.noButtonText = qsTr("Cancel") questionDrawer.yesButtonFunction = function() { - questionDrawer.close() + questionDrawer.visible = false PageController.showBusyIndicator(true) if (ServersModel.isDefaultServerCurrentlyProcessed() && ConnectionController.isConnected) { ConnectionController.closeConnection() @@ -152,9 +150,9 @@ PageType { PageController.showBusyIndicator(false) } questionDrawer.noButtonFunction = function() { - questionDrawer.close() + questionDrawer.visible = false } - questionDrawer.open() + questionDrawer.visible = true } } @@ -174,7 +172,7 @@ PageType { questionDrawer.noButtonText = qsTr("Cancel") questionDrawer.yesButtonFunction = function() { - questionDrawer.close() + questionDrawer.visible = false PageController.goToPage(PageEnum.PageDeinstalling) if (ServersModel.isDefaultServerCurrentlyProcessed() && ConnectionController.isConnected) { ConnectionController.closeConnection() @@ -182,9 +180,9 @@ PageType { InstallController.removeAllContainers() } questionDrawer.noButtonFunction = function() { - questionDrawer.close() + questionDrawer.visible = false } - questionDrawer.open() + questionDrawer.visible = true } } @@ -194,10 +192,6 @@ PageType { QuestionDrawer { id: questionDrawer - - drawerHeight: 0.5 - - parent: questionDrawerParent } } } diff --git a/client/ui/qml/Pages2/PageSettingsServerInfo.qml b/client/ui/qml/Pages2/PageSettingsServerInfo.qml index e14c6ab5..e2e7868c 100644 --- a/client/ui/qml/Pages2/PageSettingsServerInfo.qml +++ b/client/ui/qml/Pages2/PageSettingsServerInfo.qml @@ -71,17 +71,15 @@ PageType { } actionButtonFunction: function() { - serverNameEditDrawer.open() + serverNameEditDrawer.visible = true } } - Drawer2Type { + DrawerType { id: serverNameEditDrawer - parent: root width: root.width - height: root.height // * 0.35 - contentHeight: root.height * 0.35 + height: root.height * 0.35 onVisibleChanged: { if (serverNameEditDrawer.visible) { @@ -90,8 +88,6 @@ PageType { } ColumnLayout { - parent: serverNameEditDrawer.contentParent - anchors.top: parent.top anchors.left: parent.left anchors.right: parent.right @@ -99,7 +95,6 @@ PageType { anchors.leftMargin: 16 anchors.rightMargin: 16 - TextFieldWithHeaderType { id: serverName @@ -169,7 +164,6 @@ PageType { } PageSettingsServerData { stackView: root.stackView - questionDrawerParent: root } } } diff --git a/client/ui/qml/Pages2/PageSettingsServerProtocol.qml b/client/ui/qml/Pages2/PageSettingsServerProtocol.qml index a518167c..30758da4 100644 --- a/client/ui/qml/Pages2/PageSettingsServerProtocol.qml +++ b/client/ui/qml/Pages2/PageSettingsServerProtocol.qml @@ -119,14 +119,14 @@ PageType { questionDrawer.noButtonText = qsTr("Cancel") questionDrawer.yesButtonFunction = function() { - questionDrawer.close() + questionDrawer.visible = false PageController.goToPage(PageEnum.PageDeinstalling) InstallController.removeCurrentlyProcessedContainer() } questionDrawer.noButtonFunction = function() { - questionDrawer.close() + questionDrawer.visible = false } - questionDrawer.open() + questionDrawer.visible = true } MouseArea { @@ -141,7 +141,6 @@ PageType { QuestionDrawer { id: questionDrawer - parent: root } } } diff --git a/client/ui/qml/Pages2/PageSettingsSplitTunneling.qml b/client/ui/qml/Pages2/PageSettingsSplitTunneling.qml index 7811e2bb..cc4973f1 100644 --- a/client/ui/qml/Pages2/PageSettingsSplitTunneling.qml +++ b/client/ui/qml/Pages2/PageSettingsSplitTunneling.qml @@ -116,8 +116,6 @@ PageType { DropDownType { id: selector - drawerParent: root - Layout.fillWidth: true Layout.topMargin: 32 Layout.leftMargin: 16 @@ -210,13 +208,13 @@ PageType { questionDrawer.noButtonText = qsTr("Cancel") questionDrawer.yesButtonFunction = function() { - questionDrawer.close() + questionDrawer.visible = false SitesController.removeSite(index) } questionDrawer.noButtonFunction = function() { - questionDrawer.close() + questionDrawer.visible = false } - questionDrawer.open() + questionDrawer.visible = true } } @@ -224,7 +222,6 @@ PageType { QuestionDrawer { id: questionDrawer - parent: root } } } @@ -279,18 +276,13 @@ PageType { } } - Drawer2Type { + DrawerType { id: moreActionsDrawer width: parent.width - height: parent.height - contentHeight: parent.height * 0.4375 - - parent: root + height: parent.height * 0.4375 FlickableType { - parent: moreActionsDrawer.contentParent - anchors.fill: parent contentHeight: moreActionsDrawerContent.height ColumnLayout { @@ -349,20 +341,15 @@ PageType { } } - Drawer2Type { + DrawerType { id: importSitesDrawer width: parent.width - height: parent.height - contentHeight: parent.height * 0.4375 - - parent: root + height: parent.height * 0.4375 BackButtonType { id: importSitesDrawerBackButton - parent: importSitesDrawer.contentParent - anchors.top: parent.top anchors.left: parent.left anchors.right: parent.right @@ -374,8 +361,6 @@ PageType { } FlickableType { - parent: importSitesDrawer.contentParent - anchors.top: importSitesDrawerBackButton.bottom anchors.left: parent.left anchors.right: parent.right diff --git a/client/ui/qml/Pages2/PageSetupWizardProtocolSettings.qml b/client/ui/qml/Pages2/PageSetupWizardProtocolSettings.qml index 86d3c1fd..7698c755 100644 --- a/client/ui/qml/Pages2/PageSetupWizardProtocolSettings.qml +++ b/client/ui/qml/Pages2/PageSetupWizardProtocolSettings.qml @@ -97,20 +97,15 @@ PageType { } } - Drawer2Type { + DrawerType { id: showDetailsDrawer width: parent.width - height: parent.height - contentHeight: parent.height * 0.9 - - parent: root + height: parent.height * 0.9 BackButtonType { id: showDetailsBackButton - parent: showDetailsDrawer.contentParent - anchors.top: parent.top anchors.left: parent.left anchors.right: parent.right @@ -122,8 +117,6 @@ PageType { } FlickableType { - parent: showDetailsDrawer.contentParent - anchors.top: showDetailsBackButton.bottom anchors.left: parent.left anchors.right: parent.right diff --git a/client/ui/qml/Pages2/PageSetupWizardStart.qml b/client/ui/qml/Pages2/PageSetupWizardStart.qml index 059aedab..ba78c985 100644 --- a/client/ui/qml/Pages2/PageSetupWizardStart.qml +++ b/client/ui/qml/Pages2/PageSetupWizardStart.qml @@ -115,7 +115,7 @@ PageType { text: qsTr("I have the data to connect") onClicked: { - connectionTypeSelection.open() + connectionTypeSelection.visible = true } } @@ -140,7 +140,6 @@ PageType { ConnectionTypeSelectionDrawer { id: connectionTypeSelection - parent: root } } diff --git a/client/ui/qml/Pages2/PageShare.qml b/client/ui/qml/Pages2/PageShare.qml index 5e97cb42..25aad3de 100644 --- a/client/ui/qml/Pages2/PageShare.qml +++ b/client/ui/qml/Pages2/PageShare.qml @@ -179,8 +179,6 @@ PageType { DropDownType { id: serverSelector - drawerParent: root - signal severSelectorIndexChanged property int currentIndex: 0 @@ -243,8 +241,6 @@ PageType { DropDownType { id: protocolSelector - drawerParent: root - visible: accessTypeSelector.currentIndex === 0 Layout.fillWidth: true @@ -334,8 +330,6 @@ PageType { DropDownType { id: exportTypeSelector - drawerParent: root - property int currentIndex: 0 Layout.fillWidth: true @@ -377,7 +371,6 @@ PageType { ShareConnectionDrawer { id: shareConnectionDrawer - parent: root } BasicButtonType { diff --git a/client/ui/qml/Pages2/PageStart.qml b/client/ui/qml/Pages2/PageStart.qml index 65c351bf..ab02ace4 100644 --- a/client/ui/qml/Pages2/PageStart.qml +++ b/client/ui/qml/Pages2/PageStart.qml @@ -135,8 +135,6 @@ PageType { var pagePath = PageController.getPagePath(PageEnum.PageHome) ServersModel.currentlyProcessedIndex = ServersModel.defaultIndex tabBarStackView.push(pagePath, { "objectName" : pagePath }) - - connectionTypeSelection.parent = tabBarStackView } // onWidthChanged: { @@ -176,12 +174,6 @@ PageType { strokeColor: "#2C2D30" fillColor: "#1C1D21" } - - MouseArea { - id: noPropagateMouseEvent - anchors.fill: parent - enabled: true - } } TabImageButtonType { @@ -252,9 +244,7 @@ PageType { ConnectionTypeSelectionDrawer { id: connectionTypeSelection - z: 1 - - onDrawerClosed: { + onAboutToHide: { tabBar.setCurrentIndex(tabBar.previousIndex) } } From 99214e22e30c630aafa3a3e59c4b5444ac7c7abb Mon Sep 17 00:00:00 2001 From: pokamest Date: Sat, 21 Oct 2023 16:05:09 +0100 Subject: [PATCH 102/108] Fix docs url --- client/ui/qml/Pages2/PageSetupWizardStart.qml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/ui/qml/Pages2/PageSetupWizardStart.qml b/client/ui/qml/Pages2/PageSetupWizardStart.qml index ba78c985..994ec200 100644 --- a/client/ui/qml/Pages2/PageSetupWizardStart.qml +++ b/client/ui/qml/Pages2/PageSetupWizardStart.qml @@ -134,7 +134,7 @@ PageType { text: qsTr("I have nothing") - onClicked: Qt.openUrlExternally("https://ru-docs.amnezia.org/guides/hosting-instructions") + onClicked: Qt.openUrlExternally("https://amnezia.org/instructions/0_starter-guide") } } From e16a1100d8bc2f762d14e24de9800e20eeeac53b Mon Sep 17 00:00:00 2001 From: pokamest Date: Sat, 21 Oct 2023 16:20:57 +0100 Subject: [PATCH 103/108] Update amneziavpn_ru.ts --- client/translations/amneziavpn_ru.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/client/translations/amneziavpn_ru.ts b/client/translations/amneziavpn_ru.ts index 281e4edb..eb19ad82 100644 --- a/client/translations/amneziavpn_ru.ts +++ b/client/translations/amneziavpn_ru.ts @@ -2571,9 +2571,9 @@ OpenVPN обеспечивает безопасное VPN-соединение Cloak защищает OpenVPN от обнаружения и блокировок. -Cloak может изменять метаданные пакетов. Он полностью маскирует VPN-трафик под обычный веб-трафик, а также защищает VPN от обнаружения с помощью Active Probing. Это делает ее очень устойчивой к обнаружению +Cloak может изменять метаданные пакетов. Он полностью маскирует VPN-трафик под обычный веб-трафик, а также защищает VPN от обнаружения с помощью Active Probing. Это делает его очень устойчивым к обнаружению -Сразу же после получения первого пакета данных Cloak проверяет подлинность входящего соединения. Если аутентификация не проходит, плагин маскирует сервер под поддельный сайт, и ваша VPN становится невидимой для аналитических систем. +Сразу же после получения первого пакета данных Cloak проверяет подлинность входящего соединения. Если аутентификация не проходит, плагин маскирует сервер под поддельный сайт, и ваш VPN становится невидимым для аналитических систем. Если в вашем регионе существует экстремальный уровень цензуры в Интернете, мы советуем вам при первом подключении использовать только OpenVPN через Cloak From 7a54dc15da5070e744d9d9be0cc9bc72d4790e52 Mon Sep 17 00:00:00 2001 From: pokamest Date: Sat, 21 Oct 2023 16:33:21 +0100 Subject: [PATCH 104/108] Update amneziavpn_ru.ts --- client/translations/amneziavpn_ru.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/client/translations/amneziavpn_ru.ts b/client/translations/amneziavpn_ru.ts index eb19ad82..83cab7ae 100644 --- a/client/translations/amneziavpn_ru.ts +++ b/client/translations/amneziavpn_ru.ts @@ -404,7 +404,7 @@ Already installed containers were found on the server. All installed containers VPN Addresses Subnet - VPN Адреса Подсеть + Подсеть для VPN @@ -1132,7 +1132,7 @@ Already installed containers were found on the server. All installed containers Connection - Подключение + Соединение @@ -1278,7 +1278,7 @@ Already installed containers were found on the server. All installed containers Save logs to file - Сохранять логи в файл + Сохранить логи в файл From 0bb4dd94423bc8bc2a58e980fb0af31340e76c72 Mon Sep 17 00:00:00 2001 From: pokamest Date: Sat, 21 Oct 2023 18:32:30 +0100 Subject: [PATCH 105/108] Text and translations fixes --- client/translations/amneziavpn_ru.ts | 62 ++++++++++++------- client/translations/amneziavpn_zh_CN.ts | 58 +++++++++++------ .../ui/qml/Pages2/PageProtocolAwgSettings.qml | 2 +- .../Pages2/PageProtocolOpenVpnSettings.qml | 2 +- client/ui/qml/Pages2/PageProtocolRaw.qml | 2 +- .../qml/Pages2/PageSettingsServerProtocol.qml | 2 +- client/ui/qml/Pages2/PageShare.qml | 6 +- 7 files changed, 85 insertions(+), 49 deletions(-) diff --git a/client/translations/amneziavpn_ru.ts b/client/translations/amneziavpn_ru.ts index 83cab7ae..f4ef9c0f 100644 --- a/client/translations/amneziavpn_ru.ts +++ b/client/translations/amneziavpn_ru.ts @@ -120,7 +120,7 @@ Unable change protocol while there is an active connection - + Невозможно изменить протокол при активном соединении @@ -274,7 +274,7 @@ Already installed containers were found on the server. All installed containers Unable change server while there is an active connection - + Невозможно изменить сервер при активном соединении @@ -346,9 +346,13 @@ Already installed containers were found on the server. All installed containers - All users who you shared a connection with will no longer be able to connect to it. + All users with whom you shared a connection will no longer be able to connect to it. Все пользователи, с которыми вы поделились этим VPN-протоколом, больше не смогут к нему подключаться. + + All users who you shared a connection with will no longer be able to connect to it. + Все пользователи, с которыми вы поделились этим VPN-протоколом, больше не смогут к нему подключаться. + Continue @@ -571,9 +575,13 @@ Already installed containers were found on the server. All installed containers - All users who you shared a connection with will no longer be able to connect to it. + All users with whom you shared a connection will no longer be able to connect to it. Все пользователи, с которыми вы поделились этим VPN-протоколом, больше не смогут к нему подключаться. + + All users who you shared a connection with will no longer be able to connect to it. + Все пользователи, с которыми вы поделились этим VPN-протоколом, больше не смогут к нему подключаться. + Continue @@ -619,8 +627,12 @@ Already installed containers were found on the server. All installed containers + All users with whom you shared a connection will no longer be able to connect to it. + Все пользователи, с которыми вы поделились этим VPN-протоколом, больше не смогут к нему подключаться. + + All users who you shared a connection with will no longer be able to connect to it. - Все пользователи, с которыми вы поделились этим VPN-протоколом, больше не смогут к нему подключаться. + Все пользователи, с которыми вы поделились этим VPN-протоколом, больше не смогут к нему подключаться. @@ -1440,8 +1452,12 @@ Already installed containers were found on the server. All installed containers + All users with whom you shared a connection will no longer be able to connect to it. + Все пользователи, с которыми вы поделились этим VPN-протоколом, больше не смогут к нему подключаться. + + All users who you shared a connection with will no longer be able to connect to it. - Все пользователи, которым вы поделились VPN, больше не смогут к нему подключаться. + Все пользователи, которым вы поделились VPN, больше не смогут к нему подключаться. @@ -1884,9 +1900,8 @@ and will not be shared or disclosed to the Amnezia or any third parties WireGuard нативный формат - VPN Access - VPN-Доступ + VPN-Доступ @@ -1894,14 +1909,12 @@ and will not be shared or disclosed to the Amnezia or any third parties Соединение - VPN access without the ability to manage the server - Доступ к VPN, без возможности управления сервером + Доступ к VPN, без возможности управления сервером - Access to server management. The user with whom you share full access to the connection will be able to add and remove your protocols and services to the server, as well as change settings. - Доступ к управлению сервером. Пользователь, с которым вы делитесь полным доступом к соединению, сможет добавлять и удалять ваши протоколы и службы на сервере, а также изменять настройки. + Доступ к управлению сервером. Пользователь, с которым вы делитесь полным доступом к соединению, сможет добавлять и удалять ваши протоколы и службы на сервере, а также изменять настройки. @@ -1944,11 +1957,26 @@ and will not be shared or disclosed to the Amnezia or any third parties For the AmneziaVPN app Для AmneziaVPN + + + Share VPN Access + Поделиться VPN + Full access Полный доступ + + + Share VPN access without the ability to manage the server + Поделиться доступом к VPN, без возможности управления сервером + + + + Share access to server management. The user with whom you share full access to the server will be able to add and remove any protocols and services to the server, as well as change settings. + Поделиться доступом к управлению сервером. Пользователь, с которым вы делитесь полным доступом к серверу, сможет добавлять и удалять любые протоколы и службы на сервере, а также изменять настройки. + @@ -2700,16 +2728,6 @@ This means that AmneziaWG keeps the fast performance of the original while addin error 0x%1: %2 error 0x%1: %2 - - - WireGuard Configuration Highlighter - - - - - &Randomize colors - - SelectLanguageDrawer diff --git a/client/translations/amneziavpn_zh_CN.ts b/client/translations/amneziavpn_zh_CN.ts index 8e31af68..c711b3fc 100644 --- a/client/translations/amneziavpn_zh_CN.ts +++ b/client/translations/amneziavpn_zh_CN.ts @@ -131,7 +131,7 @@ Unable change protocol while there is an active connection - 已建立连接时无法更改服务器配置 + 已建立连接时无法更改服务器配置 @@ -380,8 +380,12 @@ Already installed containers were found on the server. All installed containers + All users with whom you shared a connection will no longer be able to connect to it. + 与您共享连接的所有用户将无法再连接到该连接。 + + All users who you shared a connection with will no longer be able to connect to it. - 使用此共享连接的所有用户,将无法再连接它。 + 使用此共享连接的所有用户,将无法再连接它。 @@ -605,8 +609,12 @@ Already installed containers were found on the server. All installed containers + All users with whom you shared a connection will no longer be able to connect to it. + 与您共享连接的所有用户将无法再连接到该连接。 + + All users who you shared a connection with will no longer be able to connect to it. - 使用此共享连接的所有用户,将无法再连接它。 + 使用此共享连接的所有用户,将无法再连接它。 All users with whom you shared a connection will no longer be able to connect to it @@ -661,8 +669,12 @@ Already installed containers were found on the server. All installed containers + All users with whom you shared a connection will no longer be able to connect to it. + 与您共享连接的所有用户将无法再连接到该连接。 + + All users who you shared a connection with will no longer be able to connect to it. - 使用此共享连接的所有用户,将无法再连接它。 + 使用此共享连接的所有用户,将无法再连接它。 from server? @@ -1521,8 +1533,12 @@ And if you don't like the app, all the more support it - the donation will + All users with whom you shared a connection will no longer be able to connect to it. + 与您共享连接的所有用户将无法再连接到该连接。 + + All users who you shared a connection with will no longer be able to connect to it. - 使用此共享连接的所有用户,将无法再连接它。 + 使用此共享连接的所有用户,将无法再连接它。 from server? @@ -2006,8 +2022,22 @@ and will not be shared or disclosed to the Amnezia or any third parties + Share VPN Access + 共享 VPN 访问 + + + + Share VPN access without the ability to manage the server + 共享 VPN 访问,无需管理服务器 + + + + Share access to server management. The user with whom you share full access to the server will be able to add and remove any protocols and services to the server, as well as change settings. + 共享服务器管理访问权限。与您共享服务器全部访问权限的用户将可以添加和删除服务器上的任何协议和服务,以及更改设置。 + + VPN Access - 访问VPN + 访问VPN @@ -2020,14 +2050,12 @@ and will not be shared or disclosed to the Amnezia or any third parties 完全访问 - VPN access without the ability to manage the server - 访问VPN,但没有权限管理服务。 + 访问VPN,但没有权限管理服务。 - Access to server management. The user with whom you share full access to the connection will be able to add and remove your protocols and services to the server, as well as change settings. - 除访问VPN外,用户还能添加和删除协议、服务以及更改配置信息 + 除访问VPN外,用户还能添加和删除协议、服务以及更改配置信息 Access to server management. The user with whom you share full access to the connection will be able to add and remove your protocols and services to the servers, as well as change settings. @@ -2839,16 +2867,6 @@ While it offers a blend of security, stability, and speed, it's essential t error 0x%1: %2 错误 0x%1: %2 - - - WireGuard Configuration Highlighter - - - - - &Randomize colors - - SelectLanguageDrawer diff --git a/client/ui/qml/Pages2/PageProtocolAwgSettings.qml b/client/ui/qml/Pages2/PageProtocolAwgSettings.qml index 079c85a1..237a8b46 100644 --- a/client/ui/qml/Pages2/PageProtocolAwgSettings.qml +++ b/client/ui/qml/Pages2/PageProtocolAwgSettings.qml @@ -276,7 +276,7 @@ PageType { onClicked: { questionDrawer.headerText = qsTr("Remove AmneziaWG from server?") - questionDrawer.descriptionText = qsTr("All users who you shared a connection with will no longer be able to connect to it.") + questionDrawer.descriptionText = qsTr("All users with whom you shared a connection will no longer be able to connect to it.") questionDrawer.yesButtonText = qsTr("Continue") questionDrawer.noButtonText = qsTr("Cancel") diff --git a/client/ui/qml/Pages2/PageProtocolOpenVpnSettings.qml b/client/ui/qml/Pages2/PageProtocolOpenVpnSettings.qml index cd2dd51d..55cdcf04 100644 --- a/client/ui/qml/Pages2/PageProtocolOpenVpnSettings.qml +++ b/client/ui/qml/Pages2/PageProtocolOpenVpnSettings.qml @@ -365,7 +365,7 @@ PageType { onClicked: { questionDrawer.headerText = qsTr("Remove OpenVpn from server?") - questionDrawer.descriptionText = qsTr("All users who you shared a connection with will no longer be able to connect to it.") + questionDrawer.descriptionText = qsTr("All users with whom you shared a connection will no longer be able to connect to it.") questionDrawer.yesButtonText = qsTr("Continue") questionDrawer.noButtonText = qsTr("Cancel") diff --git a/client/ui/qml/Pages2/PageProtocolRaw.qml b/client/ui/qml/Pages2/PageProtocolRaw.qml index f3621d96..967b605b 100644 --- a/client/ui/qml/Pages2/PageProtocolRaw.qml +++ b/client/ui/qml/Pages2/PageProtocolRaw.qml @@ -176,7 +176,7 @@ PageType { clickedFunction: function() { questionDrawer.headerText = qsTr("Remove %1 from server?").arg(ContainersModel.getCurrentlyProcessedContainerName()) - questionDrawer.descriptionText = qsTr("All users who you shared a connection with will no longer be able to connect to it.") + questionDrawer.descriptionText = qsTr("All users with whom you shared a connection will no longer be able to connect to it.") questionDrawer.yesButtonText = qsTr("Continue") questionDrawer.noButtonText = qsTr("Cancel") diff --git a/client/ui/qml/Pages2/PageSettingsServerProtocol.qml b/client/ui/qml/Pages2/PageSettingsServerProtocol.qml index 30758da4..a961cf56 100644 --- a/client/ui/qml/Pages2/PageSettingsServerProtocol.qml +++ b/client/ui/qml/Pages2/PageSettingsServerProtocol.qml @@ -114,7 +114,7 @@ PageType { clickedFunction: function() { questionDrawer.headerText = qsTr("Remove %1 from server?").arg(ContainersModel.getCurrentlyProcessedContainerName()) - questionDrawer.descriptionText = qsTr("All users who you shared a connection with will no longer be able to connect to it.") + questionDrawer.descriptionText = qsTr("All users with whom you shared a connection will no longer be able to connect to it.") questionDrawer.yesButtonText = qsTr("Continue") questionDrawer.noButtonText = qsTr("Cancel") diff --git a/client/ui/qml/Pages2/PageShare.qml b/client/ui/qml/Pages2/PageShare.qml index 25aad3de..ced7a5ff 100644 --- a/client/ui/qml/Pages2/PageShare.qml +++ b/client/ui/qml/Pages2/PageShare.qml @@ -118,7 +118,7 @@ PageType { Layout.fillWidth: true Layout.topMargin: 24 - headerText: qsTr("VPN Access") + headerText: qsTr("Share VPN Access") } Rectangle { @@ -171,8 +171,8 @@ PageType { Layout.topMargin: 24 Layout.bottomMargin: 24 - text: accessTypeSelector.currentIndex === 0 ? qsTr("VPN access without the ability to manage the server") : - qsTr("Access to server management. The user with whom you share full access to the connection will be able to add and remove your protocols and services to the server, as well as change settings.") + text: accessTypeSelector.currentIndex === 0 ? qsTr("Share VPN access without the ability to manage the server") : + qsTr("Share access to server management. The user with whom you share full access to the server will be able to add and remove any protocols and services to the server, as well as change settings.") color: "#878B91" } From 994aa327455c462a1c985b625a1f8d5f60fb7f92 Mon Sep 17 00:00:00 2001 From: "vladimir.kuznetsov" Date: Sun, 22 Oct 2023 17:31:13 +0500 Subject: [PATCH 106/108] added getting awg parameters when adding an already installed awg container --- client/configurators/awg_configurator.cpp | 4 +-- client/core/servercontroller.cpp | 28 +++++++++++++++++++ client/translations/amneziavpn_ru.ts | 10 +++++++ client/translations/amneziavpn_zh_CN.ts | 10 +++++++ client/ui/models/containers_model.cpp | 3 +- client/ui/models/containers_model.h | 2 +- .../qml/Pages2/PageSetupWizardInstalling.qml | 2 +- 7 files changed, 54 insertions(+), 5 deletions(-) diff --git a/client/configurators/awg_configurator.cpp b/client/configurators/awg_configurator.cpp index 8962067a..2bf03359 100644 --- a/client/configurators/awg_configurator.cpp +++ b/client/configurators/awg_configurator.cpp @@ -16,8 +16,6 @@ QString AwgConfigurator::genAwgConfig(const ServerCredentials &credentials, { QString config = WireguardConfigurator::genWireguardConfig(credentials, container, containerConfig, errorCode); - QJsonObject jsonConfig = QJsonDocument::fromJson(config.toUtf8()).object(); - ServerController serverController(m_settings); QString serverConfig = serverController.getTextFileFromContainer(container, credentials, protocols::awg::serverConfigPath, errorCode); @@ -45,6 +43,8 @@ QString AwgConfigurator::genAwgConfig(const ServerCredentials &credentials, config.replace("$UNDERLOAD_PACKET_MAGIC_HEADER", serverConfigMap.value(config_key::underloadPacketMagicHeader)); config.replace("$TRANSPORT_PACKET_MAGIC_HEADER", serverConfigMap.value(config_key::transportPacketMagicHeader)); + QJsonObject jsonConfig = QJsonDocument::fromJson(config.toUtf8()).object(); + jsonConfig[config_key::junkPacketCount] = serverConfigMap.value(config_key::junkPacketCount); jsonConfig[config_key::junkPacketMinSize] = serverConfigMap.value(config_key::junkPacketMinSize); jsonConfig[config_key::junkPacketMaxSize] = serverConfigMap.value(config_key::junkPacketMaxSize); diff --git a/client/core/servercontroller.cpp b/client/core/servercontroller.cpp index 443cd5a3..da76e1ff 100644 --- a/client/core/servercontroller.cpp +++ b/client/core/servercontroller.cpp @@ -834,6 +834,34 @@ ErrorCode ServerController::getAlreadyInstalledContainers(const ServerCredential containerConfig.insert(config_key::port, port); containerConfig.insert(config_key::transport_proto, transportProto); + if (protocol == Proto::Awg) { + QString serverConfig = getTextFileFromContainer(container, credentials, protocols::awg::serverConfigPath, &errorCode); + + QMap serverConfigMap; + auto serverConfigLines = serverConfig.split("\n"); + for (auto &line : serverConfigLines) { + auto trimmedLine = line.trimmed(); + if (trimmedLine.startsWith("[") && trimmedLine.endsWith("]")) { + continue; + } else { + QStringList parts = trimmedLine.split(" = "); + if (parts.count() == 2) { + serverConfigMap.insert(parts[0].trimmed(), parts[1].trimmed()); + } + } + } + + containerConfig[config_key::junkPacketCount] = serverConfigMap.value(config_key::junkPacketCount); + containerConfig[config_key::junkPacketMinSize] = serverConfigMap.value(config_key::junkPacketMinSize); + containerConfig[config_key::junkPacketMaxSize] = serverConfigMap.value(config_key::junkPacketMaxSize); + containerConfig[config_key::initPacketJunkSize] = serverConfigMap.value(config_key::initPacketJunkSize); + containerConfig[config_key::responsePacketJunkSize] = serverConfigMap.value(config_key::responsePacketJunkSize); + containerConfig[config_key::initPacketMagicHeader] = serverConfigMap.value(config_key::initPacketMagicHeader); + containerConfig[config_key::responsePacketMagicHeader] = serverConfigMap.value(config_key::responsePacketMagicHeader); + containerConfig[config_key::underloadPacketMagicHeader] = serverConfigMap.value(config_key::underloadPacketMagicHeader); + containerConfig[config_key::transportPacketMagicHeader] = serverConfigMap.value(config_key::transportPacketMagicHeader); + } + config.insert(config_key::container, ContainerProps::containerToString(container)); } config.insert(ProtocolProps::protoToString(protocol), containerConfig); diff --git a/client/translations/amneziavpn_ru.ts b/client/translations/amneziavpn_ru.ts index f4ef9c0f..316cd076 100644 --- a/client/translations/amneziavpn_ru.ts +++ b/client/translations/amneziavpn_ru.ts @@ -2728,6 +2728,16 @@ This means that AmneziaWG keeps the fast performance of the original while addin error 0x%1: %2 error 0x%1: %2 + + + WireGuard Configuration Highlighter + + + + + &Randomize colors + + SelectLanguageDrawer diff --git a/client/translations/amneziavpn_zh_CN.ts b/client/translations/amneziavpn_zh_CN.ts index c711b3fc..592717ab 100644 --- a/client/translations/amneziavpn_zh_CN.ts +++ b/client/translations/amneziavpn_zh_CN.ts @@ -2867,6 +2867,16 @@ While it offers a blend of security, stability, and speed, it's essential t error 0x%1: %2 错误 0x%1: %2 + + + WireGuard Configuration Highlighter + + + + + &Randomize colors + + SelectLanguageDrawer diff --git a/client/ui/models/containers_model.cpp b/client/ui/models/containers_model.cpp index 780809c5..6a4c0e63 100644 --- a/client/ui/models/containers_model.cpp +++ b/client/ui/models/containers_model.cpp @@ -117,8 +117,9 @@ QString ContainersModel::getDefaultContainerName() return ContainerProps::containerHumanNames().value(m_defaultContainerIndex); } -void ContainersModel::setDefaultContainer(DockerContainer container) +void ContainersModel::setDefaultContainer(int index) { + auto container = static_cast(index); m_settings->setDefaultContainer(m_currentlyProcessedServerIndex, container); m_defaultContainerIndex = container; emit defaultContainerChanged(); diff --git a/client/ui/models/containers_model.h b/client/ui/models/containers_model.h index 4ba85749..997b21e3 100644 --- a/client/ui/models/containers_model.h +++ b/client/ui/models/containers_model.h @@ -46,7 +46,7 @@ public: public slots: DockerContainer getDefaultContainer(); QString getDefaultContainerName(); - void setDefaultContainer(DockerContainer container); + void setDefaultContainer(int index); void setCurrentlyProcessedServerIndex(const int index); diff --git a/client/ui/qml/Pages2/PageSetupWizardInstalling.qml b/client/ui/qml/Pages2/PageSetupWizardInstalling.qml index 50aad294..a223f646 100644 --- a/client/ui/qml/Pages2/PageSetupWizardInstalling.qml +++ b/client/ui/qml/Pages2/PageSetupWizardInstalling.qml @@ -25,7 +25,7 @@ PageType { function onInstallContainerFinished(finishedMessage, isServiceInstall) { if (!ConnectionController.isConnected && !isServiceInstall) { - ContainersModel.setDefaultContainer(ContainersModel.getCurrentlyProcessedContainerIndex) + ContainersModel.setDefaultContainer(ContainersModel.getCurrentlyProcessedContainerIndex()) } PageController.goToStartPage() From 7cfb38307e5533dbaddce6578e926a75430bc6ac Mon Sep 17 00:00:00 2001 From: "vladimir.kuznetsov" Date: Sun, 22 Oct 2023 18:04:34 +0500 Subject: [PATCH 107/108] removed re-processing of server config for awg --- client/configurators/awg_configurator.cpp | 42 ++++++++--------------- 1 file changed, 15 insertions(+), 27 deletions(-) diff --git a/client/configurators/awg_configurator.cpp b/client/configurators/awg_configurator.cpp index 2bf03359..c3e42258 100644 --- a/client/configurators/awg_configurator.cpp +++ b/client/configurators/awg_configurator.cpp @@ -16,44 +16,32 @@ QString AwgConfigurator::genAwgConfig(const ServerCredentials &credentials, { QString config = WireguardConfigurator::genWireguardConfig(credentials, container, containerConfig, errorCode); - ServerController serverController(m_settings); - QString serverConfig = serverController.getTextFileFromContainer(container, credentials, protocols::awg::serverConfigPath, errorCode); + QJsonObject jsonConfig = QJsonDocument::fromJson(config.toUtf8()).object(); + QString awgConfig = jsonConfig.value(config_key::config).toString(); - QMap serverConfigMap; - auto serverConfigLines = serverConfig.split("\n"); - for (auto &line : serverConfigLines) { + QMap configMap; + auto configLines = awgConfig.split("\n"); + for (auto &line : configLines) { auto trimmedLine = line.trimmed(); if (trimmedLine.startsWith("[") && trimmedLine.endsWith("]")) { continue; } else { QStringList parts = trimmedLine.split(" = "); if (parts.count() == 2) { - serverConfigMap.insert(parts[0].trimmed(), parts[1].trimmed()); + configMap.insert(parts[0].trimmed(), parts[1].trimmed()); } } } - config.replace("$JUNK_PACKET_COUNT", serverConfigMap.value(config_key::junkPacketCount)); - config.replace("$JUNK_PACKET_MIN_SIZE", serverConfigMap.value(config_key::junkPacketMinSize)); - config.replace("$JUNK_PACKET_MAX_SIZE", serverConfigMap.value(config_key::junkPacketMaxSize)); - config.replace("$INIT_PACKET_JUNK_SIZE", serverConfigMap.value(config_key::initPacketJunkSize)); - config.replace("$RESPONSE_PACKET_JUNK_SIZE", serverConfigMap.value(config_key::responsePacketJunkSize)); - config.replace("$INIT_PACKET_MAGIC_HEADER", serverConfigMap.value(config_key::initPacketMagicHeader)); - config.replace("$RESPONSE_PACKET_MAGIC_HEADER", serverConfigMap.value(config_key::responsePacketMagicHeader)); - config.replace("$UNDERLOAD_PACKET_MAGIC_HEADER", serverConfigMap.value(config_key::underloadPacketMagicHeader)); - config.replace("$TRANSPORT_PACKET_MAGIC_HEADER", serverConfigMap.value(config_key::transportPacketMagicHeader)); - - QJsonObject jsonConfig = QJsonDocument::fromJson(config.toUtf8()).object(); - - jsonConfig[config_key::junkPacketCount] = serverConfigMap.value(config_key::junkPacketCount); - jsonConfig[config_key::junkPacketMinSize] = serverConfigMap.value(config_key::junkPacketMinSize); - jsonConfig[config_key::junkPacketMaxSize] = serverConfigMap.value(config_key::junkPacketMaxSize); - jsonConfig[config_key::initPacketJunkSize] = serverConfigMap.value(config_key::initPacketJunkSize); - jsonConfig[config_key::responsePacketJunkSize] = serverConfigMap.value(config_key::responsePacketJunkSize); - jsonConfig[config_key::initPacketMagicHeader] = serverConfigMap.value(config_key::initPacketMagicHeader); - jsonConfig[config_key::responsePacketMagicHeader] = serverConfigMap.value(config_key::responsePacketMagicHeader); - jsonConfig[config_key::underloadPacketMagicHeader] = serverConfigMap.value(config_key::underloadPacketMagicHeader); - jsonConfig[config_key::transportPacketMagicHeader] = serverConfigMap.value(config_key::transportPacketMagicHeader); + jsonConfig[config_key::junkPacketCount] = configMap.value(config_key::junkPacketCount); + jsonConfig[config_key::junkPacketMinSize] = configMap.value(config_key::junkPacketMinSize); + jsonConfig[config_key::junkPacketMaxSize] = configMap.value(config_key::junkPacketMaxSize); + jsonConfig[config_key::initPacketJunkSize] = configMap.value(config_key::initPacketJunkSize); + jsonConfig[config_key::responsePacketJunkSize] = configMap.value(config_key::responsePacketJunkSize); + jsonConfig[config_key::initPacketMagicHeader] = configMap.value(config_key::initPacketMagicHeader); + jsonConfig[config_key::responsePacketMagicHeader] = configMap.value(config_key::responsePacketMagicHeader); + jsonConfig[config_key::underloadPacketMagicHeader] = configMap.value(config_key::underloadPacketMagicHeader); + jsonConfig[config_key::transportPacketMagicHeader] = configMap.value(config_key::transportPacketMagicHeader); return QJsonDocument(jsonConfig).toJson(); } From 97090888d5b2f10c900464db1120a29bee034967 Mon Sep 17 00:00:00 2001 From: pokamest Date: Sun, 22 Oct 2023 08:11:37 -0700 Subject: [PATCH 108/108] Bump version --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 12fc8dce..2e7be435 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -2,7 +2,7 @@ cmake_minimum_required(VERSION 3.25.0 FATAL_ERROR) set(PROJECT AmneziaVPN) -project(${PROJECT} VERSION 4.0.8.5 +project(${PROJECT} VERSION 4.0.8.6 DESCRIPTION "AmneziaVPN" HOMEPAGE_URL "https://amnezia.org/" )