Skip to content

Machine-translated – improvements welcome. Suggest an improvement

Data to the outside

Routes to the outside

Ablago never opens a connection to the internet on its own. Every route to the outside is switched off until a person triggers it or the administration switches it on. The overview for users is in the administration handbook under What leaves your library.

Route Who switches it on What goes out Where in the code
Package catalogue Administration at the push of a button, setup assistant in the "Packages" step only the request to the catalogue server/src/pakete/verwaltung/kataloge.ts, katalogsignatur.ts
Version check Administration at the push of a button (Workbench → Technology) commit identifier, no data from the Library server/src/system/system.ts
Email Administration sets up the mail server; users send sent folders and documents, daily summary (titles, links), invitations, data protection requests, info email to emergency contacts (#812: text only, no link, only three names; at most 20 per day) server/src/mail/mail.ts, aufgabenmail.ts, notfallkontakte/
Mailbox Administration sets it up fetching from your own mail server server/src/post/postfach.ts, postfach-oauth.ts
Sign-in via a provider Administration sign-in process with the provider server/src/anmeldung/oidc.ts
Package network Administration confirms on installation only to the addresses from the manifest or service address package runner, right netzwerk
Retrieval links (data protection request) Administration creates the link the request, only after the retrieval code server/src/datenschutz/abruf.ts
Automation: Call URL (#671) managers of Automations approve a destination (fresh sign-in) and set up the card depending on the content level notification, IDs or values (POST only, after confirmation) – only to approved destinations server/src/automatisierung/ausleitung.ts, sicherer-abruf.ts, server/src/automatisierung/automatisierung-aussen.ts
Automation: Send e-mail (#671) managers of Automations subject and text with placeholders, to people, roles, fields or any addresses; limited per day the same, sending via mail.ts

Download (also a letter from template, #1040), email, export and the WebDAV drive ask one shared checkpoint in server/src/ausgang/ (#723, outgoing): read and export permission per folder, through dienst.ausgang.pruefeAusgang or dienst.ausgang.mitnehmbar. "With enclosures?" (#998, default yes) only widens the selection afterwards via dienst.ausgang.mitAnlagen – only by enclosures of the same folder, so with the same permissions; originalEmail: false (#999) leaves the original email out unless it is chosen itself; downloading with enclosures (dokumentMitAnlagenFuerAusgabe) hands out each file as it would singly (stamp, archive version) and packs them into a ZIP.

Rule for new routes: a new route to the outside needs an approved issue, is switched off until someone explicitly switches it on, sends as little as possible (numbers instead of content where that's enough), is listed in this table and in the overview in the administration handbook, and gets a security review.

Counter endpoint and key levels (#625)

Other programs (home automation, wall tablet, clients) often only want to know whether there is something new. For that there is GET /api/v1/ich/zaehler (internally /api/ich/zaehler, SichtenDienst.zaehlerAbruf):

curl -i -H "Authorization: Bearer dms_…" https://dms.example.org/api/v1/ich/zaehler
# HTTP/1.1 200 OK
# ETag: "z42-mJ3x0Qe7Kq9VZ1aB2cD3eF"
# {"neuePost":2,"zuErledigen":5,"ueberfaellig":1,"stand":42,"geaendert":"2026-11-03T07:15:00.000Z"}

curl -i -H "Authorization: Bearer dms_…" -H 'If-None-Match: "z42-mJ3x0Qe7Kq9VZ1aB2cD3eF"' https://dms.example.org/api/v1/ich/zaehler
# HTTP/1.1 304 Not Modified   (no content)
  • Numbers only. The response never contains titles, names, senders or content – not even in future fields. The OpenAPI schema Zaehlerstand has additionalProperties: false; the test server/test/zaehler-api.test.ts checks the keys and that no texts slip through.
  • Where the numbers come from. zuErledigen is eingang from SichtenDienst.zaehler (#512), ueberfaellig counts your own overdue entries from Fristen.termine (#528, #725; anstehend was dropped with #725), neuePost counts post with the status "New" and "For" = me or empty via zaehleKlauseln – with its own Zaehlerspeicher keyed to the household version. All within the user's rights (read filter); nothing is recomputed for the endpoint as long as nothing in the household changes.
  • Version in the database (table zaehlerstaende, migration 056). For each request the server builds a hash of the numbers (fingerabdruck), compares it with the stored one and only increments stand if they differ (Repo.setzeZaehlerstand, an INSERT … ON CONFLICT DO UPDATE … WHERE abdruck IS DISTINCT FROM …: concurrent requests count a change once). Unchanged means: read only. The household version from #512 only lives in memory and starts at 0 after every restart – so it isn't suitable as an ETag. The ETag is "z<stand>-<hash>": the same ETag means the same numbers, even after a restart or a restore.
  • ETag and 304. passtEtag (http/routen-hilfen.ts) understands lists, W/… and *. A route sets its own headers via Antwort.koepfe; it reads request headers via Anfrage.kopf(name). Cache-Control: private, no-cache instead of no-store, so that programs may revalidate.
  • Key level "counters only" (recht = 'zaehler', NUR_ZAEHLER and ZAEHLER_PFAD in apischluessel.ts). pruefeZugang only lets it through to GET /api/v1/ich/zaehler; every other route under /api/v1 and – explicitly – every internal route with such a key in the header gets 403 (api.schluessel.nur-zaehler), and so does the drive (webdav/webdav.ts). "Read passwords" doesn't exist for this level. A new interface that accepts API keys must reject this level in the same way.
  • Limits. The overload protection (#544) counts these requests too. There is no limit per key; a request answered from the cache costs a few milliseconds. If Ablago runs on several servers, each has its own cache (as with #512, at most 5 or 30 minutes old) – until then two servers may briefly return different numbers, and the version then increments more often than necessary.

Adding another number: add a field to Zaehlerzahlen (dienst.ts) and to the OpenAPI schema, and to ZAHLEN in the test – and only numbers. If the meaning of an existing number changes, increase v in the hash so that every client reads once more.

Reporting to the outside

Ablago does not report changed numbers on its own: clients query GET /api/v1/ich/zaehler with If-None-Match (see above). The separate counter webhook (#627: server/src/webhook.ts, tables webhooks and webhook_meldungen, setting webhook_ziele, Workbench → Webhooks, My account) was removed with #991 – two ways for the same thing contradict "the same thing in one place" (pattern C9). Migration 106 drops the tables and the setting; old backups can still be restored, because the restore runs the migrations afterwards.

Whoever wants to report something to the outside uses an automation with the Then card "Call URL" or "Send e-mail" (#671, below). It brings its own protection for destinations; nothing from the old webhook is reused – only the signature scheme is the same.

Cards to the outside (#671)

Model, cleaning, checking and short form in shared/src/automatisierung-aussen.ts (DannUrl, DannEmail, AussenZiel, zielProblem, zielFuer, urlProbleme, emailProbleme, platzhalterErlaubt); executed in server/src/automatisierung/automatisierung-aussen.ts (DANN_AUSFUEHRER.url / .email, under the system account); outbox, destinations and secrets in server/src/automatisierung/ausleitung.ts, the request in sicherer-abruf.ts (both via the door index.ts). The engine holds the Ausleitung as Automatisierungen.ausleitung and starts its delivery in the leader.

  • No API client (scope 08.11.2026): only GET or POST, no own headers or credentials, no JSON templates; the response is read (at most AUSSEN_ANTWORT_MAX) and discarded – only the status counts.
  • Destinations (setting automatisierung_ziele, GET/PUT /api/werkbank/automatisierungen/ziele, sensitive action aussen): prefix of scheme, host, port and path. zielFuer compares via new URL() (hostname, port, path at a / boundary), never as a string. http:// and non-public addresses only with heimnetz: true. Checked when saving (problem on the card; without a destination the automation turns red and pauses), when queueing and when delivering.
  • SSRF protection (sichererAbruf): node:http(s) with its own lookup on the connection – the name is resolved exactly once, all addresses checked (adressArt: public / home network / never; IPv4 in IPv6 and NAT64 as IPv4), one blocked address blocks the name. IP addresses in the URL are checked beforehand (Node calls no lookup there). Never: metadata addresses (169.254.169.254, fd00:ec2::254 …), 0.0.0.0/8, multicast, broadcast. No redirects (3xx = persistent error), agent: false, time limit AUSSEN_GRENZEN.zeitlimitS.
  • Content levels enforced technically: meldung (event, event ID, time, name of the automation), kennungen (+ folder ID, type key, changed field keys, link …/ablage/typ:<type>/<folder>), werte (+ title and values as text, only POST and with bestaetigt; fields as the system account sees them, never passwort, tabelle or values with dms1$; with felder in the event only those). Placeholders in parameters at the first two levels only from PLATZHALTER_OHNE_INHALT (and parameters of a call from outside) – otherwise a problem when saving, the engine pauses before the run, and parameter() leaves them empty as well.
  • Outbox (table automatisierung_ausgang, migration 115): unique per automation, card, event and recipient (schluessel = hash), fetched with FOR UPDATE SKIP LOCKED and a lease, retried per wiederholungNach (1, 5, 30 minutes, 2, 6 hours). Persistent errors (last attempt, 3xx, 4xx except 408/429, blocked address, destination withdrawn, secret unreadable) → aufgegeben, the automation pauses (angehalten.grund = 'ziel', notice via the technical tasks), open ones are discarded. The job (body, subject, text) is NULL once finished (CHECK in the migration); the history (GET …/:id/zustellungen) only has destination, state, status, error, attempts, times. Not in the full export.
  • Signature: X-DMS-Zeit, X-DMS-Signatur: v1=<hex> (HMAC-SHA256 over <time>.<content>, with GET path and query – signierterInhalt), plus X-DMS-Ereignis and X-DMS-Zustellung. Secret per card in automatisierung_geheimnisse (encrypted, secret kind aussen, re-encrypted in repo/pg/geheimnisse.ts), only in the response to POST …/:id/geheimnis/:karte (sensitive action aussen). Without a secret unsigned. If the card is removed, its secret goes too.
  • E-mail: one e-mail per recipient (text only) with a note (automatisierung.karte.email.fuss). People via their user folder (active, real address), roles via mitgliederDerRolle, fields as a link to users or text with format: email, any addresses (decision "To is free", 03.11.2026). Placeholders for people with fuelleFuer (#795), otherwise with the system account's permissions. Limits mailsJeAutomatisierungJeTag and mailsJeTag over 24 hours, counted in the table (across all processes) – above them the run fails with 429.
  • Packages never bring these cards (werkbankKartenFehler in pakete/verwaltung/inhalt-pruefen.ts, ausPaket skips them): a package's permission preview cannot show where data goes – that remains a deliberate decision of the administration.
  • Visible: destinations on the emergency sheet (zieleZeile, hosts only); paused automations in the overview and in the e-mail about technical tasks.

Triggering from outside (#679)

Something comes in without signing in only via the If card Call from outside ({ art: 'aufruf', parameter: [...] }, shared/src/automatisierung-aufruf.ts). Address, signature and brake live in the subject folder server/src/automatisierung/ (aufruf.ts, door index.ts); the engine calls Aufrufe via Automatisierungen.aufrufe:

  • Route POST /api/aufruf/:kennung (zugang: 'offen', in OFFEN of routen-liste.test.ts with a reason). It has rohKoerper: AUFRUF_KOERPER_MAX (16 KB, grenzen.ts): http.ts reads such routes in a separate scope where every content type – JSON too – arrives as a buffer; the signature applies to the bytes as they arrived. X-DMS: 1 is needed as with every changing request.
  • Signature as with the former webhook (#627): X-DMS-Zeit (Unix seconds), X-DMS-Signatur: v1=<hex> = HMAC-SHA256 over <zeit>.<body> with the secret (whsec_…); several separated by commas, one matching is enough (signaturPasst, always timingSafeEqual). Time window AUFRUF_GRENZEN.fensterS (300 s).
  • Order in annehmen: brake per IP range (aufrufBereich – IPv4 /24, IPv6 /64 –, AUFRUF_JE_BEREICH) → address and automation (on, not paused, If card aufruf) → time and signature (computed even without an address, with a throw-away secret) → replay protection (belege on the hash of identifier, time and signature, twice as long as the window) → brake for accepted calls per address (AUFRUF_ANGENOMMEN_JE_ADRESSE; above it the marker is released again) → body as JSON object → aufrufParameter (only names of the card, only text, shortened) → reihe outside the request with a fixed event id from the marker. Every rejection looks the same from outside (401); only the log contains the reason, without identifier and signature.
  • Brake (security review, PR #1160; limits in grenzen.ts, all in the short-term state across all processes): up front only the IP range counts. The check is cheap (index and HMAC), so the limit per address (AUFRUF_FEHLVERSUCHE_JE_ADRESSE, hash of the identifier, unknown ones too) and the emergency brake (AUFRUF_FEHLVERSUCHE_GESAMT) only count rejected calls (abgelehnt()); above them Ablago answers 429, without further counting or logging. A validly signed call is always checked and only counts against AUFRUF_ANGENOMMEN_JE_ADRESSE – so without the secret nobody can shut down one address or all of them.
  • Storage: table automatisierung_aufrufe (migration 112), at most one row per automation, ON DELETE CASCADE; the secret encrypted (dienst.verschluesseleGeheimnis), location quelle: 'aufruf' and secret type aufruf in geheimnisse.ts, re-encrypted in repo/pg/geheimnisse.ts (umschluesseln). Not in versions and full export – only the card with its parameter names.
  • Creating only via POST /api/werkbank/automatisierungen/:id/aufruf (was: adresse | geheimnis, sensitive action aufruf in verwaltungsbereiche.ts → fresh sign-in); the secret is only in this response. Not for automations supplied by packages; liesPaket rejects packages with wenn.art: aufruf, ausPaket skips them. If the If card changes or the automation is deleted, the address is gone.
  • Placeholders: fuelleMit sets {zeitpunkt} and the parameters as text in one pass (a value containing {titel} is not replaced again; Object.hasOwn). Run data: laufFuer → aufrufLaufFuer omits parameter if the person does not manage Automations.
  • Visible: warnungen().aufrufe for the overview (message automatisierung.aufrufe with "Switch all off" via POST /api/werkbank/uebersicht/erledigt → aufrufeAbschalten), aufrufListe() for the emergency sheet (aufrufZeile, identifier shortened).

More background in the administration handbook: Technology and Decisions.