mirror of
https://github.com/1Panel-dev/1Panel.git
synced 2025-12-17 12:58:51 +08:00
fix: Fix the issue where the demo configuration takes effect (#9468)
This commit is contained in:
parent
383bdd5f15
commit
355e656caa
3 changed files with 7 additions and 1 deletions
|
|
@ -1,6 +1,7 @@
|
||||||
base:
|
base:
|
||||||
install_dir: /opt
|
install_dir: /opt
|
||||||
mode: dev
|
mode: dev
|
||||||
|
is_demo: false
|
||||||
|
|
||||||
remote_url:
|
remote_url:
|
||||||
app_repo: https://apps-assets.fit2cloud.com
|
app_repo: https://apps-assets.fit2cloud.com
|
||||||
|
|
|
||||||
|
|
@ -50,7 +50,6 @@ func Init() {
|
||||||
}
|
}
|
||||||
|
|
||||||
global.CONF = serverConfig
|
global.CONF = serverConfig
|
||||||
global.CONF.Base.IsDemo = v.GetBool("system.is_demo")
|
|
||||||
|
|
||||||
initBaseInfo()
|
initBaseInfo()
|
||||||
global.Viper = v
|
global.Viper = v
|
||||||
|
|
|
||||||
|
|
@ -276,6 +276,12 @@ func (b *BaseApi) WsSsh(c *gin.Context) {
|
||||||
}
|
}
|
||||||
defer wsConn.Close()
|
defer wsConn.Close()
|
||||||
|
|
||||||
|
if global.CONF.Base.IsDemo {
|
||||||
|
if wshandleError(wsConn, errors.New(" demo server, prohibit this operation!")) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
id, err := strconv.Atoi(c.Query("id"))
|
id, err := strconv.Atoi(c.Query("id"))
|
||||||
if wshandleError(wsConn, errors.WithMessage(err, "invalid param id in request")) {
|
if wshandleError(wsConn, errors.WithMessage(err, "invalid param id in request")) {
|
||||||
return
|
return
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue