From 4439684e414533d4db7ef0810d9251bf1a3b6f9c Mon Sep 17 00:00:00 2001 From: groot Date: Thu, 23 Jul 2026 06:18:10 +0200 Subject: [PATCH] Update 1.8.1 Anpassung der Barrierefreiheit --- .env.example | 2 +- CHANGELOG.md | 12 +++++ Makefile | 2 +- README.md | 29 ++++++++--- bulkweb/static/bulk.css | 2 + bulkweb/static/bulk.js | 2 +- bulkweb/templates/index.html | 8 +-- compose.yaml | 43 +++++++++------- deploy/kubernetes.yaml | 2 +- deploy/swarm-stack.yaml | 2 +- docs/BACKGROUND-PAGE.md | 2 +- docs/EU-AI-ACT-COMPLIANCE.md | 10 ++-- docs/LEGAL-AND-SECURITY.md | 3 +- docs/LICENSE-CLIENT.md | 2 +- docs/LICENSE-INTEGRATION.md | 2 +- internal/app/licensing.go | 2 +- internal/app/server.go | 32 ++++++++---- internal/app/server_test.go | 10 +++- internal/badge/render.go | 59 ++++++++++++++++++++-- internal/badge/render_test.go | 31 ++++++++++++ internal/bulk/server.go | 2 +- internal/i18n/catalog.go | 48 ++++++++++++++++++ internal/marketing/content.go | 4 +- openapi.yaml | 10 ++-- web/static/app.js | 93 ++++++++++++++++++++++++++++++----- web/static/style.css | 3 ++ web/templates/background.html | 2 +- web/templates/index.html | 11 +++-- web/templates/marketing.html | 2 +- 29 files changed, 350 insertions(+), 82 deletions(-) diff --git a/.env.example b/.env.example index 1ed3d8b..b84d50d 100644 --- a/.env.example +++ b/.env.example @@ -4,7 +4,7 @@ PUBLIC_NAME=AI Usage Disclosure CONTACT_URL=https://ai.trustednet.eu SALES_URL=https://ai.trustednet.eu/product DEFAULT_LANGUAGE=de -BULK_URL=http://localhost:8081 +BULK_URL=http://localhost:8088 # Optional second container for batch rendering. BULK_MAX_URLS=500 diff --git a/CHANGELOG.md b/CHANGELOG.md index ae41d5a..b50c2a5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,17 @@ # Changelog +## 1.8.1 - 2026-07-23 + +- Added an accessible first-exposure embed with visible link text next to the SVG badge instead of relying on SVG/`alt` information alone. +- Added `accessibleText` and `embedHtml` to `GET /v1/render`; `embedHtml` combines the visible disclosure and inline JSON-LD in one copy/paste artifact. +- The normal generator now renders HTML/Markdown/JSON-LD through the core render endpoint and copies the complete HTML + JSON-LD embed by default. +- Bulk HTML exports now use `embedHtml`, so each subject receives visible disclosure markup and JSON-LD in one step. +- Flat SVG badges automatically choose black or white text per segment for at least 4.5:1 contrast; the old overlay gradient was removed so the computed contrast remains deterministic. +- Emoji/icon badges enforce at least 3:1 foreground/background contrast by falling back to black or white when a custom colour pair is insufficient; the generator shows a corresponding warning. +- Increased the recommended linked disclosure target to at least 36 CSS pixels high and added a visible text label in the generator preview. +- Adopted the supplied registry deployment: `compose.yaml` now uses `git.send.nrw/sendnrw/ai-disclosure-standard:latest` and `:bulk-latest`, and `.gitea/workflows/registry-bulk.yml` builds the separate bulk tags. +- Removed the superseded GHCR bulk workflow to avoid competing release pipelines. + ## 1.8.0 - 2026-07-22 - Added the optional `ai-disclosure-bulk` container without accounts, database or separate legal decision logic. diff --git a/Makefile b/Makefile index 6781a04..1433d99 100644 --- a/Makefile +++ b/Makefile @@ -28,7 +28,7 @@ build-bulk: CGO_ENABLED=0 go build -trimpath -ldflags="-s -w" -o bin/ai-disclosure-bulk ./cmd/bulk docker-build: - docker build -t ai-disclosure-standard:1.8.0-local . + docker build -t ai-disclosure-standard:1.8.1-local . docker-build-bulk: docker build -f Dockerfile.bulk -t ai-disclosure-bulk:1.0.0-local . diff --git a/README.md b/README.md index 87a5a20..8727fa0 100644 --- a/README.md +++ b/README.md @@ -1,11 +1,12 @@ -# AI Disclosure Standard 1.8.0 +# AI Disclosure Standard 1.8.1 Ein zustandsloser Go-Dienst für sichtbare und maschinenlesbare Erklärungen zur KI-Nutzung in Artikeln, Webseiten und einzelnen Inhaltsbestandteilen. ## Funktionen - einzelne Deklarationen und zusammengefasste Artikel-/Webseiten-Deklarationen; -- SVG-Badges, HTML-Erklärung und JSON-LD unter einem gemeinsamen Link; +- SVG-Badges, sichtbarer barrierearmer HTML-Hinweis und JSON-LD unter einem gemeinsamen Link; +- empfohlener Ein-Schritt-Embed: sichtbarer Hinweis + dekoratives SVG + inline JSON-LD in einem HTML-Snippet; - Text, Titelbild, weitere Bilder, Recherche, Übersetzung, Audio, Video und Code getrennt erfassbar; - automatisch erzeugte, professionell formulierte Zusammenfassung als Fließtext und strukturierte Tabelle; - frei wählbare Nachweisgrundlage: Selbsterklärung, technisch protokolliert, signiert oder verifiziert; @@ -37,7 +38,7 @@ Datenschutz: http://localhost:8080/datenschutz Barrierefrei: http://localhost:8080/barrierefreiheit Healthcheck: http://localhost:8080/healthz Funktionen: http://localhost:8080/v1/capabilities -Bulk: http://localhost:8081/ +Bulk (Compose-Port): http://localhost:8088/ ``` Go lädt `.env` nicht selbst. Unter PowerShell kann die Datei vor dem Start in die Prozessumgebung übernommen werden oder Docker Compose mit `--env-file .env` verwendet werden. @@ -46,9 +47,23 @@ Go lädt `.env` nicht selbst. Unter PowerShell kann die Datei vor dem Start in d ```powershell Copy-Item .env.example .env -docker compose --env-file .env up -d --build +docker compose --env-file .env pull +docker compose --env-file .env up -d ``` +Die bereitgestellte `compose.yaml` verwendet die Registry-Images `git.send.nrw/sendnrw/ai-disclosure-standard:latest` und `:bulk-latest`, bindet beide Dienste an das externe Netzwerk `proxy` und veröffentlicht den Bulk-Dienst zusätzlich auf Host-Port `8088`. Das Netzwerk `proxy` muss vor dem Start bereits existieren. + + +## Gitea Actions: Bulk-Image + +Der Workflow `.gitea/workflows/registry-bulk.yml` baut `Dockerfile.bulk` unabhängig vom Hauptimage und veröffentlicht in der konfigurierten Registry unter anderem: + +```text +git.send.nrw/sendnrw/:bulk-latest +git.send.nrw/sendnrw/:bulk- +``` + +Er verwendet dieselbe Registry- und Secret-Konfiguration wie der vorhandene Hauptimage-Workflow (`DOCKER_USERNAME` / `DOCKER_PASSWORD`). ## Bulk-Generator @@ -60,7 +75,9 @@ Typischer Ablauf: 2. **Als Bulk-Vorlage öffnen** auswählen. 3. Optional ein Website-Profil mit wiederkehrenden Angaben wie Autor, Impressums-/Verantwortlichkeits-URL und Beschwerdestelle im Browser speichern. 4. Absolute URLs oder relative Pfade einfügen. Für relative Pfade kann einmalig eine Basis-URL gesetzt werden. -5. HTML, Markdown, JSON-LD, JSONL oder CSV erzeugen und kopieren bzw. herunterladen. +5. Das komplette HTML (sichtbarer Hinweis + JSON-LD), Markdown, separates JSON-LD, JSONL oder CSV erzeugen und kopieren bzw. herunterladen. + +Der HTML-Export verwendet standardmäßig `embedHtml` aus dem Core: Das SVG ist dekorativ (`alt=""`), der Link enthält unmittelbar sichtbaren Text und hat ein größeres Klickziel; direkt danach folgt das JSON-LD als `" w.Header().Set("Content-Type", "application/json; charset=utf-8") w.Header().Set("Cache-Control", "no-store") _ = json.NewEncoder(w).Encode(renderedArtifacts{ - Subject: d.Subject, DeclarationURL: declarationURL, BadgeURL: badgeURL, ManifestURL: manifestURL, - HTML: htmlMarkup, Markdown: markdown, JSONLD: d, + Subject: d.Subject, DeclarationURL: declarationURL, BadgeURL: badgeURL, ManifestURL: manifestURL, AccessibleText: accessibleText, + HTML: htmlMarkup, EmbedHTML: embedMarkup, Markdown: markdown, JSONLD: d, }) } diff --git a/internal/app/server_test.go b/internal/app/server_test.go index c12ea21..b2c6724 100644 --- a/internal/app/server_test.go +++ b/internal/app/server_test.go @@ -699,7 +699,9 @@ func TestRenderEndpointReturnsReusableArtifacts(t *testing.T) { DeclarationURL string `json:"declarationUrl"` BadgeURL string `json:"badgeUrl"` ManifestURL string `json:"manifestUrl"` + AccessibleText string `json:"accessibleText"` HTML string `json:"html"` + EmbedHTML string `json:"embedHtml"` Markdown string `json:"markdown"` JSONLD map[string]any `json:"jsonLd"` } @@ -709,7 +711,7 @@ func TestRenderEndpointReturnsReusableArtifacts(t *testing.T) { if payload.Subject != "https://content.example/article" { t.Fatalf("subject %q", payload.Subject) } - for name, value := range map[string]string{"declaration": payload.DeclarationURL, "badge": payload.BadgeURL, "manifest": payload.ManifestURL, "html": payload.HTML, "markdown": payload.Markdown} { + for name, value := range map[string]string{"declaration": payload.DeclarationURL, "badge": payload.BadgeURL, "manifest": payload.ManifestURL, "accessibleText": payload.AccessibleText, "html": payload.HTML, "embedHtml": payload.EmbedHTML, "markdown": payload.Markdown} { if value == "" { t.Fatalf("%s is empty", name) } @@ -723,6 +725,12 @@ func TestRenderEndpointReturnsReusableArtifacts(t *testing.T) { if !strings.Contains(payload.BadgeURL, "theme=mono") { t.Fatalf("badge URL missing theme: %s", payload.BadgeURL) } + if !strings.Contains(payload.HTML, `alt="" aria-hidden="true"`) || !strings.Contains(payload.HTML, "Details zur KI-Nutzung") { + t.Fatalf("accessible visible disclosure missing: %s", payload.HTML) + } + if !strings.Contains(payload.EmbedHTML, ` diff --git a/web/templates/index.html b/web/templates/index.html index acd1f67..226597d 100644 --- a/web/templates/index.html +++ b/web/templates/index.html @@ -264,17 +264,18 @@ + {{if .CustomBadge}}{{end}} {{end}}

{{index .Text "preview"}}

- {{index .Text +
- - - + + +
{{index .Text "ai_act_embed_label"}} {{index .Text "ai_act_embed_text"}}
@@ -289,7 +290,7 @@

HA

{{index .Text "api_stateless_title"}}

{{index .Text "api_stateless_desc"}}

-
AI Usage Disclosure · App 1.8.0 · Schema 1.3 · {{.License.Edition}}{{template "legal-links" .}}
+
AI Usage Disclosure · App 1.8.1 · Schema 1.3 · {{.License.Edition}}{{template "legal-links" .}}
diff --git a/web/templates/marketing.html b/web/templates/marketing.html index 3a307ec..79bc516 100644 --- a/web/templates/marketing.html +++ b/web/templates/marketing.html @@ -119,7 +119,7 @@ -
{{.Marketing.Footer}} · App 1.8.0 · Schema 1.3 · {{.License.Edition}}{{template "legal-links" .}}
+
{{.Marketing.Footer}} · App 1.8.1 · Schema 1.3 · {{.License.Edition}}{{template "legal-links" .}}