This commit is contained in:
2026-03-28 04:00:02 +07:00
parent 1a51f10c54
commit 40c36bb784
8 changed files with 135 additions and 121 deletions
+15 -2
View File
@@ -7,8 +7,9 @@ import (
)
const (
ClientPort = ":8100"
FilePort = ":8120"
ClientPort = ":8100"
AdminClientPort = ":8110"
FilePort = ":8120"
)
func GetStoryFilepath() string {
@@ -19,6 +20,18 @@ func GetDBFilepath() string {
return getFilepath("DB_FILENAME", "data/db/store.db")
}
func GetAdminHost() string {
host := os.Getenv("HOST")
if host != "" {
return host
}
ips, err := getLocalIPs()
if err != nil || len(ips) == 0 {
return "http://127.0.0.1" + AdminClientPort
}
return "http://" + ips[0] + AdminClientPort
}
func GetHost() string {
host := os.Getenv("HOST")
if host != "" {