Merge pull request #162 from amnezia-vpn/bugfix/cloak-transport-protocol
bugfix/cloak-transport-protocol
This commit is contained in:
commit
78b8a1c36f
8 changed files with 16 additions and 19 deletions
|
|
@ -549,10 +549,9 @@ ErrorCode ServerController::installDockerWorker(const ServerCredentials &credent
|
|||
return ErrorCode::NoError;
|
||||
});
|
||||
|
||||
watcher.setFuture(future);
|
||||
|
||||
QEventLoop wait;
|
||||
QObject::connect(&watcher, &QFutureWatcher<ErrorCode>::finished, &wait, &QEventLoop::quit);
|
||||
watcher.setFuture(future);
|
||||
wait.exec();
|
||||
|
||||
m_cancelInstallation = false;
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ WireguardProtocol::WireguardProtocol(const QJsonObject &configuration, QObject*
|
|||
VpnProtocol(configuration, parent)
|
||||
{
|
||||
m_configFile.setFileName(QDir::tempPath() + QDir::separator() + serviceName() + ".conf");
|
||||
readWireguardConfiguration(configuration);
|
||||
writeWireguardConfiguration(configuration);
|
||||
}
|
||||
|
||||
WireguardProtocol::~WireguardProtocol()
|
||||
|
|
@ -70,7 +70,7 @@ void WireguardProtocol::stop()
|
|||
|
||||
}
|
||||
|
||||
void WireguardProtocol::readWireguardConfiguration(const QJsonObject &configuration)
|
||||
void WireguardProtocol::writeWireguardConfiguration(const QJsonObject &configuration)
|
||||
{
|
||||
QJsonObject jConfig = configuration.value(ProtocolProps::key_proto_config_data(Proto::WireGuard)).toObject();
|
||||
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@ public:
|
|||
|
||||
private:
|
||||
QString configPath() const;
|
||||
void readWireguardConfiguration(const QJsonObject &configuration);
|
||||
void writeWireguardConfiguration(const QJsonObject &configuration);
|
||||
|
||||
void updateRouteGateway(QString line);
|
||||
void updateVpnGateway(const QString &line);
|
||||
|
|
|
|||
|
|
@ -1,5 +1,4 @@
|
|||
FROM alpine:3.15
|
||||
|
||||
LABEL maintainer="AmneziaVPN"
|
||||
|
||||
ARG SS_RELEASE="v1.13.1"
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
cat > /opt/amnezia/openvpn/server.conf <<EOF
|
||||
port $OPENVPN_PORT
|
||||
proto $OPENVPN_TRANSPORT_PROTO
|
||||
proto tcp
|
||||
dev tun
|
||||
ca /opt/amnezia/openvpn/ca.crt
|
||||
cert /opt/amnezia/openvpn/AmneziaReq.crt
|
||||
|
|
@ -39,7 +39,7 @@ cat > /opt/amnezia/cloak/ck-config.json <<EOF
|
|||
{
|
||||
"ProxyBook": {
|
||||
"openvpn": [
|
||||
"$OPENVPN_TRANSPORT_PROTO",
|
||||
"tcp",
|
||||
"localhost:$OPENVPN_PORT"
|
||||
],
|
||||
"shadowsocks": [
|
||||
|
|
|
|||
|
|
@ -51,9 +51,15 @@ void OpenVpnLogic::updateProtocolPage(const QJsonObject &openvpnConfig, DockerCo
|
|||
set_lineEditSubnetText(openvpnConfig.value(config_key::subnet_address).
|
||||
toString(protocols::openvpn::defaultSubnetAddress));
|
||||
|
||||
QString trasnsport = openvpnConfig.value(config_key::transport_proto).
|
||||
toString(protocols::openvpn::defaultTransportProto);
|
||||
|
||||
QString trasnsport;
|
||||
if (container == DockerContainer::ShadowSocks || container == DockerContainer::Cloak) {
|
||||
trasnsport = "tcp";
|
||||
set_radioButtonUdpEnabled(false);
|
||||
set_radioButtonTcpEnabled(false);
|
||||
} else {
|
||||
trasnsport = openvpnConfig.value(config_key::transport_proto).
|
||||
toString(protocols::openvpn::defaultTransportProto);
|
||||
}
|
||||
set_radioButtonUdpChecked(trasnsport == protocols::openvpn::defaultTransportProto);
|
||||
set_radioButtonTcpChecked(trasnsport != protocols::openvpn::defaultTransportProto);
|
||||
|
||||
|
|
@ -80,12 +86,6 @@ void OpenVpnLogic::updateProtocolPage(const QJsonObject &openvpnConfig, DockerCo
|
|||
toString(protocols::openvpn::defaultAdditionalServerConfig);
|
||||
set_textAreaAdditionalServerConfig(additionalServerConfig);
|
||||
|
||||
if (container == DockerContainer::ShadowSocks) {
|
||||
set_radioButtonUdpEnabled(false);
|
||||
set_radioButtonTcpEnabled(false);
|
||||
set_radioButtonTcpChecked(true);
|
||||
}
|
||||
|
||||
set_lineEditPortText(openvpnConfig.value(config_key::port).
|
||||
toString(protocols::openvpn::defaultPort));
|
||||
|
||||
|
|
|
|||
|
|
@ -63,7 +63,7 @@ PageBase {
|
|||
pageLoader.focus = true
|
||||
}
|
||||
|
||||
onContainerSelected: {
|
||||
onContainerSelected: function(c_index){
|
||||
var containerProto = ContainerProps.defaultProtocol(c_index)
|
||||
|
||||
tf_port_num.text = ProtocolProps.defaultPort(containerProto)
|
||||
|
|
|
|||
|
|
@ -55,7 +55,6 @@ PageBase {
|
|||
tf_port_num.text = qsTr("Default")
|
||||
}
|
||||
else tf_port_num.text = ProtocolProps.defaultPort(containerProto)
|
||||
|
||||
cb_port_proto.currentIndex = ProtocolProps.defaultTransportProto(containerProto)
|
||||
|
||||
tf_port_num.enabled = ProtocolProps.defaultPortChangeable(containerProto)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue