2021-09-09 20:15:44 +03:00
# include "containers_defs.h"
2024-04-01 20:20:02 +07:00
# include "QJsonObject"
# include "QJsonDocument"
2021-09-09 20:15:44 +03:00
QDebug operator < < ( QDebug debug , const amnezia : : DockerContainer & c )
{
QDebugStateSaver saver ( debug ) ;
2021-09-20 21:51:28 +03:00
debug . nospace ( ) < < ContainerProps : : containerToString ( c ) ;
2021-09-09 20:15:44 +03:00
return debug ;
}
2023-07-31 12:54:59 +09:00
amnezia : : DockerContainer ContainerProps : : containerFromString ( const QString & container )
{
2021-09-20 21:51:28 +03:00
QMetaEnum metaEnum = QMetaEnum : : fromType < DockerContainer > ( ) ;
for ( int i = 0 ; i < metaEnum . keyCount ( ) ; + + i ) {
DockerContainer c = static_cast < DockerContainer > ( i ) ;
2023-07-31 12:54:59 +09:00
if ( container = = containerToString ( c ) )
return c ;
2021-09-20 21:51:28 +03:00
}
2021-09-09 20:15:44 +03:00
return DockerContainer : : None ;
}
2023-07-31 12:54:59 +09:00
QString ContainerProps : : containerToString ( amnezia : : DockerContainer c )
{
if ( c = = DockerContainer : : None )
return " none " ;
if ( c = = DockerContainer : : Cloak )
return " amnezia-openvpn-cloak " ;
2021-09-20 21:51:28 +03:00
QMetaEnum metaEnum = QMetaEnum : : fromType < DockerContainer > ( ) ;
QString containerKey = metaEnum . valueToKey ( static_cast < int > ( c ) ) ;
2021-09-28 02:36:38 +03:00
2021-09-20 21:51:28 +03:00
return " amnezia- " + containerKey . toLower ( ) ;
2021-09-09 20:15:44 +03:00
}
2023-07-31 12:54:59 +09:00
QString ContainerProps : : containerTypeToString ( amnezia : : DockerContainer c )
{
if ( c = = DockerContainer : : None )
return " none " ;
if ( c = = DockerContainer : : Ipsec )
return " ikev2 " ;
2023-02-14 18:02:51 +03:00
QMetaEnum metaEnum = QMetaEnum : : fromType < DockerContainer > ( ) ;
QString containerKey = metaEnum . valueToKey ( static_cast < int > ( c ) ) ;
return containerKey . toLower ( ) ;
}
2021-11-30 16:56:24 +04:00
QVector < amnezia : : Proto > ContainerProps : : protocolsForContainer ( amnezia : : DockerContainer container )
2021-09-09 20:15:44 +03:00
{
switch ( container ) {
2023-07-31 12:54:59 +09:00
case DockerContainer : : None : return { } ;
2021-09-28 02:36:38 +03:00
2023-07-31 12:54:59 +09:00
case DockerContainer : : OpenVpn : return { Proto : : OpenVpn } ;
2021-09-09 20:15:44 +03:00
2023-07-31 12:54:59 +09:00
case DockerContainer : : ShadowSocks : return { Proto : : OpenVpn , Proto : : ShadowSocks } ;
2021-09-09 20:15:44 +03:00
2023-12-22 13:06:42 +07:00
case DockerContainer : : Cloak : return { Proto : : OpenVpn , Proto : : ShadowSocks , Proto : : Cloak } ;
2021-09-09 20:15:44 +03:00
2023-07-31 12:54:59 +09:00
case DockerContainer : : Ipsec : return { Proto : : Ikev2 /*, Protocol::L2tp */ } ;
2021-10-04 19:07:49 +03:00
2024-03-27 11:02:34 +00:00
case DockerContainer : : Xray : return { Proto : : Xray } ;
2024-05-27 16:15:55 +01:00
case DockerContainer : : SSXray : return { Proto : : SSXray } ;
2023-12-08 13:50:03 +07:00
case DockerContainer : : Dns : return { Proto : : Dns } ;
2021-09-24 13:14:35 +03:00
2023-07-31 12:54:59 +09:00
case DockerContainer : : Sftp : return { Proto : : Sftp } ;
2021-11-17 23:42:17 +03:00
2024-06-10 18:35:24 +07:00
case DockerContainer : : Socks5Proxy : return { Proto : : Socks5Proxy } ;
2023-07-31 12:54:59 +09:00
default : return { defaultProtocol ( container ) } ;
2021-09-09 20:15:44 +03:00
}
}
2021-09-20 21:51:28 +03:00
QList < DockerContainer > ContainerProps : : allContainers ( )
2021-09-09 20:15:44 +03:00
{
2021-09-20 21:51:28 +03:00
QMetaEnum metaEnum = QMetaEnum : : fromType < DockerContainer > ( ) ;
QList < DockerContainer > all ;
for ( int i = 0 ; i < metaEnum . keyCount ( ) ; + + i ) {
all . append ( static_cast < DockerContainer > ( i ) ) ;
}
return all ;
2021-09-09 20:15:44 +03:00
}
2021-09-20 21:51:28 +03:00
QMap < DockerContainer , QString > ContainerProps : : containerHumanNames ( )
2021-09-09 20:15:44 +03:00
{
2023-07-31 12:54:59 +09:00
return { { DockerContainer : : None , " Not installed " } ,
{ DockerContainer : : OpenVpn , " OpenVPN " } ,
2024-07-03 12:06:31 +04:00
{ DockerContainer : : ShadowSocks , " OpenVPN over SS " } ,
2023-07-31 12:54:59 +09:00
{ DockerContainer : : Cloak , " OpenVPN over Cloak " } ,
{ DockerContainer : : WireGuard , " WireGuard " } ,
2023-10-09 23:18:24 +05:00
{ DockerContainer : : Awg , " AmneziaWG " } ,
2024-03-27 11:02:34 +00:00
{ DockerContainer : : Xray , " XRay " } ,
2023-07-31 12:54:59 +09:00
{ DockerContainer : : Ipsec , QObject : : tr ( " IPsec " ) } ,
2024-07-27 20:42:11 +03:00
{ DockerContainer : : SSXray , " Shadowsocks " } ,
2023-07-31 12:54:59 +09:00
2023-09-13 16:11:08 +05:00
{ DockerContainer : : TorWebSite , QObject : : tr ( " Website in Tor network " ) } ,
2024-06-19 02:14:22 +03:00
{ DockerContainer : : Dns , QObject : : tr ( " AmneziaDNS " ) } ,
2024-06-19 02:31:04 +03:00
{ DockerContainer : : Sftp , QObject : : tr ( " SFTP file sharing service " ) } ,
2024-06-10 18:35:24 +07:00
{ DockerContainer : : Socks5Proxy , QObject : : tr ( " SOCKS5 proxy server " ) } } ;
2021-09-09 20:15:44 +03:00
}
2021-09-20 21:51:28 +03:00
QMap < DockerContainer , QString > ContainerProps : : containerDescriptions ( )
2023-08-20 13:36:54 +05:00
{
return { { DockerContainer : : OpenVpn ,
QObject : : tr ( " OpenVPN is the most popular VPN protocol, with flexible configuration options. It uses its "
" own security protocol with SSL/TLS for key exchange. " ) } ,
{ DockerContainer : : ShadowSocks ,
2025-02-04 15:53:40 +00:00
QObject : : tr ( " Shadowsocks masks VPN traffic, making it resemble normal web traffic, but it may still be detected by certain analysis systems. " ) } ,
2023-08-20 13:36:54 +05:00
{ DockerContainer : : Cloak ,
QObject : : tr ( " OpenVPN over Cloak - OpenVPN with VPN masquerading as web traffic and protection against "
2025-02-05 23:11:21 +00:00
" active-probing detection. It is very resistant to detection, but offers low speed. " ) } ,
2023-08-20 13:36:54 +05:00
{ DockerContainer : : WireGuard ,
2025-02-04 15:53:40 +00:00
QObject : : tr ( " WireGuard - popular VPN protocol with high performance, high speed and low power "
" consumption. " ) } ,
2023-10-14 18:21:49 +05:00
{ DockerContainer : : Awg ,
2025-02-04 15:53:40 +00:00
QObject : : tr ( " AmneziaWG is a special protocol from Amnezia based on WireGuard. "
2025-02-05 23:11:21 +00:00
" It provides high connection speed and ensures stable operation even in the most challenging network conditions. " ) } ,
2024-03-27 11:02:34 +00:00
{ DockerContainer : : Xray ,
2025-02-04 15:53:40 +00:00
QObject : : tr ( " XRay with REALITY masks VPN traffic as web traffic and protects against active probing. "
2025-02-05 23:11:21 +00:00
" It is highly resistant to detection and offers high speed. " ) } ,
2023-08-20 13:36:54 +05:00
{ DockerContainer : : Ipsec ,
2024-06-19 02:14:22 +03:00
QObject : : tr ( " IKEv2/IPsec - Modern stable protocol, a bit faster than others, restores connection after "
2023-08-20 13:36:54 +05:00
" signal loss. It has native support on the latest versions of Android and iOS. " ) } ,
{ DockerContainer : : TorWebSite , QObject : : tr ( " Deploy a WordPress site on the Tor network in two clicks. " ) } ,
{ DockerContainer : : Dns ,
QObject : : tr ( " Replace the current DNS server with your own. This will increase your privacy level. " ) } ,
{ DockerContainer : : Sftp ,
2024-06-10 18:35:24 +07:00
QObject : : tr ( " Create a file vault on your server to securely store and transfer files. " ) } ,
{ DockerContainer : : Socks5Proxy ,
QObject : : tr ( " " ) } } ;
2023-08-20 13:36:54 +05:00
}
QMap < DockerContainer , QString > ContainerProps : : containerDetailedDescriptions ( )
2021-09-09 20:15:44 +03:00
{
2023-10-14 18:21:49 +05:00
return {
{ DockerContainer : : OpenVpn ,
QObject : : tr (
2025-02-04 15:53:40 +00:00
" 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 "
2025-02-05 23:11:21 +00:00
" * Recognised by DPI systems and therefore susceptible to blocking \n "
2025-02-04 15:53:40 +00:00
" * Can operate over both TCP and UDP network protocols. " ) } ,
2023-10-14 18:21:49 +05:00
{ DockerContainer : : ShadowSocks ,
2023-10-15 10:53:09 +01:00
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 "
" * Configurable encryption protocol \n "
" * Detectable by some DPI systems \n "
" * Works over TCP network protocol. " ) } ,
2023-10-14 18:21:49 +05:00
{ DockerContainer : : Cloak ,
QObject : : tr ( " This is a combination of the OpenVPN protocol and the Cloak plugin designed specifically for "
2025-02-04 15:53:40 +00:00
" protecting against detection. \n \n "
2024-01-27 00:58:40 +02:00
" OpenVPN provides a secure VPN connection by encrypting all internet traffic between the client "
2023-10-14 18:21:49 +05:00
" and the server. \n \n "
2025-02-05 23:11:21 +00:00
" Cloak protects OpenVPN from detection. \n \n "
2023-10-14 18:21:49 +05:00
" 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 "
2023-10-15 10:53:09 +01:00
" * Available in the AmneziaVPN across all platforms \n "
2023-10-14 18:21:49 +05:00
" * High power consumption on mobile devices \n "
" * Flexible settings \n "
2025-02-05 23:11:21 +00:00
" * Not recognised by detection systems \n "
2023-10-15 10:53:09 +01:00
" * Works over TCP network protocol, 443 port. \n " ) } ,
2023-10-14 18:21:49 +05:00
{ DockerContainer : : WireGuard ,
QObject : : tr ( " A relatively new popular VPN protocol with a simplified architecture. \n "
2024-01-27 00:58:40 +02:00
" WireGuard provides stable VPN connection and high performance on all devices. It uses hard-coded encryption "
2023-10-14 18:21:49 +05:00
" settings. WireGuard compared to OpenVPN has lower latency and better data transfer throughput. \n "
2025-02-04 15:53:40 +00:00
" WireGuard is very susceptible to detection and blocking due to its distinct packet signatures. "
2023-10-15 10:53:09 +01:00
" 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 "
2025-02-05 23:11:21 +00:00
" * Not recognised by traffic analysis systems \n "
2023-10-15 10:53:09 +01:00
" * Works over UDP network protocol. " ) } ,
2024-03-27 11:02:34 +00:00
{ DockerContainer : : Xray ,
2025-02-04 15:53:40 +00:00
QObject : : tr ( " The REALITY protocol, a pioneering development by the creators of XRay, "
" is designed to provide the highest level of protection against detection through its innovative approach to security and privacy. \n "
" It uniquely identifies attackers during the TLS handshake phase, seamlessly operating as a proxy for legitimate clients while diverting attackers to genuine websites, "
" thus presenting an authentic TLS certificate and data. \n "
" This advanced capability differentiates REALITY from similar technologies by its ability to disguise web traffic as coming from random, "
" legitimate sites without the need for specific configurations. \n "
" Unlike older protocols such as VMess, VLESS, and the XTLS-Vision transport, "
2025-02-05 23:11:21 +00:00
" REALITY's innovative \" friend or foe \" recognition at the TLS handshake enhances security. "
2025-02-04 15:53:40 +00:00
" This makes REALITY a robust solution for maintaining internet freedom. " )
2024-03-27 11:02:34 +00:00
} ,
2023-10-14 18:21:49 +05:00
{ DockerContainer : : Ipsec ,
2023-10-15 10:53:09 +01:00
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 "
2023-10-14 18:21:49 +05:00
" * Low power consumption, on mobile devices \n "
2023-10-15 10:53:09 +01:00
" * Minimal configuration \n "
" * Recognised by DPI analysis systems \n "
" * Works over UDP network protocol, ports 500 and 4500. " ) } ,
2023-10-14 18:21:49 +05:00
{ DockerContainer : : TorWebSite , QObject : : tr ( " Website in Tor network " ) } ,
{ DockerContainer : : Dns , QObject : : tr ( " DNS Service " ) } ,
2024-03-26 20:05:04 +02:00
{ DockerContainer : : Sftp ,
QObject : : tr ( " After installation, Amnezia will create a \n \n file storage on your server. "
" You will be able to access it using \n FileZilla or other SFTP clients, "
" as well as mount the disk on your device to access \n it directly from your device. \n \n "
2024-06-10 18:35:24 +07:00
" For more detailed information, you can \n find it in the support section under \" Create SFTP file storage. \" " ) } ,
{ DockerContainer : : Socks5Proxy , QObject : : tr ( " SOCKS5 proxy server " ) }
2023-10-14 18:21:49 +05:00
} ;
2021-09-09 20:15:44 +03:00
}
2021-09-20 21:51:28 +03:00
amnezia : : ServiceType ContainerProps : : containerService ( DockerContainer c )
2021-09-09 20:15:44 +03:00
{
2023-10-15 02:30:42 +01:00
return ProtocolProps : : protocolService ( defaultProtocol ( c ) ) ;
2021-09-09 20:15:44 +03:00
}
2021-09-20 21:51:28 +03:00
2021-11-30 16:56:24 +04:00
Proto ContainerProps : : defaultProtocol ( DockerContainer c )
2021-09-20 21:51:28 +03:00
{
2021-10-04 19:07:49 +03:00
switch ( c ) {
2023-07-31 12:54:59 +09:00
case DockerContainer : : None : return Proto : : Any ;
case DockerContainer : : OpenVpn : return Proto : : OpenVpn ;
case DockerContainer : : Cloak : return Proto : : Cloak ;
case DockerContainer : : ShadowSocks : return Proto : : ShadowSocks ;
case DockerContainer : : WireGuard : return Proto : : WireGuard ;
2023-10-06 17:19:44 +05:00
case DockerContainer : : Awg : return Proto : : Awg ;
2024-03-27 11:02:34 +00:00
case DockerContainer : : Xray : return Proto : : Xray ;
2023-07-31 12:54:59 +09:00
case DockerContainer : : Ipsec : return Proto : : Ikev2 ;
2024-05-27 16:15:55 +01:00
case DockerContainer : : SSXray : return Proto : : SSXray ;
2023-07-31 12:54:59 +09:00
case DockerContainer : : TorWebSite : return Proto : : TorWebSite ;
case DockerContainer : : Dns : return Proto : : Dns ;
case DockerContainer : : Sftp : return Proto : : Sftp ;
2024-06-10 18:35:24 +07:00
case DockerContainer : : Socks5Proxy : return Proto : : Socks5Proxy ;
2023-07-31 12:54:59 +09:00
default : return Proto : : Any ;
2021-10-04 19:07:49 +03:00
}
2021-09-20 21:51:28 +03:00
}
2022-02-15 17:08:55 +03:00
bool ContainerProps : : isSupportedByCurrentPlatform ( DockerContainer c )
2021-12-04 16:13:34 +03:00
{
# ifdef Q_OS_WINDOWS
return true ;
2023-07-31 12:54:59 +09:00
# elif defined(Q_OS_IOS)
2021-12-04 16:13:34 +03:00
switch ( c ) {
case DockerContainer : : WireGuard : return true ;
case DockerContainer : : OpenVpn : return true ;
2023-10-06 17:19:44 +05:00
case DockerContainer : : Awg : return true ;
2024-06-30 12:19:38 +03:00
case DockerContainer : : Xray : return true ;
2024-07-09 14:56:39 +07:00
case DockerContainer : : Cloak : return true ;
case DockerContainer : : SSXray : return true ;
2023-07-31 12:54:59 +09:00
// case DockerContainer::ShadowSocks: return true;
2021-12-04 16:13:34 +03:00
default : return false ;
}
2023-07-31 12:54:59 +09:00
# elif defined(Q_OS_MAC)
2022-01-23 15:25:53 -08:00
switch ( c ) {
2023-07-15 14:19:48 -07:00
case DockerContainer : : WireGuard : return true ;
2022-01-23 15:25:53 -08:00
case DockerContainer : : Ipsec : return false ;
default : return true ;
}
2021-12-04 05:24:11 -08:00
2023-07-31 12:54:59 +09:00
# elif defined(Q_OS_ANDROID)
2021-12-04 16:13:34 +03:00
switch ( c ) {
case DockerContainer : : WireGuard : return true ;
case DockerContainer : : OpenVpn : return true ;
2023-12-14 21:08:45 +03:00
case DockerContainer : : ShadowSocks : return false ;
2023-10-07 09:01:29 -04:00
case DockerContainer : : Awg : return true ;
2023-05-23 18:50:36 -04:00
case DockerContainer : : Cloak : return true ;
2024-06-18 20:46:21 +03:00
case DockerContainer : : Xray : return true ;
2024-07-06 18:44:34 +03:00
case DockerContainer : : SSXray : return true ;
2021-12-04 16:13:34 +03:00
default : return false ;
}
2023-07-31 12:54:59 +09:00
# elif defined(Q_OS_LINUX)
2023-07-15 14:19:48 -07:00
switch ( c ) {
case DockerContainer : : Ipsec : return false ;
default : return true ;
}
2021-12-04 16:13:34 +03:00
# else
2023-07-31 12:54:59 +09:00
return false ;
2021-12-04 16:13:34 +03:00
# endif
}
2023-02-14 18:02:51 +03:00
QStringList ContainerProps : : fixedPortsForContainer ( DockerContainer c )
{
switch ( c ) {
2023-07-31 12:54:59 +09:00
case DockerContainer : : Ipsec : return QStringList { " 500 " , " 4500 " } ;
default : return { } ;
2023-02-14 18:02:51 +03:00
}
}
2023-05-22 00:10:51 +08:00
bool ContainerProps : : isEasySetupContainer ( DockerContainer container )
{
switch ( container ) {
2023-10-14 02:15:49 +01:00
case DockerContainer : : Awg : return true ;
2023-07-31 12:54:59 +09:00
default : return false ;
2023-05-22 00:10:51 +08:00
}
}
QString ContainerProps : : easySetupHeader ( DockerContainer container )
{
switch ( container ) {
2025-02-04 15:53:40 +00:00
case DockerContainer : : Awg : return tr ( " Automatic " ) ;
2023-07-31 12:54:59 +09:00
default : return " " ;
2023-05-22 00:10:51 +08:00
}
}
QString ContainerProps : : easySetupDescription ( DockerContainer container )
{
switch ( container ) {
2025-02-05 23:11:21 +00:00
case DockerContainer : : Awg : return tr ( " AmneziaWG protocol will be installed. "
" It provides high connection speed and ensures stable operation even in the most challenging network conditions. " ) ;
2023-07-31 12:54:59 +09:00
default : return " " ;
2023-05-22 00:10:51 +08:00
}
}
2023-08-22 14:37:29 +05:00
2023-09-18 21:06:10 +05:00
int ContainerProps : : easySetupOrder ( DockerContainer container )
{
switch ( container ) {
2025-02-04 15:53:40 +00:00
case DockerContainer : : Awg : return 1 ;
2023-09-18 21:06:10 +05:00
default : return 0 ;
}
}
2023-08-22 14:37:29 +05:00
bool ContainerProps : : isShareable ( DockerContainer container )
{
switch ( container ) {
case DockerContainer : : TorWebSite : return false ;
case DockerContainer : : Dns : return false ;
case DockerContainer : : Sftp : return false ;
2024-06-10 18:35:24 +07:00
case DockerContainer : : Socks5Proxy : return false ;
2023-08-22 14:37:29 +05:00
default : return true ;
}
}
2024-04-01 20:20:02 +07:00
QJsonObject ContainerProps : : getProtocolConfigFromContainer ( const Proto protocol , const QJsonObject & containerConfig )
{
QString protocolConfigString = containerConfig . value ( ProtocolProps : : protoToString ( protocol ) )
2025-02-04 15:53:40 +00:00
. toObject ( )
. value ( config_key : : last_config )
. toString ( ) ;
2024-04-01 20:20:02 +07:00
return QJsonDocument : : fromJson ( protocolConfigString . toUtf8 ( ) ) . object ( ) ;
}
2024-07-02 22:00:28 +02:00
int ContainerProps : : installPageOrder ( DockerContainer container )
{
switch ( container ) {
case DockerContainer : : OpenVpn : return 4 ;
case DockerContainer : : Cloak : return 5 ;
case DockerContainer : : ShadowSocks : return 6 ;
case DockerContainer : : WireGuard : return 2 ;
case DockerContainer : : Awg : return 1 ;
case DockerContainer : : Xray : return 3 ;
case DockerContainer : : Ipsec : return 7 ;
case DockerContainer : : SSXray : return 8 ;
default : return 0 ;
}
}