From bae5b511037d49f1f4be3ecb180b996dbd031f5c Mon Sep 17 00:00:00 2001 From: Squidly271 Date: Sun, 16 Feb 2025 11:31:25 -0500 Subject: [PATCH] Disallow TS integration on network types host/container --- .../include/CreateDocker.php | 24 ++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) diff --git a/emhttp/plugins/dynamix.docker.manager/include/CreateDocker.php b/emhttp/plugins/dynamix.docker.manager/include/CreateDocker.php index ef636c2c5..3384039bf 100644 --- a/emhttp/plugins/dynamix.docker.manager/include/CreateDocker.php +++ b/emhttp/plugins/dynamix.docker.manager/include/CreateDocker.php @@ -1153,7 +1153,7 @@ _(Container Network)_: -
+
_(Use Tailscale)_: : onchange="showTailscale(this)"> @@ -1161,6 +1161,13 @@ _(Use Tailscale)_:
+
+_(Use Tailscale)_: +: _(Option disabled as Network type is not bridge or custom)_ + +:docker_tailscale_help: + +
_(NOTE)_: : _(This option will install Tailscale and dependencies into the container.)_ @@ -1536,8 +1543,13 @@ function showSubnet(bridge) { $('#netCONT').val(''); } // make sure to re-trigger Tailscale check when network is changed - if ($('#contTailscale').prop('checked')) { - showTailscale(true); + if (bridge.match(/^(host|container)$/i) !== null) { + $('#contTailscale').click().switchButton({checked: false}).prop('checked',false); + $(".TSNetworkAllowed").hide(); + $(".TSNetworkNotAllowed").show(); + } else { + $(".TSNetworkAllowed").show(); + $(".TSNetworkNotAllowed").hide(); } } @@ -1689,6 +1701,12 @@ function showTSAdvanced(checked) { } function showTailscale(source) { + var bridge = $('select[name="contNetwork"]').val(); + if (bridge.match(/^(host|container)$/i) !== null) { + $('#contTailscale').click().switchButton({checked: false}).prop('checked',false); + $(".TSNetworkAllowed").hide(); + $(".TSNetworkNotAllowed").show(); + } if (!$.trim($('#TSallowlanaccess').val())) { $('#TSallowlanaccess').val('false'); }