mirror of
https://github.com/amnezia-vpn/amnezia-client.git
synced 2026-06-22 02:01:08 +07:00
For the openvpn-cloak container, the choice of the transport protocol in the openvpn settings is blocked
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user