Merge pull request #162 from amnezia-vpn/bugfix/cloak-transport-protocol

bugfix/cloak-transport-protocol
This commit is contained in:
pokamest 2023-01-30 20:43:15 +00:00 committed by GitHub
commit 78b8a1c36f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 16 additions and 19 deletions

View file

@ -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;

View file

@ -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();

View file

@ -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);

View file

@ -1,5 +1,4 @@
FROM alpine:3.15
LABEL maintainer="AmneziaVPN"
ARG SS_RELEASE="v1.13.1"

View file

@ -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": [

View file

@ -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));

View file

@ -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)

View file

@ -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)