Compare commits

...

29 Commits

Author SHA1 Message Date
karim b72f744963 content: Datenschutz-Seite + Footer-Link
Deutsche Datenschutzerklärung an die tatsächliche Praxis angepasst (self-hosted,
keine Tracker/Analytics, Server-Logs nur technisch, Dialog-Konto mit E-Mail/Name,
revDSG-Rechte, EDÖB). Footer: Datenschutz neben Kontakt/Impressum.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-02 05:11:10 +02:00
karim fcbe91c0da ui: Uhr-Icon explizit terracotta (Akzent), weiß beim Hover
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-02 04:03:07 +02:00
karim 1196f9adf6 ui: Versions-Banner in normaler Schrift (Inter/sans) statt Mono
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-02 03:18:13 +02:00
karim e62b4c3704 ui: zitieren als Link (↗), Versionen mit Uhr-Icon, interne Zitierweise als Option
- zitieren: kein Pill mehr — Link in der Pill-Schrift (Display) mit ↗ am Ende
- Versionen: Pill behält, davor ein monochromes Uhr-SVG (currentColor)
- Zitier-Formate: „intern" (OPENBUREAU-Hausformat inkl. Version) als dritte
  Option und Default, neben APA und DIN

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-02 03:11:39 +02:00
karim fce6c9eabc ui: zitieren+Versionen als Pills (wie Dialog), Quellen kompakter
- zitieren + Versionen jetzt Akzent-Outline-Pills wie Dialog (statt Links);
  „kopieren" in der Quellenangabe bleibt ein Link
- Quellen/Fußnoten: feste, vom Theme vererbte Zeilenhöhe (~26px) mit
  unitless line-height:1.5 überschrieben + kleinere Abstände → deutlich
  kompakter. Aktionsreihe-Abstände reduziert.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-02 02:54:16 +02:00
karim 6aa88a07a6 ui: Artikel-Fuß neu — zitieren als Link, Tags neben Dialog, Versionen-Liste
- zitieren: schlichter Link direkt unter den Quellen (statt Pill); klappt eine
  dezente, gesamthaft kopierbare Quellenangabe auf — wahlweise APA oder DIN
- Tags raus von unter den Quellen → in die Aktionsreihe, ganz rechts neben Dialog
- „Versionen" als Link eine Zeile darunter; Liste in voller Inhaltsbreite und
  normaler Schrift/Größe (statt mono-Box). Auswahl öffnet Diff/Fassung oben.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-02 02:19:27 +02:00
karim f2aef5c89a feature: Versionsverlauf + Diff (rot/grün) komplett auf der Seite
- API: /api/history/diff liefert den Unified-Diff einer Fassung (git show)
- „Version vom <Datum>"-Pill (statt Marke oben + Git-Links) öffnet den Verlauf
  direkt auf openbureau: Liste der Fassungen → Diff rot/grün wie auf GitHub,
  Toggle „ganze Fassung anzeigen", Rücksprung. Keine externen Git-Links mehr.
- Pills neu: Dialog (Akzent-Outline, wie zuvor) + Version/Zitieren im Tag-Look
- CSS: Tag-Pills, Diff-Styling (d-add/d-del/d-hunk), alte Badge-Styles raus

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-02 02:06:43 +02:00
karim 0cc90ac295 ui: Dialog als Pill in die Provenance-Reihe, sticht durch Symbol+Akzent hervor
Dialog-Link in .provenance verschoben: → Dialog · Version · Verlauf · Zitieren
in einer Reihe, gleiche Pill-Form. Dialog (prov-dialog) hebt sich durch Pfeil
+ Akzentfarbe (Rahmen/Text, fett) ab, Hover füllt Akzent. Zähler-Script mit ins
Partial gezogen; alte .dialog-link-Klasse/-CSS entfernt.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-02 01:52:45 +02:00
karim 22c9b9ff61 ui: Provenance als Pills + Byline nur bei Library-Beiträgen
- Version/Verlauf/Zitieren als dezente Outline-Pills (wie Versions-Marke),
  „·"-Trenner entfernt
- Byline (Autor) + „Aktualisiert am" nur noch bei Library-Beiträgen; Seiten
  wie Manifest/Kontakt/Spenden/Colophon zeigen sie nicht mehr

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-02 01:42:28 +02:00
karim 0ce2c73004 feature: alte Versionen direkt auf openbureau anzeigen
- API (öffentlich): /api/history listet Git-Versionen eines Beitrags,
  /api/history/version rendert eine alte Fassung (marked + Fußnoten-Support),
  on-demand via git im CMS-Container — kein Vorbauen. Pfad/rev validiert.
- Versions-Marke neben dem Kopf jedes Library-Beitrags (zeigt bewusst die
  Fassung); öffnet den Verlauf, Auswahl ersetzt den Text + Rücksprung-Banner.
- CSS für Badge/Panel/Banner; marked als Dependency.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-02 01:38:48 +02:00
karim c6f5beaa7b ui: Zitieren zeigt Quellenangabe sichtbar + Copy-Fallback für HTTP
Vorher: stiller clipboard.writeText → tut auf HTTP/LAN nichts (Clipboard-API
nur in sicherem Kontext). Jetzt: Klick klappt ein Panel mit der lesbaren
Quellenangabe auf (user-select:all), „Kopieren" nutzt clipboard-API mit
execCommand-Fallback; schlägt das fehl, wird der Text markiert (manuelles
Strg/⌘+C).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-02 01:22:55 +02:00
karim a4ca05c88f ui: Fußnoten-Verweise kleiner + dezent unterstrichen
sup auf 0.62em verkleinert; .footnote-ref bekommt feine Unterstreichung
(0.5px, 0.2em Offset) statt gar keiner.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-02 01:14:54 +02:00
karim 656da26347 content: 3 Musterbeiträge (Fußnoten/Quellen) + Forum-Seed-Wortmeldungen
- content/library/**/muster-*.md: Typus und Modell, Im Offenen arbeiten,
  Die Werkzeugkette — mit echten Fußnoten/Quellen, demonstrieren auch
  Provenance/Zitieren und Dialog am Artikel
- seed-demo.sql: Wortmeldungen auf den Musterbeiträgen (thread = Beitrags-URL)
  + DELETE-Hinweis für die d-Kommentare

Test-/Demo-Inhalt — vor dem späteren Full-Wipe leicht entfernbar.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-02 01:09:26 +02:00
karim c3c8c9639f feature: lebende Dokumente — Fußnoten/Quellen + Provenance/Zitieren
- Fußnoten (Goldmark [^1], schon nativ) gestylt: ruhiges Schriftbild,
  automatische „Quellen"-Überschrift statt <hr>
- provenance.html-Partial bei Library-Beiträgen: Version → Commit, Verlauf
  (Gitea), „Zitieren"-Knopf (kopiert Quellenangabe in die Zwischenablage)
- repoURL-Param (git.openbureau.ch) für die Provenance-Links

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-02 00:56:28 +02:00
karim 9f9071d23f content: Kontakt/Impressum-Seite + Footer-Link
- content/impressum.md: Kontakt (E-Mail/Dialog) + Impressum (Karim Varano,
  Fluhmühlerain 1, 6015 Luzern, Privatperson)
- footer: „Kontakt"-Mailto → /impressum/ („Kontakt / Impressum")

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-02 00:26:37 +02:00
karim 272d30357f ops: update.sh — Update im LXC in einem Befehl
Kapselt git pull + Deploy-Config + Neustart, damit die Migrationsschritte
nicht mehr per Hand nötig sind:
- kong.yml vor dem Pull auf die Vorlage zurücksetzen (kein Konflikt), danach
  CORS-Origin aus SITE_URL rendern
- chown -R 1000:1000 (non-root-Container darf schreiben)
- git safe.directory für root auf dem uid-1000-Repo
- docker compose up -d --build + kong reload + Healthcheck

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-01 23:47:35 +02:00
karim f97999c3c0 perf/test: Build-Coalescing teilen, syncLibrary drosseln, API-Tests
- coalesce.js: generisches Serialisieren+Koaleszieren je Key; buildSite() in
  hugo.js nutzt es → Publish/Preview/Profil starten nie überlappende Hugo-
  Prozesse, schnelle Folge-Aufrufe lösen nur einen Trailing-Build aus
- dialog-store: syncLibrary() gedrosselt (60s-TTL) statt bei jedem Forum-Read
  Filesystem-Walk + Upsert; Publish forciert Sync (force:true)
- test/: node:test-Suite (19 Tests) für safeRel/normAuthors/urlFor/hasAccess,
  roleOf + lokale JWT-Verifikation, Rate-Limiter, Coalescing; npm test

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-01 23:14:36 +02:00
karim 8404165f5c perf/ops: Auth-Latenz, Zähl-View, DB-Backup, Schreib-Limit, Asset-Cache
- auth: Supabase-JWT lokal verifizieren (hono/jwt, HS256) statt GoTrue-
  Roundtrip pro Request; JWT_SECRET in cms-env, Remote-Fallback wenn ungesetzt
- dialog: comment_stats-View (group by thread) ersetzt Full-Table-Scan +
  JS-Aggregation bei jedem Forum-Aufruf
- ops: scripts/backup-db.sh (pg_dump, rotiert) + täglicher Cron im Proxmox-
  Script — Dialog-Daten liegen nur in Postgres, nicht in Git
- security: Rate-Limit auf Schreib-Endpunkte (/api non-GET, 60/min je Nutzer)
- perf: Cache-Control (1 Woche) auf statische Assets, HTML bleibt frisch

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-01 23:01:12 +02:00
karim d0b5c6f670 dialog: optionaler Forum-Demo-Seed (db/seed-demo.sql)
Beispiel-Threads + Wortmeldungen für die Forum-Kategorien, bewusst getrennt
von der Migration (Produktion startet leer). Idempotent über feste UUIDs +
ON CONFLICT DO NOTHING; manuell einspielbar, DELETE-Block zum Entfernen.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-01 22:18:27 +02:00
karim 2650913050 security: Härtung der CMS-API + Deployment
App-Level:
- Security-Header (secureHeaders) global; /images/* mit strikter CSP+sandbox
  → bösartiges SVG kann kein JS im Origin ausführen
- Body-Limit 256 KB auf /api/*; Login-Rate-Limit (10/5min) gegen Brute-Force
- Upload: 8-MB-Limit + Format-Verifikation (sharp-Metadaten, SVG/GIF-Signatur)
- Comment-Längenlimit (10k) gegen DB-Bloat
- DB-Fehler nicht mehr roh ausliefern (serverError-Helper)
- Profil-PUT koalesziert Hugo-Builds (kein Build-Sturm)

Infra:
- Container läuft non-root (USER node, uid 1000) + Proxmox-Repo-chown
- Ports binden per Default auf 127.0.0.1 (BIND_ADDR-Escape-Hatch)
- Kong-CORS auf SITE_URL beschränkt statt "*"
- README: Härtungs- + Migrationshinweise

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-01 22:05:57 +02:00
karim 6d20be036a dialog: Position/Rolle + Breadcrumb-Nav + nüchterne Wortmeldungen, Footer voll-breit
- comments: author_role (Position bei OPENBUREAU) aus authors.json gespeichert/ausgeliefert
- schema: comments.author_role hinzugefügt
- dialog.js: Breadcrumb (Dialoge › Forum), volles Datum/Uhrzeit, Box→Trennlinien-Layout
- css: Footer voll-breit (Flex statt Grid), Balken zwischen Header/main/Footer entfernt

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-01 19:37:50 +02:00
karim 7b25f644a2 ui: kurzer Inhalt vertikal zentriert (Rahmen-Layout)
body:not(.is-home) main als Flex-Spalte mit justify-content: safe center —
kurze Seiten zeigen den Inhalt mittig zwischen Header und Footer (gleiche
Lücke oben/unten), langer Inhalt scrollt normal von oben (safe → start).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-01 11:40:47 +02:00
karim 4f4eccd475 ui: Footer kompakt + Balken entfernt (Breadcrumb-Linie, Header/Inhalt-Abstand)
- Footer auf allen Seiten so flach wie auf Journal (padding 0.55rem, row-gap 0.2rem)
- Breadcrumb ohne Trennlinie und ohne großen Abstand (war der „Balken" über dem Footer)
- Artikel-Top-Abstände reduziert (Inhalt sitzt enger unter dem Header)

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-01 10:35:16 +02:00
karim af587af851 ui: App-Rahmen-Layout auf allen Seiten (Header/Footer fix, main scrollt intern)
Statt Seiten-Scroll jetzt überall der Journal-„Rahmen": body height:100dvh +
overflow:hidden, Header oben / Footer unten fix, main scrollt INTERN mit
verstecktem Scrollbalken. Dadurch:
- keine Seiten-Scrollbar → Header/Footer reichen schwarz bis an den rechten Rand
  (kein weißer scrollbar-gutter-Streifen mehr)
- Footer immer unten, Inhalt im Rahmen dazwischen
- nichts hat sichtbare Scrollbalken

Inhalt 72ch-zentriert in der vollbreiten Scroll-Fläche; Hero-Bild füllt die
volle Breite (kein 100vw-Hack mehr); Breadcrumb wandert in main (scrollt mit).
Mobil: normaler Seiten-Scroll (kein 100dvh-Rahmen).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-01 05:36:45 +02:00
karim 309d12f8a2 ui: Sticky-Footer auf allen Seiten — Body von Grid auf Flex-Spalte
Nicht-Home-Seiten nutzten ein Grid-Sticky-Layout, das den Footer durch die
zusätzliche Breadcrumb-Zeile (impliziter Grid-Row) nicht zuverlässig unten
hielt. Body jetzt durchgehend Flex-Spalte wie Home: min-height:100dvh,
main flex:1 → Footer klebt unten. Inhaltsspalte (72ch + 1.75rem Gutter) per
max-width/margin-inline zentriert, Header/Footer volle Breite (eigenes inneres
Raster zentriert deren Inhalt), Full-Bleed-Hero rechnet sich weiter korrekt aus.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-01 05:21:12 +02:00
karim f82214719a ui: Header/Footer/Journal/Dialog überarbeitet + Logo
Header/Masthead:
- neuer Wortmark logo.svg; Home als Full-Height-Flex (zwei eigenständig
  scrollbare Journal-Spalten, Footer klebt unten)
- kompakte Masthead; scrollbar-gutter:stable auf html → kein weißer Streifen
  links und kein Logo/Menü-Versatz zwischen den Seiten

Journal-Home:
- zwei Spalten, eckige Karten in natürlicher Höhe; Bild als Block (Inline-
  Whitespace-Lücke behoben)

Footer:
- Lizenzen AGPL-3.0 / CC BY-SA verlinken auf /lizenz/ (eigene Seite);
  „Hosted in Lucerne" (Link zur Autor-URL); keine Underlines; flush unten;
  kein Open-Source-Fließtext mehr, kein Name im Copyright

Dialog:
- schlichte Foren-Auflistung statt Karten; kompaktes Login; kleinerer
  „→ Dialog"-Button (nur noch auf Library-Artikeln); einheitliche Fontgrößen;
  weniger Abstand zum Header, Trennlinien entfernt

Config: CODE-Menü → git.openbureau.ch; params.author.url

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-01 04:47:36 +02:00
karim f146fc7cff content: Lizenz- und Spenden-Seiten
- /lizenz/agpl-3.0/ + /lizenz/cc-by-sa-4.0/ mit den offiziellen Volltexten
  (Code unter AGPL-3.0, Inhalte unter CC BY-SA 4.0) + /lizenz/-Übersicht
- /spenden/ mit LOGO-OB und Hinweis, wofür Spenden verwendet würden

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-01 04:46:28 +02:00
karim 822266be6c header: Wortmark auf finales LOGO-OB.svg (Pfade) umgestellt
- LOGO-OB.svg: Honk-Schriftzug in Kurven umgewandelt (10 <path>, keine
  Font-Referenz) → rendert korrekt als Hintergrundbild, hellgrau auf der
  schwarzen Masthead. Hintere Rechtecke füllen die Buchstaben-Punzen hellgrau.
- ungenutzte logo-ob2.svg (lebender Text) entfernt.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-05-31 20:39:01 +02:00
karim 58ede9005d ui: Journal als Masonry (unabhängige Spalten) + Wortmark auf eigenes SVG
- Journal-Startseite: .journal-list von Grid auf Multi-Column umgestellt —
  linke/rechte Spalte packen unabhängig (keine gemeinsame Zeilenhöhe mehr),
  break-inside:avoid hält Karten zusammen. Mobil: eine Spalte.
- Wortmark: eigenes logo-ob2.svg als Hintergrund (Honk-Webfont wieder raus).
  Hinweis: SVG enthält noch lebenden Honk-Text — für korrektes Rendern als
  Hintergrundbild müssen die Buchstaben in Kurven umgewandelt werden.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-05-31 20:33:21 +02:00
52 changed files with 3044 additions and 371 deletions
+3
View File
@@ -22,3 +22,6 @@ node_modules/
.env
.env.local
hugo.local.yaml
# DB-Backups (Dialog-Daten-Dumps)
backups/
+472 -178
View File
@@ -76,29 +76,60 @@
Base body — serif editorial, 3-col grid so header/footer can full-bleed
while content stays boxed
------------------------------------------------------------------------ */
/* Theme setzt html{margin-left:calc(100vw - 100%)} (Anti-Scrollbar-Sprung) —
das schiebt die GANZE Seite um die Scrollbar-Breite nach rechts → weißer
Streifen links. Zurücknehmen: alles bündig am linken Rand. */
/* Scrollbalken-Platz auf der Wurzel reservieren UND horizontalen Überlauf hier
kappen → Inhaltsbreite identisch auf ALLEN Seiten (auch Home ohne Scrollbar),
damit das zentrierte Logo/Menü nirgends springt. */
/* Kein Seiten-Scroll, kein Scrollbalken-Gutter → Header/Footer reichen bis ganz
an den rechten Rand (schwarz bis zur Kante). Gescrollt wird nur main intern. */
html { margin: 0; overflow: hidden; }
body {
font-family: var(--font-family-serif);
font-size: var(--font-size-base);
line-height: 1.55;
padding: 0;
margin: 0;
min-height: 100vh;
overflow-x: hidden;
gap: var(--spacing-sm);
display: grid;
grid-template-rows: auto 1fr auto;
/* Boxed content column = 72ch with 1.75rem gutters, side columns absorb the rest */
grid-template-columns:
1fr
min(var(--container-width), 100% - 3.5rem)
1fr;
/* App-Rahmen auf ALLEN Seiten: feste Höhe, Seite scrollt nicht — Header oben,
Footer unten, der Inhalt (main) scrollt INTERN mit verstecktem Scrollbalken. */
height: 100dvh;
overflow: hidden;
display: flex;
flex-direction: column;
gap: 0; /* Theme-main.css setzt body{gap:spacing-lg} → erzeugte Balken zwischen Header/main/Footer */
}
/* Default: every direct body child sits in the content column */
body > * { grid-column: 2; }
/* Opt-in: full-bleed children break out edge-to-edge */
body > .full-bleed,
body > header.site-header,
body > footer { grid-column: 1 / -1; }
body > footer { flex: none; }
body > main {
flex: 1 1 auto;
min-height: 0;
overflow-y: auto;
scrollbar-width: none; /* Scrollbalken aus (kein weißer Streifen) */
-ms-overflow-style: none;
}
body > main::-webkit-scrollbar { width: 0; height: 0; display: none; }
/* Kurzer Inhalt vertikal zentriert zwischen Header und Footer; langer Inhalt
scrollt normal von oben (safe center fällt bei Überlauf auf start zurück). */
body:not(.is-home) > main {
display: flex;
flex-direction: column;
justify-content: flex-start; /* Inhalt startet direkt unter dem Header (keine Zentrier-Bänder) */
}
/* Inhalt 72ch-zentriert in der vollbreiten Scroll-Fläche (Home = Vollbreite). */
body:not(.is-home) > main > * {
max-width: calc(var(--container-width) + 3.5rem);
margin-inline: auto;
padding-inline: 1.75rem;
flex: none;
}
/* Full-Bleed-Hero füllt die ganze Breite (main ist schon viewportbreit). */
body:not(.is-home) > main > .single-hero-image {
max-width: none;
margin-inline: 0;
padding-inline: 0;
}
p { margin: var(--spacing-sm) 0; }
@@ -129,9 +160,10 @@ a:hover {
.site-header {
background: var(--color-dark-panel);
color: var(--color-dark-panel-text);
padding: 0.9rem 0;
/* oben etwas Luft über dem Logo, unten nur 12px unter dem Menü */
padding: 0.4rem 0 2px;
border-bottom: none;
margin-bottom: var(--spacing-md);
margin-bottom: 0;
/* inner 3-col grid matches body so wordmark/nav align with content column */
display: grid;
grid-template-columns:
@@ -139,7 +171,7 @@ a:hover {
min(var(--container-width), 100% - 3.5rem)
1fr;
align-items: center;
row-gap: 0.6rem;
row-gap: 0;
}
.site-header > * { grid-column: 2; }
.site-header .wordmark-link,
@@ -153,38 +185,34 @@ a:hover {
}
/* Logo as background image (paths-only SVG, no font dependency) */
/* Wordmark-Schrift: Honk (expressive Color-Font, COLRv1), self-gehostet.
Bei fehlender Color-Font-Unterstützung greift die Fallback-Farbe unten. */
@font-face {
font-family: 'Honk';
font-style: normal;
font-weight: 400;
font-display: swap;
src: url("/fonts/honk-latin.woff2") format("woff2");
}
/* Wortmark: eigener SVG-Schriftzug „openbureau" (logo-ob2.svg). */
.wordmark-link {
border: none;
margin: 0;
padding: 0;
display: block;
justify-self: center;
width: auto;
width: clamp(140px, 18vw, 200px);
aspect-ratio: 1412 / 231;
height: auto;
font-family: 'Honk', var(--font-family-display), system-ui, sans-serif;
font-weight: 400;
font-size: clamp(2rem, 5vw, 3.1rem);
line-height: 1;
letter-spacing: 0.01em;
text-transform: lowercase;
color: #fff; /* Fallback, falls Color-Font nicht unterstützt wird */
background-image: url("/logo/logo.svg");
background-repeat: no-repeat;
background-position: center;
background-size: contain;
}
.wordmark-text {
position: absolute;
width: 1px; height: 1px;
overflow: hidden;
clip: rect(0 0 0 0);
}
.wordmark-text { display: inline-block; }
.wordmark-link:hover,
.wordmark-link:focus { border: none; opacity: 0.85; }
.site-header .site-nav {
justify-self: center;
/* etwas Luft zwischen Logo und Menü. */
margin-top: 0.1em;
}
.wordmark-link:focus-visible { outline: 2px dotted var(--color-text-muted); outline-offset: 4px; }
@@ -284,34 +312,103 @@ a:hover {
gap: 0;
}
/* ── Journal: 2-Spalten-Karten-Raster, durchgehend 10px Abstände ─────────── */
/* ── Journal: ZWEI eigenständig scrollbare Spalten, eckige Karten aneinander ──
.journal-cols = zwei Spalten nebeneinander (kein Abstand). Jede .journal-list
ist EINE Spalte, die für sich scrollt (overflow-y). Karten ohne Rundung und
ohne Abstände — direkt aneinander, nur eine Hairline als Trenner. */
/* Volle Breite (aus der 72ch-Spalte ausbrechen) */
.journal { width: 100vw; position: relative; left: 50%; margin-left: -50vw; }
.journal-header { padding: 0 10px; }
.journal-list {
.journal-cols {
display: grid;
grid-template-columns: repeat(2, 1fr);
gap: 10px;
padding: 0 10px 10px;
margin: 0;
grid-template-columns: 1fr 1fr;
gap: 0;
}
.journal-list { /* eine Spalte — eigenständig scrollbar */
margin: 0;
padding: 0;
max-height: 82vh;
overflow-y: auto;
}
.journal-cols > .journal-list:first-child { border-right: 1px solid var(--color-border); }
.journal-entry {
border: none;
border-radius: 12px;
border-radius: 0;
background: var(--color-bg-secondary);
padding: 1.5rem;
margin: 0;
}
.journal-entry:last-child { border: none; }
.journal-entry + .journal-entry { border-top: 1px solid var(--color-border); }
/* In den Karten links bündig statt zentriert */
.journal-list .journal-entry .journal-entry-body { justify-items: start; text-align: left; }
.journal-list .journal-entry .journal-entry-body > * { max-width: none; }
.journal-list .journal-bg-image {
width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover;
border-radius: 8px; margin-bottom: 0.9rem;
border-radius: 0; margin-bottom: 0.9rem;
}
@media (max-width: 720px) {
.journal-list { grid-template-columns: 1fr; }
.journal-cols { grid-template-columns: 1fr; }
.journal-cols > .journal-list:first-child { border-right: none; }
.journal-list { max-height: none; overflow: visible; }
}
/* ── Startseite: Full-Height-Layout ──────────────────────────────────────────
Masthead oben, zwei eigenständig scrollbare Spalten in der Mitte, Footer klebt
unten. Die Seite selbst scrollt nicht — nur die Spalten (overflow-y). Kette
definierter Höhen: body 100dvh → main (1fr) → .journal → .journal-cols → Spalte. */
/* Flexbox statt Grid für die Home-Höhenverteilung: flex:none hält Header und
Footer exakt auf Inhaltshöhe (im Grid wurde der Header gestreckt → Menü
rutschte nach unten). Nur main füllt die Mitte. */
body.is-home {
height: 100dvh;
overflow: hidden;
display: flex;
flex-direction: column;
gap: 0;
}
body.is-home > header.site-header { margin-bottom: 0; flex: none; }
body.is-home > footer { flex: none; }
body.is-home > main {
flex: 1 1 auto; /* füllt die Mitte */
min-height: 0;
display: flex;
flex-direction: column;
overflow: hidden;
}
/* Kein Text über den Spalten: Intro + „Journal"-Header weg → Spalten beginnen
direkt unter der Masthead und füllen die volle weiße Höhe. */
body.is-home > main > p { display: none; }
body.is-home .journal-header { display: none; }
body.is-home .journal {
width: auto; left: auto; margin: 0; /* 100vw-Ausbruch zurücknehmen */
flex: 1; min-height: 0;
display: flex; flex-direction: column;
}
body.is-home .journal-cols { flex: 1; min-height: 0; }
body.is-home .journal-list {
display: flex; flex-direction: column;
max-height: none; height: 100%; min-height: 0; overflow-y: auto;
scrollbar-width: none; /* Firefox: Scrollbar aus */
-ms-overflow-style: none; /* alte Edge */
}
body.is-home .journal-list::-webkit-scrollbar { width: 0; height: 0; display: none; }
/* Karten in NATÜRLICHER Höhe (kein Stretch) → Bild + Headline bleiben kompakt
zusammen; die Spalte scrollt bei Überlauf. Kein Auseinanderreißen mehr. */
body.is-home .journal-entry { flex: 0 0 auto; }
body.is-home .more { flex: none; padding: 0.4rem 10px; margin: 0; }
/* Footer kompakt (~1/3): kein großer Außenabstand, knappes Padding. */
body.is-home > footer { margin-top: 0; padding: 0.55rem 1.5rem; }
@media (max-width: 720px) {
/* Mobil: kein Full-Height-Rahmen — normale Seite scrollt, kein interner Scroll. */
html { overflow: visible; }
body { height: auto; min-height: 100dvh; overflow: visible; }
body > main { overflow: visible; }
body.is-home { height: auto; overflow: visible; }
body.is-home > main { display: block; overflow: visible; }
body.is-home .journal { display: block; }
body.is-home .journal-cols { min-height: 0; }
body.is-home .journal-list { height: auto; overflow: visible; }
}
/* Card link: image (optional) + body block */
@@ -457,22 +554,28 @@ a.byline-author:hover, a.journal-author:hover { color: var(--accent); }
/* ── Dialog ───────────────────────────────────────────────────────────────── */
/* Link am Ende des Beitrags (der Beitrag selbst bleibt sauber) */
.dialog-link {
/* Dialog-Pill: Akzent-Outline + Pfeil — sticht neben den gefüllten Tag-Pills
hervor (wie der frühere Dialog-Link). */
.prov-dialog {
display: inline-block;
margin-top: var(--spacing-lg);
font-family: var(--font-family-display);
font-weight: 500;
font-size: 0.82rem;
letter-spacing: 0.02em;
color: var(--accent);
text-decoration: none;
background: none;
border: 1px solid var(--accent);
border-radius: 999px;
padding: 0.45em 1.2em;
padding: 0.28em 0.85em;
}
.dialog-link:hover { background: var(--accent); color: #fff; }
.prov-dialog:hover { background: var(--accent); color: #fff; }
/* Eigene Dialog-Seite (/dialog/?thread=…) */
/* Füllt die normale Inhaltsspalte (kein eigenes max-width/Seiten-Padding → gleiche Breite wie andere Seiten) */
.dialog-page { padding: var(--spacing-lg) 0; }
/* width:100% → füllt immer die ganze Inhaltsspalte (sonst schrumpft .dialog-page
als Flex-Item mit margin-inline:auto bei schmalem Inhalt, z.B. Forum-Ansicht). */
.dialog-page { width: 100%; padding: var(--spacing-sm) 0 var(--spacing-xl); }
.dialog-overview { display: flex; flex-direction: column; gap: 0.6em; }
.dialog-overview-item {
display: flex; justify-content: space-between; align-items: baseline; gap: 1em;
@@ -483,27 +586,36 @@ a.byline-author:hover, a.journal-author:hover { color: var(--accent); }
.dialog-ov-title { font-family: var(--font-family-serif); font-weight: 600; }
.dialog-ov-meta { font-size: var(--font-size-small); color: var(--color-text-muted); flex: none; }
.dialog-back { margin: 0 0 var(--spacing-sm); }
.dialog-back:empty { margin: 0; }
.dialog-back a { color: var(--color-text-muted); text-decoration: none; }
.dialog-back a:hover { color: var(--accent); }
/* Dialog-Navigation oben: Breadcrumb (Dialoge Forum). */
.dialog-crumb { display: flex; flex-wrap: wrap; align-items: center; gap: 0.45em; font-size: var(--font-size-small); }
.dialog-crumb a { color: var(--color-text-muted); text-decoration: none; }
.dialog-crumb a:hover { color: var(--accent); }
.dialog-crumb-sep { color: var(--color-text-muted); }
.dialog-title {
font-family: var(--font-family-serif);
border-top: 1px solid var(--color-border);
padding-top: var(--spacing-md);
margin-bottom: var(--spacing-md);
margin: 0 0 var(--spacing-md);
}
.dialog-list { display: flex; flex-direction: column; gap: var(--spacing-md); margin-bottom: var(--spacing-lg); }
.dialog-list { display: flex; flex-direction: column; margin-bottom: var(--spacing-lg); }
.dialog-empty { color: var(--color-text-muted); font-style: italic; }
.dialog-card { border: 1px solid var(--color-border); border-radius: 12px; padding: var(--spacing-md); background: var(--color-bg-secondary); }
.dialog-card-head { display: flex; align-items: center; gap: 0.7em; margin-bottom: 0.6em; }
/* Nüchterne Wortmeldung: keine Box — nur feine Trennlinie + Abstand. */
.dialog-post { padding: 1.15em 0; border-bottom: 1px solid var(--color-border); }
.dialog-post:first-child { padding-top: 0.2em; }
.dialog-post:last-child { border-bottom: none; }
.dialog-post-head { display: flex; align-items: center; gap: 0.7em; margin-bottom: 0.5em; }
.dialog-avatar {
width: 40px; height: 40px; border-radius: 50%; flex: none;
background: var(--color-border) center/cover no-repeat;
display: grid; place-items: center; font-weight: 600; color: var(--color-text-muted);
}
.dialog-meta { display: flex; flex-direction: column; line-height: 1.3; }
.dialog-ident { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.dialog-nameline { display: flex; align-items: baseline; flex-wrap: wrap; gap: 0.5em; }
.dialog-name { font-weight: 600; }
.dialog-time { font-size: var(--font-size-small); color: var(--color-text-muted); }
.dialog-pos { font-size: var(--font-size-small); color: var(--color-text-muted); }
.dialog-time { font-size: var(--font-size-small); color: var(--color-text-muted); margin-top: 0.1em; }
.dialog-replyto { font-size: var(--font-size-small); color: var(--accent); }
.dialog-body { font-family: var(--font-family-serif); line-height: 1.6; white-space: pre-wrap; }
.dialog-actions { display: flex; gap: 0.8em; margin-top: 0.6em; }
@@ -522,21 +634,25 @@ a.byline-author:hover, a.journal-author:hover { color: var(--accent); }
color: var(--color-text-muted); text-decoration: underline; text-underline-offset: 3px;
}
.dialog-loginlink:hover { color: var(--accent); }
.dialog-loginform { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5em; }
.dialog-loginform .dialog-input { width: auto; flex: 1 1 9em; min-width: 8em; padding: 0.45em 0.7em; }
.dialog-loginform .dialog-send { padding: 0.45em 1em; }
.dialog-loginform { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4em; font-size: var(--font-size-small); max-width: 30em; }
.dialog-loginform .dialog-input { width: auto; flex: 1 1 8em; min-width: 7em; padding: 0.35em 0.6em; font-size: inherit; border-radius: 7px; }
.dialog-loginform .dialog-send { padding: 0.35em 0.9em; font-size: inherit; }
.dialog-logincancel { align-self: center; }
/* ── Übersicht: Split-View (links letzte Wortmeldungen, rechts Foren) ── */
.dialog-split { display: grid; grid-template-columns: 1.2fr 1fr; gap: 2.4em; align-items: start; }
@media (max-width: 720px) { .dialog-split { grid-template-columns: 1fr; gap: 1.6em; } }
.dialog-recent-list, .dialog-forum-list, .dialog-thread-list { display: flex; flex-direction: column; gap: 0.7em; }
/* Schlichte Auflistung statt Karten: nur Trennlinien + großzügiger Abstand. */
.dialog-recent-list, .dialog-forum-list, .dialog-thread-list { display: flex; flex-direction: column; }
.dialog-recent-item, .dialog-forum-item, .dialog-thread-item {
display: block; text-decoration: none; color: inherit;
border: 1px solid var(--color-border); border-radius: 12px; padding: 0.85em 1em; background: var(--color-bg-primary);
transition: border-color .12s, transform .12s;
padding: 1.05em 0;
border-bottom: 1px solid var(--color-border);
transition: color .12s;
}
.dialog-recent-item:hover, .dialog-forum-item:hover, .dialog-thread-item:hover { border-color: var(--accent); }
.dialog-recent-item:first-child, .dialog-forum-item:first-child, .dialog-thread-item:first-child { padding-top: 0.3em; }
.dialog-recent-item:last-child, .dialog-forum-item:last-child, .dialog-thread-item:last-child { border-bottom: none; }
.dialog-recent-item:hover, .dialog-thread-item:hover { color: var(--accent); }
.dialog-recent-top { display: flex; justify-content: space-between; gap: 1em; align-items: baseline; }
.dialog-recent-author { font-weight: 600; }
.dialog-recent-meta, .dialog-thread-meta, .dialog-forum-meta { color: var(--color-text-muted); font-size: var(--font-size-small); }
@@ -544,9 +660,17 @@ a.byline-author:hover, a.journal-author:hover { color: var(--accent); }
.dialog-recent-body { color: var(--color-text-muted); font-size: var(--font-size-small);
display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
/* Foren-Karten — linke Akzentkante aus der Forum-Farbe */
.dialog-forum-item { border-left: 3px solid var(--forum-accent, var(--accent)); }
.dialog-forum-name { display: block; font-weight: 600; font-size: 1.05em; }
/* Foren-Auflistung: Name mit kleinem Farbpunkt (Forum-Farbe), Meta darunter. */
.dialog-forum-name {
display: flex; align-items: center; gap: 0.55em;
font-family: var(--font-family-serif); font-weight: 600; font-size: var(--font-size-base);
}
.dialog-forum-name::before {
content: ""; flex: none; width: 0.6em; height: 0.6em; border-radius: 2px;
background: var(--forum-accent, var(--accent));
}
.dialog-forum-item:hover .dialog-forum-name { color: var(--accent); }
.dialog-forum-meta { display: block; margin-top: 0.15em; }
.dialog-forum-desc { display: block; color: var(--color-text-muted); font-size: var(--font-size-small); margin-top: 0.2em; }
/* Forum-Ansicht */
@@ -663,31 +787,10 @@ a.byline-author:hover, a.journal-author:hover { color: var(--accent); }
background: #1a1a1a;
color: #fff;
}
.journal-entry--layout-image .journal-entry-link {
display: flex;
flex-direction: column;
justify-content: flex-end;
min-height: 70vh;
}
.journal-bg-image {
position: absolute;
inset: 0;
width: 100%;
height: 100%;
object-fit: cover;
z-index: 0;
margin: 0;
filter: none;
}
.journal-bg-image:hover { filter: none; }
.journal-entry--layout-image .journal-entry-body {
position: relative;
z-index: 2;
max-width: 60ch;
padding-top: 3rem;
background: transparent;
color: #fff;
}
/* (Alte Vollflächen-Mechanik entfernt: Link war display:flex + min-height:70vh
+ justify-content:flex-end, Bild position:absolute, Body padding-top:3rem —
das zog Bild und Headline in der Karte auseinander. Karten-Layout läuft jetzt
ausschließlich über die .journal-list-Regeln weiter oben.) */
/* Solid white text — no shadow halo. Legibility comes from the slight
darkening of the image at the bottom (where the body sits). */
.journal-entry--layout-image .journal-title,
@@ -790,27 +893,39 @@ a.byline-author:hover, a.journal-author:hover { color: var(--accent); }
natürliche Höhe (align-items:start → keine Zeilen-Stretchung; ein hoher
Eintrag zieht den Nachbarn NICHT mit).
════════════════════════════════════════════════════════════════════════ */
.journal-list { align-items: start; }
.journal-list .journal-entry,
.journal-list .journal-entry--layout-image,
.journal-list .journal-entry--layout-icon,
.journal-list .journal-entry--layout-text {
margin: 0;
padding: 1.25rem;
/* oben/unten 20% knapper (1.25rem → 1rem), links/rechts unverändert */
padding: 1rem 1.25rem;
position: relative;
overflow: hidden;
border-radius: 12px;
align-self: start;
border-radius: 0;
}
.journal-list .journal-entry--layout-image {
background: var(--color-bg-secondary);
color: var(--color-text-primary);
}
.journal-list .journal-entry-link { display: block; min-height: 0; }
/* Inhalt oben-bündig (kein altes justify-content:flex-end/min-height:70vh mehr,
das Bild und Text in der gewachsenen Karte auseinanderzog). */
/* Flexbox-Spalte: Bild oben, Body darunter, oben-bündig. In Flex werden reine
Whitespace-Textknoten NICHT gerendert → die 78px-Inline-Lücke ist unmöglich. */
.journal-list .journal-entry-link {
display: flex;
flex-direction: column;
justify-content: flex-start;
min-height: 0;
height: auto;
}
/* Bild: normaler Block oben statt absolutem Hintergrund-Overlay */
/* Bild: normaler Block oben statt absolutem Hintergrund-Overlay.
display:block + vertical-align:bottom killen die Inline-Baseline-Lücke
(der „whitespace" unter dem Bild, den du im DevTools gesehen hast). */
.journal-list .journal-bg-image {
display: block;
vertical-align: bottom;
position: static;
inset: auto;
z-index: auto;
@@ -818,8 +933,8 @@ a.byline-author:hover, a.journal-author:hover { color: var(--accent); }
height: auto;
aspect-ratio: 16 / 9;
object-fit: cover;
border-radius: 8px;
margin: 0 0 0.9rem;
border-radius: 0; /* eckig */
margin: 0 0 0.7rem;
}
/* Body: linksbündig, normaler Textfluss, kompakt, dunkle Schrift */
@@ -1043,29 +1158,27 @@ a.byline-author:hover, a.journal-author:hover { color: var(--accent); }
/* ------------------------------------------------------------------------
Single page (article)
------------------------------------------------------------------------ */
.single { margin-top: var(--spacing-md); }
.single { margin-top: var(--spacing-sm); }
.single-header { margin-bottom: var(--spacing-md); }
/* Single article — full-bleed cover image directly under the masthead.
width:100vw breaks the boxed column horizontally; negative top margin
cancels the body grid gap + header margin so the image sits flush. */
/* Cover-Bild füllt die volle Breite des Scroll-Rahmens, bündig unter dem Header. */
.single-hero-image {
display: block;
width: 100vw;
max-width: 100vw;
width: 100%;
max-width: 100%;
height: auto;
max-height: 60vh;
object-fit: cover;
margin-left: calc(50% - 50vw);
margin-right: calc(50% - 50vw);
margin-top: calc(-1 * (var(--spacing-md) + var(--spacing-sm)));
margin-bottom: var(--spacing-md);
margin: 0 0 var(--spacing-sm);
filter: none;
}
.single-hero-image:hover { filter: none; }
/* Nach einem Hero-Bild: Artikel + Header bündig → kein Riesenabstand Bild↔Headline */
.single-hero-image + .single { margin-top: 0; }
.single-hero-image + .single .single-header { margin-top: 0; }
.single-header {
position: relative;
margin-top: var(--spacing-md);
margin-top: 0;
margin-bottom: var(--spacing-md);
}
.single-header h1 {
@@ -1232,9 +1345,7 @@ a.byline-author:hover, a.journal-author:hover { color: var(--accent); }
Page foot breadcrumb (moved from top → bottom)
------------------------------------------------------------------------ */
.page-foot-nav {
margin-top: var(--spacing-lg);
padding-top: var(--spacing-sm);
border-top: 1px solid var(--color-border);
margin-top: var(--spacing-md);
font-family: var(--font-family-sans);
font-size: 0.85rem;
color: var(--color-text-muted);
@@ -1257,82 +1368,58 @@ a.byline-author:hover, a.journal-author:hover { color: var(--accent); }
------------------------------------------------------------------------ */
footer {
background: var(--color-dark-panel);
color: var(--color-dark-panel-muted);
margin-top: var(--spacing-xl);
padding: var(--spacing-lg) 0;
color: var(--color-dark-panel-text); /* hell & lesbar auf Schwarz */
margin-top: 0;
/* voll-breit; horizontal bündig zum Journal-Karten-Inhalt (1.5rem) */
padding: 0.55rem 1.5rem;
border-top: none;
/* inner grid aligns with content column, same trick as header */
display: grid;
grid-template-columns:
1fr
min(var(--container-width), 100% - 3.5rem)
1fr;
}
footer > * { grid-column: 2; }
footer a { color: #d4d4d4; border: none; }
footer a, footer a:hover, footer a:focus { border: none; border-bottom: none; text-decoration: none; }
footer a { color: var(--color-dark-panel-text); }
footer a:hover { color: var(--accent-soft); }
footer p { text-align: left; margin: 0; }
footer p { margin: 0; }
/* Lizenzen ganz links (linksbündig), Footer-Menü ganz rechts. */
.footer-grid {
display: grid;
grid-template-columns: auto 1fr;
align-items: baseline;
column-gap: 2rem;
row-gap: var(--spacing-sm);
display: flex;
justify-content: space-between;
align-items: center;
column-gap: var(--spacing-lg);
}
.footer-legal { text-align: left; }
.footer-licenses {
font-family: var(--font-family-mono);
font-size: 0.8rem;
color: var(--color-dark-panel-text);
}
.footer-hosted {
font-family: var(--font-family-mono);
font-size: 0.75rem;
color: var(--color-dark-panel-muted);
margin-top: 0.1rem;
}
.footer-mark {
grid-column: 1;
font-family: var(--font-family-serif);
font-weight: 700;
font-size: 1.05rem;
letter-spacing: 0.02em;
color: #fff;
}
.footer-nav {
grid-column: 2;
justify-self: end;
}
.footer-nav ul {
list-style: none;
margin-left: 0;
.footer-links {
display: flex;
flex-wrap: wrap;
gap: 0.4rem 1.2rem;
justify-content: flex-end;
gap: 0.4rem 1.3rem;
font-family: var(--font-family-display);
font-size: 0.85rem;
font-size: 0.9rem;
font-weight: 500;
letter-spacing: 0.01em;
}
.footer-nav li { margin: 0; }
.footer-tagline {
grid-column: 1;
font-family: var(--font-family-serif);
font-style: italic;
font-size: var(--font-size-small);
line-height: 1.4;
max-width: 36ch;
}
.footer-credit {
grid-column: 2;
justify-self: end;
font-family: var(--font-family-mono);
font-size: 0.78rem;
}
.footer-legal a { color: inherit; text-decoration: none; }
.footer-legal a:hover { color: var(--accent-soft); }
/* Mobile: stack everything left */
/* Mobile: alles linksbündig stapeln */
@media (max-width: 720px) {
.footer-grid { grid-template-columns: 1fr; }
.footer-mark,
.footer-nav,
.footer-tagline,
.footer-credit {
grid-column: 1;
justify-self: start;
.footer-grid {
flex-direction: column;
align-items: flex-start;
row-gap: 0.5rem;
}
.footer-links { justify-content: flex-start; }
}
/* ------------------------------------------------------------------------
@@ -1346,3 +1433,210 @@ img {
margin: var(--spacing-sm) 0;
}
img:hover { filter: grayscale(0%); }
/* ------------------------------------------------------------------------
Fußnoten / Quellen — Goldmark rendert [^1] als hochgestellte Verweise +
eine .footnotes-Sektion am Textende. Wir geben ihr eine „Quellen"-Über-
schrift (statt des <hr>) und ein ruhigeres, kleineres Schriftbild.
------------------------------------------------------------------------ */
/* Hochgestellte Verweis-Nummer im Fließtext: klein + dezent unterstrichen. */
.single-content sup { font-size: 0.62em; line-height: 0; }
.single-content a.footnote-ref {
text-decoration: underline;
text-underline-offset: 0.2em;
text-decoration-thickness: 0.5px;
font-variant-numeric: tabular-nums;
}
.single-content .footnotes {
margin-top: var(--spacing-md);
padding-top: var(--spacing-sm);
border-top: 1px solid var(--color-border);
font-size: var(--font-size-small);
/* Theme vererbt eine feste Zeilenhöhe (~26px) → bei kleiner Schrift viel zu
luftig. Unitless überschreiben, damit die Quellen kompakt sitzen. */
line-height: 1.5;
color: var(--color-text-muted);
}
/* Goldmark setzt ein <hr> an den Anfang — wir ersetzen es durch die Überschrift. */
.single-content .footnotes > hr { display: none; }
.single-content .footnotes::before {
content: "Quellen";
display: block;
font-family: var(--font-family-serif);
font-size: 1rem;
font-weight: 600;
line-height: 1.3;
color: var(--color-text-primary);
margin-bottom: 0.4em;
}
.single-content .footnotes ol { margin: 0; padding-left: 1.4em; }
.single-content .footnotes li { margin: 0.2em 0; }
.single-content .footnotes li p { margin: 0; line-height: 1.5; }
.single-content .footnote-backref { text-decoration: none; margin-left: 0.3em; }
/* ------------------------------------------------------------------------
Herkunft / Zitieren — „lebendes Dokument": Version (→ Commit), Verlauf,
Zitieren-Knopf. Dezent unter dem Beitrag.
------------------------------------------------------------------------ */
/* ------------------------------------------------------------------------
Artikel-Fuß: zitieren (Link + dezente Angabe), Aktionsreihe, Versionen.
------------------------------------------------------------------------ */
/* Versionen: Pill wie Dialog (Akzent-Outline) mit Uhr-Icon. */
.cite { margin-top: var(--spacing-sm); }
.versions-toggle {
display: inline-flex;
align-items: center;
gap: 0.4em;
font-family: var(--font-family-display);
font-weight: 500;
font-size: 0.82rem;
letter-spacing: 0.02em;
color: var(--accent);
background: none;
border: 1px solid var(--accent);
border-radius: 999px;
padding: 0.28em 0.85em;
cursor: pointer;
}
.versions-toggle:hover,
.versions-toggle[aria-expanded="true"] { background: var(--accent); color: #fff; }
.versions-toggle .pill-icon { width: 1em; height: 1em; flex: none; stroke: var(--accent); }
.versions-toggle:hover .pill-icon,
.versions-toggle[aria-expanded="true"] .pill-icon { stroke: #fff; }
/* zitieren: kein Pill — Link in der Pill-Schrift, mit ↗ am Ende. */
.cite-toggle {
font-family: var(--font-family-display);
font-weight: 500;
font-size: 0.82rem;
letter-spacing: 0.02em;
color: var(--accent);
background: none;
border: none;
padding: 0;
cursor: pointer;
}
.cite-toggle:hover { text-decoration: underline; text-underline-offset: 0.2em; }
.cite-arrow { font-size: 0.9em; }
/* „kopieren" bleibt ein schlichter Link in der Quellenangabe. */
.cite-copy {
font: inherit;
font-size: var(--font-size-small);
color: var(--color-text-muted);
background: none;
border: none;
padding: 0;
cursor: pointer;
text-decoration: underline;
text-underline-offset: 0.2em;
}
.cite-copy:hover { color: var(--accent); }
.cite-box { margin-top: 0.7em; }
.cite-text {
margin: 0 0 0.5em;
font-family: var(--font-family-serif);
font-size: var(--font-size-small);
line-height: 1.6;
color: var(--color-text-muted);
user-select: all; /* ein Klick markiert die ganze Angabe */
}
.cite-actions { display: flex; align-items: center; gap: 0.9em; font-size: var(--font-size-small); }
.cite-fmt {
font: inherit;
font-size: var(--font-size-small);
color: var(--color-text-muted);
background: none;
border: none;
padding: 0;
cursor: pointer;
}
.cite-fmt:hover { color: var(--accent); }
.cite-fmt.is-active { color: var(--accent); font-weight: 600; }
.cite-status { color: var(--color-text-muted); }
/* Aktionsreihe: Dialog links, Tags ganz rechts; darüber eine Trennlinie. */
.article-actions {
display: flex;
flex-wrap: wrap;
align-items: center;
justify-content: space-between;
gap: 0.8em 1em;
margin-top: var(--spacing-md);
padding-top: var(--spacing-sm);
border-top: 1px solid var(--color-border);
}
.article-actions .tag-pills { margin: 0; }
/* Versionen: eine Zeile darunter, öffnet die Liste auf der Seite. */
.article-versions { margin-top: var(--spacing-sm); }
/* Versionsliste: volle Inhaltsbreite, normale Schrift/Größe wie der Text. */
.version-panel { margin-top: 0.8rem; }
.version-list { list-style: none; margin: 0; padding: 0; }
.version-list button {
display: flex;
gap: 1em;
width: 100%;
text-align: left;
font-family: var(--font-family-serif);
font-size: 1rem;
line-height: 1.5;
color: var(--color-text-primary);
background: none;
border: none;
border-bottom: 1px solid var(--color-border);
padding: 0.7em 0;
cursor: pointer;
}
.version-list li:first-child button { border-top: 1px solid var(--color-border); }
.version-list button:hover { color: var(--accent); }
.version-list .v-date { white-space: nowrap; min-width: 6em; }
.version-list .v-subject { flex: 1; color: var(--color-text-muted); }
.version-list .v-hash { white-space: nowrap; color: var(--color-text-muted); font-family: var(--font-family-mono); font-size: 0.85em; }
.version-empty { margin: 0.6rem 0; color: var(--color-text-muted); }
.version-banner {
display: flex;
flex-wrap: wrap;
align-items: center;
gap: 0.6em;
margin-bottom: var(--spacing-md);
padding: 0.5em 0.8em;
border-left: 3px solid var(--accent);
background: var(--color-bg-secondary);
font-family: var(--font-family-sans);
font-size: var(--font-size-small);
color: var(--color-text-muted);
}
.version-back,
.version-toggle {
font: inherit;
color: var(--accent);
background: none;
border: none;
padding: 0;
cursor: pointer;
}
.version-loading { color: var(--color-text-muted); font-style: italic; }
/* Diff-Ansicht (rot/grün, wie auf GitHub) — direkt auf der Seite. */
.diff {
font-family: var(--font-family-mono);
font-size: 0.8rem;
line-height: 1.5;
border: 1px solid var(--color-border);
border-radius: 8px;
overflow-x: auto;
}
.diff-line {
white-space: pre-wrap;
word-break: break-word;
padding: 0.05em 0.7em;
}
.diff-line.d-add { background: color-mix(in oklab, #2ea043 20%, transparent); }
.diff-line.d-del { background: color-mix(in oklab, #f85149 20%, transparent); }
.diff-line.d-hunk { color: var(--color-text-muted); background: var(--color-bg-secondary); }
.diff-line.d-ctx { color: var(--color-text-primary); }
+7 -1
View File
@@ -20,7 +20,13 @@ API_EXTERNAL_URL=http://localhost:8000
# unter `authors` steht.
ADMIN_EMAILS=karim@gabrielevarano.ch
# ═══ Optional: Ports ═══
# ═══ Optional: Ports & Binding ═══
# Auf welcher Host-Adresse lauschen die veröffentlichten Ports?
# 127.0.0.1 (Standard) = nur lokal / hinter Reverse-Proxy mit TLS (empfohlen).
# 0.0.0.0 = direkt im LAN erreichbar (ohne Proxy).
# Bei 127.0.0.1 muss SITE_URL/API_EXTERNAL_URL über den Proxy laufen, sonst
# erreicht der Browser :8000/:8080 nicht.
BIND_ADDR=127.0.0.1
APP_PORT=8080 # CMS: Site + /admin + /_preview + /api
KONG_HTTP_PORT=8000 # Supabase-API-Gateway
KONG_HTTPS_PORT=8443
+83 -2
View File
@@ -66,14 +66,30 @@ bash <(curl -fsSL https://git.kgva.ch/karim/OPENBUREAU/raw/branch/main/cms/proxm
Fragt interaktiv nur Storage/Bridge/IP ab (Enter = Default). Kein Token nötig.
`GIT_TOKEN` nur setzen, wenn das CMS per `GIT_PUBLISH` nach Gitea zurückschreiben soll.
### Updaten (bestehender LXC)
Nicht `git pull` von Hand — das vergisst CORS-Origin (kong.yml), Dateirechte
(non-root) und den Neustart. Stattdessen im Container:
```bash
bash /opt/openbureau/cms/update.sh
```
Das macht: `git pull` → CORS-Origin aus `SITE_URL` in `kong.yml` rendern →
`chown -R 1000:1000``docker compose up -d --build` + kong neu laden →
Healthcheck. (Beim allerersten Mal das Skript per einmaligem `git pull` holen.)
### Manuell (oder im Container)
1. `cp .env.example .env`
2. `POSTGRES_PASSWORD` + `JWT_SECRET` setzen: je `openssl rand -hex 32`
3. Keys ableiten: `node scripts/generate-keys.mjs``ANON_KEY` + `SERVICE_ROLE_KEY` in `.env`
4. `SITE_URL` + `API_EXTERNAL_URL` auf die LAN-/Domain-Adresse setzen
5. `docker compose up -d --build` (Erststart: DB bootet + Schema/Migrations)
6. Login-User anlegen (Self-Signup ist aus):
5. `kong.yml`: Platzhalter `__CORS_ORIGIN__` durch `SITE_URL` (Browser-Origin) ersetzen
6. `BIND_ADDR` in `.env`: `127.0.0.1` hinter Reverse-Proxy (Standard), `0.0.0.0` für LAN-Direktzugriff
7. Repo dem Container-User (uid 1000) übereignen: `chown -R 1000:1000 <repo-root>`
8. `docker compose up -d --build` (Erststart: DB bootet + Schema/Migrations)
9. Login-User anlegen (Self-Signup ist aus):
```
source .env
curl -X POST "$API_EXTERNAL_URL/auth/v1/admin/users" \
@@ -89,6 +105,71 @@ Dann: Admin `…:8080/admin/` · Live `…:8080/` · Preview `…:8080/_preview/
`cd admin && npm install && npm run dev` (Vite-Devserver, proxyt `/api` +
`/_preview` an den laufenden Container auf :8080).
Tests der API (ohne DB/Container, reine Logik): `cd api && npm test`
(`node --test` — Pfad-Sicherheit, Rollen/Auth, Rate-Limit, Build-Coalescing).
### Demo-Inhalt fürs Forum (optional)
`db/seed-demo.sql` füllt die Forum-Kategorien mit ein paar Beispiel-Threads und
-Wortmeldungen — bewusst **getrennt** von der Migration, damit die Produktion
leer startet. Bei Bedarf manuell einspielen (idempotent, mehrfach lauffähig):
```bash
docker compose exec -T db psql -U supabase_admin -d postgres < db/seed-demo.sql
```
Wieder entfernen: DELETE-Block am Ende der Datei (auskommentiert).
### Backup der Dialog-Daten
⚠️ Foren, Threads und Wortmeldungen liegen **nur in Postgres** — anders als
`content/*.md` (in Git) sind sie sonst nirgends gesichert. Das Proxmox-Script
richtet ein **tägliches** Backup ein (`/etc/cron.d/openbureau-backup`, 3:15 Uhr).
Manuell/sonst:
```bash
bash scripts/backup-db.sh # → backups/openbureau-<TS>.sql.gz (rotiert, 14 Stk.)
```
Wiederherstellen:
```bash
gunzip -c backups/openbureau-<TS>.sql.gz \
| docker compose exec -T db psql -U supabase_admin -d postgres
```
## Sicherheit / Härtung
Eingebaute Schutzmaßnahmen (Stand: Härtungs-Pass):
- **Sicherheits-Header** auf allen Antworten (X-Frame-Options, nosniff,
Referrer-Policy, HSTS); Uploads unter `/images/*` mit strikter CSP +
`sandbox` → ein bösartiges SVG kann kein JavaScript im Origin ausführen.
- **Rate-Limit** auf `/api/auth/login` (10 Versuche/IP pro 5 Min) gegen Brute-Force.
- **Body-Limit** 256 KB auf JSON-`/api/*`, Bild-Upload max. 8 MB mit
Format-Verifikation (sharp-Metadaten bzw. SVG/GIF-Signatur).
- **Comment-Limits** (Body ≤ 10 000 Zeichen) gegen DB-Bloat.
- **Kein Info-Leak**: rohe DB-Fehler werden serverseitig geloggt, nach außen
nur generische Meldungen.
- **Non-root**: der CMS-Container läuft als `node` (uid 1000).
- **Port-Binding** über `BIND_ADDR` (Standard `127.0.0.1`), DB nur auf localhost.
- **CORS** am Kong-Gateway auf die eigene `SITE_URL`-Origin beschränkt (kein `*`).
### Migration eines bestehenden Containers
Bei `git pull` auf einer schon laufenden Instanz greifen drei Änderungen, die
sonst einen frischen Deploy voraussetzen — **vor** dem nächsten
`docker compose up -d --build` von Hand nachziehen:
1. **Non-root:** `chown -R 1000:1000 <repo-root>` — sonst kann Hugo `public/`
nicht mehr bauen (Permission denied).
2. **CORS:** `kong.yml` enthält jetzt `__CORS_ORIGIN__`; auf einem bereits
initialisierten Container ersetzt das Proxmox-Script den Platzhalter nicht.
Manuell auf die `SITE_URL` setzen, sonst werden alle Browser-API-Calls
(inkl. Login) per CORS geblockt.
3. **BIND_ADDR:** Key in `.env` ergänzen. Default `127.0.0.1` ist hinter einem
TLS-Proxy korrekt; für LAN-Direktzugriff `0.0.0.0` setzen.
## API
Alle `/api/*` (ausser `/health`) verlangen `Authorization: Bearer <supabase-token>`.
+7
View File
@@ -40,5 +40,12 @@ COPY --from=admin /admin/dist ./admin-dist
ENV NODE_ENV=production
ENV ADMIN_DIR=/app/admin-dist
# Als non-root laufen (das node-Image bringt den User `node`, uid/gid 1000 mit).
# /app gehört dem Build (root, read-only zur Laufzeit — reicht zum Servieren).
# Das gemountete Repo unter /site muss uid 1000 gehören (siehe Proxmox-Script:
# chown -R 1000:1000), damit Hugo dort public/ bauen und content/ schreiben kann.
USER node
EXPOSE 3000
CMD ["sh", "/app/entrypoint.sh"]
+13
View File
@@ -12,6 +12,7 @@
"@supabase/supabase-js": "^2.47.10",
"gray-matter": "^4.0.3",
"hono": "^4.6.14",
"marked": "^14.1.4",
"sharp": "^0.33.5"
}
},
@@ -672,6 +673,18 @@
"node": ">=0.10.0"
}
},
"node_modules/marked": {
"version": "14.1.4",
"resolved": "https://registry.npmjs.org/marked/-/marked-14.1.4.tgz",
"integrity": "sha512-vkVZ8ONmUdPnjCKc5uTRvmkRbx4EAi2OkTOXmfTDhZz3OFqMNBM1oTTWwTr4HY4uAEojhzPf+Fy8F1DWa3Sndg==",
"license": "MIT",
"bin": {
"marked": "bin/marked.js"
},
"engines": {
"node": ">= 18"
}
},
"node_modules/section-matter": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/section-matter/-/section-matter-1.0.0.tgz",
+3 -1
View File
@@ -6,13 +6,15 @@
"description": "Headless CMS backend für OPENBUREAU — schreibt Supabase-Posts in Hugo-content/, baut und serviert die Site.",
"scripts": {
"start": "node src/index.js",
"dev": "node --watch src/index.js"
"dev": "node --watch src/index.js",
"test": "node --test"
},
"dependencies": {
"@hono/node-server": "^1.13.7",
"@supabase/supabase-js": "^2.47.10",
"gray-matter": "^4.0.3",
"hono": "^4.6.14",
"marked": "^14.1.4",
"sharp": "^0.33.5"
}
}
+27 -5
View File
@@ -1,5 +1,27 @@
import { verify } from 'hono/jwt';
import { supabaseAuth } from './supabase.js';
// Supabase-Tokens sind HS256-signiert. Mit dem JWT_SECRET verifizieren wir sie
// lokal (Signatur + Ablauf) — das spart pro Request den Roundtrip zu GoTrue.
// Ohne JWT_SECRET (z.B. Alt-Deploy) fällt requireAuth auf die Remote-Prüfung
// zurück. Tokens sind kurzlebig (1h) und Self-Signup ist aus → kein
// Sperr-Check nötig.
const JWT_SECRET = process.env.JWT_SECRET || '';
// Liefert ein User-Objekt {id,email,app_metadata} oder null.
async function verifyToken(token) {
if (JWT_SECRET) {
try {
const p = await verify(token, JWT_SECRET, 'HS256');
if (!p?.sub) return null;
return { id: p.sub, email: p.email || '', app_metadata: p.app_metadata || {} };
} catch { return null; }
}
const { data, error } = await supabaseAuth.auth.getUser(token);
if (error || !data?.user) return null;
return data.user;
}
// Rollen-Hierarchie: admin > editor (Redakteur) > user.
// - admin: alles (Foren verwalten, moderieren, Nutzer/Rollen, Inhalte)
// - editor: moderieren (Wortmeldungen ausblenden/löschen, Threads sperren)
@@ -24,12 +46,12 @@ export async function requireAuth(c, next) {
const token = header.startsWith('Bearer ') ? header.slice(7) : null;
if (!token) return c.json({ error: 'Nicht eingeloggt' }, 401);
const { data, error } = await supabaseAuth.auth.getUser(token);
if (error || !data?.user) return c.json({ error: 'Ungültiges Token' }, 401);
const user = await verifyToken(token);
if (!user) return c.json({ error: 'Ungültiges Token' }, 401);
const email = (data.user.email || '').toLowerCase();
const role = roleOf(data.user);
c.set('user', data.user);
const email = (user.email || '').toLowerCase();
const role = roleOf(user);
c.set('user', user);
c.set('email', email);
c.set('role', role);
c.set('isAdmin', role === 'admin');
+39
View File
@@ -0,0 +1,39 @@
// Serialisiert asynchrone Aufgaben je `key` und koalesziert Wartende:
// - Es läuft nie mehr als eine Aufgabe pro Key gleichzeitig.
// - Kommen während eines Laufs weitere Aufrufe rein, wird GENAU EIN weiterer
// Durchlauf nachgelagert (egal wie viele warten) — sie teilen sich dessen
// Ergebnis. So sehen alle den jüngsten Stand, ohne einen Lauf-Sturm.
//
// Einsatz: teure, idempotente Vorgänge wie der Hugo-Build (siehe hugo.js).
const state = new Map();
export function coalesce(key, fn) {
let s = state.get(key);
if (!s) { s = { running: false, rerun: false, fn, waiters: [] }; state.set(key, s); }
s.fn = fn; // jüngste Variante gewinnt für den nächsten Lauf
return new Promise((resolve, reject) => {
s.waiters.push({ resolve, reject });
if (!s.running) drain(key);
else s.rerun = true;
});
}
async function drain(key) {
const s = state.get(key);
s.running = true;
try {
do {
s.rerun = false;
const waiters = s.waiters;
s.waiters = [];
try {
const r = await s.fn();
waiters.forEach((w) => w.resolve(r));
} catch (e) {
waiters.forEach((w) => w.reject(e));
}
} while (s.rerun);
} finally {
s.running = false;
}
}
+12 -8
View File
@@ -19,7 +19,15 @@ export async function profileFor(email) {
// Library-Beiträge als Threads in der Kategorie „Beiträge" spiegeln, damit man
// auf jeden Beitrag einen Dialog starten kann. Idempotent (upsert über key).
export async function syncLibrary() {
//
// Gedrosselt: Reads rufen das bei jedem Forum-Aufruf, aber der eigentliche
// Sync (DB + Filesystem-Walk + Upsert) läuft höchstens alle SYNC_TTL ms.
// `force: true` (z.B. nach Publish) überspringt die Drosselung.
const SYNC_TTL = 60_000;
let lastSync = 0;
export async function syncLibrary({ force = false } = {}) {
if (!force && Date.now() - lastSync < SYNC_TTL) return;
lastSync = Date.now();
const { data: forum } = await supabase
.from('forums').select('id').eq('slug', LIBRARY_SLUG).single();
if (!forum) return;
@@ -34,15 +42,11 @@ export async function syncLibrary() {
}
// Wortmeldungen pro Thread-Key aggregieren: { [key]: {count, last} }.
// Aggregiert in Postgres (View comment_stats) statt alle Zeilen zu laden.
async function commentStats() {
const { data } = await supabase.from('comments').select('thread,created_at,deleted');
const { data } = await supabase.from('comment_stats').select('thread,count,last');
const map = {};
for (const r of data || []) {
if (r.deleted) continue;
const t = map[r.thread] || (map[r.thread] = { count: 0, last: r.created_at });
t.count += 1;
if (r.created_at > t.last) t.last = r.created_at;
}
for (const r of data || []) map[r.thread] = { count: r.count, last: r.last };
return map;
}
+8
View File
@@ -1,5 +1,6 @@
import { execFile } from 'node:child_process';
import { promisify } from 'node:util';
import { coalesce } from './coalesce.js';
const execFileP = promisify(execFile);
const SITE_DIR = process.env.SITE_DIR || '/site';
@@ -16,6 +17,13 @@ export async function hugoBuild({ dest, drafts = false } = {}) {
return { stdout, stderr };
}
// Koaleszierter Build je Ziel: nie zwei `hugo`-Prozesse für dasselbe dest
// parallel; schnelle Folge-Aufrufe lösen nur einen nachgelagerten Build aus.
// Publish (public), Preview (preview) und Profil teilen sich diesen Weg.
export function buildSite({ dest, drafts = false } = {}) {
return coalesce(`build:${dest}:${drafts ? 'd' : 'p'}`, () => hugoBuild({ dest, drafts }));
}
// Optionaler Git-Backup beim Publish (GIT_PUBLISH=true). Schlägt nie hart fehl —
// das Publish soll an einem Git-Problem nicht scheitern.
export async function gitCommit(message) {
+48 -1
View File
@@ -1,7 +1,10 @@
import { serve } from '@hono/node-server';
import { serveStatic } from '@hono/node-server/serve-static';
import { Hono } from 'hono';
import { secureHeaders } from 'hono/secure-headers';
import { bodyLimit } from 'hono/body-limit';
import { rateLimit } from './ratelimit.js';
import content from './routes/content.js';
import preview from './routes/preview.js';
import publish from './routes/publish.js';
@@ -9,6 +12,7 @@ import upload from './routes/upload.js';
import profile from './routes/profile.js';
import users from './routes/users.js';
import { listComments, createComment, deleteComment, login } from './routes/comments.js';
import history from './routes/history.js';
import {
listForums, showForum, recent, threadInfo, newThread, mod, adminForums,
} from './routes/dialog.js';
@@ -21,7 +25,40 @@ const PORT = Number(process.env.PORT || 3000);
const app = new Hono();
// --- Sicherheits-Header (auf allem) ---
// CSP bewusst zurückhaltend: Site + Admin-SPA + Dialog-Widget laufen same-origin.
app.use('*', secureHeaders({
xFrameOptions: 'SAMEORIGIN',
xContentTypeOptions: 'nosniff',
referrerPolicy: 'strict-origin-when-cross-origin',
crossOriginOpenerPolicy: 'same-origin',
// HSTS nur sinnvoll hinter TLS-Proxy; schadet via HTTP nicht (Browser ignoriert).
strictTransportSecurity: 'max-age=31536000; includeSubDomains',
}));
// Hochgeladene Bilder strikt isolieren: ein bösartiges SVG kann so kein
// JavaScript im Origin ausführen (sandbox + keine Skript-Quellen).
app.use('/images/*', secureHeaders({
contentSecurityPolicy: { defaultSrc: ["'none'"], imgSrc: ["'self'"], styleSrc: ["'unsafe-inline'"], sandbox: [] },
xContentTypeOptions: 'nosniff',
}));
// Statische Assets cachen: Hugo fingerprintet CSS/JS, Uploads haben stabile,
// eindeutige Namen. HTML bleibt ungecacht (Antwort ohne Header → immer frisch).
app.use('*', async (c, next) => {
await next();
if (c.req.method === 'GET' && /\.(css|js|mjs|woff2?|ttf|otf|eot|svg|png|jpe?g|webp|avif|gif|ico)$/i.test(c.req.path)) {
c.header('Cache-Control', 'public, max-age=604800'); // 1 Woche
}
});
// --- API ---
// Globales Limit gegen aufgeblähte JSON-Bodies (DoS / DB-Bloat). Der Upload-Pfad
// ist ausgenommen — der bringt sein eigenes, größeres Bild-Limit mit.
const jsonBodyLimit = bodyLimit({ maxSize: 256 * 1024, onError: (c) => c.json({ error: 'Anfrage zu groß' }, 413) });
app.use('/api/*', (c, next) =>
c.req.path.startsWith('/api/upload') ? next() : jsonBodyLimit(c, next));
app.get('/api/health', (c) => c.json({ ok: true, hugo: '0.161.1+extended' }));
// Öffentlich (ohne Login): Dialog lesen, Übersicht, Login fürs Dialog-Widget.
app.get('/api/comments', listComments);
@@ -29,9 +66,19 @@ app.get('/api/forums', listForums);
app.get('/api/forums/:slug', showForum);
app.get('/api/recent', recent);
app.get('/api/thread', threadInfo);
app.post('/api/auth/login', login);
// Öffentlich: Versionsverlauf der Beiträge (Git-History) — auf der Site anzeigbar.
app.route('/api/history', history);
// Login gegen Brute-Force drosseln: max. 10 Versuche/IP pro 5 Minuten.
app.post('/api/auth/login', rateLimit({ max: 10, windowMs: 5 * 60_000 }), login);
// Alles weitere unter /api/* braucht ein gültiges Supabase-Token.
app.use('/api/*', requireAuth);
// Schreibzugriffe drosseln (Spam-Schutz, auch bei gekapertem Token):
// 60 Mutationen/Minute je Nutzer. Lesen (GET) bleibt frei.
const mutateLimit = rateLimit({
max: 60, windowMs: 60_000,
keyFn: (c) => 'u:' + (c.get('user')?.id || c.req.header('x-forwarded-for') || 'anon'),
});
app.use('/api/*', (c, next) => (c.req.method === 'GET' ? next() : mutateLimit(c, next)));
app.get('/api/me', (c) => c.json({ email: c.get('email'), role: c.get('role'), isAdmin: c.get('isAdmin'), canModerate: c.get('canModerate') }));
app.post('/api/comments', createComment);
app.delete('/api/comments/:id', deleteComment);
+34
View File
@@ -0,0 +1,34 @@
// Einfacher In-Memory-Rate-Limiter (ein Container, eine Instanz → genügt).
// Fixed-Window pro Schlüssel (Standard: Client-IP). Bei Überschreitung 429.
// Hinter einem Reverse-Proxy liefert X-Forwarded-For die echte IP.
const buckets = new Map(); // key -> { count, reset }
function clientIp(c) {
const xff = c.req.header('x-forwarded-for');
if (xff) return xff.split(',')[0].trim();
return c.req.header('x-real-ip') || 'unknown';
}
// max Anfragen je windowMs. keyFn erlaubt eigene Schlüssel (z.B. IP+E-Mail).
export function rateLimit({ max = 10, windowMs = 60_000, keyFn = clientIp } = {}) {
return async (c, next) => {
const key = keyFn(c);
const now = Date.now();
let b = buckets.get(key);
if (!b || now > b.reset) { b = { count: 0, reset: now + windowMs }; buckets.set(key, b); }
b.count += 1;
if (b.count > max) {
const retry = Math.ceil((b.reset - now) / 1000);
c.header('Retry-After', String(retry));
return c.json({ error: 'Zu viele Anfragen — bitte später erneut.' }, 429);
}
await next();
};
}
// Speicher sauber halten: abgelaufene Buckets periodisch wegräumen.
setInterval(() => {
const now = Date.now();
for (const [k, b] of buckets) if (now > b.reset) buckets.delete(k);
}, 5 * 60_000).unref?.();
+10 -4
View File
@@ -1,10 +1,13 @@
import { supabase, supabaseAuth } from '../supabase.js';
import { roleOf } from '../auth.js';
import { profileFor, threadLocked } from '../dialog-store.js';
import { serverError } from '../util.js';
// Dialog: flache Wortmeldungen pro Thread (= Thread-Key), optionaler Bezug.
const COLS = 'id,thread,parent_id,author_name,author_avatar,body,created_at,deleted';
const COLS = 'id,thread,parent_id,author_name,author_avatar,author_role,body,created_at,deleted';
const MAX_BODY = 10_000; // Zeichen je Wortmeldung
const MAX_THREAD = 512; // Thread-Key-Länge
// ÖFFENTLICH: Wortmeldungen eines Threads lesen.
export async function listComments(c) {
@@ -12,7 +15,7 @@ export async function listComments(c) {
if (!thread) return c.json({ error: 'thread fehlt' }, 400);
const { data, error } = await supabase
.from('comments').select(COLS).eq('thread', thread).order('created_at', { ascending: true });
if (error) return c.json({ error: error.message }, 500);
if (error) return serverError(c, 'listComments', error);
const out = (data || []).map((r) => (r.deleted ? { ...r, body: '[gelöscht]', author_avatar: null } : r));
return c.json(out);
}
@@ -23,6 +26,8 @@ export async function createComment(c) {
const email = c.get('email');
const { thread, body, parent_id } = await c.req.json();
if (!thread || !body || !body.trim()) return c.json({ error: 'thread und Text nötig' }, 400);
if (typeof thread !== 'string' || thread.length > MAX_THREAD) return c.json({ error: 'Ungültiger Thread' }, 400);
if (typeof body !== 'string' || body.length > MAX_BODY) return c.json({ error: `Text zu lang (max. ${MAX_BODY} Zeichen)` }, 400);
if (await threadLocked(thread)) return c.json({ error: 'Thread ist gesperrt' }, 403);
const prof = await profileFor(email);
@@ -32,10 +37,11 @@ export async function createComment(c) {
user_id: user.id,
author_name: prof?.name || email.split('@')[0],
author_avatar: prof?.avatar || null,
author_role: prof?.title || null, // „Position bei OPENBUREAU" (aus data/authors.json)
body: body.trim(),
};
const { data, error } = await supabase.from('comments').insert(row).select(COLS).single();
if (error) return c.json({ error: error.message }, 400);
if (error) return serverError(c, 'createComment', error, 400);
return c.json(data, 201);
}
@@ -48,7 +54,7 @@ export async function deleteComment(c) {
if (e1 || !row) return c.json({ error: 'Nicht gefunden' }, 404);
if (!canModerate && row.user_id !== user.id) return c.json({ error: 'Kein Recht' }, 403);
const { error } = await supabase.from('comments').update({ deleted: true }).eq('id', id);
if (error) return c.json({ error: error.message }, 400);
if (error) return serverError(c, 'deleteComment', error, 400);
return c.json({ ok: true });
}
+7 -6
View File
@@ -1,6 +1,7 @@
import { Hono } from 'hono';
import { supabase } from '../supabase.js';
import { requireAdmin, requireModerator } from '../auth.js';
import { serverError } from '../util.js';
import {
forumsWithCounts, forumWithThreads, recentComments, createThread, recentForModeration, threadMeta,
} from '../dialog-store.js';
@@ -56,7 +57,7 @@ mod.post('/thread-lock', async (c) => {
const { key, locked } = await c.req.json();
if (!key) return c.json({ error: 'key nötig' }, 400);
const { error } = await supabase.from('threads').update({ locked: !!locked }).eq('key', key);
if (error) return c.json({ error: error.message }, 400);
if (error) return serverError(c, 'dialog', error, 400);
return c.json({ ok: true });
});
// Thread ausblenden (löschen).
@@ -64,7 +65,7 @@ mod.post('/thread-delete', async (c) => {
const { key } = await c.req.json();
if (!key) return c.json({ error: 'key nötig' }, 400);
const { error } = await supabase.from('threads').update({ deleted: true }).eq('key', key);
if (error) return c.json({ error: error.message }, 400);
if (error) return serverError(c, 'dialog', error, 400);
return c.json({ ok: true });
});
@@ -73,7 +74,7 @@ export const adminForums = new Hono();
adminForums.use('*', requireAdmin);
adminForums.get('/', async (c) => {
const { data, error } = await supabase.from('forums').select('*').order('sort');
if (error) return c.json({ error: error.message }, 500);
if (error) return serverError(c, 'dialog', error, 500);
return c.json(data || []);
});
adminForums.post('/', async (c) => {
@@ -82,7 +83,7 @@ adminForums.post('/', async (c) => {
const row = { slug: String(slug).trim(), name: String(name).trim(),
description: description || '', color: color || null, sort: Number(sort) || 0 };
const { data, error } = await supabase.from('forums').insert(row).select('*').single();
if (error) return c.json({ error: error.message }, 400);
if (error) return serverError(c, 'dialog', error, 400);
return c.json(data, 201);
});
adminForums.put('/:id', async (c) => {
@@ -90,7 +91,7 @@ adminForums.put('/:id', async (c) => {
const allowed = {};
for (const k of ['name', 'description', 'color', 'sort', 'slug']) if (k in patch) allowed[k] = patch[k];
const { data, error } = await supabase.from('forums').update(allowed).eq('id', c.req.param('id')).select('*').single();
if (error) return c.json({ error: error.message }, 400);
if (error) return serverError(c, 'dialog', error, 400);
return c.json(data);
});
adminForums.delete('/:id', async (c) => {
@@ -98,6 +99,6 @@ adminForums.delete('/:id', async (c) => {
const { data: f } = await supabase.from('forums').select('kind').eq('id', id).single();
if (f?.kind === 'library') return c.json({ error: 'Beiträge-Kategorie kann nicht gelöscht werden' }, 400);
const { error } = await supabase.from('forums').delete().eq('id', id);
if (error) return c.json({ error: error.message }, 400);
if (error) return serverError(c, 'dialog', error, 400);
return c.json({ ok: true });
});
+83
View File
@@ -0,0 +1,83 @@
import { Hono } from 'hono';
import { execFile } from 'node:child_process';
import { promisify } from 'node:util';
import matter from 'gray-matter';
import { marked } from 'marked';
import { safeRel } from '../files.js';
// ÖFFENTLICH: Versionsverlauf eines Library-Beitrags aus der Git-History.
// Der Container hat das Repo unter /site gemountet + git installiert. Wir
// holen alte Fassungen on-demand (kein Vorbauen) und zeigen sie auf der Site.
const execFileP = promisify(execFile);
const SITE_DIR = process.env.SITE_DIR || '/site';
const git = (...args) => execFileP('git', ['-C', SITE_DIR, ...args], { maxBuffer: 10 * 1024 * 1024 });
const US = '\x1f'; // Feldtrenner (Unit Separator) — kommt in Commit-Daten nicht vor.
const history = new Hono();
// Liste der Versionen: neueste zuerst.
history.get('/', async (c) => {
let rel;
try { rel = safeRel(c.req.query('path')); } catch { return c.json({ error: 'Ungültiger Pfad' }, 400); }
try {
const { stdout } = await git(
'log', '--follow', `--format=%H${US}%h${US}%aI${US}%an${US}%s`, '--', `content/${rel}`);
const versions = stdout.trim().split('\n').filter(Boolean).map((line) => {
const [rev, short, date, author, subject] = line.split(US);
return { rev, short, date, author, subject };
});
return c.json(versions);
} catch { return c.json({ error: 'Verlauf nicht verfügbar' }, 500); }
});
// Eine bestimmte Fassung gerendert (HTML), zum Anzeigen auf der Seite.
history.get('/version', async (c) => {
let rel;
try { rel = safeRel(c.req.query('path')); } catch { return c.json({ error: 'Ungültiger Pfad' }, 400); }
const rev = c.req.query('rev') || '';
if (!/^[0-9a-f]{7,40}$/i.test(rev)) return c.json({ error: 'Ungültige Version' }, 400);
try {
const { stdout } = await git('show', `${rev}:content/${rel}`);
const { data, content } = matter(stdout);
return c.json({
rev,
title: data.title || '',
date: data.date ? new Date(data.date).toISOString().slice(0, 10) : null,
html: renderMarkdown(content),
});
} catch { return c.json({ error: 'Version nicht gefunden' }, 404); }
});
// Unified-Diff einer Fassung (was dieser Commit an der Datei geändert hat) —
// fürs rot/grün-Diff auf der Seite. Roh-Diff; das Frontend färbt +/- ein.
history.get('/diff', async (c) => {
let rel;
try { rel = safeRel(c.req.query('path')); } catch { return c.json({ error: 'Ungültiger Pfad' }, 400); }
const rev = c.req.query('rev') || '';
if (!/^[0-9a-f]{7,40}$/i.test(rev)) return c.json({ error: 'Ungültige Version' }, 400);
try {
const { stdout } = await git('show', '--format=', '--no-color', rev, '--', `content/${rel}`);
return c.json({ rev, diff: stdout });
} catch { return c.json({ error: 'Diff nicht verfügbar' }, 404); }
});
// Markdown → HTML. marked kennt Goldmarks Fußnoten ([^id]) nicht — daher
// vorab: Definitionen einsammeln, Verweise zu <sup>-Nummern, „Quellen" anhängen
// (greift dieselbe .footnotes-CSS wie die Live-Seite).
function renderMarkdown(md) {
const defs = {}; const order = [];
md = md.replace(/^\[\^([^\]]+)\]:[ \t]*(.*)$/gm, (_, id, txt) => { defs[id] = txt; return ''; });
md = md.replace(/\[\^([^\]]+)\]/g, (_, id) => {
if (!order.includes(id)) order.push(id);
return `<sup class="footnote-ref">${order.indexOf(id) + 1}</sup>`;
});
let html = marked.parse(md);
if (order.length) {
html += '<div class="footnotes"><ol>'
+ order.map((id) => `<li>${marked.parseInline(defs[id] || '')}</li>`).join('')
+ '</ol></div>';
}
return html;
}
export default history;
+2 -2
View File
@@ -1,6 +1,6 @@
import { Hono } from 'hono';
import { urlFor, safeRel } from '../files.js';
import { hugoBuild } from '../hugo.js';
import { buildSite } from '../hugo.js';
// Echte Hugo-Vorschau: ganze Site mit --buildDrafts nach preview/ bauen und die
// URL des Eintrags zurückgeben (so erscheinen auch draft:true-Einträge).
@@ -10,7 +10,7 @@ preview.post('/', async (c) => {
const { path: rel } = await c.req.json();
try {
const safe = safeRel(rel);
const build = await hugoBuild({ dest: 'preview', drafts: true });
const build = await buildSite({ dest: 'preview', drafts: true });
return c.json({ ok: true, url: `/_preview${urlFor(safe)}`, hugo: build.stdout });
} catch (e) {
return c.json({ error: String(e.message || e) }, 500);
+3 -3
View File
@@ -2,7 +2,7 @@ import { Hono } from 'hono';
import { readFile, writeFile, mkdir, stat } from 'node:fs/promises';
import path from 'node:path';
import matter from 'gray-matter';
import { hugoBuild } from '../hugo.js';
import { buildSite } from '../hugo.js';
// Profile als Hugo-Data-Datei (data/authors.json) + öffentliche Autor-Seite
// (content/authors/<slug>.md), gerendert von layouts/authors/single.html.
@@ -46,8 +46,8 @@ profile.put('/', async (c) => {
}
const page = matter.stringify(bio || '', { title: name, avatar: avatar || '' });
await writeFile(path.join(AUTHORS_DIR, `${slug}.md`), page, 'utf8');
// Live bauen, damit die Seite + Byline-Links sofort funktionieren.
await hugoBuild({ dest: 'public', drafts: false }).catch(() => {});
// Live bauen (koalesziert), damit die Seite + Byline-Links sofort wirken.
await buildSite({ dest: 'public', drafts: false }).catch((e) => console.error('[profile] build:', e?.message || e));
}
return c.json({ ok: true, slug });
+5 -2
View File
@@ -1,6 +1,7 @@
import { Hono } from 'hono';
import { urlFor, safeRel } from '../files.js';
import { hugoBuild, gitCommit } from '../hugo.js';
import { buildSite, gitCommit } from '../hugo.js';
import { syncLibrary } from '../dialog-store.js';
// Publizieren: public/ neu bauen (ohne Drafts) → live. Optional git-commit.
const publish = new Hono();
@@ -9,7 +10,9 @@ publish.post('/', async (c) => {
const { path: rel } = await c.req.json();
try {
const safe = safeRel(rel);
const build = await hugoBuild({ dest: 'public', drafts: false });
const build = await buildSite({ dest: 'public', drafts: false });
// Neue/aktualisierte Library-Beiträge sofort als Dialog-Threads spiegeln.
await syncLibrary({ force: true }).catch(() => {});
const git = await gitCommit(`cms: publish ${safe}`).catch((e) => ({ error: String(e.message || e) }));
return c.json({ ok: true, url: urlFor(safe), git, hugo: build.stdout });
} catch (e) {
+33 -4
View File
@@ -6,8 +6,14 @@ import sharp from 'sharp';
// Bild-Upload → static/images/. Raster-Bilder werden zu WebP konvertiert
// (kleiner, web-optimiert), auf max. 2000px begrenzt, EXIF-Rotation korrigiert.
// SVG/GIF bleiben unangetastet (Vektor/Animation erhalten).
//
// Sicherheit: hartes Größenlimit (DoS / Decompression-Bombs), Raster wird über
// sharp-Metadaten als echtes Bild verifiziert, SVG nur wenn es wie SVG aussieht.
// Hochgeladene Dateien werden zudem mit strikter CSP (sandbox) ausgeliefert
// (siehe index.js, /images/*) → ein bösartiges SVG kann kein JS im Origin starten.
const SITE_DIR = process.env.SITE_DIR || '/site';
const PASSTHROUGH = new Set(['.svg', '.gif']);
const MAX_UPLOAD = 8 * 1024 * 1024; // 8 MB Rohdatei
const ALLOWED_RASTER = new Set(['jpeg', 'png', 'webp', 'avif', 'tiff']);
const upload = new Hono();
@@ -15,19 +21,42 @@ upload.post('/', async (c) => {
const body = await c.req.parseBody();
const file = body['file'];
if (!file || typeof file === 'string') return c.json({ error: 'Keine Datei' }, 400);
if (typeof file.size === 'number' && file.size > MAX_UPLOAD) {
return c.json({ error: 'Datei zu groß (max. 8 MB)' }, 413);
}
const buffer = Buffer.from(await file.arrayBuffer());
if (buffer.length > MAX_UPLOAD) return c.json({ error: 'Datei zu groß (max. 8 MB)' }, 413);
if (!buffer.length) return c.json({ error: 'Leere Datei' }, 400);
const dir = path.join(SITE_DIR, 'static', 'images');
await mkdir(dir, { recursive: true });
const buffer = Buffer.from(await file.arrayBuffer());
const ext = path.extname(file.name || '').toLowerCase();
const base = `${safeBase(file.name)}-${uid()}`;
let outName, outBuf;
if (PASSTHROUGH.has(ext)) {
outName = `${base}${ext}`;
if (ext === '.svg') {
// Muss wie SVG aussehen (Magie/Marker), sonst ablehnen.
const head = buffer.subarray(0, 512).toString('utf8').trimStart().toLowerCase();
if (!head.startsWith('<?xml') && !head.startsWith('<svg')) {
return c.json({ error: 'Keine gültige SVG-Datei' }, 400);
}
outName = `${base}.svg`;
outBuf = buffer;
} else if (ext === '.gif') {
// GIF-Magie prüfen (kann kein Skript ausführen → Passthrough ok).
const sig = buffer.subarray(0, 6).toString('latin1');
if (sig !== 'GIF87a' && sig !== 'GIF89a') return c.json({ error: 'Keine gültige GIF-Datei' }, 400);
outName = `${base}.gif`;
outBuf = buffer;
} else {
// Raster: über sharp als echtes Bild verifizieren, dann zu WebP.
let meta;
try { meta = await sharp(buffer).metadata(); } catch { meta = null; }
if (!meta || !ALLOWED_RASTER.has(meta.format)) {
return c.json({ error: 'Kein unterstütztes Bildformat' }, 400);
}
outName = `${base}.webp`;
outBuf = await sharp(buffer)
.rotate()
+6
View File
@@ -0,0 +1,6 @@
// Serverfehler protokollieren, aber dem Client nur eine generische Meldung
// geben — keine DB-/Stack-Interna nach außen (Info-Leak vermeiden).
export function serverError(c, where, err, status = 500) {
console.error(`[${where}]`, err?.message || err);
return c.json({ error: 'Serverfehler' }, status);
}
+68
View File
@@ -0,0 +1,68 @@
import { test } from 'node:test';
import assert from 'node:assert/strict';
// Env vor dem Import setzen: supabase.js bricht ohne URL/Key ab, ADMIN_EMAILS
// und JWT_SECRET werden beim Modul-Load gelesen.
process.env.SUPABASE_URL ||= 'http://localhost';
process.env.SUPABASE_SERVICE_KEY ||= 'dummy';
process.env.JWT_SECRET = 'test-secret';
process.env.ADMIN_EMAILS = 'boss@x.ch';
const { roleOf, requireAuth } = await import('../src/auth.js');
const { sign } = await import('hono/jwt');
test('roleOf: Admin aus ADMIN_EMAILS', () => {
assert.equal(roleOf({ email: 'boss@x.ch' }), 'admin');
assert.equal(roleOf({ email: 'BOSS@X.CH' }), 'admin');
});
test('roleOf: Rolle aus app_metadata', () => {
assert.equal(roleOf({ email: 'a@x.ch', app_metadata: { role: 'admin' } }), 'admin');
assert.equal(roleOf({ email: 'a@x.ch', app_metadata: { role: 'editor' } }), 'editor');
assert.equal(roleOf({ email: 'a@x.ch' }), 'user');
});
// Minimaler Hono-Kontext-Stub.
function fakeCtx(authHeader) {
const store = {};
return {
req: { header: (h) => (h === 'Authorization' ? authHeader : undefined) },
set: (k, v) => { store[k] = v; },
get: (k) => store[k],
json: (body, status = 200) => ({ __status: status, body }),
};
}
test('requireAuth: gültiges Token wird lokal verifiziert', async () => {
const token = await sign(
{ sub: 'u1', email: 'A@x.ch', app_metadata: { role: 'editor' }, exp: Math.floor(Date.now() / 1000) + 60 },
'test-secret', 'HS256');
let passed = false;
const c = fakeCtx('Bearer ' + token);
await requireAuth(c, async () => { passed = true; });
assert.equal(passed, true);
assert.equal(c.get('email'), 'a@x.ch'); // kleingeschrieben
assert.equal(c.get('role'), 'editor');
assert.equal(c.get('canModerate'), true);
assert.equal(c.get('isAdmin'), false);
});
test('requireAuth: fehlendes Token → 401', async () => {
const c = fakeCtx('');
const r = await requireAuth(c, async () => { throw new Error('darf nicht laufen'); });
assert.equal(r.__status, 401);
});
test('requireAuth: kaputtes/falsch signiertes Token → 401', async () => {
const bad = await sign({ sub: 'u1', exp: Math.floor(Date.now() / 1000) + 60 }, 'falsches-secret', 'HS256');
for (const t of ['Bearer garbage', 'Bearer ' + bad]) {
const r = await requireAuth(fakeCtx(t), async () => { throw new Error('darf nicht laufen'); });
assert.equal(r.__status, 401);
}
});
test('requireAuth: abgelaufenes Token → 401', async () => {
const expired = await sign({ sub: 'u1', exp: Math.floor(Date.now() / 1000) - 10 }, 'test-secret', 'HS256');
const r = await requireAuth(fakeCtx('Bearer ' + expired), async () => { throw new Error('darf nicht laufen'); });
assert.equal(r.__status, 401);
});
+46
View File
@@ -0,0 +1,46 @@
import { test } from 'node:test';
import assert from 'node:assert/strict';
const { coalesce } = await import('../src/coalesce.js');
const tick = (ms = 5) => new Promise((r) => setTimeout(r, ms));
test('coalesce: nie mehr als ein Lauf gleichzeitig pro Key', async () => {
let active = 0, maxActive = 0, runs = 0;
const fn = async () => { active++; maxActive = Math.max(maxActive, active); await tick(10); runs++; active--; return runs; };
// 5 gleichzeitige Aufrufe.
await Promise.all(Array.from({ length: 5 }, () => coalesce('k1', fn)));
assert.equal(maxActive, 1, 'parallele Läufe');
// Erster Lauf bedient den ersten Aufruf; die 4 während des Laufs eingetroffenen
// teilen sich GENAU EINEN nachgelagerten Lauf → insgesamt 2.
assert.equal(runs, 2);
});
test('coalesce: Wartende teilen sich das Ergebnis des nachgelagerten Laufs', async () => {
let n = 0;
const fn = async () => { await tick(10); return ++n; };
const first = coalesce('k2', fn); // startet sofort → Ergebnis 1
await tick(2); // sicherstellen, dass er läuft
const a = coalesce('k2', fn); // wartet → nachgelagerter Lauf
const b = coalesce('k2', fn); // wartet → selber Lauf wie a
assert.equal(await first, 1);
const [ra, rb] = await Promise.all([a, b]);
assert.equal(ra, 2);
assert.equal(rb, 2); // a und b teilen sich Lauf 2
});
test('coalesce: Fehler wird an die Wartenden propagiert, Key bleibt nutzbar', async () => {
let fail = true;
const fn = async () => { await tick(5); if (fail) throw new Error('boom'); return 'ok'; };
await assert.rejects(() => coalesce('k3', fn), /boom/);
fail = false;
assert.equal(await coalesce('k3', fn), 'ok'); // danach wieder verwendbar
});
test('coalesce: verschiedene Keys laufen unabhängig', async () => {
const fn = async () => { await tick(5); return 'done'; };
const [x, y] = await Promise.all([coalesce('kA', fn), coalesce('kB', fn)]);
assert.equal(x, 'done');
assert.equal(y, 'done');
});
+41
View File
@@ -0,0 +1,41 @@
import { test } from 'node:test';
import assert from 'node:assert/strict';
const { safeRel, normAuthors, hasAccess, urlFor } = await import('../src/files.js');
test('safeRel: gültiger relativer .md-Pfad bleibt erhalten', () => {
assert.equal(safeRel('library/software/stack.md'), 'library/software/stack.md');
assert.equal(safeRel('a/./b.md'), 'a/b.md');
});
test('safeRel: Path-Traversal wird abgelehnt', () => {
assert.throws(() => safeRel('../etc/passwd.md'));
assert.throws(() => safeRel('a/../../b.md'));
assert.throws(() => safeRel('/absolut.md'));
});
test('safeRel: nur .md erlaubt, leer/falsch wirft', () => {
assert.throws(() => safeRel('note.txt'));
assert.throws(() => safeRel(''));
assert.throws(() => safeRel(null));
});
test('normAuthors: String/Array/Leer normalisieren', () => {
assert.deepEqual(normAuthors('a@x.ch'), ['a@x.ch']);
assert.deepEqual(normAuthors(['a@x.ch', 'b@y.ch']), ['a@x.ch', 'b@y.ch']);
assert.deepEqual(normAuthors(null), []);
assert.deepEqual(normAuthors([]), []);
});
test('hasAccess: case-insensitive Mitgliedschaft', () => {
assert.equal(hasAccess(['Karim@x.ch'], 'karim@x.ch'), true);
assert.equal(hasAccess(['a@x.ch'], 'b@y.ch'), false);
assert.equal(hasAccess([], 'a@x.ch'), false);
});
test('urlFor: Hugo-URLs aus relativem Pfad', () => {
assert.equal(urlFor('_index.md'), '/');
assert.equal(urlFor('manifest.md'), '/manifest/');
assert.equal(urlFor('library/software/stack.md'), '/library/software/stack/');
assert.equal(urlFor('software/_index.md'), '/software/');
});
+44
View File
@@ -0,0 +1,44 @@
import { test } from 'node:test';
import assert from 'node:assert/strict';
const { rateLimit } = await import('../src/ratelimit.js');
function fakeCtx() {
const headers = {};
return {
req: { header: () => undefined },
header: (k, v) => { headers[k] = v; },
json: (body, status = 200) => ({ __status: status, body }),
_headers: headers,
};
}
test('rateLimit: blockt nach Überschreiten mit 429 + Retry-After', async () => {
const mw = rateLimit({ max: 2, windowMs: 10_000, keyFn: () => 'fix' });
let calls = 0;
const run = async () => { const c = fakeCtx(); const r = await mw(c, async () => { calls++; }); return { c, r }; };
assert.equal((await run()).r, undefined); // 1 → durch (next, kein Return)
assert.equal((await run()).r, undefined); // 2 → durch
const { c, r } = await run(); // 3 → blockiert
assert.equal(r.__status, 429);
assert.ok(c._headers['Retry-After']);
assert.equal(calls, 2); // next nur zweimal aufgerufen
});
test('rateLimit: getrennte Schlüssel zählen getrennt', async () => {
let key = 'a';
const mw = rateLimit({ max: 1, windowMs: 10_000, keyFn: () => key });
assert.equal((await mw(fakeCtx(), async () => {})), undefined); // a:1 ok
assert.equal((await mw(fakeCtx(), async () => {})).__status, 429); // a:2 blockiert
key = 'b';
assert.equal((await mw(fakeCtx(), async () => {})), undefined); // b:1 ok
});
test('rateLimit: Fenster läuft ab → wieder frei', async () => {
const mw = rateLimit({ max: 1, windowMs: 30, keyFn: () => 'win' });
assert.equal((await mw(fakeCtx(), async () => {})), undefined);
assert.equal((await mw(fakeCtx(), async () => {})).__status, 429);
await new Promise((r) => setTimeout(r, 40));
assert.equal((await mw(fakeCtx(), async () => {})), undefined); // Fenster neu
});
+11
View File
@@ -46,10 +46,21 @@ create table if not exists public.comments (
created_at timestamptz not null default now(),
deleted boolean not null default false
);
-- Position/Rolle bei OPENBUREAU (optional, neben dem Namen angezeigt).
alter table public.comments add column if not exists author_role text;
create index if not exists comments_thread_idx on public.comments (thread, created_at);
alter table public.comments enable row level security;
grant all on public.comments to anon, authenticated, service_role;
-- Aggregat je Thread (Anzahl + letzte Aktivität). Spart der API den Full-Table-
-- Scan + JS-Aggregation bei jedem Forum-Aufruf; Postgres zählt direkt.
create or replace view public.comment_stats as
select thread, count(*)::int as count, max(created_at) as last
from public.comments
where not deleted
group by thread;
grant select on public.comment_stats to service_role;
-- ── Foren / Subforen ────────────────────────────────────────────────────
-- Kategorien, in denen Threads leben. Admin-verwaltet. `kind=library` ist die
-- Sonder-Kategorie, in der die Library-Beiträge automatisch als Threads landen.
+142
View File
@@ -0,0 +1,142 @@
-- OPENBUREAU — OPTIONALER Demo-Inhalt fürs Forum (Dialog).
-- ─────────────────────────────────────────────────────────────────────────
-- NICHT Teil der Migration: bewusst getrennt von schema.sql, damit die
-- Produktion sauber bleibt. Nur bei Bedarf manuell einspielen, z.B.:
--
-- docker compose exec -T db \
-- psql -U supabase_admin -d postgres < db/seed-demo.sql
--
-- Idempotent: feste UUIDs + ON CONFLICT DO NOTHING → mehrfaches Einspielen
-- erzeugt keine Duplikate. Demo-Wortmeldungen haben user_id = NULL (keine
-- echten Konten); author_name/author_role sind nur Anzeigetext.
--
-- Wieder entfernen: siehe DELETE-Block ganz unten (auskommentiert).
-- ─────────────────────────────────────────────────────────────────────────
-- ── Threads ───────────────────────────────────────────────────────────────
insert into public.threads (id, forum_id, key, title, url, kind, author_name, created_at) values
('a1111111-1111-1111-1111-111111111101',
(select id from public.forums where slug = 'allgemein'),
't/a1111111-1111-1111-1111-111111111101',
'Willkommen im OPENBUREAU-Dialog',
'/dialog/?thread=t%2Fa1111111-1111-1111-1111-111111111101',
'forum', 'Karim', now() - interval '9 days'),
('a2222222-2222-2222-2222-222222222202',
(select id from public.forums where slug = 'projekte'),
't/a2222222-2222-2222-2222-222222222202',
'Altbausanierung Zürich — Materialwahl Innendämmung',
'/dialog/?thread=t%2Fa2222222-2222-2222-2222-222222222202',
'forum', 'Karim', now() - interval '6 days'),
('a3333333-3333-3333-3333-333333333303',
(select id from public.forums where slug = 'technik'),
't/a3333333-3333-3333-3333-333333333303',
'Hugo-Build-Zeiten bei großen Bildmengen',
'/dialog/?thread=t%2Fa3333333-3333-3333-3333-333333333303',
'forum', 'Mara', now() - interval '3 days'),
('a4444444-4444-4444-4444-444444444404',
(select id from public.forums where slug = 'off-topic'),
't/a4444444-4444-4444-4444-444444444404',
'Welches Architekturbuch hat euch geprägt?',
'/dialog/?thread=t%2Fa4444444-4444-4444-4444-444444444404',
'forum', 'Jonas', now() - interval '2 days')
on conflict (key) do nothing;
-- ── Wortmeldungen ─────────────────────────────────────────────────────────
-- parent_id verweist auf eine andere Wortmeldung (Antwort-Bezug).
insert into public.comments (id, thread, parent_id, author_name, author_role, body, created_at) values
-- Thread 1: Willkommen
('c1111111-0000-0000-0000-000000000001',
't/a1111111-1111-1111-1111-111111111101', null, 'Karim', 'Gründer',
'Hallo zusammen — dieser Bereich ist für den offenen Austausch rund ums Büro: Projekte, Methoden, Werkzeuge. Lest euch ein, schreibt mit.',
now() - interval '9 days'),
('c1111111-0000-0000-0000-000000000002',
't/a1111111-1111-1111-1111-111111111101',
'c1111111-0000-0000-0000-000000000001', 'Mara', 'Projektarchitektin',
'Schön, dass es losgeht. Gibt es eine Empfehlung, wie wir Projektdiskussionen von allgemeinem Plausch trennen?',
now() - interval '8 days'),
('c1111111-0000-0000-0000-000000000003',
't/a1111111-1111-1111-1111-111111111101',
'c1111111-0000-0000-0000-000000000002', 'Karim', 'Gründer',
'Genau dafür gibt es die Kategorie „Projekte". „Off-Topic" ist für alles andere.',
now() - interval '8 days'),
-- Thread 2: Innendämmung
('c2222222-0000-0000-0000-000000000001',
't/a2222222-2222-2222-2222-222222222202', null, 'Karim', 'Gründer',
'Beim Altbau an der Seestrasse steht die Innendämmung an. Kalziumsilikat oder mineralischer Dämmputz? Erfahrungen mit Feuchteverhalten?',
now() - interval '6 days'),
('c2222222-0000-0000-0000-000000000002',
't/a2222222-2222-2222-2222-222222222202',
'c2222222-0000-0000-0000-000000000001', 'Mara', 'Projektarchitektin',
'Kalziumsilikat ist diffusionsoffen und kapillaraktiv — bei den Bestandswänden dort würde ich das vorziehen. Wichtig ist die Detailausbildung an den Holzbalkenköpfen.',
now() - interval '5 days'),
('c2222222-0000-0000-0000-000000000003',
't/a2222222-2222-2222-2222-222222222202',
'c2222222-0000-0000-0000-000000000002', 'Jonas', 'Bauleiter',
'Plus eins für Kalziumsilikat. Ich hänge nächste Woche die hygrothermische Simulation an, dann sehen wir die Tauwasserbilanz.',
now() - interval '4 days'),
-- Thread 3: Hugo-Builds
('c3333333-0000-0000-0000-000000000001',
't/a3333333-3333-3333-3333-333333333303', null, 'Mara', 'Projektarchitektin',
'Seit die Projektgalerien dazugekommen sind, dauert der Build spürbar länger. Hat jemand die Bildverarbeitung schon optimiert?',
now() - interval '3 days'),
('c3333333-0000-0000-0000-000000000002',
't/a3333333-3333-3333-3333-333333333303',
'c3333333-0000-0000-0000-000000000001', 'Karim', 'Gründer',
'Hugo cached die Image-Resizes unter resources/. Solange der Ordner erhalten bleibt, werden nur neue Bilder neu gerechnet — das war bei uns der größte Hebel.',
now() - interval '2 days'),
-- Thread 4: Architekturbuch
('c4444444-0000-0000-0000-000000000001',
't/a4444444-4444-4444-4444-444444444404', null, 'Jonas', 'Bauleiter',
'Bei mir war es „Atmosphären" von Peter Zumthor — schmal, aber prägend. Was hat euch geformt?',
now() - interval '2 days'),
('c4444444-0000-0000-0000-000000000002',
't/a4444444-4444-4444-4444-444444444404',
'c4444444-0000-0000-0000-000000000001', 'Mara', 'Projektarchitektin',
'„Complexity and Contradiction" von Venturi — hat mein Verständnis von Fassaden komplett verschoben.',
now() - interval '1 day')
on conflict (id) do nothing;
-- ── Wortmeldungen auf den Musterbeiträgen (Dialog am Artikel) ─────────────
-- thread = Beitrags-URL (Library-Beiträge werden als Threads gespiegelt).
insert into public.comments (id, thread, parent_id, author_name, author_role, body, created_at) values
('d1111111-0000-0000-0000-000000000001',
'/library/theorie/muster-typologie-fussnoten/', null, 'Mara', 'Projektarchitektin',
'Schöne Verdichtung. Würdest du Léon Krier hier dazustellen, oder ist das eine andere Debatte?',
now() - interval '4 days'),
('d1111111-0000-0000-0000-000000000002',
'/library/theorie/muster-typologie-fussnoten/',
'd1111111-0000-0000-0000-000000000001', 'Karim', 'Gründer',
'Eigene Debatte — Krier zielt auf die Wiederherstellung der Stadt. Hier ging es mir nur um Typus vs. Modell.',
now() - interval '3 days'),
('d2222222-0000-0000-0000-000000000001',
'/library/buerofuehrung/muster-offen-arbeiten/', null, 'Jonas', 'Bauleiter',
'Die Lizenzfrage unterschätzen viele. Gut, das einmal klar getrennt zu sehen.',
now() - interval '2 days'),
('d3333333-0000-0000-0000-000000000001',
'/library/software/muster-werkzeugkette/', null, 'Mara', 'Projektarchitektin',
'Ein Befehl ist Gold wert. Läuft der Build bei euch auch im CMS-Container?',
now() - interval '1 day'),
('d3333333-0000-0000-0000-000000000002',
'/library/software/muster-werkzeugkette/',
'd3333333-0000-0000-0000-000000000001', 'Karim', 'Gründer',
'Genau — der Container hat das Hugo-Binary, Publish baut public/ direkt.',
now() - interval '12 hours')
on conflict (id) do nothing;
-- ── Demo-Inhalt wieder entfernen (bei Bedarf auskommentieren) ──────────────
-- delete from public.comments where id::text like 'c_______-0000-0000-0000-%';
-- delete from public.comments where id::text like 'd_______-0000-0000-0000-%';
-- delete from public.threads where key in (
-- 't/a1111111-1111-1111-1111-111111111101',
-- 't/a2222222-2222-2222-2222-222222222202',
-- 't/a3333333-3333-3333-3333-333333333303',
-- 't/a4444444-4444-4444-4444-444444444404');
-- (Musterbeitrag-Threads verschwinden mit den .md-Dateien automatisch.)
+11 -3
View File
@@ -6,7 +6,10 @@
# 2. JWT_SECRET + POSTGRES_PASSWORD setzen (openssl rand -hex 32)
# 3. node scripts/generate-keys.mjs → ANON_KEY + SERVICE_ROLE_KEY in .env
# 4. SITE_URL + API_EXTERNAL_URL auf die LAN-/Domain-Adresse setzen
# 5. kong.yml: __CORS_ORIGIN__ durch SITE_URL ersetzen (Browser-Origin)
# 6. BIND_ADDR: 127.0.0.1 hinter Reverse-Proxy, 0.0.0.0 für LAN-Direkt
#
# (Das Proxmox-Script erledigt 16 automatisch.)
# Dann: docker compose up -d --build
#
# Abweichung von RAPPORT: realtime + storage weggelassen (nutzt das CMS nicht).
@@ -129,8 +132,10 @@ services:
volumes:
- ./kong.yml:/var/lib/kong/kong.yml:ro
ports:
- "${KONG_HTTP_PORT:-8000}:8000"
- "${KONG_HTTPS_PORT:-8443}:8443"
# Standard 127.0.0.1: nur lokal/Reverse-Proxy erreichbar. Für LAN-Direkt-
# zugriff ohne Proxy BIND_ADDR=0.0.0.0 in .env setzen.
- "${BIND_ADDR:-127.0.0.1}:${KONG_HTTP_PORT:-8000}:8000"
- "${BIND_ADDR:-127.0.0.1}:${KONG_HTTPS_PORT:-8443}:8443"
# ════════════════════════════════════════════════════════════════════════
# CMS — Node-API + Hugo-Binary + Admin-SPA, serviert die Site
@@ -156,6 +161,8 @@ services:
# Server-seitig: intern über Kong, mit Service-Key.
SUPABASE_URL: http://kong:8000
SUPABASE_SERVICE_KEY: ${SERVICE_ROLE_KEY}
# Für lokale JWT-Verifikation (kein GoTrue-Roundtrip pro Request).
JWT_SECRET: ${JWT_SECRET}
ADMIN_EMAILS: ${ADMIN_EMAILS:-}
SITE_DIR: /site
PORT: 3000
@@ -168,7 +175,8 @@ services:
# Repo-Root: api schreibt content/ und baut public/ + preview/.
- ..:/site
ports:
- "${APP_PORT:-8080}:3000"
# Wie Kong: standardmäßig nur 127.0.0.1 (hinter Reverse-Proxy).
- "${BIND_ADDR:-127.0.0.1}:${APP_PORT:-8080}:3000"
volumes:
postgres-data:
+20
View File
@@ -15,6 +15,16 @@ services:
- /auth/v1/
plugins:
- name: cors
config:
# Nur die eigene Browser-Origin erlauben (nicht „*"). __CORS_ORIGIN__
# wird beim Provisionieren auf SITE_URL gesetzt (siehe Proxmox-Script);
# bei Domain/HTTPS-Wechsel hier bzw. in .env mitziehen.
origins:
- __CORS_ORIGIN__
methods: [GET, POST, PUT, PATCH, DELETE, OPTIONS]
headers: [Accept, Authorization, Content-Type, apikey, x-client-info, x-supabase-api-version]
credentials: false
max_age: 3600
- name: rest-v1
url: http://rest:3000/
@@ -25,3 +35,13 @@ services:
- /rest/v1/
plugins:
- name: cors
config:
# Nur die eigene Browser-Origin erlauben (nicht „*"). __CORS_ORIGIN__
# wird beim Provisionieren auf SITE_URL gesetzt (siehe Proxmox-Script);
# bei Domain/HTTPS-Wechsel hier bzw. in .env mitziehen.
origins:
- __CORS_ORIGIN__
methods: [GET, POST, PUT, PATCH, DELETE, OPTIONS]
headers: [Accept, Authorization, Content-Type, apikey, x-client-info, x-supabase-api-version]
credentials: false
max_age: 3600
+13
View File
@@ -147,13 +147,26 @@ pct exec "$CTID" -- bash -euo pipefail -c "
sed -i \"s|^SITE_URL=.*|SITE_URL=http://\${HOSTIP}:8080|\" .env
sed -i \"s|^API_EXTERNAL_URL=.*|API_EXTERNAL_URL=http://\${HOSTIP}:8000|\" .env
sed -i \"s|^ADMIN_EMAILS=.*|ADMIN_EMAILS=${ADMIN_EMAIL}|\" .env
# Out-of-box LAN-Direktzugriff (kein Reverse-Proxy) → auf allen Interfaces
# lauschen. Für Domain/HTTPS hinter Proxy: BIND_ADDR=127.0.0.1 setzen.
sed -i \"s|^BIND_ADDR=.*|BIND_ADDR=0.0.0.0|\" .env
# CORS auf die Browser-Origin (= SITE_URL) festnageln statt „*\".
sed -i \"s|__CORS_ORIGIN__|http://\${HOSTIP}:8080|g\" kong.yml
echo 'OK: .env generiert.'
fi
# Der CMS-Container läuft als non-root (uid 1000). Das gemountete Repo muss
# ihm gehören, damit Hugo public/ bauen und content/ schreiben kann.
chown -R 1000:1000 '${APP_DIR}'
if [ '${COMPOSE_UP}' = 'true' ]; then
echo '→ Baue + starte Stack (dauert beim ersten Mal ein paar Minuten)…'
docker compose up -d --build
fi
# Tägliches DB-Backup (3:15 Uhr) — Dialog-Daten liegen NUR in Postgres.
printf 'PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin\n15 3 * * * root cd ${APP_DIR}/cms && bash scripts/backup-db.sh >> /var/log/openbureau-backup.log 2>&1\n' > /etc/cron.d/openbureau-backup
echo 'OK: tägliches DB-Backup eingerichtet (/etc/cron.d/openbureau-backup).'
"
# --- 5. Abschluss --------------------------------------------------------
+30
View File
@@ -0,0 +1,30 @@
#!/usr/bin/env bash
# OPENBUREAU — Backup der Postgres-DB.
#
# WICHTIG: Foren, Threads und Wortmeldungen (Dialog) leben NUR in Postgres —
# anders als content/*.md sind sie NICHT in Git. Ohne Backup sind sie beim
# Verlust des Volumes weg. Dieses Skript dumpt die ganze DB komprimiert weg.
#
# Auf dem Host/LXC im cms/-Verzeichnis ausführen (oder per Cron, siehe README):
# bash scripts/backup-db.sh
#
# Wiederherstellen:
# gunzip -c backups/openbureau-<TS>.sql.gz \
# | docker compose exec -T db psql -U supabase_admin -d postgres
set -euo pipefail
# Ins cms/-Verzeichnis (eine Ebene über scripts/).
cd "$(dirname "$0")/.."
DIR="${BACKUP_DIR:-./backups}"
KEEP="${BACKUP_KEEP:-14}" # wie viele Dumps behalten
mkdir -p "$DIR"
TS="$(date +%Y%m%d-%H%M%S)"
OUT="$DIR/openbureau-$TS.sql.gz"
docker compose exec -T db pg_dump -U supabase_admin -d postgres | gzip > "$OUT"
echo "✓ Backup: $OUT ($(du -h "$OUT" | cut -f1))"
# Rotation: nur die letzten $KEEP Dumps behalten.
ls -1t "$DIR"/openbureau-*.sql.gz 2>/dev/null | tail -n +$((KEEP + 1)) | xargs -r rm -f
Executable
+55
View File
@@ -0,0 +1,55 @@
#!/usr/bin/env bash
# OPENBUREAU — Update im LXC in einem Rutsch.
# Statt `git pull` direkt: holt den Code, rendert die Deploy-Config, setzt die
# Dateirechte für den non-root-Container und startet den Stack neu.
#
# Im Container (als root) ausführen:
# bash /opt/openbureau/cms/update.sh
set -euo pipefail
# Repo-Root = eine Ebene über diesem Skript (cms/..).
ROOT="$(cd "$(dirname "$0")/.." && pwd)"
cd "$ROOT"
# Git läuft hier als root auf einem Repo, das dem Container-User (uid 1000)
# gehört → ohne das meckert Git über „dubious ownership".
git config --global --add safe.directory "$ROOT" 2>/dev/null || true
echo "→ git pull…"
# kong.yml wird beim Deploy lokal gerendert (CORS-Origin eingesetzt). Vor dem
# Pull auf die versionierte Vorlage (mit __CORS_ORIGIN__) zurücksetzen, sonst
# kollidiert der Pull mit der lokalen Änderung.
git checkout -- cms/kong.yml 2>/dev/null || true
git pull --ff-only
cd "$ROOT/cms"
# CORS-Origin aus SITE_URL (.env) in kong.yml einsetzen — eine Quelle der Wahrheit.
ORIGIN="$(grep -E '^SITE_URL=' .env | head -1 | cut -d= -f2-)"
if [ -n "${ORIGIN:-}" ]; then
sed -i "s|__CORS_ORIGIN__|${ORIGIN}|g" kong.yml
echo "✓ CORS-Origin gesetzt: ${ORIGIN}"
else
echo "WARN: SITE_URL in .env nicht gefunden — kong.yml-Origin bleibt Platzhalter."
fi
# Der CMS-Container läuft als uid 1000 und muss das ganze Repo schreiben können
# (Hugo baut public/, schreibt content/). git pull als root zieht neue Dateien
# als root → hier wieder geradeziehen.
chown -R 1000:1000 "$ROOT"
echo "✓ Dateirechte (uid 1000) gesetzt."
echo "→ docker compose up…"
docker compose up -d --build
# kong liest die declarative config nur beim Start — nach kong.yml-Änderung neu.
docker compose restart kong
echo "✓ Stack neu gestartet."
# Kurzer Healthcheck (localhost im LXC, unabhängig von BIND_ADDR).
PORT="$(grep -E '^APP_PORT=' .env | head -1 | cut -d= -f2-)"; PORT="${PORT:-8080}"
sleep 2
if curl -fsS -I "http://127.0.0.1:${PORT}/" >/dev/null 2>&1; then
echo "✓ Seite antwortet auf :${PORT}."
else
echo "WARN: Seite antwortet (noch) nicht auf :${PORT} — 'docker compose ps' prüfen."
fi
+32
View File
@@ -0,0 +1,32 @@
---
title: "Datenschutz"
toc: false
showreadingtime: false
---
OPENBUREAU ist selbst-gehostet — ohne Werbung, ohne Tracker, ohne Analyse-Dienste Dritter. So wenig Daten wie möglich zu erheben, ist Teil der Idee.
## Verantwortlich
Karim Varano, Fluhmühlerain 1, 6015 Luzern.
Kontakt: [karim@gabrielevarano.ch](mailto:karim@gabrielevarano.ch)
## Beim Besuch der Seite
Beim Aufruf werden technische Zugriffsdaten (IP-Adresse, Zeitpunkt, aufgerufene Seite, Browsertyp) kurzzeitig in Server-Logs erfasst — ausschließlich für Betrieb und Sicherheit. Diese Daten werden nicht mit anderen Quellen zusammengeführt, nicht für Werbung verwendet und nicht an Dritte weitergegeben.
Es kommen **keine** Tracking-Cookies, **keine** Analyse-Werkzeuge (etwa Google Analytics) und **keine** Werbenetzwerke zum Einsatz.
## Dialog (Mitschreiben)
Lesen ist anonym. Wer im [Dialog](/dialog/) mitschreibt, legt ein Konto an: dafür werden eine E-Mail-Adresse und ein angezeigter Name gespeichert. Deine Wortmeldungen erscheinen mit diesem Namen öffentlich. Nach dem Login wird ein Sitzungs-Token lokal in deinem Browser (localStorage) abgelegt — kein serverseitiges Tracking.
Diese Daten liegen auf eigener Infrastruktur in Luzern (self-hosted) und werden nicht an Dritte weitergegeben.
## Deine Rechte
Nach dem Schweizer Datenschutzgesetz (revDSG) hast du das Recht auf Auskunft, Berichtigung und Löschung deiner Daten — eine kurze Mail genügt. Beschwerden kannst du beim Eidgenössischen Datenschutz- und Öffentlichkeitsbeauftragten (EDÖB) einreichen.
## Offenheit
Die Seite ist quelloffen; der Code ist einsehbar. Zu Lizenzen und Technik siehe [Colophon](/colophon/).
+19
View File
@@ -0,0 +1,19 @@
---
title: "Kontakt / Impressum"
toc: false
showreadingtime: false
---
## Kontakt
[karim@gabrielevarano.ch](mailto:karim@gabrielevarano.ch)
Oder direkt im [Dialog](/dialog/).
## Impressum
Karim Varano\
Fluhmühlerain 1\
6015 Luzern
Privatperson
@@ -0,0 +1,17 @@
---
title: "Im Offenen arbeiten"
date: 2026-05-30
tags: ["büroführung", "open-source", "muster"]
summary: "Warum ein offenes Büro robuster ist — und wie Lizenzen das absichern. (Musterbeitrag mit Fußnoten.)"
color: sakura
layout: text
---
Offen zu arbeiten heißt nicht, alles zu verschenken. Es heißt, die Grundlagen so zu teilen, dass andere darauf aufbauen können — und dass die Arbeit den Wechsel von Werkzeugen, Mitarbeitenden und Jahren übersteht.
Die rechtliche Absicherung dafür sind Lizenzen. Inhalte auf OPENBUREAU stehen unter CC BY-SA,[^ccbysa] der Code überwiegend unter AGPL oder MIT.[^agpl] Beide sorgen dafür, dass Offenheit weitergegeben wird, statt verloren zu gehen.
Verwandt: Der [Werkzeug-Stack](/library/software/stack/) zeigt, womit wir das konkret tun.
[^ccbysa]: Creative Commons, *Attribution-ShareAlike 4.0 International* (CC BY-SA 4.0), <https://creativecommons.org/licenses/by-sa/4.0/>.
[^agpl]: Free Software Foundation, *GNU Affero General Public License v3.0*, 2007.
@@ -0,0 +1,21 @@
---
title: "Die Werkzeugkette"
date: 2026-06-01
tags: ["software", "werkzeuge", "muster"]
summary: "Wie DOSSIER, RAPPORT und die Site zusammenspielen. (Musterbeitrag mit Fußnoten und Code.)"
color: yuyake
layout: text
---
Die Werkzeuge des Büros sind keine Inseln, sondern eine Kette: [DOSSIER](/library/software/dossier/) hält die Projektdaten, [RAPPORT](/library/software/rapport/) erzeugt Berichte daraus, und diese Site veröffentlicht, was öffentlich sein soll.
Der Build ist bewusst banal — ein Befehl:[^hugo]
```sh
hugo --minify --destination public
```
Alles dateibasiert, alles versioniert. Wer den Stand von gestern braucht, fragt Git, nicht ein Backup.[^git]
[^hugo]: Hugo, *The world's fastest framework for building websites*, <https://gohugo.io>.
[^git]: Versionierung ersetzt kein Backup — aber sie macht jede Änderung nachvollziehbar; siehe „Verlauf" unter jedem Beitrag.
@@ -0,0 +1,18 @@
---
title: "Typus und Modell"
date: 2026-05-28
tags: ["theorie", "typologie", "muster"]
summary: "Eine kurze Unterscheidung — und warum sie fürs Entwerfen praktisch ist. (Musterbeitrag mit Fußnoten.)"
color: kusa
layout: text
---
Quatremère de Quincy trennte im frühen 19. Jahrhundert *Typus* und *Modell*: Das Modell ist die exakte Vorlage zum Kopieren, der Typus dagegen ein Prinzip, das viele verschiedene Werke begründen kann.[^quatremere]
Rafael Moneo griff diese Idee 1978 wieder auf und machte sie für die Praxis brauchbar — der Typus ist kein Käfig, sondern ein Ausgangspunkt, gegen den man entwirft.[^moneo] Aldo Rossi schließlich verband den Typus mit der Stadt: als dauerhaftes Element, das den Wandel überdauert.[^rossi]
Fürs Büro heißt das konkret: Wer den Typus einer Aufgabe versteht, entwirft nicht aus dem Nichts, sondern variiert bewusst. Das spart Zeit und macht Entscheidungen begründbar.
[^quatremere]: Antoine-Chrysostome Quatremère de Quincy, *Encyclopédie méthodique. Architecture*, Bd. 3, Paris 1825, Stichwort „Type".
[^moneo]: Rafael Moneo, „On Typology", in: *Oppositions* 13 (1978), S. 2245.
[^rossi]: Aldo Rossi, *L'architettura della città*, Padua 1966.
+11
View File
@@ -0,0 +1,11 @@
---
title: "Lizenzen"
description: "Unter welchen Lizenzen OPENBUREAU steht."
toc: false
showreadingtime: false
---
OPENBUREAU ist komplett offen lizenziert:
- **Code** — [GNU AGPL v3.0](/lizenz/agpl-3.0/)
- **Inhalte (Texte, Bilder)** — [CC BY-SA 4.0](/lizenz/cc-by-sa-4.0/)
+673
View File
@@ -0,0 +1,673 @@
---
title: "GNU AGPL v3.0"
description: "Lizenz des OPENBUREAU-Codes."
toc: false
showreadingtime: false
---
Der **Code** von OPENBUREAU steht unter der GNU Affero General Public License, Version 3.
```text
GNU AFFERO GENERAL PUBLIC LICENSE
Version 3, 19 November 2007
Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The GNU Affero General Public License is a free, copyleft license for
software and other kinds of works, specifically designed to ensure
cooperation with the community in the case of network server software.
The licenses for most software and other practical works are designed
to take away your freedom to share and change the works. By contrast,
our General Public Licenses are intended to guarantee your freedom to
share and change all versions of a program--to make sure it remains free
software for all its users.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
them if you wish), that you receive source code or can get it if you
want it, that you can change the software or use pieces of it in new
free programs, and that you know you can do these things.
Developers that use our General Public Licenses protect your rights
with two steps: (1) assert copyright on the software, and (2) offer
you this License which gives you legal permission to copy, distribute
and/or modify the software.
A secondary benefit of defending all users' freedom is that
improvements made in alternate versions of the program, if they
receive widespread use, become available for other developers to
incorporate. Many developers of free software are heartened and
encouraged by the resulting cooperation. However, in the case of
software used on network servers, this result may fail to come about.
The GNU General Public License permits making a modified version and
letting the public access it on a server without ever releasing its
source code to the public.
The GNU Affero General Public License is designed specifically to
ensure that, in such cases, the modified source code becomes available
to the community. It requires the operator of a network server to
provide the source code of the modified version running there to the
users of that server. Therefore, public use of a modified version, on
a publicly accessible server, gives the public access to the source
code of the modified version.
An older license, called the Affero General Public License and
published by Affero, was designed to accomplish similar goals. This is
a different license, not a version of the Affero GPL, but Affero has
released a new version of the Affero GPL which permits relicensing under
this license.
The precise terms and conditions for copying, distribution and
modification follow.
TERMS AND CONDITIONS
0. Definitions.
"This License" refers to version 3 of the GNU Affero General Public License.
"Copyright" also means copyright-like laws that apply to other kinds of
works, such as semiconductor masks.
"The Program" refers to any copyrightable work licensed under this
License. Each licensee is addressed as "you". "Licensees" and
"recipients" may be individuals or organizations.
To "modify" a work means to copy from or adapt all or part of the work
in a fashion requiring copyright permission, other than the making of an
exact copy. The resulting work is called a "modified version" of the
earlier work or a work "based on" the earlier work.
A "covered work" means either the unmodified Program or a work based
on the Program.
To "propagate" a work means to do anything with it that, without
permission, would make you directly or secondarily liable for
infringement under applicable copyright law, except executing it on a
computer or modifying a private copy. Propagation includes copying,
distribution (with or without modification), making available to the
public, and in some countries other activities as well.
To "convey" a work means any kind of propagation that enables other
parties to make or receive copies. Mere interaction with a user through
a computer network, with no transfer of a copy, is not conveying.
An interactive user interface displays "Appropriate Legal Notices"
to the extent that it includes a convenient and prominently visible
feature that (1) displays an appropriate copyright notice, and (2)
tells the user that there is no warranty for the work (except to the
extent that warranties are provided), that licensees may convey the
work under this License, and how to view a copy of this License. If
the interface presents a list of user commands or options, such as a
menu, a prominent item in the list meets this criterion.
1. Source Code.
The "source code" for a work means the preferred form of the work
for making modifications to it. "Object code" means any non-source
form of a work.
A "Standard Interface" means an interface that either is an official
standard defined by a recognized standards body, or, in the case of
interfaces specified for a particular programming language, one that
is widely used among developers working in that language.
The "System Libraries" of an executable work include anything, other
than the work as a whole, that (a) is included in the normal form of
packaging a Major Component, but which is not part of that Major
Component, and (b) serves only to enable use of the work with that
Major Component, or to implement a Standard Interface for which an
implementation is available to the public in source code form. A
"Major Component", in this context, means a major essential component
(kernel, window system, and so on) of the specific operating system
(if any) on which the executable work runs, or a compiler used to
produce the work, or an object code interpreter used to run it.
The "Corresponding Source" for a work in object code form means all
the source code needed to generate, install, and (for an executable
work) run the object code and to modify the work, including scripts to
control those activities. However, it does not include the work's
System Libraries, or general-purpose tools or generally available free
programs which are used unmodified in performing those activities but
which are not part of the work. For example, Corresponding Source
includes interface definition files associated with source files for
the work, and the source code for shared libraries and dynamically
linked subprograms that the work is specifically designed to require,
such as by intimate data communication or control flow between those
subprograms and other parts of the work.
The Corresponding Source need not include anything that users
can regenerate automatically from other parts of the Corresponding
Source.
The Corresponding Source for a work in source code form is that
same work.
2. Basic Permissions.
All rights granted under this License are granted for the term of
copyright on the Program, and are irrevocable provided the stated
conditions are met. This License explicitly affirms your unlimited
permission to run the unmodified Program. The output from running a
covered work is covered by this License only if the output, given its
content, constitutes a covered work. This License acknowledges your
rights of fair use or other equivalent, as provided by copyright law.
You may make, run and propagate covered works that you do not
convey, without conditions so long as your license otherwise remains
in force. You may convey covered works to others for the sole purpose
of having them make modifications exclusively for you, or provide you
with facilities for running those works, provided that you comply with
the terms of this License in conveying all material for which you do
not control copyright. Those thus making or running the covered works
for you must do so exclusively on your behalf, under your direction
and control, on terms that prohibit them from making any copies of
your copyrighted material outside their relationship with you.
Conveying under any other circumstances is permitted solely under
the conditions stated below. Sublicensing is not allowed; section 10
makes it unnecessary.
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
No covered work shall be deemed part of an effective technological
measure under any applicable law fulfilling obligations under article
11 of the WIPO copyright treaty adopted on 20 December 1996, or
similar laws prohibiting or restricting circumvention of such
measures.
When you convey a covered work, you waive any legal power to forbid
circumvention of technological measures to the extent such circumvention
is effected by exercising rights under this License with respect to
the covered work, and you disclaim any intention to limit operation or
modification of the work as a means of enforcing, against the work's
users, your or third parties' legal rights to forbid circumvention of
technological measures.
4. Conveying Verbatim Copies.
You may convey verbatim copies of the Program's source code as you
receive it, in any medium, provided that you conspicuously and
appropriately publish on each copy an appropriate copyright notice;
keep intact all notices stating that this License and any
non-permissive terms added in accord with section 7 apply to the code;
keep intact all notices of the absence of any warranty; and give all
recipients a copy of this License along with the Program.
You may charge any price or no price for each copy that you convey,
and you may offer support or warranty protection for a fee.
5. Conveying Modified Source Versions.
You may convey a work based on the Program, or the modifications to
produce it from the Program, in the form of source code under the
terms of section 4, provided that you also meet all of these conditions:
a) The work must carry prominent notices stating that you modified
it, and giving a relevant date.
b) The work must carry prominent notices stating that it is
released under this License and any conditions added under section
7. This requirement modifies the requirement in section 4 to
"keep intact all notices".
c) You must license the entire work, as a whole, under this
License to anyone who comes into possession of a copy. This
License will therefore apply, along with any applicable section 7
additional terms, to the whole of the work, and all its parts,
regardless of how they are packaged. This License gives no
permission to license the work in any other way, but it does not
invalidate such permission if you have separately received it.
d) If the work has interactive user interfaces, each must display
Appropriate Legal Notices; however, if the Program has interactive
interfaces that do not display Appropriate Legal Notices, your
work need not make them do so.
A compilation of a covered work with other separate and independent
works, which are not by their nature extensions of the covered work,
and which are not combined with it such as to form a larger program,
in or on a volume of a storage or distribution medium, is called an
"aggregate" if the compilation and its resulting copyright are not
used to limit the access or legal rights of the compilation's users
beyond what the individual works permit. Inclusion of a covered work
in an aggregate does not cause this License to apply to the other
parts of the aggregate.
6. Conveying Non-Source Forms.
You may convey a covered work in object code form under the terms
of sections 4 and 5, provided that you also convey the
machine-readable Corresponding Source under the terms of this License,
in one of these ways:
a) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by the
Corresponding Source fixed on a durable physical medium
customarily used for software interchange.
b) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by a
written offer, valid for at least three years and valid for as
long as you offer spare parts or customer support for that product
model, to give anyone who possesses the object code either (1) a
copy of the Corresponding Source for all the software in the
product that is covered by this License, on a durable physical
medium customarily used for software interchange, for a price no
more than your reasonable cost of physically performing this
conveying of source, or (2) access to copy the
Corresponding Source from a network server at no charge.
c) Convey individual copies of the object code with a copy of the
written offer to provide the Corresponding Source. This
alternative is allowed only occasionally and noncommercially, and
only if you received the object code with such an offer, in accord
with subsection 6b.
d) Convey the object code by offering access from a designated
place (gratis or for a charge), and offer equivalent access to the
Corresponding Source in the same way through the same place at no
further charge. You need not require recipients to copy the
Corresponding Source along with the object code. If the place to
copy the object code is a network server, the Corresponding Source
may be on a different server (operated by you or a third party)
that supports equivalent copying facilities, provided you maintain
clear directions next to the object code saying where to find the
Corresponding Source. Regardless of what server hosts the
Corresponding Source, you remain obligated to ensure that it is
available for as long as needed to satisfy these requirements.
e) Convey the object code using peer-to-peer transmission, provided
you inform other peers where the object code and Corresponding
Source of the work are being offered to the general public at no
charge under subsection 6d.
A separable portion of the object code, whose source code is excluded
from the Corresponding Source as a System Library, need not be
included in conveying the object code work.
A "User Product" is either (1) a "consumer product", which means any
tangible personal property which is normally used for personal, family,
or household purposes, or (2) anything designed or sold for incorporation
into a dwelling. In determining whether a product is a consumer product,
doubtful cases shall be resolved in favor of coverage. For a particular
product received by a particular user, "normally used" refers to a
typical or common use of that class of product, regardless of the status
of the particular user or of the way in which the particular user
actually uses, or expects or is expected to use, the product. A product
is a consumer product regardless of whether the product has substantial
commercial, industrial or non-consumer uses, unless such uses represent
the only significant mode of use of the product.
"Installation Information" for a User Product means any methods,
procedures, authorization keys, or other information required to install
and execute modified versions of a covered work in that User Product from
a modified version of its Corresponding Source. The information must
suffice to ensure that the continued functioning of the modified object
code is in no case prevented or interfered with solely because
modification has been made.
If you convey an object code work under this section in, or with, or
specifically for use in, a User Product, and the conveying occurs as
part of a transaction in which the right of possession and use of the
User Product is transferred to the recipient in perpetuity or for a
fixed term (regardless of how the transaction is characterized), the
Corresponding Source conveyed under this section must be accompanied
by the Installation Information. But this requirement does not apply
if neither you nor any third party retains the ability to install
modified object code on the User Product (for example, the work has
been installed in ROM).
The requirement to provide Installation Information does not include a
requirement to continue to provide support service, warranty, or updates
for a work that has been modified or installed by the recipient, or for
the User Product in which it has been modified or installed. Access to a
network may be denied when the modification itself materially and
adversely affects the operation of the network or violates the rules and
protocols for communication across the network.
Corresponding Source conveyed, and Installation Information provided,
in accord with this section must be in a format that is publicly
documented (and with an implementation available to the public in
source code form), and must require no special password or key for
unpacking, reading or copying.
7. Additional Terms.
"Additional permissions" are terms that supplement the terms of this
License by making exceptions from one or more of its conditions.
Additional permissions that are applicable to the entire Program shall
be treated as though they were included in this License, to the extent
that they are valid under applicable law. If additional permissions
apply only to part of the Program, that part may be used separately
under those permissions, but the entire Program remains governed by
this License without regard to the additional permissions.
When you convey a copy of a covered work, you may at your option
remove any additional permissions from that copy, or from any part of
it. (Additional permissions may be written to require their own
removal in certain cases when you modify the work.) You may place
additional permissions on material, added by you to a covered work,
for which you have or can give appropriate copyright permission.
Notwithstanding any other provision of this License, for material you
add to a covered work, you may (if authorized by the copyright holders of
that material) supplement the terms of this License with terms:
a) Disclaiming warranty or limiting liability differently from the
terms of sections 15 and 16 of this License; or
b) Requiring preservation of specified reasonable legal notices or
author attributions in that material or in the Appropriate Legal
Notices displayed by works containing it; or
c) Prohibiting misrepresentation of the origin of that material, or
requiring that modified versions of such material be marked in
reasonable ways as different from the original version; or
d) Limiting the use for publicity purposes of names of licensors or
authors of the material; or
e) Declining to grant rights under trademark law for use of some
trade names, trademarks, or service marks; or
f) Requiring indemnification of licensors and authors of that
material by anyone who conveys the material (or modified versions of
it) with contractual assumptions of liability to the recipient, for
any liability that these contractual assumptions directly impose on
those licensors and authors.
All other non-permissive additional terms are considered "further
restrictions" within the meaning of section 10. If the Program as you
received it, or any part of it, contains a notice stating that it is
governed by this License along with a term that is a further
restriction, you may remove that term. If a license document contains
a further restriction but permits relicensing or conveying under this
License, you may add to a covered work material governed by the terms
of that license document, provided that the further restriction does
not survive such relicensing or conveying.
If you add terms to a covered work in accord with this section, you
must place, in the relevant source files, a statement of the
additional terms that apply to those files, or a notice indicating
where to find the applicable terms.
Additional terms, permissive or non-permissive, may be stated in the
form of a separately written license, or stated as exceptions;
the above requirements apply either way.
8. Termination.
You may not propagate or modify a covered work except as expressly
provided under this License. Any attempt otherwise to propagate or
modify it is void, and will automatically terminate your rights under
this License (including any patent licenses granted under the third
paragraph of section 11).
However, if you cease all violation of this License, then your
license from a particular copyright holder is reinstated (a)
provisionally, unless and until the copyright holder explicitly and
finally terminates your license, and (b) permanently, if the copyright
holder fails to notify you of the violation by some reasonable means
prior to 60 days after the cessation.
Moreover, your license from a particular copyright holder is
reinstated permanently if the copyright holder notifies you of the
violation by some reasonable means, this is the first time you have
received notice of violation of this License (for any work) from that
copyright holder, and you cure the violation prior to 30 days after
your receipt of the notice.
Termination of your rights under this section does not terminate the
licenses of parties who have received copies or rights from you under
this License. If your rights have been terminated and not permanently
reinstated, you do not qualify to receive new licenses for the same
material under section 10.
9. Acceptance Not Required for Having Copies.
You are not required to accept this License in order to receive or
run a copy of the Program. Ancillary propagation of a covered work
occurring solely as a consequence of using peer-to-peer transmission
to receive a copy likewise does not require acceptance. However,
nothing other than this License grants you permission to propagate or
modify any covered work. These actions infringe copyright if you do
not accept this License. Therefore, by modifying or propagating a
covered work, you indicate your acceptance of this License to do so.
10. Automatic Licensing of Downstream Recipients.
Each time you convey a covered work, the recipient automatically
receives a license from the original licensors, to run, modify and
propagate that work, subject to this License. You are not responsible
for enforcing compliance by third parties with this License.
An "entity transaction" is a transaction transferring control of an
organization, or substantially all assets of one, or subdividing an
organization, or merging organizations. If propagation of a covered
work results from an entity transaction, each party to that
transaction who receives a copy of the work also receives whatever
licenses to the work the party's predecessor in interest had or could
give under the previous paragraph, plus a right to possession of the
Corresponding Source of the work from the predecessor in interest, if
the predecessor has it or can get it with reasonable efforts.
You may not impose any further restrictions on the exercise of the
rights granted or affirmed under this License. For example, you may
not impose a license fee, royalty, or other charge for exercise of
rights granted under this License, and you may not initiate litigation
(including a cross-claim or counterclaim in a lawsuit) alleging that
any patent claim is infringed by making, using, selling, offering for
sale, or importing the Program or any portion of it.
11. Patents.
A "contributor" is a copyright holder who authorizes use under this
License of the Program or a work on which the Program is based. The
work thus licensed is called the contributor's "contributor version".
A contributor's "essential patent claims" are all patent claims
owned or controlled by the contributor, whether already acquired or
hereafter acquired, that would be infringed by some manner, permitted
by this License, of making, using, or selling its contributor version,
but do not include claims that would be infringed only as a
consequence of further modification of the contributor version. For
purposes of this definition, "control" includes the right to grant
patent sublicenses in a manner consistent with the requirements of
this License.
Each contributor grants you a non-exclusive, worldwide, royalty-free
patent license under the contributor's essential patent claims, to
make, use, sell, offer for sale, import and otherwise run, modify and
propagate the contents of its contributor version.
In the following three paragraphs, a "patent license" is any express
agreement or commitment, however denominated, not to enforce a patent
(such as an express permission to practice a patent or covenant not to
sue for patent infringement). To "grant" such a patent license to a
party means to make such an agreement or commitment not to enforce a
patent against the party.
If you convey a covered work, knowingly relying on a patent license,
and the Corresponding Source of the work is not available for anyone
to copy, free of charge and under the terms of this License, through a
publicly available network server or other readily accessible means,
then you must either (1) cause the Corresponding Source to be so
available, or (2) arrange to deprive yourself of the benefit of the
patent license for this particular work, or (3) arrange, in a manner
consistent with the requirements of this License, to extend the patent
license to downstream recipients. "Knowingly relying" means you have
actual knowledge that, but for the patent license, your conveying the
covered work in a country, or your recipient's use of the covered work
in a country, would infringe one or more identifiable patents in that
country that you have reason to believe are valid.
If, pursuant to or in connection with a single transaction or
arrangement, you convey, or propagate by procuring conveyance of, a
covered work, and grant a patent license to some of the parties
receiving the covered work authorizing them to use, propagate, modify
or convey a specific copy of the covered work, then the patent license
you grant is automatically extended to all recipients of the covered
work and works based on it.
A patent license is "discriminatory" if it does not include within
the scope of its coverage, prohibits the exercise of, or is
conditioned on the non-exercise of one or more of the rights that are
specifically granted under this License. You may not convey a covered
work if you are a party to an arrangement with a third party that is
in the business of distributing software, under which you make payment
to the third party based on the extent of your activity of conveying
the work, and under which the third party grants, to any of the
parties who would receive the covered work from you, a discriminatory
patent license (a) in connection with copies of the covered work
conveyed by you (or copies made from those copies), or (b) primarily
for and in connection with specific products or compilations that
contain the covered work, unless you entered into that arrangement,
or that patent license was granted, prior to 28 March 2007.
Nothing in this License shall be construed as excluding or limiting
any implied license or other defenses to infringement that may
otherwise be available to you under applicable patent law.
12. No Surrender of Others' Freedom.
If conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot convey a
covered work so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you may
not convey it at all. For example, if you agree to terms that obligate you
to collect a royalty for further conveying from those to whom you convey
the Program, the only way you could satisfy both those terms and this
License would be to refrain entirely from conveying the Program.
13. Remote Network Interaction; Use with the GNU General Public License.
Notwithstanding any other provision of this License, if you modify the
Program, your modified version must prominently offer all users
interacting with it remotely through a computer network (if your version
supports such interaction) an opportunity to receive the Corresponding
Source of your version by providing access to the Corresponding Source
from a network server at no charge, through some standard or customary
means of facilitating copying of software. This Corresponding Source
shall include the Corresponding Source for any work covered by version 3
of the GNU General Public License that is incorporated pursuant to the
following paragraph.
Notwithstanding any other provision of this License, you have
permission to link or combine any covered work with a work licensed
under version 3 of the GNU General Public License into a single
combined work, and to convey the resulting work. The terms of this
License will continue to apply to the part which is the covered work,
but the work with which it is combined will remain governed by version
3 of the GNU General Public License.
14. Revised Versions of this License.
The Free Software Foundation may publish revised and/or new versions of
the GNU Affero General Public License from time to time. Such new versions
will be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the
Program specifies that a certain numbered version of the GNU Affero General
Public License "or any later version" applies to it, you have the
option of following the terms and conditions either of that numbered
version or of any later version published by the Free Software
Foundation. If the Program does not specify a version number of the
GNU Affero General Public License, you may choose any version ever published
by the Free Software Foundation.
If the Program specifies that a proxy can decide which future
versions of the GNU Affero General Public License can be used, that proxy's
public statement of acceptance of a version permanently authorizes you
to choose that version for the Program.
Later license versions may give you additional or different
permissions. However, no additional obligations are imposed on any
author or copyright holder as a result of your choosing to follow a
later version.
15. Disclaimer of Warranty.
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. Limitation of Liability.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
SUCH DAMAGES.
17. Interpretation of Sections 15 and 16.
If the disclaimer of warranty and limitation of liability provided
above cannot be given local legal effect according to their terms,
reviewing courts shall apply local law that most closely approximates
an absolute waiver of all civil liability in connection with the
Program, unless a warranty or assumption of liability accompanies a
copy of the Program in return for a fee.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
state the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
Also add information on how to contact you by electronic and paper mail.
If your software can interact with users remotely through a computer
network, you should also make sure that it provides a way for users to
get its source. For example, if your program is a web application, its
interface could display a "Source" link that leads users to an archive
of the code. There are many ways you could offer source, and different
solutions will be better for different programs; see section 13 for the
specific requirements.
You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU AGPL, see
<https://www.gnu.org/licenses/>.
```
+440
View File
@@ -0,0 +1,440 @@
---
title: "CC BY-SA 4.0"
description: "Lizenz der OPENBUREAU-Inhalte."
toc: false
showreadingtime: false
---
Die **Inhalte** (Texte, Bilder) von OPENBUREAU stehen unter Creative Commons Namensnennung Weitergabe unter gleichen Bedingungen 4.0 International.
```text
Attribution-ShareAlike 4.0 International
=======================================================================
Creative Commons Corporation ("Creative Commons") is not a law firm and
does not provide legal services or legal advice. Distribution of
Creative Commons public licenses does not create a lawyer-client or
other relationship. Creative Commons makes its licenses and related
information available on an "as-is" basis. Creative Commons gives no
warranties regarding its licenses, any material licensed under their
terms and conditions, or any related information. Creative Commons
disclaims all liability for damages resulting from their use to the
fullest extent possible.
Using Creative Commons Public Licenses
Creative Commons public licenses provide a standard set of terms and
conditions that creators and other rights holders may use to share
original works of authorship and other material subject to copyright
and certain other rights specified in the public license below. The
following considerations are for informational purposes only, are not
exhaustive, and do not form part of our licenses.
Considerations for licensors: Our public licenses are
intended for use by those authorized to give the public
permission to use material in ways otherwise restricted by
copyright and certain other rights. Our licenses are
irrevocable. Licensors should read and understand the terms
and conditions of the license they choose before applying it.
Licensors should also secure all rights necessary before
applying our licenses so that the public can reuse the
material as expected. Licensors should clearly mark any
material not subject to the license. This includes other CC-
licensed material, or material used under an exception or
limitation to copyright. More considerations for licensors:
wiki.creativecommons.org/Considerations_for_licensors
Considerations for the public: By using one of our public
licenses, a licensor grants the public permission to use the
licensed material under specified terms and conditions. If
the licensor's permission is not necessary for any reason--for
example, because of any applicable exception or limitation to
copyright--then that use is not regulated by the license. Our
licenses grant only permissions under copyright and certain
other rights that a licensor has authority to grant. Use of
the licensed material may still be restricted for other
reasons, including because others have copyright or other
rights in the material. A licensor may make special requests,
such as asking that all changes be marked or described.
Although not required by our licenses, you are encouraged to
respect those requests where reasonable. More considerations
for the public:
wiki.creativecommons.org/Considerations_for_licensees
=======================================================================
Creative Commons Attribution-ShareAlike 4.0 International Public
License
By exercising the Licensed Rights (defined below), You accept and agree
to be bound by the terms and conditions of this Creative Commons
Attribution-ShareAlike 4.0 International Public License ("Public
License"). To the extent this Public License may be interpreted as a
contract, You are granted the Licensed Rights in consideration of Your
acceptance of these terms and conditions, and the Licensor grants You
such rights in consideration of benefits the Licensor receives from
making the Licensed Material available under these terms and
conditions.
Section 1 -- Definitions.
a. Adapted Material means material subject to Copyright and Similar
Rights that is derived from or based upon the Licensed Material
and in which the Licensed Material is translated, altered,
arranged, transformed, or otherwise modified in a manner requiring
permission under the Copyright and Similar Rights held by the
Licensor. For purposes of this Public License, where the Licensed
Material is a musical work, performance, or sound recording,
Adapted Material is always produced where the Licensed Material is
synched in timed relation with a moving image.
b. Adapter's License means the license You apply to Your Copyright
and Similar Rights in Your contributions to Adapted Material in
accordance with the terms and conditions of this Public License.
c. BY-SA Compatible License means a license listed at
creativecommons.org/compatiblelicenses, approved by Creative
Commons as essentially the equivalent of this Public License.
d. Copyright and Similar Rights means copyright and/or similar rights
closely related to copyright including, without limitation,
performance, broadcast, sound recording, and Sui Generis Database
Rights, without regard to how the rights are labeled or
categorized. For purposes of this Public License, the rights
specified in Section 2(b)(1)-(2) are not Copyright and Similar
Rights.
e. Effective Technological Measures means those measures that, in the
absence of proper authority, may not be circumvented under laws
fulfilling obligations under Article 11 of the WIPO Copyright
Treaty adopted on December 20, 1996, and/or similar international
agreements.
f. Exceptions and Limitations means fair use, fair dealing, and/or
any other exception or limitation to Copyright and Similar Rights
that applies to Your use of the Licensed Material.
g. License Elements means the license attributes listed in the name
of a Creative Commons Public License. The License Elements of this
Public License are Attribution and ShareAlike.
h. Licensed Material means the artistic or literary work, database,
or other material to which the Licensor applied this Public
License.
i. Licensed Rights means the rights granted to You subject to the
terms and conditions of this Public License, which are limited to
all Copyright and Similar Rights that apply to Your use of the
Licensed Material and that the Licensor has authority to license.
j. Licensor means the individual(s) or entity(ies) granting rights
under this Public License.
k. Share means to provide material to the public by any means or
process that requires permission under the Licensed Rights, such
as reproduction, public display, public performance, distribution,
dissemination, communication, or importation, and to make material
available to the public including in ways that members of the
public may access the material from a place and at a time
individually chosen by them.
l. Sui Generis Database Rights means rights other than copyright
resulting from Directive 96/9/EC of the European Parliament and of
the Council of 11 March 1996 on the legal protection of databases,
as amended and/or succeeded, as well as other essentially
equivalent rights anywhere in the world.
m. You means the individual or entity exercising the Licensed Rights
under this Public License. Your has a corresponding meaning.
Section 2 -- Scope.
a. License grant.
1. Subject to the terms and conditions of this Public License,
the Licensor hereby grants You a worldwide, royalty-free,
non-sublicensable, non-exclusive, irrevocable license to
exercise the Licensed Rights in the Licensed Material to:
a. reproduce and Share the Licensed Material, in whole or
in part; and
b. produce, reproduce, and Share Adapted Material.
2. Exceptions and Limitations. For the avoidance of doubt, where
Exceptions and Limitations apply to Your use, this Public
License does not apply, and You do not need to comply with
its terms and conditions.
3. Term. The term of this Public License is specified in Section
6(a).
4. Media and formats; technical modifications allowed. The
Licensor authorizes You to exercise the Licensed Rights in
all media and formats whether now known or hereafter created,
and to make technical modifications necessary to do so. The
Licensor waives and/or agrees not to assert any right or
authority to forbid You from making technical modifications
necessary to exercise the Licensed Rights, including
technical modifications necessary to circumvent Effective
Technological Measures. For purposes of this Public License,
simply making modifications authorized by this Section 2(a)
(4) never produces Adapted Material.
5. Downstream recipients.
a. Offer from the Licensor -- Licensed Material. Every
recipient of the Licensed Material automatically
receives an offer from the Licensor to exercise the
Licensed Rights under the terms and conditions of this
Public License.
b. Additional offer from the Licensor -- Adapted Material.
Every recipient of Adapted Material from You
automatically receives an offer from the Licensor to
exercise the Licensed Rights in the Adapted Material
under the conditions of the Adapter's License You apply.
c. No downstream restrictions. You may not offer or impose
any additional or different terms or conditions on, or
apply any Effective Technological Measures to, the
Licensed Material if doing so restricts exercise of the
Licensed Rights by any recipient of the Licensed
Material.
6. No endorsement. Nothing in this Public License constitutes or
may be construed as permission to assert or imply that You
are, or that Your use of the Licensed Material is, connected
with, or sponsored, endorsed, or granted official status by,
the Licensor or others designated to receive attribution as
provided in Section 3(a)(1)(A)(i).
b. Other rights.
1. Moral rights, such as the right of integrity, are not
licensed under this Public License, nor are publicity,
privacy, and/or other similar personality rights; however, to
the extent possible, the Licensor waives and/or agrees not to
assert any such rights held by the Licensor to the limited
extent necessary to allow You to exercise the Licensed
Rights, but not otherwise.
2. Patent and trademark rights are not licensed under this
Public License.
3. To the extent possible, the Licensor waives any right to
collect royalties from You for the exercise of the Licensed
Rights, whether directly or through a collecting society
under any voluntary or waivable statutory or compulsory
licensing scheme. In all other cases the Licensor expressly
reserves any right to collect such royalties.
Section 3 -- License Conditions.
Your exercise of the Licensed Rights is expressly made subject to the
following conditions.
a. Attribution.
1. If You Share the Licensed Material (including in modified
form), You must:
a. retain the following if it is supplied by the Licensor
with the Licensed Material:
i. identification of the creator(s) of the Licensed
Material and any others designated to receive
attribution, in any reasonable manner requested by
the Licensor (including by pseudonym if
designated);
ii. a copyright notice;
iii. a notice that refers to this Public License;
iv. a notice that refers to the disclaimer of
warranties;
v. a URI or hyperlink to the Licensed Material to the
extent reasonably practicable;
b. indicate if You modified the Licensed Material and
retain an indication of any previous modifications; and
c. indicate the Licensed Material is licensed under this
Public License, and include the text of, or the URI or
hyperlink to, this Public License.
2. You may satisfy the conditions in Section 3(a)(1) in any
reasonable manner based on the medium, means, and context in
which You Share the Licensed Material. For example, it may be
reasonable to satisfy the conditions by providing a URI or
hyperlink to a resource that includes the required
information.
3. If requested by the Licensor, You must remove any of the
information required by Section 3(a)(1)(A) to the extent
reasonably practicable.
b. ShareAlike.
In addition to the conditions in Section 3(a), if You Share
Adapted Material You produce, the following conditions also apply.
1. The Adapter's License You apply must be a Creative Commons
license with the same License Elements, this version or
later, or a BY-SA Compatible License.
2. You must include the text of, or the URI or hyperlink to, the
Adapter's License You apply. You may satisfy this condition
in any reasonable manner based on the medium, means, and
context in which You Share Adapted Material.
3. You may not offer or impose any additional or different terms
or conditions on, or apply any Effective Technological
Measures to, Adapted Material that restrict exercise of the
rights granted under the Adapter's License You apply.
Section 4 -- Sui Generis Database Rights.
Where the Licensed Rights include Sui Generis Database Rights that
apply to Your use of the Licensed Material:
a. for the avoidance of doubt, Section 2(a)(1) grants You the right
to extract, reuse, reproduce, and Share all or a substantial
portion of the contents of the database;
b. if You include all or a substantial portion of the database
contents in a database in which You have Sui Generis Database
Rights, then the database in which You have Sui Generis Database
Rights (but not its individual contents) is Adapted Material,
including for purposes of Section 3(b); and
c. You must comply with the conditions in Section 3(a) if You Share
all or a substantial portion of the contents of the database.
For the avoidance of doubt, this Section 4 supplements and does not
replace Your obligations under this Public License where the Licensed
Rights include other Copyright and Similar Rights.
Section 5 -- Disclaimer of Warranties and Limitation of Liability.
a. UNLESS OTHERWISE SEPARATELY UNDERTAKEN BY THE LICENSOR, TO THE
EXTENT POSSIBLE, THE LICENSOR OFFERS THE LICENSED MATERIAL AS-IS
AND AS-AVAILABLE, AND MAKES NO REPRESENTATIONS OR WARRANTIES OF
ANY KIND CONCERNING THE LICENSED MATERIAL, WHETHER EXPRESS,
IMPLIED, STATUTORY, OR OTHER. THIS INCLUDES, WITHOUT LIMITATION,
WARRANTIES OF TITLE, MERCHANTABILITY, FITNESS FOR A PARTICULAR
PURPOSE, NON-INFRINGEMENT, ABSENCE OF LATENT OR OTHER DEFECTS,
ACCURACY, OR THE PRESENCE OR ABSENCE OF ERRORS, WHETHER OR NOT
KNOWN OR DISCOVERABLE. WHERE DISCLAIMERS OF WARRANTIES ARE NOT
ALLOWED IN FULL OR IN PART, THIS DISCLAIMER MAY NOT APPLY TO YOU.
b. TO THE EXTENT POSSIBLE, IN NO EVENT WILL THE LICENSOR BE LIABLE
TO YOU ON ANY LEGAL THEORY (INCLUDING, WITHOUT LIMITATION,
NEGLIGENCE) OR OTHERWISE FOR ANY DIRECT, SPECIAL, INDIRECT,
INCIDENTAL, CONSEQUENTIAL, PUNITIVE, EXEMPLARY, OR OTHER LOSSES,
COSTS, EXPENSES, OR DAMAGES ARISING OUT OF THIS PUBLIC LICENSE OR
USE OF THE LICENSED MATERIAL, EVEN IF THE LICENSOR HAS BEEN
ADVISED OF THE POSSIBILITY OF SUCH LOSSES, COSTS, EXPENSES, OR
DAMAGES. WHERE A LIMITATION OF LIABILITY IS NOT ALLOWED IN FULL OR
IN PART, THIS LIMITATION MAY NOT APPLY TO YOU.
c. The disclaimer of warranties and limitation of liability provided
above shall be interpreted in a manner that, to the extent
possible, most closely approximates an absolute disclaimer and
waiver of all liability.
Section 6 -- Term and Termination.
a. This Public License applies for the term of the Copyright and
Similar Rights licensed here. However, if You fail to comply with
this Public License, then Your rights under this Public License
terminate automatically.
b. Where Your right to use the Licensed Material has terminated under
Section 6(a), it reinstates:
1. automatically as of the date the violation is cured, provided
it is cured within 30 days of Your discovery of the
violation; or
2. upon express reinstatement by the Licensor.
For the avoidance of doubt, this Section 6(b) does not affect any
right the Licensor may have to seek remedies for Your violations
of this Public License.
c. For the avoidance of doubt, the Licensor may also offer the
Licensed Material under separate terms or conditions or stop
distributing the Licensed Material at any time; however, doing so
will not terminate this Public License.
d. Sections 1, 5, 6, 7, and 8 survive termination of this Public
License.
Section 7 -- Other Terms and Conditions.
a. The Licensor shall not be bound by any additional or different
terms or conditions communicated by You unless expressly agreed.
b. Any arrangements, understandings, or agreements regarding the
Licensed Material not stated herein are separate from and
independent of the terms and conditions of this Public License.
Section 8 -- Interpretation.
a. For the avoidance of doubt, this Public License does not, and
shall not be interpreted to, reduce, limit, restrict, or impose
conditions on any use of the Licensed Material that could lawfully
be made without permission under this Public License.
b. To the extent possible, if any provision of this Public License is
deemed unenforceable, it shall be automatically reformed to the
minimum extent necessary to make it enforceable. If the provision
cannot be reformed, it shall be severed from this Public License
without affecting the enforceability of the remaining terms and
conditions.
c. No term or condition of this Public License will be waived and no
failure to comply consented to unless expressly agreed to by the
Licensor.
d. Nothing in this Public License constitutes or may be interpreted
as a limitation upon, or waiver of, any privileges and immunities
that apply to the Licensor or You, including from the legal
processes of any jurisdiction or authority.
=======================================================================
Creative Commons is not a party to its public
licenses. Notwithstanding, Creative Commons may elect to apply one of
its public licenses to material it publishes and in those instances
will be considered the “Licensor.” The text of the Creative Commons
public licenses is dedicated to the public domain under the CC0 Public
Domain Dedication. Except for the limited purpose of indicating that
material is shared under a Creative Commons public license or as
otherwise permitted by the Creative Commons policies published at
creativecommons.org/policies, Creative Commons does not authorize the
use of the trademark "Creative Commons" or any other trademark or logo
of Creative Commons without its prior written consent including,
without limitation, in connection with any unauthorized modifications
to any of its public licenses or any other arrangements,
understandings, or agreements concerning use of licensed material. For
the avoidance of doubt, this paragraph does not form part of the
public licenses.
Creative Commons may be contacted at creativecommons.org.
```
+20
View File
@@ -0,0 +1,20 @@
---
title: "Spenden"
description: "OPENBUREAU unterstützen."
toc: false
showreadingtime: false
---
![OPENBUREAU](/logo/LOGO-OB.svg)
OPENBUREAU ist komplett Open Source — kein Abo, keine Werbung, keine Tracker. Die ganze Seite und alle Inhalte liegen offen.
Mit einer Spende hilfst du, das am Laufen zu halten und auszubauen:
- **Hosting & Domain** — der Server in Luzern, auf dem alles läuft
- **Werkzeuge** — Zeit, um Programme wie DOSSIER und RAPPORT weiterzuentwickeln und offen zu teilen
- **Inhalte** — neue Texte, Recherche und Pflege der Bibliothek
Kein Druck, kein Muss — auch ein Hallo oder eine Wortmeldung im [Dialog](/dialog/) zählt.
*(Konkrete Spendenmöglichkeit folgt hier in Kürze — Twint/PayPal/Ko-fi.)*
+4 -1
View File
@@ -76,13 +76,16 @@ menus:
pageRef: /dialog
weight: 40
- name: CODE
url: https://gitea.kgva.ch
url: https://git.openbureau.ch
weight: 50
params:
# Öffentliche Gitea-Repo-URL (für Provenance: Version → Commit, Verlauf).
repoURL: "https://git.openbureau.ch/karim/OPENBUREAU"
author:
name: "Karim Gabriele Varano"
email: "karim@gabrielevarano.ch"
url: "https://gabrielevarano.ch"
showreadingtime: true
showlastmod: true
comments: false
+10 -10
View File
@@ -6,22 +6,22 @@
<head>
{{ partial "head.html" . }}
</head>
<body>
<body{{ if .IsHome }} class="is-home"{{ end }}>
<a href="#main-content" class="skip-link">Skip to content</a>
<header role="banner" class="site-header">
<a href="{{ "/" | relURL }}" class="wordmark-link" aria-label="openbureau">
<span class="wordmark-text">openbureau</span>
</a>
<a href="{{ "/" | relURL }}" class="wordmark-link" aria-label="openbureau"></a>
<nav class="site-nav" aria-label="Site">
{{ partial "menu.html" (dict "menuID" "main" "page" .) }}
</nav>
</header>
<main id="main-content" role="main">{{ block "main" . }}{{ end }}</main>
{{ if not .IsHome }}
<nav class="page-foot-nav" aria-label="Breadcrumb">
{{ partial "header.html" . }}
</nav>
{{ end }}
<main id="main-content" role="main">
{{ block "main" . }}{{ end }}
{{ if not .IsHome }}
<nav class="page-foot-nav" aria-label="Breadcrumb">
{{ partial "header.html" . }}
</nav>
{{ end }}
</main>
<footer role="contentinfo">{{ partial "footer.html" . }}</footer>
</body>
</html>
+41 -40
View File
@@ -15,30 +15,34 @@
{{ with .Params.summary }}
<p class="single-summary">{{ . }}</p>
{{ end }}
{{ $author := .Params.author | default site.Params.author.name }}
{{ $aslug := urlize $author }}
{{ if not .Params.author }}{{ with index site.Data.authors site.Params.author.email }}{{ with .slug }}{{ $aslug = . }}{{ end }}{{ end }}{{ end }}
{{ $authorPage := and (ne $aslug "") (site.GetPage (printf "/authors/%s" $aslug)) }}
{{ if or $author .Date }}
<p class="single-byline">
{{- with $author -}}
{{- if $authorPage -}}<a class="byline-author" href="{{ $authorPage.RelPermalink }}">{{ . }}</a>
{{- else -}}<span class="byline-author">{{ . }}</span>{{- end -}}
{{- end -}}
{{- if and $author .Date -}}, {{ end -}}
{{- if .Date -}}<time class="byline-date" datetime="{{ .Date.Format "2006-01-02" }}">{{ .Date.Format "02.01.2006" }}</time>{{- end -}}
</p>
{{ end }}
{{/* Byline + Meta nur bei Library-Beiträgen — Seiten wie Manifest,
Kontakt, Spenden brauchen weder Autor noch „Aktualisiert am". */}}
{{ if eq .Section "library" }}
{{ $author := .Params.author | default site.Params.author.name }}
{{ $aslug := urlize $author }}
{{ if not .Params.author }}{{ with index site.Data.authors site.Params.author.email }}{{ with .slug }}{{ $aslug = . }}{{ end }}{{ end }}{{ end }}
{{ $authorPage := and (ne $aslug "") (site.GetPage (printf "/authors/%s" $aslug)) }}
{{ if or $author .Date }}
<p class="single-byline">
{{- with $author -}}
{{- if $authorPage -}}<a class="byline-author" href="{{ $authorPage.RelPermalink }}">{{ . }}</a>
{{- else -}}<span class="byline-author">{{ . }}</span>{{- end -}}
{{- end -}}
{{- if and $author .Date -}}, {{ end -}}
{{- if .Date -}}<time class="byline-date" datetime="{{ .Date.Format "2006-01-02" }}">{{ .Date.Format "02.01.2006" }}</time>{{- end -}}
</p>
{{ end }}
{{/* Reading time + last-modified — Republik-style, directly below byline */}}
{{ $showReadingTime := .Params.showreadingtime | default site.Params.showreadingtime | default true }}
{{ $showLastMod := .Params.showlastmod | default site.Params.showlastmod | default false }}
{{ $hasLastmod := and $showLastMod .Lastmod (ne (.Lastmod.Format "2006-01-02") (.Date.Format "2006-01-02")) }}
{{ if or (and $showReadingTime .ReadingTime) $hasLastmod }}
<p class="single-meta">
{{ if and $showReadingTime .ReadingTime }}<span class="reading-time">{{ .ReadingTime }} min Lesezeit</span>{{ end }}
{{ if $hasLastmod }}{{ if and $showReadingTime .ReadingTime }} · {{ end }}<span class="lastmod">Aktualisiert am {{ .Lastmod.Format "02.01.2006" }}</span>{{ end }}
</p>
{{/* Reading time + last-modified — Republik-style, directly below byline */}}
{{ $showReadingTime := .Params.showreadingtime | default site.Params.showreadingtime | default true }}
{{ $showLastMod := .Params.showlastmod | default site.Params.showlastmod | default false }}
{{ $hasLastmod := and $showLastMod .Lastmod (ne (.Lastmod.Format "2006-01-02") (.Date.Format "2006-01-02")) }}
{{ if or (and $showReadingTime .ReadingTime) $hasLastmod }}
<p class="single-meta">
{{ if and $showReadingTime .ReadingTime }}<span class="reading-time">{{ .ReadingTime }} min Lesezeit</span>{{ end }}
{{ if $hasLastmod }}{{ if and $showReadingTime .ReadingTime }} · {{ end }}<span class="lastmod">Aktualisiert am {{ .Lastmod.Format "02.01.2006" }}</span>{{ end }}
</p>
{{ end }}
{{ end }}
</header>
@@ -56,24 +60,21 @@
{{ .Content }}
</div>
{{/* Tags as small pills at the bottom — Republik-style, no hash symbol */}}
{{- with .Params.tags }}
<ul class="tag-pills" aria-label="Tags">
{{- range . -}}<li><a href="/tags/{{ . | urlize }}/">{{ . }}</a></li>{{- end -}}
</ul>
{{- end }}
{{/* Tags: bei Seiten (nicht-Library) wie bisher unter dem Text. Bei Library
wandern sie in die Aktionsreihe (rechts neben Dialog) im Partial. */}}
{{ if ne .Section "library" }}
{{- with .Params.tags }}
<ul class="tag-pills" aria-label="Tags">
{{- range . -}}<li><a href="/tags/{{ . | urlize }}/">{{ . }}</a></li>{{- end -}}
</ul>
{{- end }}
{{ end }}
{{/* Dialog liegt auf eigener Seiteder Beitrag bleibt sauber */}}
<a class="dialog-link" id="dialog-link" data-thread="{{ .RelPermalink }}" href="/dialog/?thread={{ .RelPermalink }}">→ Dialog</a>
<script>
(function () {
var l = document.getElementById('dialog-link'); if (!l) return;
fetch('/api/comments?thread=' + encodeURIComponent(l.dataset.thread))
.then(function (r) { return r.ok ? r.json() : []; })
.then(function (d) { var n = d.filter(function (c) { return !c.deleted; }).length; if (n) l.textContent = '→ Dialog · ' + n; })
.catch(function () {});
})();
</script>
{{/* Artikel-Fuß (zitieren, Dialog, Tags, Versionen)nur bei Library. */}}
{{ if eq .Section "library" }}
{{ partial "provenance.html" . }}
<script src="/version-history.js"></script>
{{ end }}
</article>
{{ end }}
+15 -14
View File
@@ -1,17 +1,18 @@
<div class="footer-grid">
<div class="footer-mark">OPENBUREAU</div>
<nav class="footer-nav" aria-label="Footer">
<ul>
<li><a href="/manifest/">Manifest</a></li>
<li><a href="/colophon/">Colophon</a></li>
<li><a href="/dialog/">Dialog</a></li>
<li><a href="https://gitea.kgva.ch">Code ↗</a></li>
<li><a href="/index.xml">RSS</a></li>
</ul>
<div class="footer-legal">
<p class="footer-licenses">
Code <a href="/lizenz/agpl-3.0/">AGPL-3.0</a>
· Inhalte <a href="/lizenz/cc-by-sa-4.0/">CC BY-SA 4.0</a>
</p>
<p class="footer-hosted">
{{ with site.Params.author.url }}<a href="{{ . }}">Hosted in Lucerne</a>{{ else }}Hosted in Lucerne{{ end }}
</p>
</div>
<nav class="footer-links" aria-label="Footer">
<a href="/colophon/">Colophon</a>
<a href="/impressum/">Kontakt / Impressum</a>
<a href="/datenschutz/">Datenschutz</a>
<a href="/index.xml">RSS</a>
<a href="/spenden/">Spenden</a>
</nav>
<p class="footer-tagline">
Sammlung, Plattform, Praxis.<br>
Texte unter <a href="https://creativecommons.org/licenses/by-sa/4.0/">CC BY-SA 4.0</a>.
</p>
<p class="footer-credit">© {{ now.Year }} · Karim Gabriele Varano</p>
</div>
+33
View File
@@ -0,0 +1,33 @@
{{/* Eine Journal-Karte. Kontext (.) = die Library-Seite. */}}
{{ $section := "" }}
{{ with .Parent }}{{ $section = path.Base .RelPermalink }}{{ end }}
{{ $author := .Params.author | default site.Params.author.name }}
{{ $cover := .Params.cover_image }}
{{ $layout := .Params.layout }}
{{ if not $layout }}{{ $layout = cond (ne $cover nil) "image" "text" }}{{ end }}
<li class="journal-entry journal-entry--layout-{{ $layout }}"
data-section="{{ $section }}"
{{ with .Params.color }}data-color="{{ . }}"{{ end }}>
<a class="journal-entry-link" href="{{ .RelPermalink }}">
{{ if and $cover (eq $layout "image") }}
<img class="journal-bg-image" src="{{ $cover | relURL }}" alt="" loading="eager" />
{{ end }}
<div class="journal-entry-body">
{{ if and $cover (eq $layout "icon") }}
<img class="journal-icon-image" src="{{ $cover | relURL }}" alt="" loading="lazy" />
{{ end }}
{{ with .Parent }}
<p class="journal-rubric"><span class="journal-section">{{ .Title }}</span></p>
{{ end }}
<h3 class="journal-title">{{ .LinkTitle }}</h3>
{{ with .Params.summary }}
<p class="journal-summary">{{ . }}</p>
{{ end }}
<p class="journal-byline">
{{- with $author -}}<span class="journal-author">{{ . }}</span>{{- end -}}
{{- if and $author .Date -}}, {{ end -}}
<time class="journal-date" datetime="{{ .Date.Format "2006-01-02" }}">{{ .Date.Format "02.01.2006" }}</time>
</p>
</div>
</a>
</li>
+117
View File
@@ -0,0 +1,117 @@
{{/* Artikel-Fuß für Library-Beiträge: Quellenangabe (zitieren), Aktionsreihe
(Dialog links, Tags rechts) und der Versionsverlauf (eine Zeile darunter). */}}
{{ $author := .Params.author | default site.Params.author.name }}
{{/* Zitieren: schlichter Link direkt unter den Quellen. */}}
<div class="cite">
<button type="button" class="cite-toggle" aria-expanded="false">zitieren <span class="cite-arrow"></span></button>
<div class="cite-box" hidden
data-title="{{ .Title }}"
data-author="{{ $author }}"
data-url="{{ .Permalink }}"
data-year="{{ .Date.Format "2006" }}"
{{ with .GitInfo }}data-version="{{ .AbbreviatedHash }}"{{ end }}>
<p class="cite-text"></p>
<div class="cite-actions">
<button type="button" class="cite-fmt is-active" data-fmt="ob">intern</button>
<button type="button" class="cite-fmt" data-fmt="apa">APA</button>
<button type="button" class="cite-fmt" data-fmt="din">DIN</button>
<button type="button" class="cite-copy">kopieren</button>
<span class="cite-status" role="status"></span>
</div>
</div>
</div>
{{/* Aktionsreihe: Dialog links, Tags ganz rechts. */}}
<div class="article-actions">
<a class="prov-dialog" id="dialog-link" data-thread="{{ .RelPermalink }}" href="/dialog/?thread={{ .RelPermalink }}">→ Dialog</a>
{{ with .Params.tags }}
<ul class="tag-pills" aria-label="Tags">
{{- range . -}}<li><a href="/tags/{{ . | urlize }}/">{{ . }}</a></li>{{- end -}}
</ul>
{{ end }}
</div>
{{/* Versionen: eine Zeile darunter; öffnet den Verlauf direkt auf der Seite. */}}
<div class="article-versions">
<button type="button" class="versions-toggle" id="version-badge" aria-expanded="false"
data-path="{{ .File.Path }}"><svg class="pill-icon" viewBox="0 0 24 24" width="14" height="14" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><circle cx="12" cy="12" r="9"/><path d="M12 7.5V12l3 2"/></svg>Versionen</button>
</div>
<script>
/* Zitieren: APA/DIN umschaltbar, gesamthaft kopierbar. */
(function () {
if (window.__cite) return; window.__cite = 1;
var toggle = document.querySelector('.cite-toggle');
var box = document.querySelector('.cite-box');
if (!toggle || !box) return;
var textEl = box.querySelector('.cite-text');
var statusEl = box.querySelector('.cite-status');
var d = box.dataset;
var fmt = 'ob';
function nameParts(n) {
var p = (n || '').trim().split(/\s+/);
var last = p.pop() || '';
return { last: last, first: p.join(' '), initials: p.map(function (w) { return w.charAt(0) + '.'; }).join(' ') };
}
function today() { return new Date().toLocaleDateString('de-CH'); }
function build() {
var n = nameParts(d.author);
if (fmt === 'din') {
return (n.last ? n.last.toUpperCase() + ', ' + n.first + ': ' : '')
+ d.title + '. OPENBUREAU. ' + d.url + ' (abgerufen am ' + today() + ').';
}
if (fmt === 'apa') {
return (n.last ? n.last + ', ' + n.initials + ' ' : '')
+ '(' + d.year + '). ' + d.title + '. OPENBUREAU. Abgerufen am ' + today() + ', von ' + d.url;
}
// intern (OPENBUREAU-Hausformat): inkl. Version, weil Beiträge lebende Dokumente sind.
return (d.author ? d.author + ': ' : '') + d.title + '. OPENBUREAU'
+ (d.version ? ', Version ' + d.version : '') + '. Abgerufen am ' + today() + ', ' + d.url;
}
function render() { textEl.textContent = build(); }
function copy() {
var t = build();
if (navigator.clipboard && navigator.clipboard.writeText) return navigator.clipboard.writeText(t);
return new Promise(function (res, rej) {
try {
var ta = document.createElement('textarea'); ta.value = t; ta.style.position = 'fixed'; ta.style.opacity = '0';
document.body.appendChild(ta); ta.select();
var ok = document.execCommand('copy'); document.body.removeChild(ta); ok ? res() : rej();
} catch (e) { rej(e); }
});
}
toggle.addEventListener('click', function () {
var open = box.hasAttribute('hidden');
if (open) { box.removeAttribute('hidden'); render(); } else { box.setAttribute('hidden', ''); }
toggle.setAttribute('aria-expanded', String(open));
});
box.querySelectorAll('.cite-fmt').forEach(function (b) {
b.addEventListener('click', function () {
fmt = b.dataset.fmt;
box.querySelectorAll('.cite-fmt').forEach(function (x) { x.classList.toggle('is-active', x === b); });
render();
});
});
box.querySelector('.cite-copy').addEventListener('click', function () {
copy().then(function () { statusEl.textContent = 'kopiert ✓'; })
.catch(function () {
statusEl.textContent = 'markieren & kopieren';
var r = document.createRange(); r.selectNodeContents(textEl);
var s = window.getSelection(); s.removeAllRanges(); s.addRange(r);
});
setTimeout(function () { statusEl.textContent = ''; }, 2500);
});
})();
</script>
<script>
/* Wortmeldungs-Zahl an die Dialog-Pill hängen (→ Dialog · 3). */
(function () {
var l = document.getElementById('dialog-link'); if (!l) return;
fetch('/api/comments?thread=' + encodeURIComponent(l.dataset.thread))
.then(function (r) { return r.ok ? r.json() : []; })
.then(function (d) { var n = d.filter(function (c) { return !c.deleted; }).length; if (n) l.textContent = '→ Dialog · ' + n; })
.catch(function () {});
})();
</script>
+10 -41
View File
@@ -10,47 +10,16 @@
<p class="text-muted">Was zuletzt geschrieben wurde.</p>
</header>
<ol class="journal-list">
{{ range $journal }}
{{ $section := "" }}
{{ with .Parent }}{{ $section = path.Base .RelPermalink }}{{ end }}
{{ $author := .Params.author | default site.Params.author.name }}
{{ $cover := .Params.cover_image }}
{{/* Layout: explicit `layout:` in front matter, else derive:
- cover_image present → image
- none → text */}}
{{ $layout := .Params.layout }}
{{ if not $layout }}
{{ $layout = cond (ne $cover nil) "image" "text" }}
{{ end }}
<li class="journal-entry journal-entry--layout-{{ $layout }}"
data-section="{{ $section }}"
{{ with .Params.color }}data-color="{{ . }}"{{ end }}>
<a class="journal-entry-link" href="{{ .RelPermalink }}">
{{ if and $cover (eq $layout "image") }}
<img class="journal-bg-image" src="{{ $cover | relURL }}" alt="" loading="eager" />
{{ end }}
<div class="journal-entry-body">
{{ if and $cover (eq $layout "icon") }}
<img class="journal-icon-image" src="{{ $cover | relURL }}" alt="" loading="lazy" />
{{ end }}
{{ with .Parent }}
<p class="journal-rubric"><span class="journal-section">{{ .Title }}</span></p>
{{ end }}
<h3 class="journal-title">{{ .LinkTitle }}</h3>
{{ with .Params.summary }}
<p class="journal-summary">{{ . }}</p>
{{ end }}
<p class="journal-byline">
{{- with $author -}}<span class="journal-author">{{ . }}</span>{{- end -}}
{{- if and $author .Date -}}, {{ end -}}
<time class="journal-date" datetime="{{ .Date.Format "2006-01-02" }}">{{ .Date.Format "02.01.2006" }}</time>
</p>
</div>
</a>
</li>
{{ end }}
</ol>
{{/* Zwei eigenständig scrollbare Spalten: Einträge abwechselnd verteilt
(gerade Indizes links, ungerade rechts) → Lese-Reihenfolge links-rechts. */}}
<div class="journal-cols">
<ol class="journal-list">
{{ range $i, $e := $journal }}{{ if eq (mod $i 2) 0 }}{{ partial "journal-card.html" $e }}{{ end }}{{ end }}
</ol>
<ol class="journal-list">
{{ range $i, $e := $journal }}{{ if eq (mod $i 2) 1 }}{{ partial "journal-card.html" $e }}{{ end }}{{ end }}
</ol>
</div>
{{ if gt (len $library) 20 }}
<p class="more"><a href="/library/">→ Alle Beiträge in der Library</a></p>
+32 -13
View File
@@ -28,6 +28,11 @@
if (s < 86400) return Math.floor(s / 3600) + ' Std.';
return d.toLocaleDateString('de-CH');
}
// Volles Datum + Uhrzeit (für die Wortmeldungen in der Thread-Ansicht).
function fmtFull(ts) {
const d = new Date(ts);
return d.toLocaleDateString('de-CH') + ' · ' + d.toLocaleTimeString('de-CH', { hour: '2-digit', minute: '2-digit' });
}
const api = (p, opt) => fetch(p, opt).then(async (r) => ({ ok: r.ok, status: r.status, body: await r.json().catch(() => ({})) }));
const authHdr = () => ({ Authorization: 'Bearer ' + token });
@@ -115,7 +120,7 @@
// ── Forum-Ansicht: Threads + neuer Thread ─────────────────────────────────
function renderForum(slug) {
root.innerHTML = '';
if (ctxEl) { ctxEl.innerHTML = ''; const b = el('a', null, '← Dialoge'); b.href = '/dialog/'; ctxEl.appendChild(b); }
if (ctxEl) { ctxEl.innerHTML = ''; const c = el('nav', 'dialog-crumb'); const b = el('a', null, '← Dialoge'); b.href = '/dialog/'; c.appendChild(b); ctxEl.appendChild(c); }
api('/api/forums/' + encodeURIComponent(slug)).then((r) => {
if (!r.ok) { root.appendChild(el('p', 'dialog-empty', 'Forum nicht gefunden.')); return; }
const { forum, threads } = r.body;
@@ -192,9 +197,19 @@
const m = r.body; title.textContent = m.title || 'Dialog'; locked = m.locked;
if (ctxEl) {
ctxEl.innerHTML = '';
const back = el('a', null, m.kind === 'library' ? '← zum Beitrag' : (m.forum ? '← ' + m.forum.name : '← Dialoge'));
back.href = m.kind === 'library' ? m.url : (m.forum ? '/dialog/?forum=' + encodeURIComponent(m.forum.slug) : '/dialog/');
ctxEl.appendChild(back);
if (m.kind === 'library') {
const back = el('a', null, '← zum Beitrag'); back.href = m.url; ctxEl.appendChild(back);
} else {
// Breadcrumb-Navigation oben: Dialoge Forum (beide anklickbar).
const crumb = el('nav', 'dialog-crumb');
const a0 = el('a', null, 'Dialoge'); a0.href = '/dialog/'; crumb.appendChild(a0);
if (m.forum) {
crumb.appendChild(el('span', 'dialog-crumb-sep', ''));
const a1 = el('a', null, m.forum.name); a1.href = '/dialog/?forum=' + encodeURIComponent(m.forum.slug);
crumb.appendChild(a1);
}
ctxEl.appendChild(crumb);
}
}
renderModbar(); renderComposer();
});
@@ -230,23 +245,27 @@
const names = {}; data.forEach((c) => { names[c.id] = c.author_name; });
if (!data.length) { list.appendChild(el('p', 'dialog-empty', 'Noch keine Wortmeldungen — beginne den Dialog.')); return; }
data.forEach((c) => {
const card = el('article', 'dialog-card');
const head = el('header', 'dialog-card-head');
// Nüchtern: Avatar · Name (+ Position) · darunter Datum/Uhrzeit · Text.
const post = el('article', 'dialog-post');
const head = el('header', 'dialog-post-head');
const av = el('span', 'dialog-avatar');
if (c.author_avatar) av.style.backgroundImage = 'url(' + c.author_avatar + ')';
else av.textContent = (c.author_name || '?').slice(0, 1).toUpperCase();
const meta = el('div', 'dialog-meta');
meta.append(el('span', 'dialog-name', c.author_name || 'Unbekannt'), el('time', 'dialog-time', fmt(c.created_at)));
if (c.parent_id && names[c.parent_id]) meta.appendChild(el('span', 'dialog-replyto', '↳ ' + names[c.parent_id]));
head.append(av, meta); card.appendChild(head);
card.appendChild(el('div', 'dialog-body', c.body));
const ident = el('div', 'dialog-ident');
const nameline = el('div', 'dialog-nameline');
nameline.appendChild(el('span', 'dialog-name', c.author_name || 'Unbekannt'));
if (c.author_role) nameline.appendChild(el('span', 'dialog-pos', c.author_role));
if (c.parent_id && names[c.parent_id]) nameline.appendChild(el('span', 'dialog-replyto', '↳ ' + names[c.parent_id]));
ident.append(nameline, el('time', 'dialog-time', fmtFull(c.created_at)));
head.append(av, ident); post.appendChild(head);
post.appendChild(el('div', 'dialog-body', c.body));
if (token && !c.deleted) {
const actions = el('div', 'dialog-actions');
if (!locked) { const rep = el('button', null, 'Antworten'); rep.onclick = () => { replyTo = { id: c.id, name: c.author_name }; renderComposer(); if (textarea) textarea.focus(); }; actions.appendChild(rep); }
const del = el('button', null, 'Löschen'); del.onclick = () => remove(c.id); actions.appendChild(del);
card.appendChild(actions);
post.appendChild(actions);
}
list.appendChild(card);
list.appendChild(post);
});
}
+25
View File
@@ -0,0 +1,25 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg width="100%" height="100%" viewBox="0 0 1773 247" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve" xmlns:serif="http://www.serif.com/" style="fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2;">
<g transform="matrix(1,0,0,1,-1,-25)">
<rect x="717" y="32" width="99" height="55" style="fill:rgb(240,240,240);"/>
</g>
<g transform="matrix(1,0,0,1,-1,-25)">
<rect x="191" y="223" width="91" height="40" style="fill:rgb(240,240,240);"/>
</g>
<g transform="matrix(1.905742,0,0,1,38.397616,-25)">
<rect x="-17" y="69" width="923" height="160" style="fill:rgb(240,240,240);"/>
</g>
<g transform="matrix(4.161487,0,0,4.161487,-877.670228,-2027.145952)">
<path d="M259.981,527.071L256.537,527.071L256.537,507.267L259.981,507.267L259.981,527.071ZM259.981,514.069L259.981,538.093L234.838,538.093L234.838,534.649L249.562,534.649C249.648,534.649 249.935,534.434 250.423,534.003C250.911,533.573 251.499,533.027 252.188,532.367C252.877,531.707 253.552,531.04 254.212,530.365C254.872,529.691 255.425,529.109 255.869,528.621C256.314,528.133 256.537,527.846 256.537,527.76L256.537,514.069L259.981,514.069ZM259.981,520.441L256.537,520.441L256.537,506.75C256.537,506.664 256.314,506.377 255.869,505.889C255.425,505.401 254.872,504.82 254.212,504.145C253.552,503.471 252.877,502.804 252.188,502.143C251.499,501.483 250.911,500.938 250.423,500.507C249.935,500.077 249.648,499.862 249.562,499.862L234.838,499.862L234.838,496.417L259.981,496.417L259.981,520.441ZM233.718,522.508L233.718,511.831C233.718,511.658 233.733,511.558 233.761,511.529C233.79,511.5 233.891,511.486 234.063,511.486L236.818,511.486C236.99,511.486 237.091,511.5 237.12,511.529C237.148,511.558 237.163,511.658 237.163,511.831L237.163,522.508C237.163,522.68 237.148,522.78 237.12,522.809C237.091,522.838 236.99,522.852 236.818,522.852L234.063,522.852C233.891,522.852 233.79,522.838 233.761,522.809C233.733,522.78 233.718,522.68 233.718,522.508ZM210.9,527.071L210.9,507.267L214.344,507.267L214.344,527.071L210.9,527.071ZM210.9,514.069L214.344,514.069L214.344,527.76C214.344,527.846 214.567,528.133 215.012,528.621C215.456,529.109 216.009,529.691 216.669,530.365C217.329,531.04 218.004,531.707 218.693,532.367C219.382,533.027 219.97,533.573 220.458,534.003C220.946,534.434 221.233,534.649 221.319,534.649L236.043,534.649L236.043,538.093L210.9,538.093L210.9,514.069ZM210.9,520.441L210.9,496.417L236.043,496.417L236.043,499.862L221.319,499.862C221.233,499.862 220.946,500.077 220.458,500.507C219.97,500.938 219.382,501.483 218.693,502.143C218.004,502.804 217.329,503.471 216.669,504.145C216.009,504.82 215.456,505.401 215.012,505.889C214.567,506.377 214.344,506.664 214.344,506.75L214.344,520.441L210.9,520.441Z" style="fill:rgb(15,15,15);fill-rule:nonzero;"/>
<path d="M303.322,527.158L299.877,527.158L299.877,507.353L303.322,507.353L303.322,527.158ZM303.322,520.441L299.877,520.441L299.877,506.75C299.877,506.664 299.655,506.377 299.21,505.889C298.765,505.401 298.213,504.82 297.552,504.145C296.892,503.471 296.218,502.804 295.529,502.143C294.84,501.483 294.252,500.938 293.764,500.507C293.276,500.077 292.989,499.862 292.903,499.862L278.178,499.862L278.178,496.417L303.322,496.417L303.322,520.441ZM254.241,521.905L257.685,521.905L257.685,543.432L277.576,543.432L277.576,534.649L292.903,534.649C293.017,534.649 293.326,534.434 293.828,534.003C294.331,533.573 294.919,533.027 295.593,532.367C296.268,531.707 296.935,531.04 297.595,530.365C298.256,529.691 298.801,529.109 299.231,528.621C299.662,528.133 299.877,527.846 299.877,527.76L299.877,521.13L303.322,521.13L303.322,538.093L281.02,538.093L281.02,546.876L254.241,546.876L254.241,521.905ZM254.241,520.441L254.241,496.417L279.384,496.417L279.384,499.862L257.685,499.862L257.685,520.441L254.241,520.441ZM277.059,522.594L277.059,511.917C277.059,511.744 277.073,511.644 277.102,511.615C277.131,511.587 277.231,511.572 277.403,511.572L280.159,511.572C280.331,511.572 280.431,511.587 280.46,511.615C280.489,511.644 280.503,511.744 280.503,511.917L280.503,522.594C280.503,522.766 280.489,522.867 280.46,522.895C280.431,522.924 280.331,522.938 280.159,522.938L277.403,522.938C277.231,522.938 277.131,522.924 277.102,522.895C277.073,522.867 277.059,522.766 277.059,522.594ZM254.241,507.353L257.685,507.353L257.685,527.158L254.241,527.158L254.241,507.353Z" style="fill:rgb(15,15,15);fill-rule:nonzero;"/>
<path d="M297.581,520.441L297.581,496.417L321.002,496.417L321.002,499.862L308,499.862C307.914,499.862 307.627,500.077 307.139,500.507C306.651,500.938 306.063,501.483 305.374,502.143C304.685,502.804 304.01,503.471 303.35,504.145C302.69,504.82 302.138,505.401 301.693,505.889C301.248,506.377 301.025,506.664 301.025,506.75L301.025,520.441L297.581,520.441ZM297.581,507.353L301.025,507.353L301.025,527.158L297.581,527.158L297.581,507.353ZM297.581,514.069L301.025,514.069L301.025,527.76C301.025,527.846 301.248,528.133 301.693,528.621C302.138,529.109 302.69,529.691 303.35,530.365C304.01,531.04 304.685,531.707 305.374,532.367C306.063,533.027 306.651,533.573 307.139,534.003C307.627,534.434 307.914,534.649 308,534.649L321.002,534.649L321.002,538.093L297.581,538.093L297.581,514.069ZM343.39,520.441L339.946,520.441L339.946,506.75C339.946,506.664 339.723,506.377 339.278,505.889C338.834,505.401 338.281,504.82 337.621,504.145C336.961,503.471 336.286,502.804 335.597,502.143C334.908,501.483 334.32,500.938 333.832,500.507C333.344,500.077 333.057,499.862 332.971,499.862L319.969,499.862L319.969,496.417L343.39,496.417L343.39,520.441ZM343.39,516.653L343.39,538.093L319.969,538.093L319.969,534.649L339.946,534.649L339.946,516.653L343.39,516.653ZM325.996,510.453C326.169,510.453 326.269,510.467 326.298,510.496C326.326,510.525 326.341,510.625 326.341,510.797L326.341,513.553C326.341,513.725 326.326,513.825 326.298,513.854C326.269,513.883 326.169,513.897 325.996,513.897L315.319,513.897C315.147,513.897 315.046,513.883 315.018,513.854C314.989,513.825 314.975,513.725 314.975,513.553L314.975,510.797C314.975,510.625 314.989,510.525 315.018,510.496C315.046,510.467 315.147,510.453 315.319,510.453L325.996,510.453ZM341.582,524.058L339.946,524.058L339.946,522.852C339.946,522.852 339.365,522.938 338.202,523.111C337.04,523.283 335.605,523.491 333.897,523.735C332.189,523.979 330.481,524.223 328.773,524.467C327.066,524.711 325.63,524.919 324.468,525.091C323.306,525.263 322.724,525.349 322.724,525.349C322.724,525.349 322.717,525.292 322.703,525.177C322.688,525.062 322.66,524.883 322.617,524.639C322.574,524.395 322.523,524.086 322.466,523.713C322.409,523.34 322.358,523.024 322.315,522.766C322.272,522.508 322.244,522.314 322.229,522.185C322.215,522.056 322.208,521.991 322.208,521.991C322.208,521.991 322.803,521.905 323.994,521.733C325.186,521.561 326.664,521.345 328.429,521.087C330.194,520.829 331.959,520.57 333.724,520.312C335.49,520.054 336.968,519.838 338.159,519.666C339.35,519.494 339.946,519.408 339.946,519.408L339.946,517.772L341.582,517.772L341.582,524.058Z" style="fill:rgb(15,15,15);fill-rule:nonzero;"/>
<path d="M386.731,527.071L383.286,527.071L383.286,507.267L386.731,507.267L386.731,527.071ZM337.65,527.071L337.65,507.267L341.094,507.267L341.094,527.071L337.65,527.071ZM386.731,520.441L383.286,520.441L383.286,506.75C383.286,506.664 383.064,506.377 382.619,505.889C382.174,505.401 381.622,504.82 380.961,504.145C380.301,503.471 379.627,502.804 378.938,502.143C378.249,501.483 377.661,500.938 377.173,500.507C376.685,500.077 376.398,499.862 376.312,499.862L361.587,499.862L361.587,496.417L386.731,496.417L386.731,520.441ZM386.731,514.069L386.731,538.093L361.587,538.093L361.587,534.649L383.286,534.649L383.286,514.069L386.731,514.069ZM337.65,514.069L341.094,514.069L341.094,534.649L362.793,534.649L362.793,538.093L337.65,538.093L337.65,514.069ZM337.65,520.441L337.65,496.417L362.793,496.417L362.793,499.862L341.094,499.862L341.094,520.441L337.65,520.441ZM363.762,535.252L360.619,535.252C360.576,535.252 360.54,535.237 360.511,535.209C360.482,535.18 360.468,535.144 360.468,535.101L360.468,516.48C360.468,516.365 360.475,516.287 360.489,516.244C360.504,516.2 360.532,516.172 360.576,516.157C360.619,516.143 360.698,516.136 360.812,516.136L363.568,516.136C363.683,516.136 363.762,516.143 363.805,516.157C363.848,516.172 363.876,516.2 363.891,516.244C363.905,516.287 363.912,516.365 363.912,516.48L363.912,535.101C363.912,535.144 363.898,535.18 363.869,535.209C363.84,535.237 363.805,535.252 363.762,535.252Z" style="fill:rgb(15,15,15);fill-rule:nonzero;"/>
<path d="M430.071,507.267L430.071,527.071L426.627,527.071L426.627,507.267L430.071,507.267ZM430.071,514.069L430.071,538.093L404.928,538.093L404.928,534.649L419.652,534.649C419.738,534.649 420.025,534.434 420.513,534.003C421.001,533.573 421.59,533.027 422.278,532.367C422.967,531.707 423.642,531.04 424.302,530.365C424.962,529.691 425.515,529.109 425.959,528.621C426.404,528.133 426.627,527.846 426.627,527.76L426.627,514.069L430.071,514.069ZM380.99,512.605L380.99,487.634L407.769,487.634L407.769,496.417L430.071,496.417L430.071,513.38L426.627,513.38L426.627,506.75C426.627,506.664 426.412,506.377 425.981,505.889C425.55,505.401 425.005,504.82 424.345,504.145C423.685,503.471 423.017,502.804 422.343,502.143C421.668,501.483 421.08,500.938 420.578,500.507C420.075,500.077 419.767,499.862 419.652,499.862L404.325,499.862L404.325,491.079L384.434,491.079L384.434,512.605L380.99,512.605ZM380.99,514.069L384.434,514.069L384.434,534.649L406.133,534.649L406.133,538.093L380.99,538.093L380.99,514.069ZM380.99,507.267L384.434,507.267L384.434,527.071L380.99,527.071L380.99,507.267ZM403.808,522.508L403.808,511.831C403.808,511.658 403.823,511.558 403.851,511.529C403.88,511.5 403.981,511.486 404.153,511.486L406.908,511.486C407.081,511.486 407.181,511.5 407.21,511.529C407.238,511.558 407.253,511.658 407.253,511.831L407.253,522.508C407.253,522.68 407.238,522.78 407.21,522.809C407.181,522.838 407.081,522.852 406.908,522.852L404.153,522.852C403.981,522.852 403.88,522.838 403.851,522.809C403.823,522.78 403.808,522.68 403.808,522.508Z" style="fill:rgb(15,15,15);fill-rule:nonzero;"/>
<path d="M424.331,507.353L427.775,507.353L427.775,527.158L424.331,527.158L424.331,507.353ZM473.412,507.353L473.412,527.158L469.967,527.158L469.967,507.353L473.412,507.353ZM424.331,514.069L427.775,514.069L427.775,527.76C427.775,527.846 427.997,528.133 428.442,528.621C428.887,529.109 429.44,529.691 430.1,530.365C430.76,531.04 431.434,531.707 432.123,532.367C432.812,533.027 433.401,533.573 433.889,534.003C434.376,534.434 434.663,534.649 434.75,534.649L449.474,534.649L449.474,538.093L424.331,538.093L424.331,514.069ZM424.331,520.441L424.331,496.417L449.474,496.417L449.474,499.862L427.775,499.862L427.775,520.441L424.331,520.441ZM473.412,520.441L469.967,520.441L469.967,499.862L448.268,499.862L448.268,496.417L473.412,496.417L473.412,520.441ZM473.412,514.069L473.412,538.093L448.268,538.093L448.268,534.649L469.967,534.649L469.967,514.069L473.412,514.069ZM447.3,499.689L450.443,499.689C450.486,499.689 450.522,499.704 450.55,499.732C450.579,499.761 450.593,499.797 450.593,499.84L450.593,518.461C450.593,518.576 450.586,518.655 450.572,518.698C450.557,518.741 450.529,518.769 450.486,518.784C450.443,518.798 450.364,518.805 450.249,518.805L447.493,518.805C447.379,518.805 447.3,518.798 447.257,518.784C447.214,518.769 447.185,518.741 447.171,518.698C447.156,518.655 447.149,518.576 447.149,518.461L447.149,499.84C447.149,499.797 447.163,499.761 447.192,499.732C447.221,499.704 447.257,499.689 447.3,499.689Z" style="fill:rgb(15,15,15);fill-rule:nonzero;"/>
<path d="M513.48,538.093L467.671,538.093L467.671,515.878L471.115,515.878L471.115,534.649L491.092,534.649L491.092,522.508L510.036,522.508L510.036,508.903L513.48,508.903L513.48,538.093ZM467.671,517.858L467.671,496.417L491.351,496.417L491.351,509.075C491.351,509.075 491.114,508.609 490.64,507.676C490.167,506.743 489.628,505.674 489.026,504.468C488.423,503.263 487.885,502.194 487.411,501.261C486.938,500.328 486.701,499.862 486.701,499.862L471.115,499.862L471.115,517.858L467.671,517.858ZM513.48,513.725L510.036,513.725L510.036,499.862L496.173,499.862C496.173,499.862 495.929,500.328 495.441,501.261C494.953,502.194 494.393,503.263 493.762,504.468C493.13,505.674 492.57,506.743 492.083,507.676C491.595,508.609 491.351,509.075 491.351,509.075C491.351,509.075 491.286,508.609 491.157,507.676C491.028,506.743 490.884,505.674 490.726,504.468C490.568,503.263 490.425,502.194 490.296,501.261C490.167,500.328 490.102,499.862 490.102,499.862L490.102,496.417L513.48,496.417L513.48,513.725Z" style="fill:rgb(15,15,15);fill-rule:nonzero;"/>
<path d="M507.74,520.441L507.74,496.417L531.161,496.417L531.161,499.862L518.159,499.862C518.072,499.862 517.785,500.077 517.298,500.507C516.81,500.938 516.221,501.483 515.532,502.143C514.843,502.804 514.169,503.471 513.509,504.145C512.849,504.82 512.296,505.401 511.851,505.889C511.406,506.377 511.184,506.664 511.184,506.75L511.184,520.441L507.74,520.441ZM507.74,507.353L511.184,507.353L511.184,527.158L507.74,527.158L507.74,507.353ZM507.74,514.069L511.184,514.069L511.184,527.76C511.184,527.846 511.406,528.133 511.851,528.621C512.296,529.109 512.849,529.691 513.509,530.365C514.169,531.04 514.843,531.707 515.532,532.367C516.221,533.027 516.81,533.573 517.298,534.003C517.785,534.434 518.072,534.649 518.159,534.649L531.161,534.649L531.161,538.093L507.74,538.093L507.74,514.069ZM553.549,520.441L550.104,520.441L550.104,506.75C550.104,506.664 549.882,506.377 549.437,505.889C548.992,505.401 548.44,504.82 547.779,504.145C547.119,503.471 546.445,502.804 545.756,502.143C545.067,501.483 544.479,500.938 543.991,500.507C543.503,500.077 543.216,499.862 543.13,499.862L530.127,499.862L530.127,496.417L553.549,496.417L553.549,520.441ZM553.549,516.653L553.549,538.093L530.127,538.093L530.127,534.649L550.104,534.649L550.104,516.653L553.549,516.653ZM536.155,510.453C536.327,510.453 536.428,510.467 536.456,510.496C536.485,510.525 536.499,510.625 536.499,510.797L536.499,513.553C536.499,513.725 536.485,513.825 536.456,513.854C536.428,513.883 536.327,513.897 536.155,513.897L525.478,513.897C525.305,513.897 525.205,513.883 525.176,513.854C525.148,513.825 525.133,513.725 525.133,513.553L525.133,510.797C525.133,510.625 525.148,510.525 525.176,510.496C525.205,510.467 525.305,510.453 525.478,510.453L536.155,510.453ZM551.74,524.058L550.104,524.058L550.104,522.852C550.104,522.852 549.523,522.938 548.361,523.111C547.198,523.283 545.763,523.491 544.055,523.735C542.347,523.979 540.64,524.223 538.932,524.467C537.224,524.711 535.789,524.919 534.627,525.091C533.464,525.263 532.883,525.349 532.883,525.349C532.883,525.349 532.876,525.292 532.861,525.177C532.847,525.062 532.818,524.883 532.775,524.639C532.732,524.395 532.682,524.086 532.625,523.713C532.567,523.34 532.517,523.024 532.474,522.766C532.431,522.508 532.402,522.314 532.388,522.185C532.373,522.056 532.366,521.991 532.366,521.991C532.366,521.991 532.962,521.905 534.153,521.733C535.344,521.561 536.822,521.345 538.587,521.087C540.353,520.829 542.118,520.57 543.883,520.312C545.648,520.054 547.126,519.838 548.318,519.666C549.509,519.494 550.104,519.408 550.104,519.408L550.104,517.772L551.74,517.772L551.74,524.058Z" style="fill:rgb(15,15,15);fill-rule:nonzero;"/>
<path d="M547.808,514.069L551.252,514.069L551.252,527.76C551.252,527.846 551.475,528.133 551.92,528.621C552.365,529.109 552.917,529.691 553.577,530.365C554.237,531.04 554.912,531.707 555.601,532.367C556.29,533.027 556.878,533.573 557.366,534.003C557.854,534.434 558.141,534.649 558.227,534.649L571.229,534.649L571.229,538.093L547.808,538.093L547.808,514.069ZM547.808,517.858L547.808,496.417L571.229,496.417L571.229,499.862L551.252,499.862L551.252,517.858L547.808,517.858ZM593.617,520.441L590.173,520.441L590.173,506.75C590.173,506.664 589.95,506.377 589.505,505.889C589.061,505.401 588.508,504.82 587.848,504.145C587.188,503.471 586.513,502.804 585.824,502.143C585.136,501.483 584.547,500.938 584.059,500.507C583.571,500.077 583.284,499.862 583.198,499.862L570.196,499.862L570.196,496.417L593.617,496.417L593.617,520.441ZM593.617,516.653L593.617,538.093L570.196,538.093L570.196,534.649L590.173,534.649L590.173,516.653L593.617,516.653ZM593.617,527.071L590.173,527.071L590.173,507.267L593.617,507.267L593.617,527.071ZM565.46,524.574C565.288,524.574 565.187,524.56 565.159,524.531C565.13,524.503 565.116,524.402 565.116,524.23L565.116,521.475C565.116,521.302 565.13,521.202 565.159,521.173C565.187,521.144 565.288,521.13 565.46,521.13L576.137,521.13C576.31,521.13 576.41,521.144 576.439,521.173C576.467,521.202 576.482,521.302 576.482,521.475L576.482,524.23C576.482,524.402 576.467,524.503 576.439,524.531C576.41,524.56 576.31,524.574 576.137,524.574L565.46,524.574ZM549.616,511.056L551.252,511.056L551.252,512.261C551.252,512.261 551.834,512.175 552.996,512.003C554.158,511.831 555.594,511.622 557.301,511.378C559.009,511.134 560.717,510.891 562.425,510.647C564.133,510.403 565.568,510.194 566.73,510.022C567.893,509.85 568.474,509.764 568.474,509.764C568.474,509.764 568.481,509.821 568.495,509.936C568.51,510.051 568.538,510.23 568.581,510.474C568.624,510.718 568.675,511.027 568.732,511.4C568.79,511.773 568.84,512.089 568.883,512.347C568.926,512.605 568.955,512.799 568.969,512.928C568.983,513.058 568.99,513.122 568.99,513.122C568.99,513.122 568.395,513.208 567.204,513.38C566.013,513.553 564.534,513.768 562.769,514.026C561.004,514.285 559.239,514.543 557.474,514.801C555.708,515.06 554.23,515.275 553.039,515.447C551.848,515.619 551.252,515.705 551.252,515.705L551.252,517.341L549.616,517.341L549.616,511.056Z" style="fill:rgb(15,15,15);fill-rule:nonzero;"/>
<path d="M587.877,507.353L591.321,507.353L591.321,527.158L587.877,527.158L587.877,507.353ZM636.958,507.353L636.958,527.158L633.513,527.158L633.513,507.353L636.958,507.353ZM587.877,514.069L591.321,514.069L591.321,527.76C591.321,527.846 591.543,528.133 591.988,528.621C592.433,529.109 592.986,529.691 593.646,530.365C594.306,531.04 594.98,531.707 595.669,532.367C596.358,533.027 596.947,533.573 597.434,534.003C597.922,534.434 598.209,534.649 598.296,534.649L613.02,534.649L613.02,538.093L587.877,538.093L587.877,514.069ZM587.877,520.441L587.877,496.417L613.02,496.417L613.02,499.862L591.321,499.862L591.321,520.441L587.877,520.441ZM636.958,520.441L633.513,520.441L633.513,499.862L611.814,499.862L611.814,496.417L636.958,496.417L636.958,520.441ZM636.958,514.069L636.958,538.093L611.814,538.093L611.814,534.649L633.513,534.649L633.513,514.069L636.958,514.069ZM610.846,499.689L613.989,499.689C614.032,499.689 614.067,499.704 614.096,499.732C614.125,499.761 614.139,499.797 614.139,499.84L614.139,518.461C614.139,518.576 614.132,518.655 614.118,518.698C614.103,518.741 614.075,518.769 614.032,518.784C613.989,518.798 613.91,518.805 613.795,518.805L611.039,518.805C610.925,518.805 610.846,518.798 610.803,518.784C610.76,518.769 610.731,518.741 610.716,518.698C610.702,518.655 610.695,518.576 610.695,518.461L610.695,499.84C610.695,499.797 610.709,499.761 610.738,499.732C610.767,499.704 610.803,499.689 610.846,499.689Z" style="fill:rgb(15,15,15);fill-rule:nonzero;"/>
</g>
</svg>

After

Width:  |  Height:  |  Size: 19 KiB

+1 -32
View File
File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 7.0 KiB

After

Width:  |  Height:  |  Size: 2.8 KiB

+119
View File
@@ -0,0 +1,119 @@
/* OPENBUREAU — Versionsverlauf eines Beitrags direkt auf der Seite.
Die Pill „Version vom …" öffnet die Liste der Fassungen (aus /api/history).
Auswahl zeigt standardmäßig den Diff (rot/grün, wie auf GitHub) aus
/api/history/diff; ein Toggle zeigt die ganze alte Fassung (/api/history/version).
Alles auf openbureau — keine externen Git-Links. */
(function () {
var trigger = document.getElementById('version-badge');
if (!trigger) return;
var path = trigger.dataset.path;
var content = document.querySelector('.single-content');
var article = document.querySelector('article.single');
if (!path || !content || !article) return;
var originalHTML = content.innerHTML;
var panel = null, banner = null;
function api(p) { return fetch(p).then(function (r) { return r.ok ? r.json() : null; }).catch(function () { return null; }); }
function fmt(d) { try { return new Date(d).toLocaleDateString('de-CH'); } catch (e) { return d || ''; } }
function q(p, rev) { return p + '?path=' + encodeURIComponent(path) + '&rev=' + encodeURIComponent(rev); }
function toTop() { window.scrollTo({ top: 0, behavior: 'smooth' }); }
function closePanel() {
if (panel) { panel.remove(); panel = null; }
trigger.setAttribute('aria-expanded', 'false');
}
function restore() {
content.innerHTML = originalHTML;
if (banner) { banner.remove(); banner = null; }
}
// Unified-Diff → farbige Zeilen (rot gelöscht, grün neu, grau Hunk/Kontext).
function renderDiff(diff) {
var box = document.createElement('div');
box.className = 'diff';
diff.split('\n').forEach(function (ln) {
if (/^(diff --git|index |new file|deleted file|similarity |rename |--- |\+\+\+ )/.test(ln)) return;
var cls = 'd-ctx';
if (/^@@/.test(ln)) cls = 'd-hunk';
else if (ln.charAt(0) === '+') cls = 'd-add';
else if (ln.charAt(0) === '-') cls = 'd-del';
var row = document.createElement('div');
row.className = 'diff-line ' + cls;
row.textContent = ln || ' ';
box.appendChild(row);
});
return box;
}
function showBanner(v, mode) {
if (banner) banner.remove();
banner = document.createElement('div');
banner.className = 'version-banner';
banner.append((mode === 'diff' ? 'Änderungen' : 'Fassung') + ' vom ' + fmt(v.date) + ' · Version ' + v.short + ' ');
var toggle = document.createElement('button');
toggle.type = 'button'; toggle.className = 'version-toggle';
toggle.textContent = mode === 'diff' ? 'ganze Fassung anzeigen' : 'Änderungen anzeigen';
toggle.addEventListener('click', function () { mode === 'diff' ? loadVersion(v) : loadDiff(v); });
var back = document.createElement('button');
back.type = 'button'; back.className = 'version-back'; back.textContent = '→ zur aktuellen Fassung';
back.addEventListener('click', restore);
banner.append(toggle, ' ', back);
article.insertBefore(banner, article.firstChild);
}
function loadDiff(v) {
closePanel();
content.innerHTML = '<p class="version-loading">Lade Änderungen …</p>';
api(q('/api/history/diff', v.rev)).then(function (data) {
if (!data || data.diff == null) { restore(); return; }
content.innerHTML = '';
if (!data.diff.trim()) content.innerHTML = '<p class="version-empty">Keine Änderungen an dieser Datei in dieser Fassung.</p>';
else content.appendChild(renderDiff(data.diff));
showBanner(v, 'diff');
toTop();
});
}
function loadVersion(v) {
closePanel();
content.innerHTML = '<p class="version-loading">Lade Fassung …</p>';
api(q('/api/history/version', v.rev)).then(function (data) {
if (!data || !data.html) { restore(); return; }
content.innerHTML = data.html;
showBanner(v, 'full');
toTop();
});
}
function openPanel() {
api('/api/history?path=' + encodeURIComponent(path)).then(function (list) {
panel = document.createElement('div');
panel.className = 'version-panel';
if (!list || !list.length) {
panel.innerHTML = '<p class="version-empty">Kein Verlauf verfügbar.</p>';
} else {
var ol = document.createElement('ol');
ol.className = 'version-list';
list.forEach(function (v, i) {
var li = document.createElement('li');
var b = document.createElement('button');
b.type = 'button';
var date = document.createElement('span'); date.className = 'v-date'; date.textContent = fmt(v.date);
var subj = document.createElement('span'); subj.className = 'v-subject'; subj.textContent = v.subject || '';
var hash = document.createElement('span'); hash.className = 'v-hash'; hash.textContent = v.short + (i === 0 ? ' · aktuell' : '');
b.append(date, subj, hash);
if (i === 0) b.addEventListener('click', function () { restore(); closePanel(); });
else b.addEventListener('click', function () { loadDiff(v); });
li.appendChild(b);
ol.appendChild(li);
});
panel.appendChild(ol);
}
var host = trigger.closest('.article-versions') || trigger;
host.parentNode.insertBefore(panel, host.nextSibling);
trigger.setAttribute('aria-expanded', 'true');
});
}
trigger.addEventListener('click', function () { panel ? closePanel() : openPanel(); });
})();