mirror of
https://github.com/1Panel-dev/1Panel.git
synced 2025-09-12 17:46:20 +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:
|
||||
install_dir: /opt
|
||||
mode: dev
|
||||
is_demo: false
|
||||
|
||||
remote_url:
|
||||
app_repo: https://apps-assets.fit2cloud.com
|
||||
|
|
|
@ -50,7 +50,6 @@ func Init() {
|
|||
}
|
||||
|
||||
global.CONF = serverConfig
|
||||
global.CONF.Base.IsDemo = v.GetBool("system.is_demo")
|
||||
|
||||
initBaseInfo()
|
||||
global.Viper = v
|
||||
|
|
|
@ -276,6 +276,12 @@ func (b *BaseApi) WsSsh(c *gin.Context) {
|
|||
}
|
||||
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"))
|
||||
if wshandleError(wsConn, errors.WithMessage(err, "invalid param id in request")) {
|
||||
return
|
||||
|
|
Loading…
Add table
Reference in a new issue