You've already forked CasaOS
mirror of
https://github.com/IceWhaleTech/CasaOS.git
synced 2025-07-06 23:37:26 +02:00
20 lines
466 B
Go
20 lines
466 B
Go
![]() |
package env_helper
|
||
|
|
||
|
import "strings"
|
||
|
|
||
|
func ReplaceDefaultENV(key string) string {
|
||
|
temp := ""
|
||
|
switch key {
|
||
|
case "$DefaultPassword":
|
||
|
temp = "casaos"
|
||
|
case "$DefaultUserName":
|
||
|
temp = "admin"
|
||
|
}
|
||
|
return temp
|
||
|
}
|
||
|
|
||
|
//replace env default setting
|
||
|
func ReplaceStringDefaultENV(str string) string {
|
||
|
return strings.ReplaceAll(strings.ReplaceAll(str, "$DefaultPassword", ReplaceDefaultENV("$DefaultPassword")), "$DefaultUserName", ReplaceDefaultENV("$DefaultUserName"))
|
||
|
}
|