CasaOS/service/docker_base/common.go
link a5fee0ee97 New App Store
Add App Store for installation
Fix favicon display in dark mode
2021-11-03 17:07:46 +08:00

24 lines
622 B
Go

package docker_base
import "github.com/IceWhaleTech/CasaOS/model"
//过滤mysql关键字
func MysqlFilter(c MysqlConfig, envs model.EnvArray) model.EnvArray {
for i := 0; i < len(envs); i++ {
switch envs[i].Value {
case "$MYSQL_HOST":
envs[i].Value = c.DataBaseHost
case "$MYSQL_PORT":
envs[i].Value = c.DataBasePort
case "$MYSQL_USERNAME":
envs[i].Value = c.DataBaseUser
case "$MYSQL_PASSWORD":
envs[i].Value = c.DataBasePassword
case "$MYSQL_DBNAME":
envs[i].Value = c.DataBaseDB
case "$MYSQL_HOST_AND_PORT":
envs[i].Value = c.DataBaseHost + ":" + c.DataBasePort
}
}
return envs
}