From 6e77311c22ead082011751b88164af11d0cb878f Mon Sep 17 00:00:00 2001 From: Evan Jarrett Date: Sat, 13 Jun 2026 20:56:30 -0500 Subject: [PATCH] minor ui fixes, update privacy page with manged holds list --- .gitignore | 1 + pkg/appview/handlers/base.go | 1 + pkg/appview/handlers/legal.go | 16 ++++++++++++++++ pkg/appview/routes/routes.go | 2 ++ pkg/appview/server.go | 1 + pkg/appview/templates/components/head.html | 7 +++++-- pkg/appview/templates/pages/privacy.html | 9 ++++++--- pkg/appview/templates/pages/repository.html | 6 +++--- 8 files changed, 35 insertions(+), 8 deletions(-) diff --git a/.gitignore b/.gitignore index 7d28f9a..e424cc3 100644 --- a/.gitignore +++ b/.gitignore @@ -37,3 +37,4 @@ pkg/hold/admin/public/css/style.css Thumbs.db node_modules .impeccable.md +.playwright-mcp/ diff --git a/pkg/appview/handlers/base.go b/pkg/appview/handlers/base.go index 34650d1..2d6ac92 100644 --- a/pkg/appview/handlers/base.go +++ b/pkg/appview/handlers/base.go @@ -44,6 +44,7 @@ type BaseUIHandler struct { // Config DefaultHoldDID string + ManagedHolds []string // DIDs of holds this appview operates (server.managed_holds) CompanyName string Jurisdiction string ClientName string // Full name: "AT Container Registry" diff --git a/pkg/appview/handlers/legal.go b/pkg/appview/handlers/legal.go index 96ff633..c25478e 100644 --- a/pkg/appview/handlers/legal.go +++ b/pkg/appview/handlers/legal.go @@ -1,6 +1,7 @@ package handlers import ( + "context" "net/http" "time" ) @@ -12,6 +13,7 @@ type LegalPageData struct { CompanyName string Jurisdiction string LastUpdated string + ManagedHolds []string // Resolved display names of the holds this appview operates } // legalDefaults applies sensible fallbacks for operators who haven't set @@ -52,6 +54,19 @@ type PrivacyPolicyHandler struct { BaseUIHandler } +// resolveManagedHoldNames maps the configured managed-hold DIDs to friendly +// display names (handle, decoded did:web domain, or truncated did:plc) for +// listing on the privacy page. +func (h *PrivacyPolicyHandler) resolveManagedHoldNames(ctx context.Context) []string { + names := make([]string, 0, len(h.ManagedHolds)) + for _, did := range h.ManagedHolds { + if name := resolveHoldDisplayName(ctx, &h.BaseUIHandler, did); name != "" { + names = append(names, name) + } + } + return names +} + func (h *PrivacyPolicyHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) { meta := NewPageMeta( "Privacy Policy - "+h.ClientShortName, @@ -66,6 +81,7 @@ func (h *PrivacyPolicyHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) CompanyName: company, Jurisdiction: jurisdiction, LastUpdated: formatLegalDate(privacyLastUpdated), + ManagedHolds: h.resolveManagedHoldNames(r.Context()), } if err := h.Templates.ExecuteTemplate(w, "privacy", data); err != nil { diff --git a/pkg/appview/routes/routes.go b/pkg/appview/routes/routes.go index 2859509..f05bd75 100644 --- a/pkg/appview/routes/routes.go +++ b/pkg/appview/routes/routes.go @@ -40,6 +40,7 @@ type UIDependencies struct { ReadmeFetcher *readme.Fetcher Templates *template.Template DefaultHoldDID string + ManagedHolds []string // DIDs of holds this appview operates (server.managed_holds) LegalConfig LegalConfig ClientName string // Full name: "AT Container Registry" ClientShortName string // Short name: "ATCR" @@ -79,6 +80,7 @@ func RegisterUIRoutes(router chi.Router, deps UIDependencies) { BillingManager: deps.BillingManager, WebhookDispatcher: deps.WebhookDispatcher, DefaultHoldDID: deps.DefaultHoldDID, + ManagedHolds: deps.ManagedHolds, CompanyName: deps.LegalConfig.CompanyName, Jurisdiction: deps.LegalConfig.Jurisdiction, ClientName: deps.ClientName, diff --git a/pkg/appview/server.go b/pkg/appview/server.go index 9f3a50a..4f21df7 100644 --- a/pkg/appview/server.go +++ b/pkg/appview/server.go @@ -346,6 +346,7 @@ func NewAppViewServer(cfg *Config, branding *BrandingOverrides) (*AppViewServer, ReadmeFetcher: s.ReadmeFetcher, Templates: s.Templates, DefaultHoldDID: defaultHoldDID, + ManagedHolds: cfg.Server.ManagedHolds, ClientName: cfg.Server.ClientName, ClientShortName: cfg.Server.ClientShortName, BillingManager: s.BillingManager, diff --git a/pkg/appview/templates/components/head.html b/pkg/appview/templates/components/head.html index bdd92bb..caed8d3 100644 --- a/pkg/appview/templates/components/head.html +++ b/pkg/appview/templates/components/head.html @@ -17,8 +17,11 @@ - + at startup so renaming a .woff2 doesn't silently 404. + icons.svg is intentionally NOT preloaded: it is consumed via SVG + references, whose fetch has request + destination "empty" and never matches an as="image" (or any) preload, + so the hint was always dropped as "preloaded but not used". --> {{ range fontPreloads }} {{ end }} diff --git a/pkg/appview/templates/pages/privacy.html b/pkg/appview/templates/pages/privacy.html index cb027fb..9ee835c 100644 --- a/pkg/appview/templates/pages/privacy.html +++ b/pkg/appview/templates/pages/privacy.html @@ -1,3 +1,6 @@ +{{/* Renders the comma-separated list of managed holds we operate, falling back + to a generic example if none are configured. Expects LegalPageData as dot. */}} +{{ define "managedHoldsList" }}{{ if .ManagedHolds }}{{ range $i, $h := .ManagedHolds }}{{ if $i }}, {{ end }}{{ $h }}{{ end }}{{ else }}hold01.{{ .SiteURL }}{{ end }}{{ end }} {{ define "privacy" }} @@ -21,7 +24,7 @@

Data Stored on Our Infrastructure

-

Layer Records: Our hold services (e.g., hold01.{{ .SiteURL }}) maintain records in their embedded PDS that reference container image layers you publish. These records are public and link your AT Protocol identity (DID) to content-addressed SHA identifiers.

+

Layer Records: Our hold services ({{ template "managedHoldsList" . }}) maintain records in their embedded PDS that reference container image layers you publish. These records are public and link your AT Protocol identity (DID) to content-addressed SHA identifiers.

OCI Blobs: Container image layers are stored in our object storage (S3). These blobs are content-addressed and deduplicated—meaning identical layers uploaded by different users are stored only once.

@@ -58,7 +61,7 @@

{{ .ClientShortName }}-Hosted Hold Services

-

Storage backends we operate (e.g., hold01.{{ .SiteURL }}). Each hold has an embedded PDS and stores:

+

Storage backends we operate ({{ template "managedHoldsList" . }}). Each hold has an embedded PDS and stores: