diff --git a/client/configurators/openvpn_configurator.cpp b/client/configurators/openvpn_configurator.cpp
index da9974d5..0f60aba3 100644
--- a/client/configurators/openvpn_configurator.cpp
+++ b/client/configurators/openvpn_configurator.cpp
@@ -203,7 +203,14 @@ QString OpenVpnConfigurator::genOpenVpnConfig(const ServerCredentials &credentia
config.replace("$OPENVPN_CA_CERT", connData.caCert);
config.replace("$OPENVPN_CLIENT_CERT", connData.clientCert);
config.replace("$OPENVPN_PRIV_KEY", connData.privKey);
- config.replace("$OPENVPN_TA_KEY", connData.taKey);
+
+ if (config.contains("$OPENVPN_TA_KEY")) {
+ config.replace("$OPENVPN_TA_KEY", connData.taKey);
+ }
+ else {
+ config.replace("", "");
+ config.replace("", "");
+ }
#ifdef Q_OS_MAC
config.replace("block-outside-dns", "");
@@ -222,6 +229,11 @@ QString OpenVpnConfigurator::processConfigWithLocalSettings(QString config)
if (m_settings().customRouting()) {
config.replace("redirect-gateway def1 bypass-dhcp", "");
}
+ else {
+ if(!config.contains("redirect-gateway def1 bypass-dhcp")) {
+ config.append("redirect-gateway def1 bypass-dhcp\n");
+ }
+ }
#ifdef Q_OS_MAC
config.replace("block-outside-dns", "");
diff --git a/client/core/servercontroller.cpp b/client/core/servercontroller.cpp
index 263f74dc..e1507657 100644
--- a/client/core/servercontroller.cpp
+++ b/client/core/servercontroller.cpp
@@ -508,7 +508,7 @@ ErrorCode ServerController::startupContainerWorker(const ServerCredentials &cred
genVarsForScript(credentials, container, config)));
}
-ServerController::Vars ServerController::genVarsForScript(const ServerCredentials &credentials, DockerContainer container, const QJsonObject &config)
+ServerController::Vars ServerController:: genVarsForScript(const ServerCredentials &credentials, DockerContainer container, const QJsonObject &config)
{
const QJsonObject &openvpnConfig = config.value(config_key::openvpn).toObject();
const QJsonObject &cloakConfig = config.value(config_key::cloak).toObject();
@@ -529,9 +529,17 @@ ServerController::Vars ServerController::genVarsForScript(const ServerCredential
bool isNcpDisabled = openvpnConfig.value(config_key::ncp_disable).toBool(amnezia::protocols::openvpn::defaultNcpDisable);
vars.append({{"$OPENVPN_NCP_DISABLE", isNcpDisabled ? protocols::openvpn::ncpDisableString : "" }});
+
vars.append({{"$OPENVPN_CIPHER", openvpnConfig.value(config_key::cipher).toString(amnezia::protocols::openvpn::defaultCipher) }});
vars.append({{"$OPENVPN_HASH", openvpnConfig.value(config_key::hash).toString(amnezia::protocols::openvpn::defaultHash) }});
+ bool isTlsAuth = openvpnConfig.value(config_key::tls_auth).toBool(amnezia::protocols::openvpn::defaultTlsAuth);
+ vars.append({{"$OPENVPN_TLS_AUTH", isTlsAuth ? protocols::openvpn::tlsAuthString : "" }});
+ if (!isTlsAuth) {
+ // erase $OPENVPN_TA_KEY, so it will not set in OpenVpnConfigurator::genOpenVpnConfig
+ vars.append({{"$OPENVPN_TA_KEY", "" }});
+ }
+
// ShadowSocks vars
vars.append({{"$SHADOWSOCKS_SERVER_PORT", ssConfig.value(config_key::port).toString(amnezia::protocols::shadowsocks::defaultPort) }});
vars.append({{"$SHADOWSOCKS_LOCAL_PORT", ssConfig.value(config_key::local_port).toString(amnezia::protocols::shadowsocks::defaultLocalProxyPort) }});
diff --git a/client/images/plus.png b/client/images/plus.png
index 40a238e0..81d44ec4 100644
Binary files a/client/images/plus.png and b/client/images/plus.png differ
diff --git a/client/protocols/protocols_defs.h b/client/protocols/protocols_defs.h
index cbbb7358..5b4620bb 100644
--- a/client/protocols/protocols_defs.h
+++ b/client/protocols/protocols_defs.h
@@ -29,6 +29,7 @@ constexpr char transport_proto[] = "transport_proto";
constexpr char cipher[] = "cipher";
constexpr char hash[] = "hash";
constexpr char ncp_disable[] = "ncp_disable";
+constexpr char tls_auth[] = "tls_auth";
constexpr char site[] = "site";
constexpr char block_outside_dns[] = "block_outside_dns";
@@ -72,7 +73,9 @@ constexpr char defaultCipher[] = "AES-256-GCM";
constexpr char defaultHash[] = "SHA512";
constexpr bool defaultBlockOutsideDns = true;
constexpr bool defaultNcpDisable = false;
+constexpr bool defaultTlsAuth = true;
constexpr char ncpDisableString[] = "ncp-disable";
+constexpr char tlsAuthString[] = "tls-auth /opt/amnezia/openvpn/ta.key 0";
}
diff --git a/client/server_scripts/openvpn/configure_container.sh b/client/server_scripts/openvpn/configure_container.sh
index 1be0902c..0402c328 100644
--- a/client/server_scripts/openvpn/configure_container.sh
+++ b/client/server_scripts/openvpn/configure_container.sh
@@ -23,5 +23,5 @@ status openvpn-status.log \\n\
verb 1 \\n\
tls-server \\n\
tls-version-min 1.2 \\n\
-tls-auth /opt/amnezia/openvpn/ta.key 0" >>/opt/amnezia/openvpn/server.conf'
+$OPENVPN_TLS_AUTH" >/opt/amnezia/openvpn/server.conf'
diff --git a/client/server_scripts/openvpn_cloak/configure_container.sh b/client/server_scripts/openvpn_cloak/configure_container.sh
index ff521284..21209892 100644
--- a/client/server_scripts/openvpn_cloak/configure_container.sh
+++ b/client/server_scripts/openvpn_cloak/configure_container.sh
@@ -23,7 +23,7 @@ status openvpn-status.log \\n\
verb 1 \\n\
tls-server \\n\
tls-version-min 1.2 \\n\
-tls-auth /opt/amnezia/openvpn/ta.key 0" >>/opt/amnezia/openvpn/server.conf'
+$OPENVPN_TLS_AUTH" >/opt/amnezia/openvpn/server.conf'
# Cloak config
sudo docker exec -i $CONTAINER_NAME bash -c '\
diff --git a/client/server_scripts/openvpn_shadowsocks/configure_container.sh b/client/server_scripts/openvpn_shadowsocks/configure_container.sh
index 5f05427a..a7a55250 100644
--- a/client/server_scripts/openvpn_shadowsocks/configure_container.sh
+++ b/client/server_scripts/openvpn_shadowsocks/configure_container.sh
@@ -23,7 +23,7 @@ status openvpn-status.log \\n\
verb 1 \\n\
tls-server \\n\
tls-version-min 1.2 \\n\
-tls-auth /opt/amnezia/openvpn/ta.key 0" >>/opt/amnezia/openvpn/server.conf'
+$OPENVPN_TLS_AUTH" >/opt/amnezia/openvpn/server.conf'
# Cloak config
sudo docker exec -i $CONTAINER_NAME bash -c '\
diff --git a/client/translations/amneziavpn_ru.qm b/client/translations/amneziavpn_ru.qm
index 380d6090..8478a761 100644
Binary files a/client/translations/amneziavpn_ru.qm and b/client/translations/amneziavpn_ru.qm differ
diff --git a/client/translations/amneziavpn_ru.ts b/client/translations/amneziavpn_ru.ts
index 5031f289..72cecdd2 100644
--- a/client/translations/amneziavpn_ru.ts
+++ b/client/translations/amneziavpn_ru.ts
@@ -4,32 +4,32 @@
MainWindow
-
+
Connect to the already created VPN server
Подключиться к уже созданному серверу VPN
-
+
Connection code
Код для подключения
-
+
Connecting...
Подключение...
-
-
-
-
-
+
+
+
+
+
Connect
Подключиться
-
-
+
+
Set up your own server
Настроить собственный сервер
@@ -38,196 +38,198 @@
Подключите ваш сервер, чтобы использовать VPN
-
+
Server IP address
IP адрес сервера
-
+
Login to connect via SSH
Логин для подключения по SSH
-
-
-
+
+
+
Password
Пароль
-
+
Where to get connection data →
Где взять логин для подключения →
-
+
vpn://...
-
- <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
-<html><head><meta name="qrichtext" content="1" /><style type="text/css">
-p, li { white-space: pre-wrap; }
-</style></head><body style=" font-family:'Lato'; font-size:8.25pt; font-weight:400; font-style:normal;">
-<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:16px;"><br /></p></body></html>
-
-
-
-
-
-
-
+
+
+
+
+
Please wait, configuring process may take up to 5 minutes
Пожалуйста подождите, настройка может занять до 5 минут
-
+
+
Setup your server to use VPN
Настроить ваш сервер для VPN
-
+
root
-
-
+
+
Connect using SSH key
Использовать SSH ключ
-
Select VPN protocols to install
- Выберите VPN протоколы для установки
+ Выберите VPN протоколы для установки
-
+
OpenVPN and ShadowSocks
with masking using Cloak plugin
OpenVPN и ShadowSocks
с маскировкой плагином Cloak
-
+
Port (TCP)
Порт (TCP)
-
+
443
-
-
+
+
Fake Web Site
Сайт маскировки
-
-
+
+
mail.ru
-
+
ShadowSocks
-
+
Port(TCP)
Порт (TCP)
-
+
6789
-
+
Encryption
Шифрование
-
+
chacha20-ietf-poly1305
-
+
xchacha20-ietf-poly1305
-
-
-
+
+
+
aes-256-gcm
-
-
+
+
aes-192-gcm
-
-
-
+
+
+
aes-128-gcm
-
+
OpenVPN
-
-
-
-
+
+
+
+
Port
Порт
-
+
Protocol
Протокол
-
-
+
+ DNS settings
+ Настройки DNS
+
+
+
UDP
-
-
+
TCP
-
-
-
-
-
+
+ AmneziaVPN will install OpenVPN protocol with public/private key pairs generated on server and client sides. You can also configure connection on your mobile device by copying exported ".ovpn" file to your device and setting up official OpenVPN client. We recommend do not use messengers for sending connection profile - it contains VPN private keys.
+ AmneziaVPN установит протокол OpenVPN и сгенерирует публичные/приваные пары ключей для серверной и клиентской стороны. Вы сможете так же настроить подключение для вашего мобильного устройства, экспортировав конфиг ".ovpn" на устройство и установив официальный клиент OpenVPN. Мы рекоммендуем не передавать конфиг через мессенджеры - он содержит приватный ключ для VPN.
+
+
+
+
+
+
+
+
+
Configuring...
Настройка...
-
+
Setup server
Установить сервер
-
-
+
+
0 Mbps
0 Мбит/сек
@@ -236,32 +238,32 @@ p, li { white-space: pre-wrap; }
Добавить сайт
-
+
Connected
Подключено
-
+
How to use VPN
Как использовать VPN
-
+
For all connections
Для всех соединений
-
+
For selected sites
Для выбранных сайтов
-
+
Error text
-
+
List of the most popular prohibited sites
Список самых популярных запрещенных сайтов
@@ -286,212 +288,389 @@ p, li { white-space: pre-wrap; }
Имя хоста или IP адрес
-
+
+
+
-
+
Software version: 1.6.1 (09.05.2021)
-
+
Server settings
Настройки сервера
-
+
Share connection
Поделиться подключением
-
+
+ <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
+<html><head><meta name="qrichtext" content="1" /><style type="text/css">
+p, li { white-space: pre-wrap; }
+</style></head><body style=" font-family:'Lato'; font-size:8.25pt; font-weight:400; font-style:normal;">
+<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><br /></p></body></html>
+
+
+
+
+ Configure VPN protocols manually
+ Выбрать протоколы
+
+
+
+ Run Setup Wizard
+ Мастер настройки
+
+
+
+ If you want easily configure your server just run Wizard
+ Для облегченной настройки сервера запустите мастер настройки
+
+
+
+ Press configure manually to choose VPN protocols you want to install
+ Выбрать протоколы для установки самостоятельно
+
+
+
+
+
+
+
+ Setup Wizard
+ Мастер настройки
+
+
+
+ High censorship level
+ Высокий уровень цензуры
+
+
+
+ Medium censorship level
+ Средний уровень цензуры
+
+
+
+ Low censorship level
+ Низкий уровень цензуры
+
+
+
+ I'm living in country with high censorship level. Many of foreign web sites and VPNs blocked by my government. I want to setup reliable VPN, which is invisible for government.
+ Я живу в стране с высоким уровнем цензуры. Многие зарубежные сайты и VPN сервисы заблокированы. Я хочу установить надёжный VPN, невидимый для надзорных органов.
+
+
+
+ I'm living in country with medium censorship level. Some web sites blocked by my government, but VPNs are not blocked at all. I want to setup flexible solution.
+ Я живу в стране со средним уровнем цензуры. Некоторые зарубежные сайты заблокированы, но VPN сервисы в целом работают. Я хочу установить гибкое решение.
+
+
+
+ I just want to improve my privacy in internet.
+ Я просто хочу повысить уровень моей приватности в интернете.
+
+
+
+
+
+ Next
+ Далее
+
+
+
+ AmneziaVPN will install VPN protocol which is not visible for your internet provider and government firewall. Your VPN connection will be detected by your provider as regular web traffic to particular web site.
+
+You SHOULD set this web site address to some foreign web site which is not blocked by your internet provider. Other words you need to type below some foreign web site address which is accessible without VPN.
+
+Please note, this protocol still does not support export connection profile to mobile devices. Keep for updates.
+ AmneziaVPN установит VPN протокол невидимый для вашего провайдера и гос. фаервола. Ваше VPN соединение будет определяться как обычные запросы к определнному web сайту.
+Вы ДОЛЖНЫ установить адрес этого сайта таким, который не заблокирован вашим провайдером, и находится за границей. Другими словами, вы должны ввести адрес какого-либо зарубежного сайта, который доступен и без VPN.
+
+Заметьте, этот протокол пока не имеет функции экспорта настроек подключения для мобильных устаройств. Следите за обновлениями.
+
+
+
+ OpenVPN over Cloak (VPN obfuscation) profile will be installed
+ Будет установлен профиль OpenVPN over Cloak (VPN маскировка)
+
+
+
+ Type web site address for mask
+ Адрес сайта для маскировки
+
+
+
+ Optional.
+
+We recommend to enable VPN mode "For selected sites" and add blocked sites you need to visit manually. If you will choose this option, you will need add every bloked site you want to visit to the access list. You may switch between modes later.
+
+Please note, you should add addresses to the list after VPN connection established. You may add any domain, URL or IP address, it will be resolved to IP address.
+ Опционально.
+
+Мы рекомендуем включить режим VPN "Для выбранных сайтов" и добавить вручную заблокированные сайты, которые вы хотите посещать. Если вы выберите эту опцию, вы должны будете добавить каждый заблокированный сайт, который вы хотите посетить в список. Позже вы сможете переключаться между режимами работы VPN.
+
+Мы рекомендуем добавлять сайты в список только после того, как соединение VPN будет подключено. Вы сможете добавить любые домены, URL или IP адреса.
+
+
+
+
+ Start configuring
+ Начать настройку
+
+
+
+ Turn on mode "VPN for selected sites"
+ Включить режим
+"VPN для выбранных сайтов"
+
+
+
+ AmneziaVPN will install VPN protocol which is difficult to detect by your internet provider and government firewall (but possible). In most cases, this is the most suitable protocol. This protocol is faster compared to the VPN protocols with "web traffic masking".
+
+This protocol support export connection profile to mobile devices using QR code (you should launch 3rd party opensource VPN client - ShadowSocks VPN).
+ AmneziaVPN установит VPN протокол, который трудно детектировать интернет провайдерам (но возможно). В большинстве случаев, это наиболее подходящий выбор. Этот протокол быстрее, по сравнению с VPN протоколами с полной маскировкой трафика.
+
+Этот протокол поддерживает экспорт профиля подключения с помощью QR кода для настройки на мобильных устройствах (вам нужно будет установить сторонний клиент VPN - ShadowSocks VPN).
+
+
+
+ OpenVPN over ShadowSocks profile will be installed
+ Будет установлен профиль
+OpenVPN over ShadowSocks
+
+
+
+ OpenVPN profile will be installed
+ Будет установлен профиль OpenVPN
+
+
+
+ Please wait.
+ Пожалуйста, ждите.
+
+
+
+ Select VPN protocols
+ Выберите протоколы
+
+
+
+ udp
+
+
+
+
+ tcp
+
+
+
+
+ Add site
+ Добавить сайт
-
+
These sites will be opened using VPN
Эти сайты будут открываться через VPN
-
+
For example, yousite.com or 17.21.111.8
Например, yousite.com или 17.21.111.8
-
+
Web site or hostname or IP address
Web-сайт, имя хоста или IP-адрес
-
-
+
+
Reinstall server, clear server
Переустановить сервер, очистить сервер
-
+
Server management
Управление сервером
-
-
+
+
Exit
Выход из приложения
-
+
Auto start, Auto connect
Авто-запуск, авто-соединение
-
+
App settings
Настройки приложения
-
- Dns, Kill Switch
-
-
-
-
+
Network settings
Настройки сети
-
+
Servers
Список серверов
-
+
+ Add or import new server
+ Добавить или импортировать новый сервер
+
+
+
+ Add server
+ Добавить сервер
+
+
+
Servers list
Список серверов
-
+
Auto start
Авто старт
-
+
Application Settings
Настройки приложения
-
+
Auto connect
Авто соединение
-
+
Check for updates
Проверить обновления
-
+
+ Start minimized
+ Запускать свёрнутым
+
+
+
+ Open logs folder
+ Открыть папки с логами
+
+
+
DNS Servers
DNS сервера
-
-
+
+
Reset to default value
Сбросить по умолчанию
-
+
Primary DNS server
Первичный DSN сервер
-
+
Secondray DNS server
Вторичный DNS сервер
-
-
+
+
Clear client cached profile
Удалить закешировнный профиль
-
-
+
+
Clear server from Amnezia software
Очистить сервер от Amnezia
-
+
Forget this server
Забыть этот сервер
-
+
root@yourserver.org
-
+
VPN protocols
VPN протоколы
-
+
VPN Protocol:
VPN протокол:
-
+
Protocols
Протоколы
-
+
Cloak container
Cloak контейнер
-
-
-
+
+
+
OpenVPN settings
Настройки OpenVPN
-
-
+
+
ShadowSocks settings
Настройки ShadowSocks
-
+
Cloak settings
Настройки Cloak
-
+
ShadowSocks container
ShadowSocks контейнер
-
+
OpenVPN container
OpenVPN контейнер
-
+
Full access
Полный доступ
-
-
-
+
+
+
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
<html><head><meta name="qrichtext" content="1" /><style type="text/css">
p, li { white-space: pre-wrap; }
@@ -500,7 +679,7 @@ p, li { white-space: pre-wrap; }
-
+
Anyone who logs in with this code will have the same permissions to use VPN and your server as you.
This code includes your server credentials!
Provide this code only to TRUSTED users.
@@ -508,381 +687,398 @@ Provide this code only to TRUSTED users.
Предоставляйте этот код только доверенным пользователям.
-
+
Share for Amnezia client
Расшарить для Amnezia
-
+
Anyone who logs in with this code will be able to connect to this VPN server.
This code does not include server credentials.
Любой, кто получит этот код, получит возможность подключаться к этому VPN серверу
Этот код не содержи пароль от сервера.
-
-
-
+
+
+
+
Generate config
Сгенерировать конфиг
-
-
+
+
Share for OpenVPN client
Расшарить для OpenVPN
-
+
Save file
Сохранить файл
-
-
+
+
Share for ShadowSocks client
Расшарить для ShadowSocks
-
-
+
+
Server:
Сервер:
-
-
+
+
Encryption:
Шифрование:
-
-
+
+
Port:
Порт:
-
+
Password:
Пароль:
-
+
Connection string
Строка подключения
-
+
Share for Cloak client
Расшарить для Cloak
-
+
OpenVPN Settings
Настройки OpenVPN
-
+
Hash
Хеш
-
-
-
+
+
+
Cipher
Шифр
-
+
Network protocol
Сетевой протокол
-
+
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
-
+
VPN Addresses Subnet
Подсеть для VPN
-
-
-
+
+
+
Save and restart VPN
Сохранить и перезапустить VPN
-
+
Auto-negotiate encryption
Авто-согласование шифрования
-
+
SHA512
-
+
SHA384
-
+
SHA256
-
+
SHA3-512
-
+
SHA3-384
-
+
SHA3-256
-
+
whirlpool
-
+
BLAKE2b512
-
+
BLAKE2s256
-
+
+ SHA1
+
+
+
+
Block DNS requests outside of VPN
Блокировать запросы DNS мимо VPN
-
+
+ Enable TLS auth
+ Включить TLS auth
+
+
+
ShadowSocks Settings
Настройки ShadowSocks
-
-
+
+
chacha20-poly1305
-
+
Cloak Settings
Настройки Cloak
-
+
plain
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
Copy
Копировать
-
+
Cannot open logs folder!
Невозможно открыть папку с логами!
-
-
+
+
Please fill in all fields
Пожалуйста, заполните все поля
-
+
It's public key. Private key required
Это публичный ключ. Требуется приватный
-
+
of
из
-
-
-
+
+
+
Error occurred while configuring server.
Ошибка во время настройки сервера
-
+
+ Amnezia server installed
+ Amnezia сервер установлен
+
+
+
Operation finished
Операция завершена
-
+
Uninstalling Amnezia software...
Удаление Amnezia...
-
+
See logs for details.
Смотрите логи для подробных деталей
-
+
Amnezia server successfully uninstalled
Amnezia сервер удален
-
+
Show
Показать окно
-
-
+
+
Disconnect
Отключиться
-
+
Visit Website
Посетить сайт
-
+
Quit
Выход
-
+
Do you really want to quit?
Вы действительно хотите выйти?
-
+
Import connection
Импортировать соединение
-
+
Private key
Приватный ключ
-
+
Connect using SSH password
Соединиться с паролем SSH
-
+
Cache cleared
Кеш очищен
-
-
-
-
+
+
+
+
Copied
Скопировано
-
+
+
Generating...
Генерация...
-
+
Error while generating connection profile
Ошибка во время генерации профиля
-
+
Save OpenVPN config
Сохранить OpenVPN конфиг
-
+
VPN Protocols is not installed.
Please install VPN container at first
VPN протоколы ещё не установлены. Установите VPN контейнеры
-
+
VPN Protocol not choosen
VPN протокол не выбран
-
+
Protocol:
Протокол:
-
+
Press Generate config
Нажмите Сгенерировать конфиг
@@ -1522,7 +1718,7 @@ with a password, which you can enter below.
VpnConnection
-
+
Mbps
diff --git a/client/ui/Controls/SlidingStackedWidget.cpp b/client/ui/Controls/SlidingStackedWidget.cpp
index ee370fe9..d37422d1 100644
--- a/client/ui/Controls/SlidingStackedWidget.cpp
+++ b/client/ui/Controls/SlidingStackedWidget.cpp
@@ -121,6 +121,8 @@ void SlidingStackedWidget::slideInWgtImpl(QWidget * newwidget, enum t_direction
}
else m_active = true;
+ m_nextWidget = newwidget;
+
enum t_direction directionhint;
int now = currentIndex(); // currentIndex() is a function inherited from QStackedWidget
int next = indexOf(newwidget);
@@ -209,6 +211,18 @@ void SlidingStackedWidget::slideInWgtImpl(QWidget * newwidget, enum t_direction
// that we implement here below in animationDoneSlot.
}
+void SlidingStackedWidget::setCurrentWidget(QWidget *w)
+{
+ m_nextWidget = w;
+ QStackedWidget::setCurrentWidget(w);
+}
+
+QWidget *SlidingStackedWidget::nextWidget() const
+{
+ if (m_nextWidget == nullptr) return currentWidget();
+ return m_nextWidget;
+}
+
void SlidingStackedWidget::animationDoneSlot(void) {
// when ready, call the QStackedWidget slot setCurrentIndex(int)
setCurrentIndex(m_next); // this function is inherited from QStackedWidget
diff --git a/client/ui/Controls/SlidingStackedWidget.h b/client/ui/Controls/SlidingStackedWidget.h
index f0798306..6a72f592 100644
--- a/client/ui/Controls/SlidingStackedWidget.h
+++ b/client/ui/Controls/SlidingStackedWidget.h
@@ -34,6 +34,9 @@ public:
SlidingStackedWidget(QWidget *parent);
~SlidingStackedWidget(void);
+ QWidget *nextWidget() const;
+ void setCurrentWidget(QWidget *w);
+
public slots:
// Some basic settings API
void setSpeed(int speed); // animation duration in milliseconds
@@ -77,6 +80,8 @@ protected:
QPropertyAnimation *animnow;
QPropertyAnimation *animnext;
QParallelAnimationGroup *animgroup;
+
+ QWidget *m_nextWidget = nullptr;
};
#endif // SLIDINGSTACKEDWIDGET_H
diff --git a/client/ui/mainwindow.cpp b/client/ui/mainwindow.cpp
index 75785bcf..cdf87c98 100644
--- a/client/ui/mainwindow.cpp
+++ b/client/ui/mainwindow.cpp
@@ -57,6 +57,9 @@ MainWindow::MainWindow(QWidget *parent) :
setupTray();
setupUiConnections();
+ setupNewServerConnections();
+ setupWizardConnections();
+ setupGeneralSettingsConnections();
setupAppSettingsConnections();
setupNetworkSettingsConnections();
setupProtocolsPageConnections();
@@ -98,6 +101,7 @@ MainWindow::MainWindow(QWidget *parent) :
});
//ui->pushButton_general_settings_exit->hide();
+ updateSharingPage(selectedServerIndex, m_settings.serverCredentials(selectedServerIndex), selectedDockerContainer);
setFixedSize(width(),height());
@@ -173,6 +177,8 @@ void MainWindow::showOnStartup()
void MainWindow::goToPage(Page page, bool reset, bool slide)
{
//qDebug() << "goToPage" << page;
+ if (ui->stackedWidget_main->nextWidget() == getPageWidget(page)) return;
+
if (reset) {
if (page == Page::ServerSettings) {
updateServerPage();
@@ -186,7 +192,7 @@ void MainWindow::goToPage(Page page, bool reset, bool slide)
if (page == Page::Start) {
updateStartPage();
}
- if (page == Page::NewServer_2) {
+ if (page == Page::NewServerProtocols) {
ui->pushButton_new_server_settings_cloak->setChecked(true);
ui->pushButton_new_server_settings_cloak->setChecked(false);
ui->pushButton_new_server_settings_ss->setChecked(true);
@@ -257,7 +263,13 @@ QWidget *MainWindow::getPageWidget(MainWindow::Page page)
switch (page) {
case(Page::Start): return ui->page_start;
case(Page::NewServer): return ui->page_new_server;
- case(Page::NewServer_2): return ui->page_new_server_2;
+ case(Page::NewServerProtocols): return ui->page_new_server_protocols;
+ case(Page::Wizard): return ui->page_setup_wizard;
+ case(Page::WizardHigh): return ui->page_setup_wizard_high_level;
+ case(Page::WizardLow): return ui->page_setup_wizard_low_level;
+ case(Page::WizardMedium): return ui->page_setup_wizard_medium_level;
+ case(Page::WizardVpnMode): return ui->page_setup_wizard_vpn_mode;
+ case(Page::ServerConfiguring): return ui->page_new_server_configuring;
case(Page::Vpn): return ui->page_vpn;
case(Page::GeneralSettings): return ui->page_general_settings;
case(Page::AppSettings): return ui->page_app_settings;
@@ -317,6 +329,13 @@ void MainWindow::keyPressEvent(QKeyEvent *event)
case Qt::Key_Q:
qApp->quit();
break;
+ case Qt::Key_H:
+ selectedServerIndex = m_settings.defaultServerIndex();
+ selectedDockerContainer = m_settings.defaultContainer(selectedServerIndex);
+
+ updateSharingPage(selectedServerIndex, m_settings.serverCredentials(selectedServerIndex), selectedDockerContainer);
+ goToPage(Page::ShareConnection);
+ break;
#endif
case Qt::Key_C:
qDebug().noquote() << "Def server" << m_settings.defaultServerIndex() << m_settings.defaultContainerName(m_settings.defaultServerIndex());
@@ -335,10 +354,11 @@ void MainWindow::keyPressEvent(QKeyEvent *event)
goToPage(Page::ServerVpnProtocols);
break;
case Qt::Key_Escape:
+ if (currentPage() == Page::Vpn) break;
+ if (currentPage() == Page::ServerConfiguring) break;
+ if (currentPage() == Page::Start && pagesStack.size() < 2) break;
if (! ui->stackedWidget_main->isAnimationRunning() && ui->stackedWidget_main->currentWidget()->isEnabled()) {
- if (currentPage() != Page::Vpn && currentPage() != Page::Start) {
- closePage();
- }
+ closePage();
}
default:
;
@@ -430,9 +450,14 @@ void MainWindow::onPushButtonNewServerConnect(bool)
ui->pushButton_new_server_connect->setEnabled(false);
ui->pushButton_new_server_connect->setText(tr("Connecting..."));
+
ErrorCode e = ErrorCode::NoError;
+#ifdef Q_DEBUG
//QString output = ServerController::checkSshConnection(serverCredentials, &e);
+#else
QString output;
+#endif
+
bool ok = true;
if (e) {
ui->label_new_server_wait_info->show();
@@ -452,10 +477,10 @@ void MainWindow::onPushButtonNewServerConnect(bool)
ui->pushButton_new_server_connect->setText(tr("Connect"));
installCredentials = serverCredentials;
- if (ok) goToPage(Page::NewServer_2);
+ if (ok) goToPage(Page::NewServer);
}
-void MainWindow::onPushButtonNewServerConnectConfigure(bool)
+QMap MainWindow::getInstallConfigsFromProtocolsPage() const
{
QJsonObject cloakConfig {
{ config_key::container, amnezia::containerToString(DockerContainer::OpenVpnOverCloak) },
@@ -479,32 +504,70 @@ void MainWindow::onPushButtonNewServerConnectConfigure(bool)
}
};
- QJsonArray containerConfigs;
- QList containers;
+ QMap containers;
if (ui->checkBox_new_server_cloak->isChecked()) {
- containerConfigs.append(cloakConfig);
- containers.append(DockerContainer::OpenVpnOverCloak);
+ containers.insert(DockerContainer::OpenVpnOverCloak, cloakConfig);
}
if (ui->checkBox_new_server_ss->isChecked()) {
- containerConfigs.append(ssConfig);
- containers.append(DockerContainer::OpenVpnOverShadowSocks);
+ containers.insert(DockerContainer::OpenVpnOverShadowSocks, ssConfig);
}
if (ui->checkBox_new_server_openvpn->isChecked()) {
- containerConfigs.append(openVpnConfig);
- containers.append(DockerContainer::OpenVpn);
+ containers.insert(DockerContainer::OpenVpn, openVpnConfig);
}
+ return containers;
+}
+
+QMap MainWindow::getInstallConfigsFromWizardPage() const
+{
+ QJsonObject cloakConfig {
+ { config_key::container, amnezia::containerToString(DockerContainer::OpenVpnOverCloak) },
+ { config_key::cloak, QJsonObject {
+ { config_key::site, ui->lineEdit_setup_wizard_high_website_masking->text() }}
+ }
+ };
+ QJsonObject ssConfig {
+ { config_key::container, amnezia::containerToString(DockerContainer::OpenVpnOverShadowSocks) }
+ };
+ QJsonObject openVpnConfig {
+ { config_key::container, amnezia::containerToString(DockerContainer::OpenVpn) }
+ };
+
+ QMap containers;
+
+ if (ui->radioButton_setup_wizard_high->isChecked()) {
+ containers.insert(DockerContainer::OpenVpnOverCloak, cloakConfig);
+ }
+
+ if (ui->radioButton_setup_wizard_medium->isChecked()) {
+ containers.insert(DockerContainer::OpenVpnOverShadowSocks, ssConfig);
+ }
+
+ if (ui->radioButton_setup_wizard_low->isChecked()) {
+ containers.insert(DockerContainer::OpenVpn, openVpnConfig);
+ }
+
+ return containers;
+}
+
+void MainWindow::installServer(const QMap &containers)
+{
if (containers.isEmpty()) return;
-// bool ok = true;
- bool ok = installServer(installCredentials, containers, containerConfigs,
- ui->page_new_server_2,
- ui->progressBar_new_server_connection,
- ui->pushButton_new_server_connect_configure,
- ui->label_new_server_wait_info);
+ goToPage(Page::ServerConfiguring);
+ QEventLoop loop;
+ QTimer::singleShot(500, &loop, SLOT(quit()));
+ loop.exec();
+ qApp->processEvents();
+
+ bool ok = installContainers(installCredentials, containers,
+ ui->page_new_server_configuring,
+ ui->progressBar_new_server_configuring,
+ nullptr,
+ ui->label_new_server_configuring_wait_info);
if (ok) {
QJsonObject server;
@@ -514,15 +577,22 @@ void MainWindow::onPushButtonNewServerConnectConfigure(bool)
server.insert(config_key::port, installCredentials.port);
server.insert(config_key::description, m_settings.nextAvailableServerName());
+ QJsonArray containerConfigs;
+ for (const QJsonObject &cfg : containers) {
+ containerConfigs.append(cfg);
+ }
server.insert(config_key::containers, containerConfigs);
- server.insert(config_key::defaultContainer, containerToString(containers.first()));
+ server.insert(config_key::defaultContainer, containerToString(containers.firstKey()));
m_settings.addServer(server);
m_settings.setDefaultServer(m_settings.serversCount() - 1);
- goToPage(Page::Vpn);
+ setStartPage(Page::Vpn);
qApp->processEvents();
}
+ else {
+ closePage();
+ }
}
void MainWindow::onPushButtonNewServerImport(bool)
@@ -564,18 +634,21 @@ void MainWindow::onPushButtonNewServerImport(bool)
}
-bool MainWindow::installServer(ServerCredentials credentials,
- QList containers, QJsonArray configs,
+bool MainWindow::installContainers(ServerCredentials credentials,
+ const QMap &containers,
QWidget *page, QProgressBar *progress, QPushButton *button, QLabel *info)
{
- page->setEnabled(false);
- button->setVisible(false);
+ if (!progress) return false;
- info->setVisible(true);
- info->setText(tr("Please wait, configuring process may take up to 5 minutes"));
+ if (page) page->setEnabled(false);
+ if (button) button->setVisible(false);
+
+ if (info) info->setVisible(true);
+ if (info) info->setText(tr("Please wait, configuring process may take up to 5 minutes"));
- for (int i = 0; i < containers.size(); ++i) {
+ int cnt = 0;
+ for (QMap::const_iterator i = containers.constBegin(); i != containers.constEnd(); i++, cnt++) {
QTimer timer;
connect(&timer, &QTimer::timeout, [progress](){
progress->setValue(progress->value() + 1);
@@ -585,16 +658,16 @@ bool MainWindow::installServer(ServerCredentials credentials,
timer.start(1000);
progress->setTextVisible(true);
- progress->setFormat(QString("Installing %1 %2 %3").arg(i+1).arg(tr("of")).arg(containers.size()));
+ progress->setFormat(QString("Installing %1 %2 %3").arg(cnt+1).arg(tr("of")).arg(containers.size()));
- ErrorCode e = ServerController::setupContainer(credentials, containers.at(i), configs.at(i).toObject());
+ ErrorCode e = ServerController::setupContainer(credentials, i.key(), i.value());
qDebug() << "Setup server finished with code" << e;
ServerController::disconnectFromHost(credentials);
if (e) {
- page->setEnabled(true);
- button->setVisible(true);
- info->setVisible(false);
+ if (page) page->setEnabled(true);
+ if (button) button->setVisible(true);
+ if (info) info->setVisible(false);
QMessageBox::warning(this, APPLICATION_NAME,
tr("Error occurred while configuring server.") + "\n" +
@@ -625,9 +698,9 @@ bool MainWindow::installServer(ServerCredentials credentials,
}
- button->show();
- page->setEnabled(true);
- info->setText(tr("Amnezia server installed"));
+ if (button) button->show();
+ if (page) page->setEnabled(true);
+ if (info) info->setText(tr("Amnezia server installed"));
return true;
}
@@ -893,51 +966,36 @@ void MainWindow::setupUiConnections()
else hide();
});
connect(ui->pushButton_general_settings_exit, &QPushButton::clicked, this, [&](){ qApp->quit(); });
- connect(ui->pushButton_new_server_get_info, &QPushButton::clicked, this, [&](){
- QDesktopServices::openUrl(QUrl("https://amnezia.org"));
- });
-
-
- connect(ui->pushButton_new_server_connect, SIGNAL(clicked(bool)), this, SLOT(onPushButtonNewServerConnect(bool)));
- connect(ui->pushButton_new_server_connect_configure, SIGNAL(clicked(bool)), this, SLOT(onPushButtonNewServerConnectConfigure(bool)));
- connect(ui->pushButton_new_server_import, SIGNAL(clicked(bool)), this, SLOT(onPushButtonNewServerImport(bool)));
connect(ui->pushButton_vpn_add_site, &QPushButton::clicked, this, [this](){ goToPage(Page::Sites); });
- connect(ui->pushButton_settings, &QPushButton::clicked, this, [this](){ goToPage(Page::GeneralSettings); });
- connect(ui->pushButton_app_settings, &QPushButton::clicked, this, [this](){ goToPage(Page::AppSettings); });
- connect(ui->pushButton_network_settings, &QPushButton::clicked, this, [this](){ goToPage(Page::NetworkSettings); });
- connect(ui->pushButton_server_settings, &QPushButton::clicked, this, [this](){
- selectedServerIndex = m_settings.defaultServerIndex();
- goToPage(Page::ServerSettings);
- });
- connect(ui->pushButton_servers_list, &QPushButton::clicked, this, [this](){ goToPage(Page::ServersList); });
- connect(ui->pushButton_share_connection, &QPushButton::clicked, this, [this](){
- selectedServerIndex = m_settings.defaultServerIndex();
- selectedDockerContainer = m_settings.defaultContainer(selectedServerIndex);
-
- goToPage(Page::ShareConnection);
- updateSharingPage(selectedServerIndex, m_settings.serverCredentials(selectedServerIndex), selectedDockerContainer);
- //updateShareCodePage();
- });
- connect(ui->pushButton_back_from_sites, &QPushButton::clicked, this, [this](){ closePage(); });
- connect(ui->pushButton_back_from_settings, &QPushButton::clicked, this, [this](){ closePage(); });
- connect(ui->pushButton_back_from_start, &QPushButton::clicked, this, [this](){ closePage(); });
- connect(ui->pushButton_back_from_new_server, &QPushButton::clicked, this, [this](){ closePage(); });
- connect(ui->pushButton_back_from_new_server_2, &QPushButton::clicked, this, [this](){ closePage(); });
- connect(ui->pushButton_back_from_app_settings, &QPushButton::clicked, this, [this](){ closePage(); });
- connect(ui->pushButton_back_from_network_settings, &QPushButton::clicked, this, [this](){ closePage(); });
- connect(ui->pushButton_back_from_server_settings, &QPushButton::clicked, this, [this](){ closePage(); });
- connect(ui->pushButton_back_from_servers, &QPushButton::clicked, this, [this](){ closePage(); });
- connect(ui->pushButton_back_from_share, &QPushButton::clicked, this, [this](){ closePage(); });
- connect(ui->pushButton_back_from_server_vpn_protocols, &QPushButton::clicked, this, [this](){ closePage(); });
-
- connect(ui->pushButton_back_from_openvpn_settings, &QPushButton::clicked, this, [this](){ closePage(); });
- connect(ui->pushButton_back_from_cloak_settings, &QPushButton::clicked, this, [this](){ closePage(); });
- connect(ui->pushButton_back_from_shadowsocks_settings, &QPushButton::clicked, this, [this](){ closePage(); });
+ QVector backButtons {
+ ui->pushButton_back_from_sites,
+ ui->pushButton_back_from_settings,
+ ui->pushButton_back_from_start,
+ ui->pushButton_back_from_new_server,
+ ui->pushButton_back_from_new_server_protocols,
+ ui->pushButton_back_from_setup_wizard,
+ ui->pushButton_back_from_setup_wizard_high,
+ ui->pushButton_back_from_setup_wizard_low,
+ ui->pushButton_back_from_setup_wizard_medium,
+ ui->pushButton_back_from_setup_wizard_vpn_mode,
+ ui->pushButton_back_from_app_settings,
+ ui->pushButton_back_from_network_settings,
+ ui->pushButton_back_from_server_settings,
+ ui->pushButton_back_from_servers,
+ ui->pushButton_back_from_share,
+ ui->pushButton_back_from_server_vpn_protocols,
+ ui->pushButton_back_from_openvpn_settings,
+ ui->pushButton_back_from_cloak_settings,
+ ui->pushButton_back_from_shadowsocks_settings
+ };
+ for (QPushButton *b : backButtons) {
+ connect(b, &QPushButton::clicked, this, [this](){ closePage(); });
+ }
connect(ui->pushButton_sites_add_custom, &QPushButton::clicked, this, [this](){ onPushButtonAddCustomSitesClicked(); });
@@ -962,6 +1020,58 @@ void MainWindow::setupUiConnections()
});
}
+void MainWindow::setupNewServerConnections()
+{
+ connect(ui->pushButton_new_server_get_info, &QPushButton::clicked, this, [](){
+ QDesktopServices::openUrl(QUrl("https://amnezia.org"));
+ });
+
+ connect(ui->pushButton_new_server_connect, SIGNAL(clicked(bool)), this, SLOT(onPushButtonNewServerConnect(bool)));
+ connect(ui->pushButton_new_server_import, SIGNAL(clicked(bool)), this, SLOT(onPushButtonNewServerImport(bool)));
+
+ connect(ui->pushButton_new_server_connect_configure, &QPushButton::clicked, this, [this](){
+ installServer(getInstallConfigsFromProtocolsPage());
+ });
+
+}
+
+void MainWindow::setupWizardConnections()
+{
+ connect(ui->pushButton_new_server_wizard, &QPushButton::clicked, this, [this](){ goToPage(Page::Wizard); });
+ connect(ui->pushButton_new_server_advanced, &QPushButton::clicked, this, [this](){ goToPage(Page::NewServerProtocols); });
+ connect(ui->pushButton_setup_wizard_next, &QPushButton::clicked, this, [this](){
+ if (ui->radioButton_setup_wizard_high->isChecked()) goToPage(Page::WizardHigh);
+ if (ui->radioButton_setup_wizard_medium->isChecked()) goToPage(Page::WizardMedium);
+ if (ui->radioButton_setup_wizard_low->isChecked()) goToPage(Page::WizardLow);
+ });
+
+ connect(ui->pushButton_setup_wizard_high_next, &QPushButton::clicked, this, [this](){
+ QString domain = ui->lineEdit_setup_wizard_high_website_masking->text();
+ if (domain.isEmpty() || !domain.contains(".")) return;
+ goToPage(Page::WizardVpnMode);
+ });
+
+ connect(ui->lineEdit_setup_wizard_high_website_masking, &QLineEdit::textEdited, this, [this](){
+ QString text = ui->lineEdit_setup_wizard_high_website_masking->text();
+ text.replace("http://", "");
+ text.replace("https://", "");
+ if (text.isEmpty()) return;
+ text = text.split("/").first();
+ ui->lineEdit_setup_wizard_high_website_masking->setText(text);
+ });
+
+ connect(ui->pushButton_setup_wizard_medium_next, &QPushButton::clicked, this, [this](){ goToPage(Page::WizardVpnMode); });
+
+ connect(ui->pushButton_setup_wizard_vpn_mode_finish, &QPushButton::clicked, this, [this](){
+ installServer(getInstallConfigsFromWizardPage());
+ m_settings.setCustomRouting(ui->checkBox_setup_wizard_vpn_mode->isChecked());
+ });
+
+ connect(ui->pushButton_setup_wizard_low_finish, &QPushButton::clicked, this, [this](){
+ installServer(getInstallConfigsFromWizardPage());
+ });
+}
+
void MainWindow::setupAppSettingsConnections()
{
connect(ui->checkBox_app_settings_autostart, &QCheckBox::stateChanged, this, [this](int state){
@@ -982,6 +1092,34 @@ void MainWindow::setupAppSettingsConnections()
connect(ui->pushButton_app_settings_check_for_updates, &QPushButton::clicked, this, [this](){
QDesktopServices::openUrl(QUrl("https://github.com/amnezia-vpn/desktop-client/releases/latest"));
});
+
+ connect(ui->pushButton_app_settings_open_logs, &QPushButton::clicked, this, [this](){
+ Debug::openLogsFolder();
+ QDesktopServices::openUrl(QUrl::fromLocalFile(Utils::systemLogPath()));
+ });
+
+}
+
+void MainWindow::setupGeneralSettingsConnections()
+{
+ connect(ui->pushButton_settings, &QPushButton::clicked, this, [this](){ goToPage(Page::GeneralSettings); });
+ connect(ui->pushButton_app_settings, &QPushButton::clicked, this, [this](){ goToPage(Page::AppSettings); });
+ connect(ui->pushButton_network_settings, &QPushButton::clicked, this, [this](){ goToPage(Page::NetworkSettings); });
+ connect(ui->pushButton_server_settings, &QPushButton::clicked, this, [this](){
+ selectedServerIndex = m_settings.defaultServerIndex();
+ goToPage(Page::ServerSettings);
+ });
+ connect(ui->pushButton_servers_list, &QPushButton::clicked, this, [this](){ goToPage(Page::ServersList); });
+ connect(ui->pushButton_share_connection, &QPushButton::clicked, this, [this](){
+ selectedServerIndex = m_settings.defaultServerIndex();
+ selectedDockerContainer = m_settings.defaultContainer(selectedServerIndex);
+
+ updateSharingPage(selectedServerIndex, m_settings.serverCredentials(selectedServerIndex), selectedDockerContainer);
+ goToPage(Page::ShareConnection);
+ });
+
+ connect(ui->pushButton_general_settings_add_server, &QPushButton::clicked, this, [this](){ goToPage(Page::Start); });
+
}
void MainWindow::setupNetworkSettingsConnections()
@@ -1732,6 +1870,9 @@ void MainWindow::updateOpenVpnPage(const QJsonObject &openvpnConfig, DockerConta
bool isNcpDisabled = openvpnConfig.value(config_key::ncp_disable).toBool(protocols::openvpn::defaultNcpDisable);
ui->checkBox_proto_openvpn_auto_encryption->setChecked(!isNcpDisabled);
+ bool isTlsAuth = openvpnConfig.value(config_key::tls_auth).toBool(protocols::openvpn::defaultTlsAuth);
+ ui->checkBox_proto_openvpn_tls_auth->setChecked(isTlsAuth);
+
if (container == DockerContainer::OpenVpnOverShadowSocks) {
ui->radioButton_proto_openvpn_udp->setEnabled(false);
ui->radioButton_proto_openvpn_tcp->setEnabled(false);
@@ -1809,6 +1950,7 @@ void MainWindow::updateSharingPage(int serverIndex, const ServerCredentials &cre
ui->pushButton_share_openvpn_copy->setEnabled(false);
ui->pushButton_share_openvpn_save->setEnabled(false);
}
+ ui->toolBox_share_connection->setCurrentWidget(ui->page_share_openvpn);
}
if (container == DockerContainer::OpenVpnOverShadowSocks) {
@@ -1842,6 +1984,12 @@ void MainWindow::updateSharingPage(int serverIndex, const ServerCredentials &cre
ui->label_share_ss_port->setText(ssConfig.value("server_port").toString());
ui->label_share_ss_method->setText(ssConfig.value("method").toString());
ui->label_share_ss_password->setText(ssConfig.value("password").toString());
+
+ ui->toolBox_share_connection->setCurrentWidget(ui->page_share_shadowsocks);
+ ui->page_share_shadowsocks->show();
+ ui->page_share_shadowsocks->raise();
+ qDebug() << ui->page_share_shadowsocks->size();
+ ui->toolBox_share_connection->layout()->update();
}
// Amnezia sharing
@@ -1856,6 +2004,9 @@ void MainWindow::updateSharingPage(int serverIndex, const ServerCredentials &cre
// ui->textEdit_share_amnezia_code->setPlainText(QJsonDocument(exportContainer).toJson());
ui->textEdit_share_amnezia_code->setPlainText(tr(""));
+ repaint();
+ update();
+ updateGeometry();
}
void MainWindow::makeSitesListItem(QListWidget *listWidget, const QString &address)
@@ -1949,6 +2100,7 @@ QJsonObject MainWindow::getOpenVpnConfigFromPage(QJsonObject oldConfig)
oldConfig.insert(config_key::hash, ui->comboBox_proto_openvpn_hash->currentText());
oldConfig.insert(config_key::block_outside_dns, ui->checkBox_proto_openvpn_block_dns->isChecked());
oldConfig.insert(config_key::port, ui->lineEdit_proto_openvpn_port->text());
+ oldConfig.insert(config_key::tls_auth, ui->checkBox_proto_openvpn_tls_auth->isChecked());
return oldConfig;
}
diff --git a/client/ui/mainwindow.h b/client/ui/mainwindow.h
index 9f683499..45fb5fdf 100644
--- a/client/ui/mainwindow.h
+++ b/client/ui/mainwindow.h
@@ -40,8 +40,10 @@ public:
explicit MainWindow(QWidget *parent = nullptr);
~MainWindow();
- enum Page {Start, NewServer, NewServer_2, Vpn, GeneralSettings, AppSettings, NetworkSettings,
- ServerSettings, ServerVpnProtocols, ServersList, ShareConnection, Sites,
+ enum Page {Start, NewServer, NewServerProtocols, Vpn,
+ Wizard, WizardLow, WizardMedium, WizardHigh, WizardVpnMode, ServerConfiguring,
+ GeneralSettings, AppSettings, NetworkSettings, ServerSettings,
+ ServerVpnProtocols, ServersList, ShareConnection, Sites,
OpenVpnSettings, ShadowSocksSettings, CloakSettings};
Q_ENUM(Page)
@@ -54,7 +56,7 @@ private slots:
void onPushButtonConnectClicked(bool checked);
void onPushButtonNewServerConnect(bool);
- void onPushButtonNewServerConnectConfigure(bool);
+ void installServer(const QMap &containers);
void onPushButtonNewServerImport(bool);
void onPushButtonClearServer(bool);
@@ -81,7 +83,7 @@ private:
QWidget *getPageWidget(Page page);
Page currentPage();
- bool installServer(ServerCredentials credentials, QList containers, QJsonArray configs,
+ bool installContainers(ServerCredentials credentials, const QMap &containers,
QWidget *page, QProgressBar *progress, QPushButton *button, QLabel *info);
ErrorCode doInstallAction(const std::function &action, QWidget *page, QProgressBar *progress, QPushButton *button, QLabel *info);
@@ -90,7 +92,10 @@ private:
void setTrayIcon(const QString &iconPath);
void setupUiConnections();
+ void setupNewServerConnections();
+ void setupWizardConnections();
void setupAppSettingsConnections();
+ void setupGeneralSettingsConnections();
void setupNetworkSettingsConnections();
void setupProtocolsPageConnections();
void setupNewServerPageConnections();
@@ -121,6 +126,9 @@ private:
QJsonObject getShadowSocksConfigFromPage(QJsonObject oldConfig);
QJsonObject getCloakConfigFromPage(QJsonObject oldConfig);
+ QMap getInstallConfigsFromProtocolsPage() const;
+ QMap getInstallConfigsFromWizardPage() const;
+
private:
Ui::MainWindow *ui;
VpnConnection* m_vpnConnection;
@@ -157,7 +165,7 @@ private:
QStack pagesStack;
int selectedServerIndex = -1; // server index to use when proto settings page opened
DockerContainer selectedDockerContainer; // same
- ServerCredentials installCredentials; // used to save cred between pages new_server and new_server_2
+ ServerCredentials installCredentials; // used to save cred between pages new_server and new_server_protocols and wizard
};
#endif // MAINWINDOW_H
diff --git a/client/ui/mainwindow.ui b/client/ui/mainwindow.ui
index ad5ff242..cb51c430 100644
--- a/client/ui/mainwindow.ui
+++ b/client/ui/mainwindow.ui
@@ -291,7 +291,7 @@ QPushButton:hover {
- 2
+ 13
@@ -513,8 +513,8 @@ color: #100A44;
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
<html><head><meta name="qrichtext" content="1" /><style type="text/css">
p, li { white-space: pre-wrap; }
-</style></head><body style=" font-family:'Lato'; font-size:13pt; font-weight:400; font-style:normal;">
-<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:8.25pt;"><br /></p></body></html>
+</style></head><body style=" font-family:'Lato'; font-size:8.25pt; font-weight:400; font-style:normal;">
+<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><br /></p></body></html>
@@ -544,25 +544,6 @@ color: #15CDCB;
Where to get connection data →
-
-
- true
-
-
-
- 40
- 400
- 301
- 41
-
-
-
- Please wait, configuring process may take up to 5 minutes
-
-
- true
-
-
@@ -762,9 +743,27 @@ color: #15CDCB;
Password
+
+
+ true
+
+
+
+ 40
+ 390
+ 301
+ 41
+
+
+
+ Please wait, configuring process may take up to 5 minutes
+
+
+ true
+
+
textEdit_new_server_ssh_key
pushButton_new_server_get_info
- label_new_server_wait_info
lineEdit_new_server_ip
pushButton_new_server_connect
lineEdit_new_server_login
@@ -774,6 +773,7 @@ color: #15CDCB;
label_5
label_new_server_password
label_2
+ label_new_server_wait_info
@@ -840,15 +840,1126 @@ QPushButton:hover {
+
+
+
+ 40
+ 310
+ 301
+ 40
+
+
+
+ PointingHandCursor
+
+
+ QPushButton {
+color:rgb(212, 212, 212);
+border-radius: 4px;
+
+font-family: Lato;
+font-style: normal;
+font-weight: normal;
+font-size: 16px;
+line-height: 21px;
+
+background: #100A44;
+border-radius: 4px;
+}
+QPushButton:hover {
+background: #211966;
+}
+
+
+ Configure VPN protocols manually
+
+
+
+
+
+ 10
+ 35
+ 361
+ 31
+
+
+
+ QLabel {
+font-family: Lato;
+font-style: normal;
+font-weight: bold;
+font-size: 24px;
+color: #100A44;
+}
+
+
+
+ Setup your server to use VPN
+
+
+ Qt::AlignCenter
+
+
+ true
+
+
+
+
+
+ 40
+ 150
+ 301
+ 40
+
+
+
+ PointingHandCursor
+
+
+ QPushButton {
+color:rgb(212, 212, 212);
+border-radius: 4px;
+
+font-family: Lato;
+font-style: normal;
+font-weight: normal;
+font-size: 16px;
+line-height: 21px;
+
+background: #100A44;
+border-radius: 4px;
+}
+QPushButton:hover {
+background: #211966;
+}
+
+
+ Run Setup Wizard
+
+
+
+
+
+ 40
+ 100
+ 301
+ 41
+
+
+
+
+
+
+ If you want easily configure your server just run Wizard
+
+
+ Qt::AlignBottom|Qt::AlignHCenter
+
+
+ true
+
+
+
+
+
+ 40
+ 260
+ 301
+ 41
+
+
+
+
+
+
+ Press configure manually to choose VPN protocols you want to install
+
+
+ Qt::AlignBottom|Qt::AlignHCenter
+
+
+ true
+
+
-
+
+
+
+
+ 0
+ 35
+ 381
+ 31
+
+
+
+ QLabel {
+font-family: Lato;
+font-style: normal;
+font-weight: bold;
+font-size: 24px;
+color: #100A44;
+}
+
+
+
+ Setup Wizard
+
+
+ Qt::AlignCenter
+
+
+ true
+
+
+
+
+
+ 10
+ 10
+ 26
+ 20
+
+
+
+ PointingHandCursor
+
+
+ QPushButton {
+ image: url(:/images/arrow_right.png);
+ image-position: left;
+ text-align: left;
+ /*font: 17pt "Ancient";*/
+
+ padding: 1px;
+ image: url(:/images/arrow_left.png);
+}
+QPushButton:hover {
+ padding: 0px;
+}
+
+
+
+
+
+
+
+
+
+
+ 10
+ 70
+ 361
+ 561
+
+
+
+
+
+ 10
+ 10
+ 331
+ 25
+
+
+
+ High censorship level
+
+
+
+
+
+ 10
+ 180
+ 331
+ 30
+
+
+
+ Medium censorship level
+
+
+ true
+
+
+
+
+
+ 10
+ 330
+ 331
+ 30
+
+
+
+ Low censorship level
+
+
+
+
+
+ 30
+ 40
+ 321
+ 121
+
+
+
+ I'm living in country with high censorship level. Many of foreign web sites and VPNs blocked by my government. I want to setup reliable VPN, which is invisible for government.
+
+
+ Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop
+
+
+ true
+
+
+ Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse
+
+
+
+
+
+ 30
+ 210
+ 321
+ 101
+
+
+
+ I'm living in country with medium censorship level. Some web sites blocked by my government, but VPNs are not blocked at all. I want to setup flexible solution.
+
+
+ Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop
+
+
+ true
+
+
+ Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse
+
+
+
+
+
+ 30
+ 360
+ 321
+ 51
+
+
+
+ I just want to improve my privacy in internet.
+
+
+ Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop
+
+
+ true
+
+
+ Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse
+
+
+
+
+
+ 30
+ 490
+ 301
+ 40
+
+
+
+ PointingHandCursor
+
+
+ QPushButton {
+color:rgb(212, 212, 212);
+border-radius: 4px;
+
+font-family: Lato;
+font-style: normal;
+font-weight: normal;
+font-size: 16px;
+line-height: 21px;
+
+background: #100A44;
+border-radius: 4px;
+}
+QPushButton:hover {
+background: #211966;
+}
+
+
+ Next
+
+
+
+
+
+
+
+
+ 0
+ 35
+ 381
+ 31
+
+
+
+ QLabel {
+font-family: Lato;
+font-style: normal;
+font-weight: bold;
+font-size: 24px;
+color: #100A44;
+}
+
+
+
+ Setup Wizard
+
+
+ Qt::AlignCenter
+
+
+ true
+
+
+
+
+
+ 10
+ 70
+ 361
+ 561
+
+
+
+ QLabel {
+ font-size: 16px;
+}
+
+
+
+
+ 30
+ 10
+ 321
+ 321
+
+
+
+ AmneziaVPN will install VPN protocol which is not visible for your internet provider and government firewall. Your VPN connection will be detected by your provider as regular web traffic to particular web site.
+
+You SHOULD set this web site address to some foreign web site which is not blocked by your internet provider. Other words you need to type below some foreign web site address which is accessible without VPN.
+
+Please note, this protocol still does not support export connection profile to mobile devices. Keep for updates.
+
+
+ Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop
+
+
+ true
+
+
+ Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse
+
+
+
+
+
+ 30
+ 400
+ 321
+ 71
+
+
+
+ OpenVPN over Cloak (VPN obfuscation) profile will be installed
+
+
+ Qt::AlignBottom|Qt::AlignLeading|Qt::AlignLeft
+
+
+ true
+
+
+
+
+
+ 30
+ 490
+ 301
+ 40
+
+
+
+ PointingHandCursor
+
+
+ QPushButton {
+color:rgb(212, 212, 212);
+border-radius: 4px;
+
+font-family: Lato;
+font-style: normal;
+font-weight: normal;
+font-size: 16px;
+line-height: 21px;
+
+background: #100A44;
+border-radius: 4px;
+}
+QPushButton:hover {
+background: #211966;
+}
+
+
+ Next
+
+
+
+
+
+ 30
+ 360
+ 301
+ 41
+
+
+
+
+
+
+ 30
+ 330
+ 291
+ 21
+
+
+
+ Type web site address for mask
+
+
+
+
+
+
+ 10
+ 10
+ 26
+ 20
+
+
+
+ PointingHandCursor
+
+
+ QPushButton {
+ image: url(:/images/arrow_right.png);
+ image-position: left;
+ text-align: left;
+ /*font: 17pt "Ancient";*/
+
+ padding: 1px;
+ image: url(:/images/arrow_left.png);
+}
+QPushButton:hover {
+ padding: 0px;
+}
+
+
+
+
+
+
+
+
+
+
+
+
+ 10
+ 70
+ 361
+ 561
+
+
+
+ QLabel {
+ font-size: 16px;
+}
+
+
+
+
+ 30
+ 10
+ 321
+ 341
+
+
+
+ Optional.
+
+We recommend to enable VPN mode "For selected sites" and add blocked sites you need to visit manually. If you will choose this option, you will need add every bloked site you want to visit to the access list. You may switch between modes later.
+
+Please note, you should add addresses to the list after VPN connection established. You may add any domain, URL or IP address, it will be resolved to IP address.
+
+
+ Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop
+
+
+ true
+
+
+ Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse
+
+
+
+
+
+ 30
+ 490
+ 301
+ 40
+
+
+
+ PointingHandCursor
+
+
+ QPushButton {
+color:rgb(212, 212, 212);
+border-radius: 4px;
+
+font-family: Lato;
+font-style: normal;
+font-weight: normal;
+font-size: 16px;
+line-height: 21px;
+
+background: #100A44;
+border-radius: 4px;
+}
+QPushButton:hover {
+background: #211966;
+}
+
+
+ Start configuring
+
+
+
+
+
+ 30
+ 350
+ 301
+ 71
+
+
+
+ Turn on mode "VPN for selected sites"
+
+
+
+
+
+
+ 10
+ 10
+ 26
+ 20
+
+
+
+ PointingHandCursor
+
+
+ QPushButton {
+ image: url(:/images/arrow_right.png);
+ image-position: left;
+ text-align: left;
+ /*font: 17pt "Ancient";*/
+
+ padding: 1px;
+ image: url(:/images/arrow_left.png);
+}
+QPushButton:hover {
+ padding: 0px;
+}
+
+
+
+
+
+
+
+
+
+
+ 0
+ 35
+ 381
+ 31
+
+
+
+ QLabel {
+font-family: Lato;
+font-style: normal;
+font-weight: bold;
+font-size: 24px;
+color: #100A44;
+}
+
+
+
+ Setup Wizard
+
+
+ Qt::AlignCenter
+
+
+ true
+
+
+
+
+
+
+
+ 0
+ 35
+ 381
+ 31
+
+
+
+ QLabel {
+font-family: Lato;
+font-style: normal;
+font-weight: bold;
+font-size: 24px;
+color: #100A44;
+}
+
+
+
+ Setup Wizard
+
+
+ Qt::AlignCenter
+
+
+ true
+
+
+
+
+
+ 10
+ 70
+ 361
+ 561
+
+
+
+ QLabel {
+ font-size: 16px;
+}
+
+
+
+
+ 30
+ 10
+ 321
+ 341
+
+
+
+ AmneziaVPN will install VPN protocol which is difficult to detect by your internet provider and government firewall (but possible). In most cases, this is the most suitable protocol. This protocol is faster compared to the VPN protocols with "web traffic masking".
+
+This protocol support export connection profile to mobile devices using QR code (you should launch 3rd party opensource VPN client - ShadowSocks VPN).
+
+
+ Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop
+
+
+ true
+
+
+ Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse
+
+
+
+
+
+ 30
+ 400
+ 321
+ 71
+
+
+
+ OpenVPN over ShadowSocks profile will be installed
+
+
+ Qt::AlignBottom|Qt::AlignLeading|Qt::AlignLeft
+
+
+ true
+
+
+
+
+
+ 30
+ 490
+ 301
+ 40
+
+
+
+ PointingHandCursor
+
+
+ QPushButton {
+color:rgb(212, 212, 212);
+border-radius: 4px;
+
+font-family: Lato;
+font-style: normal;
+font-weight: normal;
+font-size: 16px;
+line-height: 21px;
+
+background: #100A44;
+border-radius: 4px;
+}
+QPushButton:hover {
+background: #211966;
+}
+
+
+ Next
+
+
+
+
+
+
+ 10
+ 10
+ 26
+ 20
+
+
+
+ PointingHandCursor
+
+
+ QPushButton {
+ image: url(:/images/arrow_right.png);
+ image-position: left;
+ text-align: left;
+ /*font: 17pt "Ancient";*/
+
+ padding: 1px;
+ image: url(:/images/arrow_left.png);
+}
+QPushButton:hover {
+ padding: 0px;
+}
+
+
+
+
+
+
+
+
+
+
+
+
+ 0
+ 35
+ 381
+ 31
+
+
+
+ QLabel {
+font-family: Lato;
+font-style: normal;
+font-weight: bold;
+font-size: 24px;
+color: #100A44;
+}
+
+
+
+ Setup Wizard
+
+
+ Qt::AlignCenter
+
+
+ true
+
+
+
+
+
+ 10
+ 70
+ 361
+ 561
+
+
+
+ QLabel {
+ font-size: 16px;
+}
+
+
+
+
+ 30
+ 10
+ 321
+ 341
+
+
+
+ AmneziaVPN will install OpenVPN protocol with public/private key pairs generated on server and client sides. You can also configure connection on your mobile device by copying exported ".ovpn" file to your device and setting up official OpenVPN client. We recommend do not use messengers for sending connection profile - it contains VPN private keys.
+
+
+ Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop
+
+
+ true
+
+
+ Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse
+
+
+
+
+
+ 30
+ 400
+ 321
+ 71
+
+
+
+ OpenVPN profile will be installed
+
+
+ Qt::AlignBottom|Qt::AlignLeading|Qt::AlignLeft
+
+
+ true
+
+
+
+
+
+ 30
+ 490
+ 301
+ 40
+
+
+
+ PointingHandCursor
+
+
+ QPushButton {
+color:rgb(212, 212, 212);
+border-radius: 4px;
+
+font-family: Lato;
+font-style: normal;
+font-weight: normal;
+font-size: 16px;
+line-height: 21px;
+
+background: #100A44;
+border-radius: 4px;
+}
+QPushButton:hover {
+background: #211966;
+}
+
+
+ Start configuring
+
+
+
+
+
+
+ 10
+ 10
+ 26
+ 20
+
+
+
+ PointingHandCursor
+
+
+ QPushButton {
+ image: url(:/images/arrow_right.png);
+ image-position: left;
+ text-align: left;
+ /*font: 17pt "Ancient";*/
+
+ padding: 1px;
+ image: url(:/images/arrow_left.png);
+}
+QPushButton:hover {
+ padding: 0px;
+}
+
+
+
+
+
+
+
+
+
+
+
+
+ 40
+ 510
+ 301
+ 40
+
+
+
+ QProgressBar{
+color:rgb(212, 212, 212);
+border-radius: 4px;
+
+font-family: Lato;
+font-style: normal;
+font-weight: normal;
+font-size: 16px;
+line-height: 21px;
+
+background: #100A44;
+border-radius: 4px;
+}
+
+QProgressBar::chunk {
+background: rgba(255, 255, 255, 0.15);
+border-radius: 4px 0px 0px 4px;
+
+}
+
+
+
+ 0
+
+
+ Qt::AlignCenter
+
+
+ true
+
+
+ Configuring...
+
+
+
+
+
+ 0
+ 35
+ 381
+ 31
+
+
+
+ QLabel {
+font-family: Lato;
+font-style: normal;
+font-weight: bold;
+font-size: 24px;
+color: #100A44;
+}
+
+
+
+ Configuring...
+
+
+ Qt::AlignCenter
+
+
+ true
+
+
+
+
+
+ 30
+ 90
+ 321
+ 31
+
+
+
+ Please wait.
+
+
+ Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop
+
+
+ true
+
+
+ Qt::LinksAccessibleByMouse|Qt::TextSelectableByMouse
+
+
+
+
+ true
+
+
+
+ 40
+ 560
+ 301
+ 41
+
+
+
+ Please wait, configuring process may take up to 5 minutes
+
+
+ true
+
+
+
+
10
- 30
+ 35
361
- 61
+ 31
@@ -861,7 +1972,7 @@ color: #100A44;
- Select VPN protocols to install
+ Select VPN protocols
Qt::AlignCenter
@@ -870,7 +1981,7 @@ color: #100A44;
true
-
+
10
@@ -906,7 +2017,7 @@ QPushButton:hover {
0
- 95
+ 70
380
471
@@ -1468,12 +2579,12 @@ border: none;
-
- UDP
+ udp
-
- TCP
+ tcp
@@ -1507,7 +2618,7 @@ border: none;
40
- 580
+ 570
301
40
@@ -1551,7 +2662,7 @@ border-radius: 4px 0px 0px 4px;
40
- 580
+ 570
301
40
@@ -2020,9 +3131,9 @@ QPushButton:hover {
20
- 50
+ 40
340
- 40
+ 60
@@ -2038,7 +3149,7 @@ color: #100A44;
These sites will be opened using VPN
- Qt::AlignCenter
+ Qt::AlignHCenter|Qt::AlignTop
true
@@ -2048,7 +3159,7 @@ color: #100A44;
20
- 150
+ 140
281
31
@@ -2090,7 +3201,7 @@ color: #100A44;
310
- 150
+ 140
51
31
@@ -2117,7 +3228,7 @@ background: #211966;
20
- 115
+ 110
311
21
@@ -2183,6 +3294,24 @@ QListView::item:hover {
+
+ QPushButton {
+font-family: Lato;
+font-style: normal;
+font-weight: bold;
+font-size: 20px;
+line-height: 25px;
+Text-align:left;
+padding-left: 30px;
+
+
+/* black */
+color: #100A44;
+
+background-repeat: no-repeat;
+ background-position: left center;
+}
+
@@ -2247,21 +3376,7 @@ QPushButton:hover {
Reinstall server, clear server
- font-family: Lato;
-font-style: normal;
-font-weight: bold;
-font-size: 20px;
-line-height: 25px;
-Text-align:left;
-padding-left: 30px;
-
-
-/* black */
-color: #100A44;
-
-background-image: url(:/images/server_settings.png);
-background-repeat: no-repeat;
- background-position: left center;
+ background-image: url(:/images/server_settings.png);
Server management
@@ -2299,21 +3414,7 @@ background-repeat: no-repeat;
PointingHandCursor
- font-family: Lato;
-font-style: normal;
-font-weight: bold;
-font-size: 20px;
-line-height: 25px;
-Text-align:left;
-padding-left: 30px;
-
-
-/* black */
-color: #100A44;
-
-background-image: url(:/images/share.png);
-background-repeat: no-repeat;
- background-position: left center;
+ background-image: url(:/images/share.png);
Share connection
@@ -2367,20 +3468,7 @@ background-repeat: no-repeat;
PointingHandCursor
- font-family: Lato;
-font-style: normal;
-font-weight: bold;
-font-size: 20px;
-line-height: 25px;
-Text-align:left;
-padding-left: 30px;
-
-
-/* black */
-color: #100A44;
-
-background-repeat: no-repeat;
- background-position: left center;
+
Exit
@@ -2418,21 +3506,8 @@ background-repeat: no-repeat;
Auto start, Auto connect
- font-family: Lato;
-font-style: normal;
-font-weight: bold;
-font-size: 20px;
-line-height: 25px;
-Text-align:left;
-padding-left: 30px;
-
-
-/* black */
-color: #100A44;
-
-background-image: url(:/images/settings.png);
-background-repeat: no-repeat;
- background-position: left center;
+ background-image: url(:/images/settings.png);
+
App settings
@@ -2483,24 +3558,11 @@ background-repeat: no-repeat;
PointingHandCursor
- Dns, Kill Switch
+ DNS settings
- font-family: Lato;
-font-style: normal;
-font-weight: bold;
-font-size: 20px;
-line-height: 25px;
-Text-align:left;
-padding-left: 30px;
-
-
-/* black */
-color: #100A44;
-
-background-image: url(:/images/settings.png);
-background-repeat: no-repeat;
- background-position: left center;
+ background-image: url(:/images/settings.png);
+
Network settings
@@ -2522,21 +3584,7 @@ background-repeat: no-repeat;
Reinstall server, clear server
- font-family: Lato;
-font-style: normal;
-font-weight: bold;
-font-size: 20px;
-line-height: 25px;
-Text-align:left;
-padding-left: 30px;
-
-
-/* black */
-color: #100A44;
-
-background-image: url(:/images/server_settings.png);
-background-repeat: no-repeat;
- background-position: left center;
+ background-image: url(:/images/server_settings.png);
Servers
@@ -2558,6 +3606,45 @@ background-repeat: no-repeat;
+
+
+
+ 10
+ 400
+ 360
+ 10
+
+
+
+ image: url(:/images/line.png);
+
+
+
+
+
+
+
+
+ 30
+ 360
+ 330
+ 30
+
+
+
+ PointingHandCursor
+
+
+ Add or import new server
+
+
+ background-image: url(:/images/plus.png);
+
+
+
+ Add server
+
+
@@ -2671,7 +3758,7 @@ QPushButton:hover {
50
- 40
+ 30
171
40
@@ -2696,7 +3783,7 @@ color: #100A44;
240
- 49
+ 39
24
24
@@ -2785,7 +3872,7 @@ QPushButton:hover {
20
- 50
+ 30
340
40
@@ -2864,7 +3951,7 @@ background: #211966;
- Software version: 1.6.1 (09.05.2021)
+ Software version: 1.7.0 (18.05.2021)
@@ -2880,6 +3967,41 @@ background: #211966;
Start minimized
+
+
+
+ 30
+ 340
+ 321
+ 41
+
+
+
+ PointingHandCursor
+
+
+ QPushButton {
+color:rgb(212, 212, 212);
+border-radius: 4px;
+
+font-family: Lato;
+font-style: normal;
+font-weight: normal;
+font-size: 16px;
+line-height: 21px;
+
+background: #100A44;
+border-radius: 4px;
+}
+
+QPushButton:hover {
+background: #211966;
+}
+
+
+ Open logs folder
+
+
@@ -2950,7 +4072,7 @@ QPushButton:hover {
20
- 50
+ 30
340
40
@@ -4265,7 +5387,7 @@ QToolBox::tab:hover {
0
- 1
+ 0
6
@@ -4275,8 +5397,8 @@ QToolBox::tab:hover {
0
0
- 100
- 30
+ 360
+ 360
@@ -4563,8 +5685,8 @@ background: #282932;
0
0
- 100
- 30
+ 360
+ 360
@@ -4729,8 +5851,8 @@ background: #282932;
0
0
- 100
- 30
+ 360
+ 360
@@ -4953,8 +6075,8 @@ color: #15CDCB;
0
0
- 100
- 30
+ 360
+ 360
@@ -5355,6 +6477,11 @@ background: #211966;
BLAKE2s256
+ -
+
+ SHA1
+
+
@@ -5379,7 +6506,7 @@ background: #211966;
30
- 400
+ 430
321
21
@@ -5457,6 +6584,22 @@ border-radius: 4px 0px 0px 4px;
true
+
+
+
+ 30
+ 390
+ 321
+ 21
+
+
+
+ Enable TLS auth
+
+
+ false
+
+
progressBar_proto_openvpn_reset
label_38
label_97
@@ -5473,6 +6616,7 @@ border-radius: 4px 0px 0px 4px;
label_103
checkBox_proto_openvpn_block_dns
label_proto_openvpn_info
+ checkBox_proto_openvpn_tls_auth
diff --git a/service/server/tapcontroller_win.cpp b/service/server/tapcontroller_win.cpp
index 44e18165..537d1334 100644
--- a/service/server/tapcontroller_win.cpp
+++ b/service/server/tapcontroller_win.cpp
@@ -140,6 +140,10 @@ bool TapController::checkAndSetup()
qDebug() << "TapController: Installing TAP driver...";
bool ok = setupDriver();
+ if (QSysInfo::prettyProductName().contains("Server 2008")) {
+ restartTapService();
+ }
+
if (ok) qDebug() << "TapController: TAP driver successfully installed";
else qDebug() << "TapController: Failed to install TAP driver";
@@ -255,7 +259,7 @@ QString TapController::getTapInstallPath()
{
#ifdef Q_OS_WIN
- if (QOperatingSystemVersion::current() <= QOperatingSystemVersion::Windows7) {
+ if (oldDriversRequired()) {
return qApp->applicationDirPath() + "\\tap\\"+ QSysInfo::currentCpuArchitecture() + "_windows_7\\tapinstall.exe";
}
else {
@@ -285,7 +289,7 @@ QString TapController::getOpenVpnPath()
QString TapController::getTapDriverDir()
{
- if (QOperatingSystemVersion::current() <= QOperatingSystemVersion::Windows7) {
+ if (oldDriversRequired()) {
return qApp->applicationDirPath() + "\\tap\\"+ QSysInfo::currentCpuArchitecture() + "_windows_7\\";
}
else {
@@ -323,9 +327,36 @@ bool TapController::removeDriver(const QString& tapInstanceId)
}
}
+bool TapController::oldDriversRequired()
+{
+ if (QOperatingSystemVersion::current() <= QOperatingSystemVersion::Windows7) return true;
+ if (QSysInfo::prettyProductName().contains("Server 2008")) return true;
+
+ return false;
+}
+
+bool TapController::restartTapService()
+{
+ {
+ QProcess tapRestartroc;
+ tapRestartroc.start("net", QStringList() << "stop" << "TapiSrv");
+ if(!tapRestartroc.waitForStarted()) return false;
+ tapRestartroc.waitForFinished();
+ }
+
+ {
+ QProcess tapRestartroc;
+ tapRestartroc.start("net", QStringList() << "start" << "TapiSrv");
+ if(!tapRestartroc.waitForStarted()) return false;
+ tapRestartroc.waitForFinished();
+ }
+
+ return true;
+}
+
bool TapController::setupDriver()
{
- if (QOperatingSystemVersion::current() <= QOperatingSystemVersion::Windows7) {
+ if (oldDriversRequired()) {
setupDriverCertificate();
}
diff --git a/service/server/tapcontroller_win.h b/service/server/tapcontroller_win.h
index 37043c03..49f1dece 100644
--- a/service/server/tapcontroller_win.h
+++ b/service/server/tapcontroller_win.h
@@ -35,6 +35,9 @@ private:
static bool setupDriverCertificate();
static bool removeDriver(const QString& tapInstanceId);
+ static bool oldDriversRequired();
+ static bool restartTapService();
+
};
#endif // TAPCONTROLLER_H