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

BIN
.DS_Store vendored

Binary file not shown.

View File

@ -51,6 +51,7 @@ func main() {
}
clientHost := config.GetHost()
adminClientHost := config.GetAdminHost()
fileHost := config.GetFileHost()
cleaner := cleaner.NewCleaner()
@ -168,7 +169,7 @@ func main() {
muxAdmin.Handle("/", fileServerAdmin)
// Serve admin web server
log.Println("Serving admin web on http://0.0.0.0:8110")
log.Printf("Serving admin web on %s\n", adminClientHost)
log.Fatalln(http.ListenAndServe(":8110", muxAdmin))
}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -5,8 +5,8 @@
<link rel="icon" href="/favicon.ico">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>ВД Админка</title>
<script type="module" crossorigin src="/assets/index-Bsz6dkXJ.js"></script>
<link rel="stylesheet" crossorigin href="/assets/index-CPNDoyHf.css">
<script type="module" crossorigin src="/assets/index-CH9kKe_e.js"></script>
<link rel="stylesheet" crossorigin href="/assets/index-C16dKKOO.css">
</head>
<body>
<div id="app"></div>

View File

@ -8,6 +8,7 @@ import (
const (
ClientPort = ":8100"
AdminClientPort = ":8110"
FilePort = ":8120"
)
@ -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 != "" {