v0.315.0: one app page with four tabs; the guide the catalog can carry; no Raspberry Pi badge
gates / gates (push) Failing after 47s

An app was six pages — details, install/settings, logs, export, the per-app backup panel and a
details card for moving data — and every "Vissza" on them went to the app LIST, so there was no way
back to the app you were looking at. It is now ONE page with four tab URLs under /apps/{slug}/,
one shared header and one set of banners.

  settings  Mukodes (Start/Restart/Stop, Stop confirms) + the cards that want something from the
            household + the install-time and optional settings. The default for an installed app,
            RENDERED at the bare URL and never redirected to.
  data      the data folders, move to another drive, the nightly copy, the 2nd-copy setting, export
  guide     tagline, screenshots, use cases, first steps, the catalog's guide, the FAQ, the docs
            link — and the WHOLE page for an app that is not installed
  logs      the log, and the only tab whose poller runs

The tabs are links, not panels: a link in an alert has to land ON a tab, and the log poller must not
run on the other three. Start/Restart/Stop left the page header, where they read as menu buttons.

The old /stacks/{name}/{deploy,logs,export,backup} GETs answer 302 — never 301, which a browser
caches beyond anyone's reach — to the tab that now holds them, query string carried through, with
name->slug resolved through the stack list rather than assumed equal. Every POST on those paths is
untouched: the backup form, the app-email toggle and the reveal endpoints keep their URLs.

A value asked AFTER the app starts is now generic (D2). The catalog marks a field `after_start: true`
and supplies its label; the ACTION is Go, in a registry keyed by slug + env var. The catalog can
never declare what runs — a declared field with no registered action renders nothing, POSTs 404 and
logs one WARN with the env var KEY, never the value. A red-proof found the second half of that guard
unpinned: deleting the "the catalog must have DECLARED this field" check left the suite green, and a
POST for an undeclared field then reached Plex and opened the setup gate.
TestAfterStart_RegistryAloneIsNotAnInvitation pins it.

New catalog block app_info.guide (sections + faq + checked_version), parsed, localised field by
field and rendered with the household's own address filled in. It renders only when checked_version
names the image tag its author clicked through. No template carries one yet.

The Pi and "csak x86" badges are gone; PiCompatible and the catalog key stay this release, or a box
on 0.314.0 would read "csak x86" on every app (R-1067).

template_id_gate.py now follows {{template}} includes, with a scope decoy proving the walk did not
become vacuous.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0117kRTSgs3rJWUFGxyoWN6Y
This commit is contained in:
2026-10-15 18:37:50 +02:00
parent 85f65c70d8
commit e66d4669d6
120 changed files with 16239 additions and 9866 deletions
+122 -6
View File
@@ -64,12 +64,44 @@ type MetadataOverlay struct {
// AppInfoOverlay carries the info page's prose. The three lists replace whole.
type AppInfoOverlay struct {
Tagline *string `yaml:"tagline,omitempty"`
UseCases []string `yaml:"use_cases,omitempty"`
FirstSteps []string `yaml:"first_steps,omitempty"`
Prerequisites []string `yaml:"prerequisites,omitempty"`
DefaultCreds *string `yaml:"default_creds,omitempty"`
AddPeople *string `yaml:"add_people,omitempty"`
Tagline *string `yaml:"tagline,omitempty"`
UseCases []string `yaml:"use_cases,omitempty"`
FirstSteps []string `yaml:"first_steps,omitempty"`
Prerequisites []string `yaml:"prerequisites,omitempty"`
DefaultCreds *string `yaml:"default_creds,omitempty"`
AddPeople *string `yaml:"add_people,omitempty"`
Guide *AppGuideOverlay `yaml:"guide,omitempty"`
}
// AppGuideOverlay translates the user guide. `checked_version` is NOT here and that is the rule
// stated in code: a version vouches for a click-through, and a translator did not do it.
//
// SECTIONS AND FAQ ENTRIES ARE MATCHED BY INDEX, and they are the only lists in this file that are.
// The header above says every list is matched by its own key — a guide section has no key to match
// on. Its title is the very thing being translated, so a `match_title` would have to be kept in step
// with the Hungarian by hand, which is the drift the key rule exists to prevent. Index matching is
// safe HERE because the catalog's copy gate requires a translated guide to carry the same number of
// sections and FAQ entries in the same running order, and because the fallback is field by field:
// a misaligned entry shows the Hungarian one, never a sentence nobody wrote. An English list LONGER
// than the Hungarian one is ignored past the Hungarian count, with one WARN naming the slug
// (GuideOverlayExtras).
type AppGuideOverlay struct {
Sections []GuideSectionOverlay `yaml:"sections,omitempty"`
FAQ []GuideFAQOverlay `yaml:"faq,omitempty"`
}
// GuideSectionOverlay translates one section, found by its POSITION. Steps replace whole, like
// every other prose list in this file.
type GuideSectionOverlay struct {
Title *string `yaml:"title,omitempty"`
Intro *string `yaml:"intro,omitempty"`
Steps []string `yaml:"steps,omitempty"`
}
// GuideFAQOverlay translates one FAQ entry, found by its POSITION.
type GuideFAQOverlay struct {
Q *string `yaml:"q,omitempty"`
A *string `yaml:"a,omitempty"`
}
// DeployFieldOverlay translates one deploy field, found by EnvVar.
@@ -150,6 +182,69 @@ func overlayList(in []string, base []string) []string {
return out
}
// overlayGuide returns the translated guide. `CheckedVersion` is carried through from the base
// UNTOUCHED: it is the render gate, not copy, so a translation can neither set it nor clear it — an
// untranslated guide and a translated one are shown or hidden by the same fact.
//
// Entries are matched by index and every field falls back on its own (see AppGuideOverlay). Nothing
// is mutated: both slices are rebuilt.
func overlayGuide(ov *AppGuideOverlay, base AppGuide) AppGuide {
if ov == nil {
return base
}
out := base
if len(ov.Sections) > 0 && len(base.Sections) > 0 {
secs := make([]GuideSection, len(base.Sections))
copy(secs, base.Sections)
for i := range secs {
if i >= len(ov.Sections) {
break
}
so := ov.Sections[i]
secs[i].Title = overlayStr(so.Title, secs[i].Title)
secs[i].Intro = overlayStr(so.Intro, secs[i].Intro)
secs[i].Steps = overlayList(so.Steps, secs[i].Steps)
}
out.Sections = secs
}
if len(ov.FAQ) > 0 && len(base.FAQ) > 0 {
faq := make([]GuideFAQ, len(base.FAQ))
copy(faq, base.FAQ)
for i := range faq {
if i >= len(ov.FAQ) {
break
}
qo := ov.FAQ[i]
faq[i].Q = overlayStr(qo.Q, faq[i].Q)
faq[i].A = overlayStr(qo.A, faq[i].A)
}
out.FAQ = faq
}
return out
}
// GuideOverlayExtras counts the guide entries a language's overlay carries BEYOND the Hungarian
// count — the ones overlayGuide ignores. It exists so the page that renders the guide can say so
// once in a log line: `For` runs per request and holds no logger, and a silently dropped
// translation is exactly the kind of absence nobody notices. Zero for the base language, for a
// language with no block, and for a correctly sized overlay.
func (m Metadata) GuideOverlayExtras(lang string) (sections, faq int) {
if lang == "" || lang == BaseLanguage {
return 0, 0
}
ov, ok := m.I18n[lang]
if !ok || ov.AppInfo == nil || ov.AppInfo.Guide == nil {
return 0, 0
}
if n := len(ov.AppInfo.Guide.Sections) - len(m.AppInfo.Guide.Sections); n > 0 {
sections = n
}
if n := len(ov.AppInfo.Guide.FAQ) - len(m.AppInfo.Guide.FAQ); n > 0 {
faq = n
}
return sections, faq
}
// For returns this app's metadata as the given language renders it.
//
// For the base language — and for any language this template has no block for — it is the parsed
@@ -183,6 +278,7 @@ func (m Metadata) For(lang string) Metadata {
out.AppInfo.UseCases = overlayList(ov.AppInfo.UseCases, out.AppInfo.UseCases)
out.AppInfo.FirstSteps = overlayList(ov.AppInfo.FirstSteps, out.AppInfo.FirstSteps)
out.AppInfo.Prerequisites = overlayList(ov.AppInfo.Prerequisites, out.AppInfo.Prerequisites)
out.AppInfo.Guide = overlayGuide(ov.AppInfo.Guide, out.AppInfo.Guide)
}
if len(ov.DeployFields) > 0 && len(out.DeployFields) > 0 {
@@ -356,6 +452,26 @@ func (o MetadataOverlay) Clone() MetadataOverlay {
DefaultCreds: cloneStrPtr(o.AppInfo.DefaultCreds),
AddPeople: cloneStrPtr(o.AppInfo.AddPeople),
}
if o.AppInfo.Guide != nil {
g := AppGuideOverlay{}
if o.AppInfo.Guide.Sections != nil {
g.Sections = make([]GuideSectionOverlay, len(o.AppInfo.Guide.Sections))
for i, se := range o.AppInfo.Guide.Sections {
g.Sections[i] = GuideSectionOverlay{
Title: cloneStrPtr(se.Title),
Intro: cloneStrPtr(se.Intro),
Steps: cloneStrs(se.Steps),
}
}
}
if o.AppInfo.Guide.FAQ != nil {
g.FAQ = make([]GuideFAQOverlay, len(o.AppInfo.Guide.FAQ))
for i, qa := range o.AppInfo.Guide.FAQ {
g.FAQ[i] = GuideFAQOverlay{Q: cloneStrPtr(qa.Q), A: cloneStrPtr(qa.A)}
}
}
ai.Guide = &g
}
c.AppInfo = &ai
}
if o.DeployFields != nil {