package main

import (
  "fmt"

  initpkg "github.com/perfect-panel/server/initialize"
  "github.com/perfect-panel/server/internal/config"
  "github.com/perfect-panel/server/internal/svc"
  "github.com/perfect-panel/server/pkg/conf"
)

func main() {
  var c config.Config
  conf.MustLoad("/private/tmp/ppanel-local-upload.yaml", &c)
  ctx := svc.NewServiceContext(c)
  method, err := ctx.AuthModel.FindOneByMethod(ctx.DB.Statement.Context, "device")
  if err != nil {
    panic(err)
  }
  fmt.Printf("db auth_method.enabled=%v config=%s\n", *method.Enabled, method.Config)
  initpkg.Device(ctx)
  fmt.Printf("ctx.Config.Device.Enable=%v SecuritySecret=%q EnableSecurity=%v\n", ctx.Config.Device.Enable, ctx.Config.Device.SecuritySecret, ctx.Config.Device.EnableSecurity)
}
