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:
2026-11-25 06:55:30 -07:00
co-authored by Claude Opus 5.5
parent 338eaa2c79
commit 7a857c7346
12 changed files with 671 additions and 9 deletions
+16
View File
@@ -0,0 +1,16 @@
{{define "content"}}{{template "settings-start" .}}{{with .Data}}
<h2>About</h2>
<p class="lede">This Supermarket: its edition, its version, and where it keeps things.</p>
<section class="card">
<h2>{{.Edition.Name}} edition</h2>
<dl class="facts">
<dt>Version</dt><dd>{{.Version}} <span class="muted">· database schema {{.Schema}}</span></dd>
{{range .Items}}<dt>{{.Name}}</dt><dd>{{.Value}}{{if .Help}} <span class="help">{{.Help}}</span>{{end}}</dd>
{{end}}
</dl>
{{if eq (print .Edition) "local"}}
<p class="help">Supermarket also comes as a <strong>server</strong> edition, for a team signing in on a server, and a <strong>multi-tenant</strong> one, for many teams at one address. The edition is chosen with <code>SUPERMARKET_MODE</code> when it starts; <code>supermarket config</code> checks the settings.</p>
{{end}}
</section>
{{end}}{{template "settings-end"}}{{end}}