Skip to content
Permalink

Comparing changes

This is a direct comparison between two commits made in this repository or its related repositories. View the default comparison for this range or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: 1Panel-dev/1Panel
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 969f487a6bb9dc355ac1791faada3b49cc0d9854
Choose a base ref
..
head repository: 1Panel-dev/1Panel
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 1a1c3d93521354b220aa132e867acef1bddb8616
Choose a head ref
Showing with 941 additions and 906 deletions.
  1. +3 −2 agent/app/dto/request/runtime.go
  2. +1 −1 agent/app/dto/response/runtime.go
  3. +1 −1 agent/app/model/runtime.go
  4. +6 −0 agent/app/repo/common.go
  5. +4 −1 agent/app/repo/runtime.go
  6. +14 −13 agent/app/service/app.go
  7. +29 −43 agent/app/service/runtime.go
  8. +39 −5 agent/app/service/runtime_utils.go
  9. +1 −1 agent/cmd/server/conf/app.yaml
  10. +1 −1 agent/init/migration/migrations/init.go
  11. +2 −1 core/constant/common.go
  12. +0 −2 frontend/package.json
  13. +1 −0 frontend/src/api/interface/runtime.ts
  14. +29 −33 frontend/src/api/modules/app.ts
  15. +28 −28 frontend/src/api/modules/files.ts
  16. +4 −4 frontend/src/api/modules/group.ts
  17. +9 −13 frontend/src/api/modules/host-tool.ts
  18. +8 −8 frontend/src/api/modules/nginx.ts
  19. +1 −1 frontend/src/api/modules/process.ts
  20. +3 −3 frontend/src/api/modules/runtime.ts
  21. +1 −1 frontend/src/api/modules/setting.ts
  22. +80 −88 frontend/src/api/modules/website.ts
  23. +3 −3 frontend/src/components/app-status/index.vue
  24. +1 −1 frontend/src/components/drawer-pro/index.vue
  25. +3 −3 frontend/src/components/file-list/index.vue
  26. +2 −2 frontend/src/components/group/change.vue
  27. +8 −8 frontend/src/components/group/index.vue
  28. +2 −2 frontend/src/components/license-import/index.vue
  29. +2 −2 frontend/src/components/log-file/index.vue
  30. +5 −5 frontend/src/components/upload/index.vue
  31. +1 −0 frontend/src/store/modules/global.ts
  32. +10 −10 frontend/src/views/app-store/apps/index.vue
  33. +3 −3 frontend/src/views/app-store/detail/index.vue
  34. +6 −6 frontend/src/views/app-store/detail/install/index.vue
  35. +4 −4 frontend/src/views/app-store/detail/params/index.vue
  36. +2 −2 frontend/src/views/app-store/index.vue
  37. +2 −2 frontend/src/views/app-store/installed/check/index.vue
  38. +2 −2 frontend/src/views/app-store/installed/delete/index.vue
  39. +4 −4 frontend/src/views/app-store/installed/detail/index.vue
  40. +3 −3 frontend/src/views/app-store/installed/ignore/index.vue
  41. +14 −14 frontend/src/views/app-store/installed/index.vue
  42. +4 −4 frontend/src/views/app-store/installed/upgrade/index.vue
  43. +2 −2 frontend/src/views/app-store/setting/default-domain/index.vue
  44. +4 −7 frontend/src/views/app-store/setting/index.vue
  45. +4 −4 frontend/src/views/cronjob/operate/index.vue
  46. +2 −2 frontend/src/views/cronjob/record/index.vue
  47. +2 −2 frontend/src/views/database/mysql/conn/index.vue
  48. +3 −3 frontend/src/views/database/mysql/index.vue
  49. +4 −4 frontend/src/views/database/mysql/setting/index.vue
  50. +2 −2 frontend/src/views/database/postgresql/conn/index.vue
  51. +2 −2 frontend/src/views/database/postgresql/index.vue
  52. +3 −3 frontend/src/views/database/postgresql/setting/index.vue
  53. +2 −2 frontend/src/views/database/redis/conn/index.vue
  54. +2 −2 frontend/src/views/database/redis/index.vue
  55. +3 −3 frontend/src/views/database/redis/setting/index.vue
  56. +5 −5 frontend/src/views/home/app/index.vue
  57. +2 −2 frontend/src/views/host/file-management/batch-role/index.vue
  58. +2 −2 frontend/src/views/host/file-management/change-role/index.vue
  59. +2 −2 frontend/src/views/host/file-management/chown/index.vue
  60. +4 −4 frontend/src/views/host/file-management/code-editor/index.vue
  61. +2 −2 frontend/src/views/host/file-management/compress/index.vue
  62. +2 −2 frontend/src/views/host/file-management/create/index.vue
  63. +2 −2 frontend/src/views/host/file-management/decompress/index.vue
  64. +3 −3 frontend/src/views/host/file-management/delete/index.vue
  65. +3 −3 frontend/src/views/host/file-management/detail/index.vue
  66. +2 −2 frontend/src/views/host/file-management/download/index.vue
  67. +3 −3 frontend/src/views/host/file-management/favorite/index.vue
  68. +30 −28 frontend/src/views/host/file-management/index.vue
  69. +3 −3 frontend/src/views/host/file-management/move/index.vue
  70. +2 −2 frontend/src/views/host/file-management/process/index.vue
  71. +2 −2 frontend/src/views/host/file-management/recycle-bin/delete/index.vue
  72. +2 −2 frontend/src/views/host/file-management/recycle-bin/index.vue
  73. +2 −2 frontend/src/views/host/file-management/rename/index.vue
  74. +3 −3 frontend/src/views/host/file-management/upload/index.vue
  75. +2 −2 frontend/src/views/host/file-management/wget/index.vue
  76. +4 −4 frontend/src/views/host/process/process/index.vue
  77. +4 −4 frontend/src/views/host/ssh/session/index.vue
  78. +3 −9 frontend/src/views/log/website/index.vue
  79. +3 −3 frontend/src/views/setting/safe/ssl/index.vue
  80. +2 −2 frontend/src/views/terminal/command/index.vue
  81. +2 −2 frontend/src/views/terminal/host/change-group/index.vue
  82. +2 −2 frontend/src/views/terminal/host/index.vue
  83. +2 −2 frontend/src/views/terminal/host/operate/index.vue
  84. +2 −2 frontend/src/views/terminal/terminal/host-create.vue
  85. +3 −3 frontend/src/views/toolbox/supervisor/config/basic/index.vue
  86. +2 −2 frontend/src/views/toolbox/supervisor/config/log/index.vue
  87. +3 −3 frontend/src/views/toolbox/supervisor/config/source/index.vue
  88. +2 −2 frontend/src/views/toolbox/supervisor/create/index.vue
  89. +4 −8 frontend/src/views/toolbox/supervisor/file/index.vue
  90. +4 −4 frontend/src/views/toolbox/supervisor/index.vue
  91. +3 −3 frontend/src/views/toolbox/supervisor/status/index.vue
  92. +2 −2 frontend/src/views/toolbox/supervisor/status/init/index.vue
  93. +7 −7 frontend/src/views/website/runtime/app/index.vue
  94. +6 −2 frontend/src/views/website/runtime/dotnet/index.vue
  95. +0 −2 frontend/src/views/website/runtime/dotnet/operate/index.vue
  96. +2 −2 frontend/src/views/website/runtime/environment/index.vue
  97. +6 −2 frontend/src/views/website/runtime/go/index.vue
  98. +0 −2 frontend/src/views/website/runtime/go/operate/index.vue
  99. +6 −2 frontend/src/views/website/runtime/java/index.vue
  100. +0 −2 frontend/src/views/website/runtime/java/operate/index.vue
  101. +6 −2 frontend/src/views/website/runtime/node/index.vue
  102. +0 −2 frontend/src/views/website/runtime/node/operate/index.vue
  103. +33 −23 frontend/src/views/website/runtime/php/create/index.vue
  104. +2 −2 frontend/src/views/website/runtime/php/supervisor/create/index.vue
  105. +4 −4 frontend/src/views/website/runtime/php/supervisor/file/index.vue
  106. +2 −2 frontend/src/views/website/runtime/php/supervisor/index.vue
  107. +39 −55 frontend/src/views/website/runtime/port/index.vue
  108. +6 −2 frontend/src/views/website/runtime/python/index.vue
  109. +0 −2 frontend/src/views/website/runtime/python/operate/index.vue
  110. +2 −2 frontend/src/views/website/runtime/volume/index.vue
  111. +2 −2 frontend/src/views/website/ssl/acme-account/create/index.vue
  112. +3 −3 frontend/src/views/website/ssl/acme-account/index.vue
  113. +5 −5 frontend/src/views/website/ssl/apply/index.vue
  114. +2 −2 frontend/src/views/website/ssl/ca/create/index.vue
  115. +2 −2 frontend/src/views/website/ssl/ca/detail/index.vue
  116. +6 −6 frontend/src/views/website/ssl/ca/index.vue
  117. +2 −2 frontend/src/views/website/ssl/ca/obtain/index.vue
  118. +8 −8 frontend/src/views/website/ssl/create/index.vue
  119. +2 −2 frontend/src/views/website/ssl/detail/index.vue
  120. +3 −3 frontend/src/views/website/ssl/dns-account/create/index.vue
  121. +3 −3 frontend/src/views/website/ssl/dns-account/index.vue
  122. +8 −8 frontend/src/views/website/ssl/index.vue
  123. +3 −3 frontend/src/views/website/ssl/obtain/index.vue
  124. +2 −2 frontend/src/views/website/ssl/upload/index.vue
  125. +4 −4 frontend/src/views/website/website/config/basic/anti-Leech/index.vue
  126. +3 −3 frontend/src/views/website/website/config/basic/auth-basic/create/index.vue
  127. +6 −6 frontend/src/views/website/website/config/basic/auth-basic/index.vue
  128. +3 −3 frontend/src/views/website/website/config/basic/default-doc/index.vue
  129. +2 −2 frontend/src/views/website/website/config/basic/domain/create/index.vue
  130. +11 −11 frontend/src/views/website/website/config/basic/domain/index.vue
  131. +10 −10 frontend/src/views/website/website/config/basic/https/index.vue
  132. +3 −3 frontend/src/views/website/website/config/basic/limit-conn/index.vue
  133. +2 −2 frontend/src/views/website/website/config/basic/load-balance/file/index.vue
  134. +3 −3 frontend/src/views/website/website/config/basic/load-balance/index.vue
  135. +3 −3 frontend/src/views/website/website/config/basic/load-balance/operate/index.vue
  136. +5 −5 frontend/src/views/website/website/config/basic/other/index.vue
  137. +3 −3 frontend/src/views/website/website/config/basic/php/index.vue
  138. +3 −3 frontend/src/views/website/website/config/basic/proxy/cache/index.vue
  139. +2 −2 frontend/src/views/website/website/config/basic/proxy/create/index.vue
  140. +2 −2 frontend/src/views/website/website/config/basic/proxy/file/index.vue
  141. +5 −5 frontend/src/views/website/website/config/basic/proxy/index.vue
  142. +3 −3 frontend/src/views/website/website/config/basic/real-ip/index.vue
  143. +4 −4 frontend/src/views/website/website/config/basic/redirect/create/index.vue
  144. +2 −2 frontend/src/views/website/website/config/basic/redirect/file/index.vue
  145. +4 −4 frontend/src/views/website/website/config/basic/redirect/index.vue
  146. +9 −9 frontend/src/views/website/website/config/basic/resource/index.vue
  147. +2 −2 frontend/src/views/website/website/config/basic/rewrite/custom/index.vue
  148. +15 −15 frontend/src/views/website/website/config/basic/rewrite/index.vue
  149. +7 −7 frontend/src/views/website/website/config/basic/site-folder/index.vue
  150. +2 −2 frontend/src/views/website/website/config/index.vue
  151. +6 −6 frontend/src/views/website/website/config/log/log-fiile/index.vue
  152. +2 −2 frontend/src/views/website/website/config/resource/index.vue
  153. +3 −3 frontend/src/views/website/website/config/resource/nginx/index.vue
  154. +35 −35 frontend/src/views/website/website/create/index.vue
  155. +3 −3 frontend/src/views/website/website/default/index.vue
  156. +2 −2 frontend/src/views/website/website/delete/index.vue
  157. +3 −3 frontend/src/views/website/website/html/index.vue
  158. +22 −14 frontend/src/views/website/website/index.vue
  159. +3 −3 frontend/src/views/website/website/nginx/module/build/index.vue
  160. +4 −4 frontend/src/views/website/website/nginx/module/index.vue
  161. +2 −2 frontend/src/views/website/website/nginx/module/operate/index.vue
  162. +3 −3 frontend/src/views/website/website/nginx/performance/index.vue
  163. +8 −8 frontend/src/views/website/website/nginx/source/index.vue
  164. +49 −31 frontend/src/views/website/website/nginx/status/index.vue
5 changes: 3 additions & 2 deletions agent/app/dto/request/runtime.go
Original file line number Diff line number Diff line change
@@ -42,8 +42,9 @@ type Volume struct {
}

type ExposedPort struct {
HostPort int `json:"hostPort"`
ContainerPort int `json:"containerPort"`
HostPort int `json:"hostPort"`
ContainerPort int `json:"containerPort"`
HostIP string `json:"hostIP"`
}

type RuntimeDelete struct {
2 changes: 1 addition & 1 deletion agent/app/dto/response/runtime.go
Original file line number Diff line number Diff line change
@@ -23,7 +23,7 @@ type RuntimeDTO struct {
CreatedAt time.Time `json:"createdAt"`
CodeDir string `json:"codeDir"`
AppParams []AppParam `json:"appParams"`
Port int `json:"port"`
Port string `json:"port"`
Path string `json:"path"`
ExposedPorts []request.ExposedPort `json:"exposedPorts"`
Environments []request.Environment `json:"environments"`
2 changes: 1 addition & 1 deletion agent/app/model/runtime.go
Original file line number Diff line number Diff line change
@@ -19,7 +19,7 @@ type Runtime struct {
Type string `gorm:"not null" json:"type"`
Status string `gorm:"not null" json:"status"`
Resource string `gorm:"not null" json:"resource"`
Port int `json:"port"`
Port string `json:"port"`
Message string `json:"message"`
CodeDir string `json:"codeDir"`
ContainerName string `json:"containerName"`
6 changes: 6 additions & 0 deletions agent/app/repo/common.go
Original file line number Diff line number Diff line change
@@ -18,6 +18,12 @@ func WithByID(id uint) DBOption {
}
}

func WithByNOTID(id uint) DBOption {
return func(g *gorm.DB) *gorm.DB {
return g.Where("id != ?", id)
}
}

func WithByIDs(ids []uint) DBOption {
return func(g *gorm.DB) *gorm.DB {
return g.Where("id in (?)", ids)
5 changes: 4 additions & 1 deletion agent/app/repo/runtime.go
Original file line number Diff line number Diff line change
@@ -2,6 +2,7 @@ package repo

import (
"context"
"fmt"

"github.com/1Panel-dev/1Panel/agent/app/model"
"github.com/1Panel-dev/1Panel/agent/global"
@@ -55,7 +56,9 @@ func (r *RuntimeRepo) WithNotId(id uint) DBOption {

func (r *RuntimeRepo) WithPort(port int) DBOption {
return func(g *gorm.DB) *gorm.DB {
return g.Where("port = ?", port)
portStr := fmt.Sprintf("%d", port)
regexPattern := fmt.Sprintf("(^|,)%s(,|$)", portStr)
return g.Where("port REGEXP ?", regexPattern)
}
}

27 changes: 14 additions & 13 deletions agent/app/service/app.go
Original file line number Diff line number Diff line change
@@ -351,7 +351,7 @@ func (a AppService) Install(req request.AppInstallCreate) (appInstall *model.App
return
}
}
if app.Key == "openresty" && app.Resource == "remote" && common.CompareVersion(appDetail.Version, "1.21.4.3-3-3") {
if app.Key == "openresty" && app.Resource == "remote" && common.CompareVersion(appDetail.Version, "1.27") {
if dir, ok := req.Params["WEBSITE_DIR"]; ok {
siteDir := dir.(string)
if siteDir == "" || !strings.HasPrefix(siteDir, "/") {
@@ -365,6 +365,7 @@ func (a AppService) Install(req request.AppInstallCreate) (appInstall *model.App
}
if !fileOp.Stat(siteDir) {
_ = fileOp.CreateDir(siteDir, constant.DirPerm)
_ = fileOp.CreateDir(path.Join(siteDir, "conf.d"), constant.DirPerm)
}
err = settingRepo.UpdateOrCreate("WEBSITE_DIR", siteDir)
if err != nil {
@@ -377,16 +378,16 @@ func (a AppService) Install(req request.AppInstallCreate) (appInstall *model.App
continue
}
var port int
if port, err = checkPort(key, req.Params); err == nil {
if key == "PANEL_APP_PORT_HTTP" {
httpPort = port
}
if key == "PANEL_APP_PORT_HTTPS" {
httpsPort = port
}
} else {
port, err = checkPort(key, req.Params)
if err != nil {
return
}
if key == "PANEL_APP_PORT_HTTP" {
httpPort = port
}
if key == "PANEL_APP_PORT_HTTPS" {
httpsPort = port
}
}

if err = checkRequiredAndLimit(app); err != nil {
@@ -919,11 +920,11 @@ func (a AppService) SyncAppListFromRemote(taskID string) (err error) {
appTags []*model.AppTag
oldAppIds []uint
)
for _, t := range list.Extra.Tags {
for _, tag := range list.Extra.Tags {
tags = append(tags, &model.Tag{
Key: t.Key,
Name: t.Name,
Sort: t.Sort,
Key: tag.Key,
Name: tag.Name,
Sort: tag.Sort,
})
}
deleteCustomApp()
72 changes: 29 additions & 43 deletions agent/app/service/runtime.go
Original file line number Diff line number Diff line change
@@ -93,7 +93,7 @@ func (r *RuntimeService) Create(create request.RuntimeCreate) (*model.Runtime, e
return nil, err
}
}

var hostPorts []string
switch create.Type {
case constant.RuntimePHP:
if create.Resource == constant.ResourceLocal {
@@ -116,17 +116,12 @@ func (r *RuntimeService) Create(create request.RuntimeCreate) (*model.Runtime, e
}
create.Install = true
for _, export := range create.ExposedPorts {
hostPorts = append(hostPorts, strconv.Itoa(export.HostPort))
if err := checkPortExist(export.HostPort); err != nil {
return nil, err
}
}
}
portValue, _ := create.Params["PANEL_APP_PORT_HTTP"]
if portValue != nil {
if err := checkPortExist(int(portValue.(float64))); err != nil {
return nil, err
}
}
containerName, ok := create.Params["CONTAINER_NAME"]
if !ok {
return nil, buserr.New("ErrContainerNameIsNull")
@@ -159,7 +154,7 @@ func (r *RuntimeService) Create(create request.RuntimeCreate) (*model.Runtime, e
Resource: create.Resource,
Version: create.Version,
ContainerName: containerName.(string),
Port: int(portValue.(float64)),
Port: strings.Join(hostPorts, ","),
}

switch create.Type {
@@ -352,34 +347,30 @@ func (r *RuntimeService) Get(id uint) (*response.RuntimeDTO, error) {
return nil, err
}
for k, v := range envs {
switch k {
case "APP_PORT", "PANEL_APP_PORT_HTTP":
port, err := strconv.Atoi(v)
if err != nil {
return nil, err
}
res.Params[k] = port
default:
if strings.Contains(k, "CONTAINER_PORT") || strings.Contains(k, "HOST_PORT") {
if strings.Contains(k, "CONTAINER_PORT") {
r := regexp.MustCompile(`_(\d+)$`)
matches := r.FindStringSubmatch(k)
containerPort, err := strconv.Atoi(v)
if err != nil {
return nil, err
}
hostPort, err := strconv.Atoi(envs[fmt.Sprintf("HOST_PORT_%s", matches[1])])
if err != nil {
return nil, err
}
res.ExposedPorts = append(res.ExposedPorts, request.ExposedPort{
ContainerPort: containerPort,
HostPort: hostPort,
})
if strings.Contains(k, "CONTAINER_PORT") || strings.Contains(k, "HOST_PORT") {
if strings.Contains(k, "CONTAINER_PORT") {
r := regexp.MustCompile(`_(\d+)$`)
matches := r.FindStringSubmatch(k)
containerPort, err := strconv.Atoi(v)
if err != nil {
return nil, err
}
} else {
res.Params[k] = v
hostPort, err := strconv.Atoi(envs[fmt.Sprintf("HOST_PORT_%s", matches[1])])
if err != nil {
return nil, err
}
hostIP := envs[fmt.Sprintf("HOST_IP_%s", matches[1])]
if hostIP == "" {
hostIP = "0.0.0.0"
}
res.ExposedPorts = append(res.ExposedPorts, request.ExposedPort{
ContainerPort: containerPort,
HostPort: hostPort,
HostIP: hostIP,
})
}
} else {
res.Params[k] = v
}
}
if v, ok := envs["CONTAINER_PACKAGE_URL"]; ok {
@@ -437,22 +428,17 @@ func (r *RuntimeService) Update(req request.RuntimeUpdate) error {
}
oldImage := runtime.Image
oldEnv := runtime.Env
port := int(req.Params["PANEL_APP_PORT_HTTP"].(float64))
var hostPorts []string
switch runtime.Type {
case constant.RuntimePHP:
exist, _ := runtimeRepo.GetFirst(runtimeRepo.WithImage(req.Name), runtimeRepo.WithNotId(req.ID))
if exist != nil {
return buserr.New("ErrImageExist")
}
case constant.RuntimeNode, constant.RuntimeJava, constant.RuntimeGo, constant.RuntimePython, constant.RuntimeDotNet:
if runtime.Port != port {
if err = checkPortExist(port); err != nil {
return err
}
runtime.Port = port
}
for _, export := range req.ExposedPorts {
if err = checkPortExist(export.HostPort); err != nil {
hostPorts = append(hostPorts, strconv.Itoa(export.HostPort))
if err = checkRuntimePortExist(export.HostPort, false, runtime.ID); err != nil {
return err
}
}
@@ -522,7 +508,7 @@ func (r *RuntimeService) Update(req request.RuntimeUpdate) error {
case constant.RuntimeNode, constant.RuntimeJava, constant.RuntimeGo, constant.RuntimePython, constant.RuntimeDotNet:
runtime.Version = req.Version
runtime.CodeDir = req.CodeDir
runtime.Port = port
runtime.Port = strings.Join(hostPorts, ",")
runtime.Status = constant.RuntimeReCreating
_ = runtimeRepo.Save(runtime)
go reCreateRuntime(runtime)
44 changes: 39 additions & 5 deletions agent/app/service/runtime_utils.go
Original file line number Diff line number Diff line change
@@ -6,6 +6,8 @@ import (
"context"
"encoding/json"
"fmt"
"github.com/1Panel-dev/1Panel/agent/i18n"
"github.com/1Panel-dev/1Panel/agent/utils/common"
"io"
"os"
"os/exec"
@@ -319,7 +321,7 @@ func handleParams(create request.RuntimeCreate, projectDir string) (composeConte
return
}
for k := range env {
if strings.HasPrefix(k, "CONTAINER_PORT_") || strings.HasPrefix(k, "HOST_PORT_") {
if strings.HasPrefix(k, "CONTAINER_PORT_") || strings.HasPrefix(k, "HOST_PORT_") || strings.HasPrefix(k, "HOST_IP_") || strings.Contains(k, "APP_PORT") {
delete(env, k)
}
}
@@ -431,18 +433,19 @@ func handleCompose(env gotenv.Env, composeContent []byte, create request.Runtime
for name, service := range services {
serviceName = name
serviceValue = service.(map[string]interface{})
_, ok := serviceValue["ports"].([]interface{})
if ok {
delete(serviceValue, "ports")
if create.ExposedPorts != nil && len(create.ExposedPorts) > 0 {
var ports []interface{}
ports = append(ports, "${HOST_IP}:${PANEL_APP_PORT_HTTP}:${APP_PORT}")
for i, port := range create.ExposedPorts {
containerPortStr := fmt.Sprintf("CONTAINER_PORT_%d", i)
hostPortStr := fmt.Sprintf("HOST_PORT_%d", i)
existMap[containerPortStr] = struct{}{}
existMap[hostPortStr] = struct{}{}
ports = append(ports, fmt.Sprintf("${HOST_IP}:${%s}:${%s}", hostPortStr, containerPortStr))
hostIPStr := fmt.Sprintf("HOST_IP_%d", i)
ports = append(ports, fmt.Sprintf("${%s}:${%s}:${%s}", hostIPStr, hostPortStr, containerPortStr))
create.Params[containerPortStr] = port.ContainerPort
create.Params[hostPortStr] = port.HostPort
create.Params[hostIPStr] = port.HostIP
}
serviceValue["ports"] = ports
}
@@ -667,3 +670,34 @@ func getDockerComposeVolumes(yml []byte) ([]request.Volume, error) {
}
return res, nil
}

func checkRuntimePortExist(port int, scanPort bool, runtimeID uint) error {
errMap := make(map[string]interface{})
errMap["port"] = port
appInstall, _ := appInstallRepo.GetFirst(appInstallRepo.WithPort(port))
if appInstall.ID > 0 {
errMap["type"] = i18n.GetMsgByKey("TYPE_APP")
errMap["name"] = appInstall.Name
return buserr.WithMap("ErrPortExist", errMap, nil)
}
opts := []repo.DBOption{runtimeRepo.WithPort(port)}
if runtimeID > 0 {
opts = append(opts, repo.WithByNOTID(runtimeID))
}
runtime, _ := runtimeRepo.GetFirst(opts...)
if runtime != nil {
errMap["type"] = i18n.GetMsgByKey("TYPE_RUNTIME")
errMap["name"] = runtime.Name
return buserr.WithMap("ErrPortExist", errMap, nil)
}
domain, _ := websiteDomainRepo.GetFirst(websiteDomainRepo.WithPort(port))
if domain.ID > 0 {
errMap["type"] = i18n.GetMsgByKey("TYPE_DOMAIN")
errMap["name"] = domain.Domain
return buserr.WithMap("ErrPortExist", errMap, nil)
}
if scanPort && common.ScanPort(port) {
return buserr.WithDetail("ErrPortInUsed", port, nil)
}
return nil
}
2 changes: 1 addition & 1 deletion agent/cmd/server/conf/app.yaml
Original file line number Diff line number Diff line change
@@ -2,7 +2,7 @@ base:
install_dir: /opt
mode: dev

remote_rul:
remote_url:
repo_url: https://resource.fit2cloud.com/1panel/package
resource_url: https://resource.fit2cloud.com/1panel/resource
app_repo: https://apps-assets.fit2cloud.com
2 changes: 1 addition & 1 deletion agent/init/migration/migrations/init.go
Original file line number Diff line number Diff line change
@@ -207,7 +207,7 @@ var InitDefaultCA = &gormigrate.Migration{
var InitPHPExtensions = &gormigrate.Migration{
ID: "20240722-add-php-extensions",
Migrate: func(tx *gorm.DB) error {
if err := tx.Create(&model.PHPExtensions{Name: "Default", Extensions: "bcmath,gd,gettext,intl,pcntl,shmop,soap,sockets,sysvsem,xmlrpc,zip"}).Error; err != nil {
if err := tx.Create(&model.PHPExtensions{Name: "Default", Extensions: "bcmath,ftp,gd,gettext,intl,mysqli,pcntl,pdo_mysql,shmop,soap,sockets,sysvsem,xmlrpc,zip"}).Error; err != nil {
return err
}
if err := tx.Create(&model.PHPExtensions{Name: "WordPress", Extensions: "exif,igbinary,imagick,intl,zip,apcu,memcached,opcache,redis,bc,image,shmop,mysqli,pdo_mysql,gd"}).Error; err != nil {
3 changes: 2 additions & 1 deletion core/constant/common.go
Original file line number Diff line number Diff line change
@@ -72,7 +72,6 @@ var WebUrlMap = map[string]struct{}{
"/hosts/files": {},
"/hosts/monitor/monitor": {},
"/hosts/monitor/setting": {},
"/hosts/terminal": {},
"/hosts/firewall/port": {},
"/hosts/firewall/forward": {},
"/hosts/firewall/ip": {},
@@ -82,6 +81,8 @@ var WebUrlMap = map[string]struct{}{
"/hosts/ssh/log": {},
"/hosts/ssh/session": {},

"/terminal": {},

"/logs": {},
"/logs/operation": {},
"/logs/login": {},
2 changes: 0 additions & 2 deletions frontend/package.json
Original file line number Diff line number Diff line change
@@ -21,8 +21,6 @@
},
"dependencies": {
"@codemirror/lang-json": "^6.0.1",
"@codemirror/lang-html": "^6.4.9",
"@codemirror/lang-php": "^6.0.1",
"@codemirror/language": "^6.10.2",
"@codemirror/legacy-modes": "^6.4.0",
"@codemirror/theme-one-dark": "^6.1.2",
1 change: 1 addition & 0 deletions frontend/src/api/interface/runtime.ts
Original file line number Diff line number Diff line change
@@ -65,6 +65,7 @@ export namespace Runtime {
export interface ExposedPort {
hostPort: number;
containerPort: number;
hostIP: string;
}

export interface Environment {
Loading