feat: initialize managed portal

This commit is contained in:
Yoilun
2026-04-27 10:04:36 +08:00
commit d4e351df71
145 changed files with 13425 additions and 0 deletions

29
internal/config/config.go Normal file
View File

@@ -0,0 +1,29 @@
package config
import "os"
type Config struct {
HTTPAddr string
WebDistDir string
RegistryPath string
}
func Load() *Config {
cfg := &Config{
HTTPAddr: ":8080",
WebDistDir: "web/dist",
RegistryPath: "managed_services.yaml",
}
if value := os.Getenv("MANAGED_PORTAL_HTTP_ADDR"); value != "" {
cfg.HTTPAddr = value
}
if value := os.Getenv("MANAGED_PORTAL_WEB_DIST_DIR"); value != "" {
cfg.WebDistDir = value
}
if value := os.Getenv("MANAGED_PORTAL_REGISTRY_PATH"); value != "" {
cfg.RegistryPath = value
}
return cfg
}