init: 0.1.2
Some checks failed
/ build and run u-api (push) Failing after 8s
/ clean (push) Successful in 0s

feat: login page && auth required
todo: file dir cleanup
This commit is contained in:
loveuer
2025-05-09 17:49:12 +08:00
parent e5cf2c1367
commit 93c4339039
30 changed files with 1166 additions and 35 deletions

View File

@ -15,7 +15,7 @@ func init() {
flag.BoolVar(&opt.Cfg.Debug, "debug", false, "debug mode")
flag.StringVar(&opt.Cfg.Address, "address", "0.0.0.0:9119", "")
flag.StringVar(&opt.Cfg.DataPath, "data", "/data", "")
flag.BoolVar(&opt.Cfg.Auth, "auth", false, "upload need login")
flag.StringVar(&opt.Cfg.Auth, "auth", "", "auth required(admin, password)")
flag.Parse()
if opt.Cfg.Debug {
@ -28,6 +28,8 @@ func main() {
ctx, cancel := signal.NotifyContext(context.Background(), syscall.SIGINT, syscall.SIGTERM)
defer cancel()
opt.Init(ctx)
controller.UserManager.Start(ctx)
controller.MetaManager.Start(ctx)
api.Start(ctx)