For the openvpn-cloak container, the choice of the transport protocol in the openvpn settings is blocked

This commit is contained in:
vladimir.kuznetsov 2023-01-29 08:39:31 +03:00
parent ee609f3e8f
commit d652ecff21
5 changed files with 12 additions and 14 deletions

View file

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

View file

@ -1,6 +1,6 @@
cat > /opt/amnezia/openvpn/server.conf <<EOF cat > /opt/amnezia/openvpn/server.conf <<EOF
port $OPENVPN_PORT port $OPENVPN_PORT
proto $OPENVPN_TRANSPORT_PROTO proto tcp
dev tun dev tun
ca /opt/amnezia/openvpn/ca.crt ca /opt/amnezia/openvpn/ca.crt
cert /opt/amnezia/openvpn/AmneziaReq.crt cert /opt/amnezia/openvpn/AmneziaReq.crt
@ -39,7 +39,7 @@ cat > /opt/amnezia/cloak/ck-config.json <<EOF
{ {
"ProxyBook": { "ProxyBook": {
"openvpn": [ "openvpn": [
"$OPENVPN_TRANSPORT_PROTO", "tcp",
"localhost:$OPENVPN_PORT" "localhost:$OPENVPN_PORT"
], ],
"shadowsocks": [ "shadowsocks": [

View file

@ -51,9 +51,15 @@ void OpenVpnLogic::updateProtocolPage(const QJsonObject &openvpnConfig, DockerCo
set_lineEditSubnetText(openvpnConfig.value(config_key::subnet_address). set_lineEditSubnetText(openvpnConfig.value(config_key::subnet_address).
toString(protocols::openvpn::defaultSubnetAddress)); toString(protocols::openvpn::defaultSubnetAddress));
QString trasnsport = openvpnConfig.value(config_key::transport_proto). QString trasnsport;
toString(protocols::openvpn::defaultTransportProto); 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_radioButtonUdpChecked(trasnsport == protocols::openvpn::defaultTransportProto);
set_radioButtonTcpChecked(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); toString(protocols::openvpn::defaultAdditionalServerConfig);
set_textAreaAdditionalServerConfig(additionalServerConfig); set_textAreaAdditionalServerConfig(additionalServerConfig);
if (container == DockerContainer::ShadowSocks) {
set_radioButtonUdpEnabled(false);
set_radioButtonTcpEnabled(false);
set_radioButtonTcpChecked(true);
}
set_lineEditPortText(openvpnConfig.value(config_key::port). set_lineEditPortText(openvpnConfig.value(config_key::port).
toString(protocols::openvpn::defaultPort)); toString(protocols::openvpn::defaultPort));

View file

@ -63,7 +63,7 @@ PageBase {
pageLoader.focus = true pageLoader.focus = true
} }
onContainerSelected: { onContainerSelected: function(c_index){
var containerProto = ContainerProps.defaultProtocol(c_index) var containerProto = ContainerProps.defaultProtocol(c_index)
tf_port_num.text = ProtocolProps.defaultPort(containerProto) tf_port_num.text = ProtocolProps.defaultPort(containerProto)

View file

@ -55,7 +55,6 @@ PageBase {
tf_port_num.text = qsTr("Default") tf_port_num.text = qsTr("Default")
} }
else tf_port_num.text = ProtocolProps.defaultPort(containerProto) else tf_port_num.text = ProtocolProps.defaultPort(containerProto)
cb_port_proto.currentIndex = ProtocolProps.defaultTransportProto(containerProto) cb_port_proto.currentIndex = ProtocolProps.defaultTransportProto(containerProto)
tf_port_num.enabled = ProtocolProps.defaultPortChangeable(containerProto) tf_port_num.enabled = ProtocolProps.defaultPortChangeable(containerProto)