Repository navigation
Configurable branding: colours, logo and busy animation via Administration - #470
Merged
Merged
Conversation
Admins set a primary and an accent colour as hex codes and upload a logo
and a busy animation (SVG, GIF or PNG, at most 1 MiB) under
Administration › Betrieb › Erscheinungsbild. Portal and chat apply them,
including the login pages and the browser-tab icon; without a setting
everything looks as before.
- Ingest: branding_config/branding_assets (migration 0061), palette
derivation for light and dark mode, content-typed uploads with a strict
SVG check, public GET /api/v1/branding (+ /assets/{kind}) and admin
routes under /api/v1/auth/admin/branding; contracts/openapi.json
regenerated.
- weave-api: public read-only GET /v1/branding (+ /assets/{kind}) for the
chat, with caching and last-good fallback.
- Chat: server-side branding fetch, style injection, asset proxy,
favicon and busy tab.
- Portal: branding provider, admin tab, brand components switch to the
tokens only while a custom palette is applied.
Assets are only rendered as <img> and served with a sandbox CSP.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01W9t7FebTPSQxa4Av4VRenB
- Ingest SVG check: read <style> CSS the way browsers do (direct text, not child elements' text) and refuse <style> with child elements, so a child cannot split @import, url( or javascript: past the check. - Chat logo: fall back to the built-in mark for an asset that already failed before hydration; decide reduced motion in the server markup (<picture> media source / motion-safe classes) instead of only in JS. - weave-api asset cache honours ?v=: a newer requested version bypasses the cached bytes or a remembered miss (at most every 5 s per kind) and bytes that still do not match are sent with no-cache; the chat proxy forwards ?v= and passes that no-cache through. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01W9t7FebTPSQxa4Av4VRenB
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Admins can now set the look of portal and chat under Administration › Betrieb › Erscheinungsbild:
Both portal and chat use them, including the login pages, and the logo becomes the browser-tab icon. Without a setting, everything looks exactly as before.
How it works:
branding_configandbranding_assets(migration0061, included in backups).foreignObject, external references,xml:base, DTDs/entities, processing instructions and unsafe CSS.GET /api/v1/brandingandGET /api/v1/branding/assets/{kind}; adminGET/PUT /api/v1/auth/admin/branding,PUT/DELETE /api/v1/auth/admin/branding/assets/{kind}.GET /v1/branding(+/assets/{kind}) publicly and read-only, so the chat (and later the desktop app) can show branding before login.?v=.html:has(#weave-branding), so the default look is unchanged.img-src.<img>, never as inline markup.Content-Security-Policy: default-src 'none'; style-src 'unsafe-inline'; img-src data:; sandbox,nosniffand a svg/gif/png allowlist.No new env settings.
contracts/openapi.jsonis regenerated (additive only). The CHANGELOG entry sits in the 0.7.25 section, because that release has not been published yet; the run was cancelled before any image was pushed.Affected services
services/ingest (backend + frontend), services/api, services/chat, contracts/, docs/
Test plan
npm run lint,npm run typecheck,npm test: 351 passednpm run lint(0 errors),npm run typecheck,npm test: 307 passed;next buildOK, and the compiled CSS contains the gated brand rulesscripts/tests(weave-mark sync check): passed, the built-in mark is unchanged<style>CSS in SVG, pre-hydration image error fallback, reduced motion in server HTML,?v=in the weave-api asset cache)Checklist
contracts/updated if an API or event changed (openapi.jsonregenerated)python scripts/weave_config.py checkpasses if configuration changed (n/a, no configuration change)docs/updated if operators or users see the change (docs/wissensportal.md,docs/api-referenz.md,services/api/README.md,services/chat/README.md)deploy/.envin the diffNotes for reviewers
GET /v1/brandingfrom weave-api.Generated by Claude Code