carlos / platform Public

console: the chrome and welcome name the deployment (CARLOS_CONSOLE_NAME)

carloku.com said "Welcome to the CARLOS platform" and "CARLOS console";
with CARLOS_CONSOLE_NAME=Carloku they now say Carloku in the welcome
heading, the header brand, the tab title and the front page eyebrow.
Unset, nothing changes. Census overlay proposed (#280).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
claude agent, operated by paul@keymail.dev 7af9953c8d7949dd378bd77e0223c07ee3b8e081 parent f6ba443
8 files changed, +80 −4
  • internal/console/authcli.go +1 −0
  • internal/console/server.go +21 −0
  • internal/console/server_test.go +31 −0
  • internal/console/templates/apps.html +1 −1
  • internal/console/templates/home.html +1 −1
  • internal/console/templates/layout.html +2 −2
  • internal/provision/plan14_root_reads_test.go +13 −0
  • internal/provision/testdata/plan14-root-reads-console-brand-name.tsv +10 −0

CI passed — run details

diff --git a/internal/console/authcli.go b/internal/console/authcli.go
index b18c7763f..90c76a5b6 100644
--- a/internal/console/authcli.go
+++ b/internal/console/authcli.go
@@ -1386,6 +1386,7 @@ type cliPage struct {
}
func (s *Server) renderCLI(w http.ResponseWriter, status int, name string, p cliPage) {
+ s.chrome(&p.page)
w.Header().Set("Content-Type", "text/html; charset=utf-8")
w.WriteHeader(status)
if err := templates.ExecuteTemplate(w, name, p); err != nil {
diff --git a/internal/console/server.go b/internal/console/server.go
index 728c16991..e8f8d7e5f 100644
--- a/internal/console/server.go
+++ b/internal/console/server.go
@@ -1190,6 +1190,22 @@ func (s *Server) consoleName() string {
return "the CARLOS platform"
}
+// brandName is the console's own name in its page chrome (the header, the
+// tab title, the front page): CARLOS_CONSOLE_NAME when the deployment sets
+// one, so carloku.com reads "Carloku" throughout, else "CARLOS console".
+func (s *Server) brandName() string {
+ if n := strings.TrimSpace(s.consoleNameCfg); n != "" {
+ return n
+ }
+ return "CARLOS console"
+}
+
+// chrome fills the deployment's names on any page before it renders.
+func (s *Server) chrome(p *page) {
+ p.Brand = s.brandName()
+ p.ConsoleName = s.consoleName()
+}
+
// dnsTargets is what every custom-domain guidance string in this console is
// built from (view.go's domainGuidance): the deployment's edge addresses and
// its steering hostname, read from ONE place so the app page, the Settings
@@ -1799,6 +1815,10 @@ type page struct {
NoMail bool
CheckSent, CodeError string
SigninCopy signinView
+ // Brand and ConsoleName are the deployment's names (render fills them):
+ // Brand in the page chrome, ConsoleName in prose ("Welcome to ...").
+ Brand string
+ ConsoleName string
// The emailed link's confirm page: the token and the login-CSRF nonce
// its form POSTs; StepUpLink when the link re-confirms a session
// rather than signing in.
@@ -2132,6 +2152,7 @@ func (s *Server) render(w http.ResponseWriter, status int, name string, p page)
p.BrowserRestartCopy = approvedBrowserRestartCopy
p.MismatchCopy = approvedMismatchCopy
p.SigninCopy = approvedSigninView
+ s.chrome(&p)
w.Header().Set("Content-Type", "text/html; charset=utf-8")
w.WriteHeader(status)
if err := templates.ExecuteTemplate(w, name, p); err != nil {
diff --git a/internal/console/server_test.go b/internal/console/server_test.go
index b5be130b6..1d43c7dc5 100644
--- a/internal/console/server_test.go
+++ b/internal/console/server_test.go
@@ -2634,3 +2634,34 @@ func TestNormalizeHost(t *testing.T) {
}
}
}
+
+// A deployment that sets CARLOS_CONSOLE_NAME reads as itself everywhere a
+// person looks: the front page, the tab title, the header and the new
+// account's welcome. Unset, the CARLOS names stay (TestEmptyStateWelcomesNewUser).
+func TestConsoleNameBrandsThePages(t *testing.T) {
+ fx := newConsoleFixture(t)
+ fx.srv.consoleNameCfg = "Carloku"
+ _, _, front := get(t, newBrowser(t), fx.ts.URL+"/")
+ for _, want := range []string{"🤖 Carloku", "· Carloku</title>", `<a href="/">Carloku</a>`} {
+ if !strings.Contains(front, want) {
+ t.Fatalf("front page missing %q", want)
+ }
+ }
+ if strings.Contains(front, "CARLOS console") {
+ t.Fatal("front page still says CARLOS console")
+ }
+ fx.setUser("bob@keymail.dev")
+ c := newBrowser(t)
+ signUp(t, fx, c, "code-b")
+ _, home, _ := get(t, c, fx.ts.URL+"/")
+ _, _, body := get(t, c, fx.ts.URL+home)
+ // Inside an account the header is the account switcher, not the brand.
+ for _, want := range []string{"Welcome to Carloku", "· Carloku</title>"} {
+ if !strings.Contains(body, want) {
+ t.Fatalf("account home missing %q", want)
+ }
+ }
+ if strings.Contains(body, "CARLOS platform") || strings.Contains(body, "CARLOS console") {
+ t.Fatal("account home still names CARLOS")
+ }
+}
diff --git a/internal/console/templates/apps.html b/internal/console/templates/apps.html
index 0b035b1e2..adc59fe07 100644
--- a/internal/console/templates/apps.html
+++ b/internal/console/templates/apps.html
@@ -18,7 +18,7 @@
</table>
</div>
{{else}}
-<h1>Welcome to the CARLOS platform</h1>
+<h1>Welcome to {{.ConsoleName}}</h1>
<p>The account <strong>{{.Account.Name}}</strong> is ready. No apps live here yet — claim a name below and it's yours.</p>
{{end}}
{{if .TrashN}}<p class="small"><a href="{{.Nav}}/trash">Trash ({{.TrashN}})</a>: deleted apps you can still
diff --git a/internal/console/templates/home.html b/internal/console/templates/home.html
index 7099f68e9..cd9944420 100644
--- a/internal/console/templates/home.html
+++ b/internal/console/templates/home.html
@@ -1,6 +1,6 @@
{{define "home"}}{{template "top" .}}
<div class="pagehead">
- <p class="eyebrow">🤖 CARLOS console</p>
+ <p class="eyebrow">🤖 {{.Brand}}</p>
<h1>Ship it. Promote it. Sleep<span style="color: var(--accent)">.</span></h1>
<p class="lede">Your apps, their live routes, and their release channels —
signed releases in, immutable bytes out.</p>
diff --git a/internal/console/templates/layout.html b/internal/console/templates/layout.html
index 172755dd3..3f4e63949 100644
--- a/internal/console/templates/layout.html
+++ b/internal/console/templates/layout.html
@@ -3,7 +3,7 @@
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
-<title>{{.Title}} · CARLOS console</title>
+<title>{{.Title}} · {{.Brand}}</title>
<style>
:root {
--bg: #ffffff; --ink: #201d29; --muted: #6f6480;
@@ -574,7 +574,7 @@
</div>
</details>
{{else}}
- <div class="brand"><a href="/">CARLOS console</a></div>
+ <div class="brand"><a href="/">{{.Brand}}</a></div>
{{end}}
{{if .Address}}<nav>
{{if .Account}}
diff --git a/internal/provision/plan14_root_reads_test.go b/internal/provision/plan14_root_reads_test.go
index 40cb11596..a7ceeefa6 100644
--- a/internal/provision/plan14_root_reads_test.go
+++ b/internal/provision/plan14_root_reads_test.go
@@ -1297,6 +1297,19 @@ func TestPlan14RootReadCensus(t *testing.T) {
t.Fatal(err)
}
seal = "b25dfda5a68d2183af759b42398f79bb471749d46e68d267545647d1a2e6046b"
+ if errs := checkRootReadLegacy(inv, seal); len(errs) != 0 {
+ t.Fatal(errs)
+ }
+ // Census overlay console-brand-name (the console's chrome and welcome name
+ // the deployment from CARLOS_CONSOLE_NAME), loaded last, after
+ // email-signin. Proposed; ruling asked of the census owner on #280. Three
+ // templates change text only; envelopes re-pinned; no read is added. The
+ // seal moves because the three templates' legacy declarations are
+ // re-pinned.
+ if err = loadRootReadInventory(filepath.Join(root, "internal/provision/testdata/plan14-root-reads-console-brand-name.tsv"), &inv, true); err != nil {
+ t.Fatal(err)
+ }
+ seal = "973d16c6dfa10ad1bc46cf9b58c622295e4ab896d39fc68f8b77033a2b697a61"
errs := append(compareRootReads(got, inv), checkRootReadLegacy(inv, seal)...)
errs = append(errs, checkRootReadDeclarations(got, inv)...)
if len(errs) > 0 {
diff --git a/internal/provision/testdata/plan14-root-reads-console-brand-name.tsv b/internal/provision/testdata/plan14-root-reads-console-brand-name.tsv
new file mode 100644
index 000000000..694a8d82d
--- /dev/null
+++ b/internal/provision/testdata/plan14-root-reads-console-brand-name.tsv
@@ -0,0 +1,10 @@
+# Census overlay console-brand-name (the console names the deployment in its chrome and welcome from CARLOS_CONSOLE_NAME: "Carloku" on carloku.com, the CARLOS names otherwise), loaded last, after email-signin. Proposed; rows carry rev3=PROPOSED-console-brand-name and the ruling is asked of the census owner on #280.
+# Three embedded templates change their text only (apps.html, home.html, layout.html); no read, file or record write is added. They run in the console (cmd/console serve under console.service, user carlos-console). The internal/console and internal/console/templates envelopes are re-pinned (server.go and authcli.go gain brandName/chrome, render paths fill two page fields).
+@legacy d156d262b04550e8dcf774d6291dfd1b4f08cf5d2bb13ae615fb1f142bfa1b86 internal/console/templates/apps.html external legacy accepted-legacy accepted-legacy;rev3=J4;basis=root-input;rev3=PROPOSED-console-brand-name;identity=the console (cmd/console serve under console.service, user carlos-console);basis=the empty account's welcome names the deployment ({{.ConsoleName}}, CARLOS_CONSOLE_NAME) instead of the CARLOS platform; no new input. file:external@0 c048758eb446bbd78fc65e08103348d5f3e160b4e983ad180bf55039b75ec3ee
+@legacy 9a8bb2eb92f4e88e3b65dc6fcfb7fb658403e95da7e11007e8edfce03d415cd0 internal/console/templates/home.html external legacy accepted-legacy accepted-legacy;rev3=J4;basis=root-input;rev3=PROPOSED-email-signin;identity=the console (cmd/console serve under console.service, user carlos-console);basis=the front page's one address form posting to /auth/continue, with the approved copy, a banner and a no-mail note; whole embedded template remains frozen as legacy UI input;rev3=PROPOSED-console-brand-name;identity=the console (cmd/console serve under console.service, user carlos-console);basis=the front page eyebrow names the deployment ({{.Brand}}, CARLOS_CONSOLE_NAME); no new input. file:external@0 86cbfc29e2098cbe5c0224e8256f96bfe640c62db467c4c55e035f2c821c745b
+@legacy 35be103f7a6c54220be3d3da5c8fd9078a364c36b93ca3850c8df5190ba9d094 internal/console/templates/layout.html external legacy accepted-legacy accepted-legacy;rev3=PROPOSED-console-switcher-filter;basis=Account switcher adds a client-side filter box and a scrolling list; whole embedded template remains frozen as legacy UI input.;rev3=PROPOSED-email-signin;identity=the console (cmd/console serve under console.service, user carlos-console);basis=CSS only: email inputs styled as text inputs and sign-in form labels; whole embedded template remains frozen as legacy UI input;rev3=PROPOSED-console-brand-name;identity=the console (cmd/console serve under console.service, user carlos-console);basis=the tab title and header brand name the deployment ({{.Brand}}, CARLOS_CONSOLE_NAME); no new input. file:external@0 c9a651201ef7b3e7af39bc90793b8e1c10cd4450f51ceb634afaff6a1cd74020
+internal/console/templates/apps.html external legacy accepted-legacy accepted-legacy;rev3=J4;basis=root-input;rev3=PROPOSED-console-brand-name;identity=the console (cmd/console serve under console.service, user carlos-console);basis=the empty account's welcome names the deployment ({{.ConsoleName}}, CARLOS_CONSOLE_NAME) instead of the CARLOS platform; no new input. file:external@0 c048758eb446bbd78fc65e08103348d5f3e160b4e983ad180bf55039b75ec3ee
+internal/console/templates/home.html external legacy accepted-legacy accepted-legacy;rev3=J4;basis=root-input;rev3=PROPOSED-email-signin;identity=the console (cmd/console serve under console.service, user carlos-console);basis=the front page's one address form posting to /auth/continue, with the approved copy, a banner and a no-mail note; whole embedded template remains frozen as legacy UI input;rev3=PROPOSED-console-brand-name;identity=the console (cmd/console serve under console.service, user carlos-console);basis=the front page eyebrow names the deployment ({{.Brand}}, CARLOS_CONSOLE_NAME); no new input. file:external@0 86cbfc29e2098cbe5c0224e8256f96bfe640c62db467c4c55e035f2c821c745b
+internal/console/templates/layout.html external legacy accepted-legacy accepted-legacy;rev3=PROPOSED-console-switcher-filter;basis=Account switcher adds a client-side filter box and a scrolling list; whole embedded template remains frozen as legacy UI input.;rev3=PROPOSED-email-signin;identity=the console (cmd/console serve under console.service, user carlos-console);basis=CSS only: email inputs styled as text inputs and sign-in form labels; whole embedded template remains frozen as legacy UI input;rev3=PROPOSED-console-brand-name;identity=the console (cmd/console serve under console.service, user carlos-console);basis=the tab title and header brand name the deployment ({{.Brand}}, CARLOS_CONSOLE_NAME); no new input. file:external@0 c9a651201ef7b3e7af39bc90793b8e1c10cd4450f51ceb634afaff6a1cd74020
+@coverage internal/console dfea61c6b76b94e57a65620113f69798f6785c2ab753fa2c2eac9e338786b213
+@coverage internal/console/templates 8fe5a2476674ae5ab64a9e6dad7c8e3b5ce301fa81a39da3a5d7c0583a25c585