added admin routes

This commit is contained in:
2025-02-28 19:08:48 -05:00
parent c5cd1a4399
commit 29ef485e29
3 changed files with 202 additions and 6 deletions
+15 -6
View File
@@ -5,15 +5,24 @@ import (
"os"
)
func GetArgs() (string, string) {
func GetArgs() (string, string, string) {
var PORT string
if len(os.Args) > 1 {
var ADMINPORT string
if len(os.Args) > 2 {
ADMINPORT = os.Args[2]
PORT = os.Args[1]
} else {
} else if len(os.Args) > 1 {
PORT = os.Args[1]
}
if PORT == "" {
PORT = "15521"
}
if ADMINPORT == "" {
ADMINPORT = "15522"
}
dbdir := "data"
isDocker := os.Getenv("container") == "docker" || os.Getenv("DOCKER") == "true" || func() bool { _, err := os.Stat("/.dockerenv"); return err == nil }()
@@ -27,5 +36,5 @@ func GetArgs() (string, string) {
}
}
return PORT, dbdir
}
return ADMINPORT, PORT, dbdir
}