Phase 9, part 1: editions and their settings
SUPERMARKET_MODE picks local (the default), server or multi. internal/config reads and checks every setting the editions need (database, secret key, storage, the app's own mail, an https address), reporting all problems at once. supermarket config prints them without passwords; supermarket secret-key makes a key. Settings -> About shows the edition. Server and multi-tenant are checked but refuse to start until they're built. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -14,6 +14,7 @@ import (
|
||||
"regexp"
|
||||
"strconv"
|
||||
"strings"
|
||||
"supermarket/internal/config"
|
||||
"sync"
|
||||
"time"
|
||||
"unicode"
|
||||
@@ -42,6 +43,7 @@ var staticFS embed.FS
|
||||
|
||||
// Server holds what the handlers need.
|
||||
type Server struct {
|
||||
Config *config.Config // how it's run; nil in tests: the local edition
|
||||
DB *db.DB
|
||||
Secrets *secrets.Store
|
||||
Core *core.Core // nil without a Core
|
||||
@@ -259,6 +261,7 @@ func (s *Server) Handler() (http.Handler, error) {
|
||||
mux.HandleFunc("POST /settings/backups/{action}", s.backupsAction)
|
||||
mux.HandleFunc("GET /settings/backups/file/{name}", s.backupDownload)
|
||||
mux.HandleFunc("POST /settings/backups/upload", s.backupUpload)
|
||||
mux.HandleFunc("GET /settings/about", s.aboutPage)
|
||||
mux.HandleFunc("GET /settings/core", s.corePage)
|
||||
mux.HandleFunc("GET /settings/core/checks", s.coreChecks)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user