Skip to content

Commit

Permalink
Fix dbName in app.conf
Browse files Browse the repository at this point in the history
  • Loading branch information
nomeguy committed Jan 22, 2024
1 parent 9def87c commit a1272c8
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion run/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,12 +72,13 @@ func ensureFileFolderExists(path string) error {
func updateAppConfFile(name string, i int) {
fmt.Printf("updateAppConfFile(): [%s]\n", name)

dbName := strings.Replace(name, "_00", "_", 1)
confPath := getCodeAppConfPath(name)
content := util.ReadStringFromPath(confPath)
content = strings.ReplaceAll(content, "httpport = 8000", fmt.Sprintf("httpport = %d", 30000+i))
content = strings.ReplaceAll(content, "123456", beego.AppConfig.String("dbPass"))
content = strings.ReplaceAll(content, "(localhost:3306)", "(localhost:33060)")
content = strings.ReplaceAll(content, "dbName = casdoor", fmt.Sprintf("dbName = casdoor_customer_%d", i))
content = strings.ReplaceAll(content, "dbName = casdoor", fmt.Sprintf("dbName = %s", dbName))
content = strings.ReplaceAll(content, "redisEndpoint =", "redisEndpoint = \"localhost:6379\"")
content = strings.ReplaceAll(content, "socks5Proxy = \"127.0.0.1:10808\"", "socks5Proxy =")
content = strings.ReplaceAll(content, "../casdoor", "../cc_0")
Expand Down

0 comments on commit a1272c8

Please sign in to comment.