Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions contracts/api/v2/breaking-approvals.json
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
{
"approvals": [
{
"operation_id": "listAdminUsers",
"change_id": "response-property-became-nullable",
"fingerprint": "5ea325c6e0cd4853fee0c248dd139bd6346e273ca0e10f2c4a2f6bd6a25c54f0",
"reason": "Pre-lock change from #1399: an account's profile limit now inherits its access group's limit unless the account overrides it, like the other policy fields, so a null max_profiles means the account inherits and effective_policy.max_profiles carries the limit that applies. The bundled web admin pages read both in the same change. The Apple and Android apps don't read max_profiles. The frozen v1 admin user body keeps reporting the limit that applies.",
"approved_in": "#1399"
"operation_id": "getBrandingCapabilities",
"change_id": "response-required-property-removed",
"fingerprint": "e694d8b1db36caa8200181773b35234d47dea4b450449b55632c47556c3e6183",
"reason": "Pre-lock removal: the field reported whether getThemeOverrides was available, and that operation is removed in the same change. No first-party client reads it; silo-apple and silo-android do not call the branding capability.",
"approved_in": "#2413"
},
{
"operation_id": "getAdminUser",
"change_id": "response-property-became-nullable",
"fingerprint": "a8d908f1ed47cb86f549d3375898bc45ea000241df9fd8179d7dc5da63e62ba5",
"reason": "Pre-lock change from #1399: an account's profile limit now inherits its access group's limit unless the account overrides it, like the other policy fields, so a null max_profiles means the account inherits and effective_policy.max_profiles carries the limit that applies. The bundled web admin pages read both in the same change. The Apple and Android apps don't read max_profiles. The frozen v1 admin user body keeps reporting the limit that applies.",
"approved_in": "#1399"
"operation_id": "getThemeOverrides",
"change_id": "api-path-removed-without-deprecation",
"fingerprint": "144c93e5f4a3cf0f51527df6ca683a547e4e4fee0c91fdd4ceb8d1b9c1551b07",
"reason": "Pre-lock removal: the web client no longer offers the admin token and font overrides or custom CSS, so nothing reads them; the accent color stays on getBranding. The bundled web client stops calling this operation in the same change; silo-apple and silo-android never called it. The frozen v1 route stays for the bridge.",
"approved_in": "#2413"
}
]
}
18 changes: 9 additions & 9 deletions contracts/api/v2/migration.json
Original file line number Diff line number Diff line change
Expand Up @@ -41678,18 +41678,18 @@
],
"section": "settings-branding",
"release_flow": "browse_search",
"tier": 1,
"disposition": "ported",
"disposition_rule": "default_ported",
"disposition_rationale": "No exclusion, removal, or ratified redesign applies; port to v2 in its section PR.",
"owner": null,
"tier": 2,
"disposition": "removed",
"disposition_rule": "v1_scope_removals_table",
"disposition_rationale": "Listed in docs/architecture/v1-scope.md removals (\"The admin theme overrides route\"); still registered on the bridge surface, retired by the tombstone. No successor: the web client applies only the branding accent color, with no admin token, font or CSS overrides.",
"owner": "Quick104",
"review_state": "ratified",
"v2": {
"method": "GET",
"path": "/api/v2/theme/admin-css",
"operation_id": "getThemeOverrides"
"method": null,
"path": null,
"operation_id": null
},
"notes": "Implemented public branding discovery/overrides and image GET/HEAD on reviewed raw foundation. Asset URLs target v2, exact content-version requests cache immutably, stale versions return404, unversioned reads revalidate. Security headers and conditional tags preserved. Bundled web uses v2 discovery/overrides. Capability GET /api/v2/theme/capabilities. Frozen v1 transport unchanged. Independently reviewed and accepted with coordinated Apple and Android public branding consumers; no native CSS caller."
"notes": "Section settings-branding. The v2 getThemeOverrides operation and the overrides_available capability field were removed before the v2 lock when the admin token and font overrides and custom CSS were removed from the web client; the accent color stays on getBranding and the web client applies it from there. The bundled web client no longer reads the overrides; no native or Jellyfin consumer exists. The frozen v1 route keeps reporting the stored ui.admin_theme_vars and ui.admin_custom_css values until the /api/v1 tombstone retires it. Removal ratified 2026-10-13 (owner decision, Quick104)."
},
{
"listener": "api",
Expand Down
93 changes: 0 additions & 93 deletions contracts/api/v2/openapi.json
Original file line number Diff line number Diff line change
Expand Up @@ -21322,9 +21322,6 @@
"branding_available": {
"type": "boolean"
},
"overrides_available": {
"type": "boolean"
},
"revision": {
"description": "Opaque revision of this document",
"type": "string"
Expand All @@ -21345,7 +21342,6 @@
},
"required": [
"branding_available",
"overrides_available",
"storage_available",
"revision",
"state"
Expand Down Expand Up @@ -46980,22 +46976,6 @@
],
"type": "object"
},
"ThemeOverrides": {
"additionalProperties": false,
"properties": {
"raw_css": {
"type": "string"
},
"vars": {
"type": "string"
}
},
"required": [
"vars",
"raw_css"
],
"type": "object"
},
"ThemePlayback": {
"additionalProperties": false,
"properties": {
Expand Down Expand Up @@ -201164,79 +201144,6 @@
"x-silo-service-backed": true
}
},
"/api/v2/theme/admin-css": {
"get": {
"operationId": "getThemeOverrides",
"responses": {
"200": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ThemeOverrides"
}
}
},
"description": "OK"
},
"400": {
"content": {
"application/problem+json": {
"schema": {
"$ref": "#/components/schemas/Problem"
}
}
},
"description": "Bad Request"
},
"406": {
"content": {
"application/problem+json": {
"schema": {
"$ref": "#/components/schemas/Problem"
}
}
},
"description": "Not Acceptable"
},
"422": {
"content": {
"application/problem+json": {
"schema": {
"$ref": "#/components/schemas/Problem"
}
}
},
"description": "Unprocessable Entity"
},
"500": {
"content": {
"application/problem+json": {
"schema": {
"$ref": "#/components/schemas/Problem"
}
}
},
"description": "Internal Server Error"
},
"503": {
"content": {
"application/problem+json": {
"schema": {
"$ref": "#/components/schemas/Problem"
}
}
},
"description": "Service Unavailable"
}
},
"summary": "Read public pre-login theme overrides.",
"tags": [
"branding"
],
"x-silo-class": "public",
"x-silo-service-backed": true
}
},
"/api/v2/theme/branding": {
"get": {
"operationId": "getBranding",
Expand Down
3 changes: 2 additions & 1 deletion docs/architecture/v1-scope.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,8 @@ migration ledger.
| The legacy (pre-v3) request and response bodies of `POST /api/v1/playback/start`. The route stays; a body that does not declare `protocol_version: 3` now gets `426 client_upgrade_required` instead of a legacy plan | Playback protocol v3, [spec](playback-protocol-v3.md) | v3 is a platform-neutral contract that moves route selection, quality laddering and track choice server-side. The legacy body carried the opposite model — the client posted a decision it had already made. Running both means every planner change has to be made twice, in two shapes that disagree about who decides, and the legacy shape is the one the client-specific bugs live in. A deprecation window would extend that duplication across the whole window for a protocol no shipping client will still speak by lock. |
| `POST /api/v1/playback/transcode/start` | Playback protocol v3, [spec](playback-protocol-v3.md) | Client-posted transcode recipes. Superseded by the `quality_change` replan operation: the client sends a label from `playback_plan.available_qualities` and the server picks the encode. Keeping the endpoint keeps a second, unvalidated way to start a transcode that bypasses plan identity entirely. |
| The legacy `/api/v1/plex-sync/*` aliases of the webhook-sync surface: `GET /api/v1/plex-sync/connections`, `POST /api/v1/plex-sync/connections`, `DELETE /api/v1/plex-sync/connections/{id}`, `GET /api/v1/plex-sync/connections/{id}/actors`, `PUT /api/v1/plex-sync/connections/{id}/actors`, `POST /api/v1/plex-sync/connections/{id}/webhook/rotate` | API v2 migration, personal-imports section ([ledger](../../contracts/api/v2/migration.json)) | Plex-only projections of the provider-neutral `/api/v1/webhook-sync/*` routes, served by the same handler over the same connection rows, with no first-party consumer. Their successors are the `/api/v2/webhook-sync/*` operations; carrying a second, Plex-shaped spelling of every connection operation into v2 would double the contract for one provider. The public inbound receiver `POST /api/v1/plex-sync/webhooks/{secret}` is not in this entry: external Plex servers were configured with that URL, so it keeps working on v1 (see its ledger row). |
| The community theme catalog routes: `GET /api/v1/theme/catalog`, `POST /api/v1/theme/catalog/refresh`, `GET /api/v1/theme/download` | Single web theme, 2026-09-26 | The web client now has one theme, Cinema Dark, which only the admin customizes with the accent color, token overrides and raw CSS. Profiles no longer pick or import themes, so nothing consumes a catalog of portable theme files, and the v2 catalog operations were removed before the v2 lock. The v1 routes are unchanged on the bridge surface, and `theme.catalog_url` keeps its default for them, until the retirement tombstone removes them with everything else. |
| The community theme catalog routes: `GET /api/v1/theme/catalog`, `POST /api/v1/theme/catalog/refresh`, `GET /api/v1/theme/download` | Single web theme, 2026-09-26 | The web client now has one theme, Cinema Dark, with no profile theme choice (the admin's token overrides and raw CSS were removed later, in the next row; the accent color stays). Profiles no longer pick or import themes, so nothing consumes a catalog of portable theme files, and the v2 catalog operations were removed before the v2 lock. The v1 routes are unchanged on the bridge surface, and `theme.catalog_url` keeps its default for them, until the retirement tombstone removes them with everything else. |
| The admin theme overrides route: `GET /api/v1/theme/admin-css` | Accent-only admin theming, 2026-10-13 | The web client no longer offers the admin token and font overrides or custom CSS, so nothing reads the overrides, and the v2 `getThemeOverrides` operation and the `overrides_available` capability field were removed before the v2 lock. The accent color stays: the web client now applies it from the branding document. The v1 route stays unchanged on the bridge surface, still reporting the stored `ui.admin_theme_vars` and `ui.admin_custom_css`, until the retirement tombstone removes it with everything else. |
| Personal collection groups and per-profile allow lists on `/api/v1/collections`: `POST /api/v1/collections/groups`, `PUT /api/v1/collections/groups/order`, `PUT /api/v1/collections/groups/{id}` and `DELETE /api/v1/collections/groups/{id}` answer `501 unsupported`; `PUT /api/v1/collections/order` accepts only a null or absent `group_id`, and its `ordered_ids` names only the acting profile's own collections, so another profile's shared collection in the list is a `400`; `PUT /api/v1/collections/{id}` ignores a null or blank `group_id` and answers `501 unsupported` for a named one; `allowed_profile_ids` is ignored on create and update | Personal collection sharing, [#1615](https://github.com/Silo-Server/silo-server/issues/1615), [API](../collections-api.md) | Collections are either private to their creator or shared with every profile on the login, and each profile has one flat order of its own collections. The v1 routes share the service seams, so they follow the same model rather than keep a second one: list responses keep their shape, with `groups` always `[]`, `group_id` always `null`, and `allowed_profile_ids` reporting the effective audience. The group routes answer as they already did for an account on the SQLite user store. Keeping login-wide groups or per-profile allow lists on v1 would let one profile keep rearranging or narrowing another's collections, the defect #1615 removes. |
| The `sections.allow_profile_custom_sections` admin setting routes: `GET /api/v1/admin/settings/sections`, `PUT /api/v1/admin/settings/sections` | Rule rows for every profile, 2026-10-05 | Profiles may always add rule rows ("Titles matching rules") to their pages, so the "Let profiles add rule rows" switch and its setting are gone, and the v2 operations were removed before the v2 lock. The v1 routes stay on the bridge surface until the retirement tombstone: `GET` answers `allow_profile_custom_sections: true`, and `PUT` checks that the body is JSON, changes nothing, and answers the same. `GET /api/v1/profile/sections/flags` and v2 `getProfileSectionFlags` keep the field, always `true`. Only an admin adds new Editor's picks rows; a profile keeps the ones it has. |
| The meaning of `allow_profile_custom_sections` on `GET /api/v1/profile/sections/flags` | Rule rows for every profile, 2026-10-05 | The flag used to mean that a profile that is not an admin may also add rows of admin-only recipes (Editor's picks), and clients offered those rows on `role == "admin" \|\| flag`. It now answers `true` everywhere and no longer grants that: `PUT /api/v1/profile/sections` still refuses a new Editor's picks row from a profile that is not an admin with `403 custom_disabled` and its unchanged message. A client follows each recipe's `admin_only` in `listSectionRecipes` instead. No first-party client reads the flag. |
Expand Down
29 changes: 17 additions & 12 deletions docs/settings-api.md
Original file line number Diff line number Diff line change
Expand Up @@ -450,13 +450,12 @@ Branding remains public so it can render before sign-in:

| Method | Path | Response |
|---|---|---|
| GET | `/api/v2/theme/capabilities` | Branding, CSS-override, and asset-storage availability |
| GET | `/api/v2/theme/capabilities` | Branding and asset-storage availability |
| GET | `/api/v2/theme/branding` | Server name, login subtitle, optional accent color and asset URLs, storage availability |
| GET | `/api/v2/theme/admin-css` | JSON object with `vars` and `raw_css` strings |
| GET / HEAD | `/api/v2/branding/assets/{kind}` | Image bytes or matching headers without a body |

Discovery uses the existing branding service and theme settings. When dependencies
are absent, configuration returns default branding and empty overrides; capabilities
Discovery uses the existing branding service. When dependencies are absent,
configuration returns default branding; capabilities
report availability explicitly. Discovery responses are not cached. The bundled web
uses these v2 reads. Native server-identity discovery must adopt the same public
endpoint through its negotiated API-version handling.
Expand All @@ -472,14 +471,20 @@ A valid kind without a configured asset returns `404`; missing asset storage ret

The frozen v1 routes and administrator asset upload/delete operations are unchanged.

The web client has one theme, Cinema Dark. Only an administrator customizes it, with
the accent color and the overrides `admin-css` returns (`ui.admin_theme_vars` and
`ui.admin_custom_css`), layered on that theme. The v2 branding document therefore
has no default theme and no light-theme logo URLs, and v2 has no theme catalog.
The frozen v1 `/theme/branding` response is unchanged: it still reports a stored
`default_theme` and light logo URLs. The server keeps those settings for v1 alone. The v1
`/theme/catalog`, `/theme/catalog/refresh` and `/theme/download` routes keep their
behavior, and `theme.catalog_url` its default, until v1 retires.
The web client has one theme, Cinema Dark. The only customization is the
administrator's accent color (`branding.accent_color`), which the web client
reads from the branding document and applies to the primary action color, the
focus ring and the sidebar accent, turning the labels on those surfaces white
when white reads better on the accent. A stored value that is not a `#rgb` or
`#rrggbb` hex color is ignored, as email ignores it. Email buttons, the shell's `theme-color` and
the web app manifest use it too. The v2 branding document has no default theme
or light-theme logo URLs, and v2 has no theme overrides or theme catalog.
The frozen v1 routes are unchanged: `/theme/branding` still reports a stored
`default_theme` and light logo URLs, and `/theme/admin-css` still reports the
stored `ui.admin_theme_vars` and `ui.admin_custom_css`. The server keeps those
settings for v1 alone; nothing else reads them. The v1 `/theme/catalog`,
`/theme/catalog/refresh` and `/theme/download` routes keep their behavior, and
`theme.catalog_url` its default, until v1 retires.

### Retired theme settings

Expand Down
20 changes: 8 additions & 12 deletions internal/api/handlers/theme.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@ type ThemeSettingsReader interface {
Get(ctx context.Context, key string) (string, error)
}

// ThemeHandler serves theme-related public endpoints.
// ThemeHandler serves the frozen /api/v1 theme routes. The web client has one
// look and reads none of them; they stay on the bridge surface, reporting
// whatever is stored, until v1 retires.
type ThemeHandler struct {
settings ThemeSettingsReader

Expand Down Expand Up @@ -45,19 +47,13 @@ type AdminCSSView struct {
RawCSS string `json:"raw_css"`
}

// HandleAdminCSS returns the server-wide admin theme overrides.
// Public endpoint — no authentication required. This allows admin
// branding to apply before login (white-label).
// HandleAdminCSS returns the retired server-wide theme overrides. Public
// endpoint — no authentication required, as it was read before login.
func (h *ThemeHandler) HandleAdminCSS(w http.ResponseWriter, r *http.Request) {
vars, _ := h.settings.Get(r.Context(), "ui.admin_theme_vars")
rawCSS, _ := h.settings.Get(r.Context(), "ui.admin_custom_css")
w.Header().Set("Cache-Control", "no-store")
writeJSON(w, http.StatusOK, h.AdminCSS(r.Context()))
}

// AdminCSS reads the shared server overrides used before login.
func (h *ThemeHandler) AdminCSS(ctx context.Context) AdminCSSView {
vars, _ := h.settings.Get(ctx, "ui.admin_theme_vars")
rawCSS, _ := h.settings.Get(ctx, "ui.admin_custom_css")
return AdminCSSView{Vars: vars, RawCSS: rawCSS}
writeJSON(w, http.StatusOK, AdminCSSView{Vars: vars, RawCSS: rawCSS})
}

// HandleDownload retains the frozen portable JSON response.
Expand Down
1 change: 0 additions & 1 deletion internal/api/router.go
Original file line number Diff line number Diff line change
Expand Up @@ -2523,7 +2523,6 @@ func newChiRouter(deps Dependencies) chi.Router {
var themeHandler *handlers.ThemeHandler
if settingsRepo != nil {
themeHandler = handlers.NewThemeHandler(settingsRepo)
v2deps.ThemeOverrides = themeHandler
}
if deps.BrandingService != nil {
v2deps.Branding = deps.BrandingService
Expand Down
Loading
Loading