mirror of
https://github.com/1Panel-dev/1Panel.git
synced 2025-01-31 22:18:07 +08:00
parent
6ee9789a2f
commit
c556affc91
@ -113,6 +113,7 @@ type RootInfo struct {
|
|||||||
Name string `json:"name"`
|
Name string `json:"name"`
|
||||||
Port int64 `json:"port"`
|
Port int64 `json:"port"`
|
||||||
Password string `json:"password"`
|
Password string `json:"password"`
|
||||||
|
UserPassword string `json:"userPassword"`
|
||||||
ContainerName string `json:"containerName"`
|
ContainerName string `json:"containerName"`
|
||||||
Param string `json:"param"`
|
Param string `json:"param"`
|
||||||
Env string `json:"env"`
|
Env string `json:"env"`
|
||||||
@ -146,6 +147,10 @@ func (a *AppInstallRepo) LoadBaseInfo(key string, name string) (*RootInfo, error
|
|||||||
if ok {
|
if ok {
|
||||||
info.Password = password
|
info.Password = password
|
||||||
}
|
}
|
||||||
|
userPassword, ok := envMap["PANEL_DB_USER_PASSWORD"].(string)
|
||||||
|
if ok {
|
||||||
|
info.UserPassword = userPassword
|
||||||
|
}
|
||||||
info.Port = int64(appInstall.HttpPort)
|
info.Port = int64(appInstall.HttpPort)
|
||||||
info.ID = appInstall.ID
|
info.ID = appInstall.ID
|
||||||
info.ContainerName = appInstall.ContainerName
|
info.ContainerName = appInstall.ContainerName
|
||||||
|
@ -3,9 +3,6 @@ package service
|
|||||||
import (
|
import (
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
"fmt"
|
"fmt"
|
||||||
"github.com/1Panel-dev/1Panel/backend/utils/env"
|
|
||||||
"github.com/1Panel-dev/1Panel/backend/utils/nginx"
|
|
||||||
"github.com/joho/godotenv"
|
|
||||||
"io/ioutil"
|
"io/ioutil"
|
||||||
"math"
|
"math"
|
||||||
"os"
|
"os"
|
||||||
@ -14,6 +11,10 @@ import (
|
|||||||
"strconv"
|
"strconv"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
|
"github.com/1Panel-dev/1Panel/backend/utils/env"
|
||||||
|
"github.com/1Panel-dev/1Panel/backend/utils/nginx"
|
||||||
|
"github.com/joho/godotenv"
|
||||||
|
|
||||||
"github.com/1Panel-dev/1Panel/backend/app/dto/request"
|
"github.com/1Panel-dev/1Panel/backend/app/dto/request"
|
||||||
"github.com/1Panel-dev/1Panel/backend/app/dto/response"
|
"github.com/1Panel-dev/1Panel/backend/app/dto/response"
|
||||||
"github.com/1Panel-dev/1Panel/backend/buserr"
|
"github.com/1Panel-dev/1Panel/backend/buserr"
|
||||||
@ -648,7 +649,7 @@ func updateInstallInfoInDB(appKey, appName, param string, isRestart bool, value
|
|||||||
}, commonRepo.WithByID(appInstall.ID))
|
}, commonRepo.WithByID(appInstall.ID))
|
||||||
}
|
}
|
||||||
if param == "user-password" {
|
if param == "user-password" {
|
||||||
oldVal = fmt.Sprintf("\"PANEL_DB_USER_PASSWORD\":\"%v\"", appInstall.Password)
|
oldVal = fmt.Sprintf("\"PANEL_DB_USER_PASSWORD\":\"%v\"", appInstall.UserPassword)
|
||||||
newVal = fmt.Sprintf("\"PANEL_DB_USER_PASSWORD\":\"%v\"", value)
|
newVal = fmt.Sprintf("\"PANEL_DB_USER_PASSWORD\":\"%v\"", value)
|
||||||
_ = appInstallRepo.BatchUpdateBy(map[string]interface{}{
|
_ = appInstallRepo.BatchUpdateBy(map[string]interface{}{
|
||||||
"param": strings.ReplaceAll(appInstall.Param, oldVal, newVal),
|
"param": strings.ReplaceAll(appInstall.Param, oldVal, newVal),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user