From 246115837eeb26bcd26d1b89809b82eb70bbfe49 Mon Sep 17 00:00:00 2001
From: zhengkunwang <31820853+zhengkunwang223@users.noreply.github.com>
Date: Fri, 1 Dec 2023 16:58:10 +0800
Subject: [PATCH] =?UTF-8?q?feat:=20=E5=BA=94=E7=94=A8=E5=AE=89=E8=A3=85?=
=?UTF-8?q?=E5=A2=9E=E5=8A=A0=20IPV6=20=E5=9C=B0=E5=9D=80=E7=AB=AF?=
=?UTF-8?q?=E5=8F=A3=E7=9B=91=E5=90=AC=20(#3130)?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Refs https://github.com/1Panel-dev/1Panel/issues/2990
---
backend/app/service/app_utils.go | 4 ++--
frontend/src/views/app-store/detail/install/index.vue | 9 +++++----
frontend/src/views/app-store/installed/detail/index.vue | 9 +++++----
3 files changed, 12 insertions(+), 10 deletions(-)
diff --git a/backend/app/service/app_utils.go b/backend/app/service/app_utils.go
index 4cabc8961..d51be064e 100644
--- a/backend/app/service/app_utils.go
+++ b/backend/app/service/app_utils.go
@@ -1136,7 +1136,7 @@ func addDockerComposeCommonParam(composeMap map[string]interface{}, serviceName
if portExist {
allowHost := "127.0.0.1"
if req.Advanced && req.AllowPort {
- allowHost = "0.0.0.0"
+ allowHost = ""
}
params[constant.HostIP] = allowHost
}
@@ -1148,7 +1148,7 @@ func getAppCommonConfig(envs map[string]interface{}) request.AppContainerConfig
config := request.AppContainerConfig{}
if hostIp, ok := envs[constant.HostIP]; ok {
- config.AllowPort = hostIp.(string) == "0.0.0.0"
+ config.AllowPort = hostIp.(string) != "127.0.0.1"
} else {
config.AllowPort = true
}
diff --git a/frontend/src/views/app-store/detail/install/index.vue b/frontend/src/views/app-store/detail/install/index.vue
index 38cd6a794..c6e88f7fd 100644
--- a/frontend/src/views/app-store/detail/install/index.vue
+++ b/frontend/src/views/app-store/detail/install/index.vue
@@ -65,6 +65,10 @@
:placeholder="$t('app.containerNameHelper')"
>
+
+
+ {{ $t('app.allowPortHelper') }}
+
-
-
- {{ $t('app.allowPortHelper') }}
-
+
{{ $t('app.editComposeHelper') }}
diff --git a/frontend/src/views/app-store/installed/detail/index.vue b/frontend/src/views/app-store/installed/detail/index.vue
index d90c2cb0f..48fa7a378 100644
--- a/frontend/src/views/app-store/installed/detail/index.vue
+++ b/frontend/src/views/app-store/installed/detail/index.vue
@@ -52,6 +52,10 @@
:placeholder="$t('app.containerNameHelper')"
>
+
+
+ {{ $t('app.allowPortHelper') }}
+
{{ $t('container.limitHelper') }}
-
-
- {{ $t('app.allowPortHelper') }}
-
+
{{ $t('app.editComposeHelper') }}