Implement ultra-friendly selection wizard and 15-category hierarchal catalog

This commit is contained in:
lucio committed 2026-05-21 02:31:23 -07:00
1 parent 3d7c232b94
commit 92ebb0f65a
6 files changed
+1446 -115

No files matched your search

+7
View File
@@ -20,15 +20,22 @@ type Server struct {
db *db.DB
sessions *sessionStore
limiter *rateLimiter
catalog []config.CatalogCategory
}
func New(cfg *config.Config, database *db.DB) *Server {
ttl := time.Duration(cfg.Admin.SessionHours) * time.Hour
cat, err := config.LoadCatalog("catalog.json")
if err != nil {
log.Printf("Warning: failed to load catalog.json: %v. Using empty catalog.", err)
cat = []config.CatalogCategory{}
}
return &Server{
cfg: cfg,
db: database,
sessions: newSessionStore(ttl),
limiter: newRateLimiter(2 * time.Second), // 2 seconds between login attempts
catalog: cat,
}
}