Skip to content

Machine-translated – improvements welcome. Suggest an improvement

Ablago's technology

An overview for operation and support. Which versions actually run on a system is shown by the workbench under Technology – there the overview can also be copied for a GitHub issue.

Building blocks

Browser ── HTTP ──▶ Ablago container (Node.js) ──▶ PostgreSQL container
   React interface         Fastify API              Folders, types, users,
   (included in image)     files under /data/…      sessions, logs
Building block Technology What for
Interface React 19, built with Vite Library, workbench, My account – everything in the browser
Server Node.js 26, Fastify 5, TypeScript (bundled with esbuild) Interface under /api, also delivers the user interface
Database PostgreSQL 18 (at least 16), access with postgres.js, SQL migrations in server/migrations All data except the files
Files Fixed folders /data/files, /data/geheim, /data/sicherung (volumes, see Installation); each file named by its SHA-256; optionally the Intake folder /eingang Uploaded documents, the same content only once; key; backups; scans to collect
Phone numbers libphonenumber-js (MIT), only the small “min” data (length of area codes per country) Showing numbers uniformly and finding them in any notation (Region)
Email nodemailer via SMTP for sending; imapflow and mailparser via IMAP for collecting (both optional, set in the workbench) Invitations, password links, notices, sending folders; collecting emails from mailboxes as post
Full text and text recognition poppler (pdftotext, pdftoppm) in the image for the text layer of PDFs; text recognition of scans and images as the package Text recognition (Tesseract as WebAssembly in the package runner); PostgreSQL's full-text search Full text of PDFs, scans and images
Shrinking PDFs pdf-lib, pdftoppm (poppler) for the images and qpdf (Apache-2.0) for the structure, both in the image; no Ghostscript Making large scans smaller
Redacting pdftoppm and pdftotext (poppler) for rendering and word positions (text layer only), pdf-lib for rebuilding; no MuPDF, no Ghostscript (both AGPL) Removing passages for good, the original stays
Editing PDFs pdf-lib (MIT), encapsulated only via one shared place in the server; evaluation of the alternatives in the Developer manual Stamps, export, editing pages, redacting, shrinking, preview, access copy, labels
Font in our own PDFs Noto Sans and Noto Sans Mono (SIL Open Font License 1.1, licence in server/schriften/OFL.txt and NOTICE), embedded as a subset with @pdf-lib/fontkit (MIT); 1.4 MB in the image (details) Latin (including Turkish, Polish, Czech, Vietnamese), Greek and Cyrillic shown correctly in stamps, letters, export, labels, text documents and the emergency sheet
Workers node:worker_threads, without an additional library: a small pool next to the main thread, see System health PDF work and large exports without other users waiting
Encryption AES-256-GCM (Node.js crypto), key as a file under /data/geheim Stored passwords
Passkeys WebAuthn; verified with @simplewebauthn/server (MIT), in the browser the built-in interface; only public keys in the database Signing in without a password, second factor, signing in again (Passkeys)
Image node:26-alpine, multi-stage build, for amd64 and arm64 – each architecture on its own matching GitHub machine (without emulation), then merged into one image Runs on the NAS next to the PostgreSQL image
dms-komplett The same image with PostgreSQL 18 (Alpine package) in the same container; database in the folder /data/postgres Ablago and database in one container
Checks GitHub Actions: type check, tests against PostgreSQL, image build Every push to main, every pull request, every version tag and once a week

Limits

How large something may be at most. Ablago checks every limit before it processes the data; anything larger is rejected with a message (usually “413 – too large”). In the source code all limits are in one place: server/src/grundlagen/grenzen.ts.

What At most
Uploading, replacing or photographing a document 100 MB
File for “Fill in from document” without filing 30 MB
Text recognition and preview of Office files 100 MB per file; larger ones get no full text or preview
Attachments of an e-mail together 50 MB
Package (archive and all files under code/ together) 128 MB
Bundle file 256 MB, at most 50 packages
Catalogue, signature and key of a package source 10 MB
Uploaded packages not yet installed 30 minutes; 512 MB together in memory, beyond that the oldest are dropped
Converted version, archive version and preview image from packages 50 MB, 100 MB, 5 MB
Error report (with screenshot and attachments) 30 MB, the screenshot 10 MB
Logo of a design 1 MB
Setup file 64 KB
Call from outside body 16 KB, 10 parameters of 500 characters each; 30 calls per minute from one network (IPv4 /24, IPv6 /64), 12 accepted per minute per address; failed attempts: 12 per minute per address, 600 per minute in total
Call URL 50 destinations; content at most 256 KB, 8 KB of text per field value, 10 parameters of 500 characters each; 10 seconds per call; Ablago reads at most 64 KB of the response and discards it
Send e-mail 50 recipients per run, 50 e-mails per automation and 200 for all together in 24 hours; subject 200, text 4000 characters
Passkeys 20 per person, name 60 characters, device response 16 KB; signing in without email address: 20 challenges per IP address or IPv6 /64 in 5 minutes, 20,000 open in total
E-invoice (XML as a file or from the PDF attachment) 4 MB, at most 64 levels deep, 200,000 elements, 500 items are taken over; without DTD and entities. Ablago doesn't read anything larger as an e-invoice
All other requests (forms, settings) 2 MB; they do not accept a file at all

A reverse proxy in front needs its own limit slightly above that, for nginx client_max_body_size 260m; (with bundle files) or 130m (without), see Installation.

Many simultaneous requests

A household has 2–6 users, a small business 10–20. A single user already triggers several requests at once (opening the Library is 6–10), plus WebDAV programs, packages and scripts. 100 simultaneous requests – about 10–15 people clicking at the same moment – are the realistic upper limit; Ablago is designed for this and it is measured regularly (load test in three levels). What each device copes with is under What Ablago copes with; you can measure yourself with the load test. More hardly ever happens in operation, for instance with a wrongly configured WebDAV program.

  • Overload protection: if 250 requests are already running at once (DMS_MAX_ANFRAGEN), every further one immediately gets the answer "Ablago is very busy right now. Please try again in a few seconds." (HTTP 503 with Retry-After: 5) – instead of hanging in an ever longer queue until browsers and programs give up. That keeps response times and memory limited, and Ablago recovers by itself as soon as the load eases. The container's health check is never rejected. When the protection kicks in, "Überlast: …" (overload) appears in the log at most once a minute – as a notice with the number of rejections, not as an error; the individual requests with 503 no longer appear there.
  • Database connections: at most 10 at once. In the load test with 100 simultaneous requests, 5, 10 and 20 connections were level: the bottleneck is the computing time that server and PostgreSQL share, not the number of connections. Each connection costs PostgreSQL about 5–10 MB of memory. Only with clearly more cores (or PostgreSQL on a computer of its own) can more help: DMS_DB_VERBINDUNGEN (2–100; PostgreSQL allows 100 connections in total by default). With several processes, the number applies to all of them together. How long queries wait for a free connection is shown by Workbench → Database connection under Server load. This includes a separate connection for locks (see below); the pool for requests and work has one fewer (9 by default).
  • Locks on their own connection: schedules (bin, deadlines, emergency contacts …), installing packages, intake folders, mailboxes and the sign of life take session locks in PostgreSQL. Before, each of them held a connection from the pool while its work ran – when many schedules met in the same second, the pool was full, every piece of work waited for a connection, and Ablago hung silently. Now all locks of a process run over one connection of their own; the work itself holds none. If this connection drops, the log warns ("Verbindung für Sperren abgebrochen"), running work carries on, and Ablago rebuilds it. The schedules also start staggered (a fixed offset per schedule) instead of all in the same second.
  • Waiting with a time limit: if a request waits longer than 10 seconds for a free connection, the log says "Anfragen warten lange auf eine freie Verbindung zur Datenbank" with the number of connections in use, reserved and waiting and the locks running. After 30 seconds it gives up and gets a 503 ("Ablago is busy") instead of waiting for ever. Workbench → system health shows for the connections how many are in use and reserved right now and which locks are running.
  • Health check with database: /api/gesundheit (and so the Docker health check) checks the database with a short query (at most 5 seconds, result cached for 5 seconds). If no connection is free or the database doesn't answer, it reports 503 with "zustand": "datenbank" – the container then counts as unhealthy. It also says where the problem is: "datenbank": "antwortet-nicht" (no connection free or no answer within the time limit – Ablago is stuck) or "abgewiesen" (the database refuses the connection – it is off or can't be reached), plus seit (point in time) and dauerS (seconds). Nothing more: no error text, no address, no version – anyone who knows the address can see the answer. What to do: Ablago doesn't load or stays black.
  • Heavy work such as PDF editing and large exports runs in separate workers so that other users don't wait.
  • People come first: background work – the workers, the package runner (e.g. text recognition) and the programs Ablago starts (pdftoppm, qpdf …) – runs at lower priority (nice 10, adjustable with DMS_HINTERGRUND_NICE, 0 = off); requests from people and PostgreSQL get the cores first. If the container doesn't allow this, everything carries on at normal priority and the log says so once.
  • Several processes (below): several processes answer the requests together and so use several cores. Without DMS_PROZESSE, Ablago takes 2 by itself if the container may use at least 4 cores and 8 GB of memory – dms-komplett, the image dms with its own database.
  • The current values of DMS_PROZESSE, DMS_ARBEITER, DMS_DB_VERBINDUNGEN and DMS_MAX_ANFRAGEN and where they come from are shown by Workbench → system health; if something gets tight, the notice there names the variable that can help (Settings and bottlenecks).
  • Sign-in protection counts every failed attempt even under load; a rejected sign-in (503) checks no password and therefore doesn't count.
  • Password checks: every check of a password (signing in, confirming again, changing the password) deliberately costs computing time with scrypt – about 265 ms and 16 MB of memory on a small NAS. At most 2 run at once per process; further ones wait briefly in a queue. If 50 are already waiting, every further sign-in immediately gets “A great many sign-ins are happening right now …” (HTTP 503 with Retry-After: 5) – the same for known and unknown addresses, and without counting as a failed attempt. That way a wave of sign-in attempts doesn't tie up more computing time than necessary, and files and other requests carry on.

Several processes

Ablago answers requests with Node.js in one thread per process. With one process, one core works on the requests, even if the server has more. With DMS_PROZESSE, several processes answer the requests together:

Value Meaning
not set like auto – dms-komplett, the image dms with its own database
1 one process
2 to 16 that many processes
auto 2 processes if the container may use at least 4 cores and 8 GB of memory, otherwise 1 (before cores − 1, at most 2). What counts is the container's limit (cpus, mem_limit), otherwise the computer

Default: without DMS_PROZESSE, Ablago chooses by itself – two processes with at least 4 cores and 8 GB, otherwise one (Raspberry Pi, small NAS). Both images follow the same rule. You decide how much Ablago may use with the container's limits: if you limit it to 2 cores (cpus: 2) or 4 GB (mem_limit: 4g), you get one process. Without work, both processes sit at 0 % CPU. On the maintainer's NAS (6 threads, 16 GB), the second process gave 697 instead of 497 requests per second at level small and moved the load limit from 250 to 450 simultaneous requests; memory rose from at most 1.8 GB to just under 3 GB together. Back to one process: DMS_PROZESSE=1 in the Compose file. What was chosen and why is shown in Workbench → system health (“automatic: 6 cores, 16 GB → 2 processes” or “container limit: 2 cores, 16 GB → 1 process”) and in the log at startup.

Image dms with its own database: two processes open 14 instead of 10 connections to the database together (see below). If you set DMS_DB_VERBINDUNGEN, auto only takes as many processes as this number carries – process 1 needs 6, each further one 2: below 8 it stays at one process, and Workbench → system health says so (“(limited by DMS_DB_VERBINDUNGEN)”). The pools of all processes together thus stay below this number. If your database shares its connections with other programs, set DMS_DB_VERBINDUNGEN to what Ablago may have of them. When updating: on a computer with at least 4 cores and 8 GB whose container isn't limited, Ablago then runs with two processes – about 1 GB more memory under load. If you don't want that: DMS_PROZESSE=1.

More than 2: for now auto doesn't take more: on a NAS with 6 threads, 4 processes only made the median faster, not the slow requests (p95) when saving – with PostgreSQL in the same container as well as in a container of its own; the load limit even dropped, and memory rose to 3.5 GB (with saving 5.8 GB). It stays at 2 until a measurement shows that more helps (with dms-komplett at most 2 later too, because there Ablago and PostgreSQL share the cores). A fixed number (e.g. DMS_PROZESSE=4) still applies as it is. For a household, a Raspberry Pi or a small NAS it stays at one process – there a second one brings nothing but costs memory. Measurements under What Ablago copes with.

This is how the processes work together:

  • A slim main process starts the processes, distributes the connections to them in turn and restarts a crashed process after 1 second (with repeated crashes with a growing pause up to 1 minute). Sign-ins are kept; they are in the database.
  • Process 1 leads: at start-up it shows the page "Ablago is starting …", brings the database up to date and does all the background work – text recognition, thumbnails, schedules, automations, the package runner (exactly once), intake folders, mailboxes, backup and restore. Besides that, it answers requests like all the others. The remaining processes only start once it is ready.
  • Maintenance mode, sign-in protection, workbench jobs and settings apply in all processes (after a few seconds at the latest). The lock against a downgrade stops Ablago as with one process. The container's health check stays unchanged; the command dms in the container works as before.
  • Memory: every process needs its own memory. When idle it is about 250–300 MB per process, under load clearly more: Node.js only tidies up memory bit by bit. Plan about 1 GB per process and adjust mem_limit (auto only takes two processes from 8 GB); the main process itself only needs about 40 MB. So that not every process acts as if it had the container to itself, Ablago limits Node.js's heap in every process: in the further processes (process 2 onwards) to 60 % of their share, 1–1.5 GB, in process 1 to 512 MB more, because it also does the work in the background (1.5–2 GB). In the load test, a further process then needed about 720 instead of 1,050 MB; on a NAS, process 1 without a limit grew to 2.6 GB (heap 2.3 GB) at gross with saving, process 2 with a limit only to 1.3 GB. The main process stays without a limit; both values are in the log at start-up (haldeLeiterMb, haldeMb). If you set --max-old-space-size in NODE_OPTIONS yourself, your value is kept. The processes share the caches for the PDF display, page images and stamped WebDAV versions: together they take at most as much as with one process.
  • Crashes of a process are counted by the main process (with number and code or signal); the load test shows them for each run, together with the kinds of errors (e.g. broken connections).
  • When it is worth it: only with free cores. On a computer with 2 cores (Ablago, PostgreSQL and the load share them), a second process was slower than one at level medium; at level large it moved the limit from 100 to 150 simultaneous requests. That's why auto takes one process below 4 cores. Details: Developer manual → Performance.

Database connections – for all together: DMS_DB_VERBINDUNGEN applies to all processes together (before: per process). Process 1 gets 4 connections first – one of them for its locks and the rest for its background work (before, it held 3 of them permanently for locks); all processes share the rest equally (each further one at least 2, process 1 at least 6 in total). Without the variable it is 10 as before with one process and 4 more for each further process (2 processes 14: process 1 has 9, process 2 has 5; 4 processes 22 instead of 40 before). If the number is too small for the processes, Ablago raises it to the minimum; if it were more than the database allows (max_connections, minus 10 for others), Ablago reduces it – both are written to the log.

Why together: more connections don't make a database faster that shares the cores with Ablago. If more queries run at once than PostgreSQL has cores, each waits longer for computing time and for other people's locks – which hits saving in particular. With 4 processes, Ablago used to open 40 connections, on a NAS with 6 threads.

When updating: with one process nothing changes. If you have set several processes and DMS_DB_VERBINDUNGEN, you now get this number for all together instead of per process. For the previous behaviour, multiply the value by the number of processes (e.g. 3 processes with 20 per process: DMS_DB_VERBINDUNGEN=60).

What applies per process: DMS_MAX_ANFRAGEN and DMS_ARBEITER apply per process. The default number of workers is divided among the processes (at least 1 per process) so that together no more threads compute than with one process. Workbench → system health shows the values with "per process, together …" or, for the connections, the division ("together for 2 processes: leader 9, each further one 5") and below them one line per process with memory, computing time, waiting time and running requests. Where things get stuck under load – waiting for connections, locks, computing time of PostgreSQL and Ablago, restarts and memory per process – is shown by the load test for each run.

Stopping and restarting

With SIGTERM or SIGINT (e.g. docker stop, Ctrl+C) Ablago shuts down in an orderly way: open requests finish, background work stops, database connections close. Each process takes at most 7 seconds for this – even with a single process, below the 10 seconds of docker stop. If a step takes longer (for example a request that does not finish), the process ends itself and logs where it hung ("Beenden: nach 7 s noch nicht fertig – hängt bei …"). All of its processes end:

  • The package runner and, with DMS_PROZESSE, the further processes end by themselves as soon as the connection to their parent process breaks – even if it crashes or is killed hard.
  • Programs Ablago starts (pdftoppm, qpdf, Ghostscript, text recognition …) are ended together with Ablago, after an orderly shutdown as well as after a crash.
  • Only a SIGKILL (kill -9) gives Ablago no time for this; in a container everything ends with the container anyway.

docker stop: Docker sends SIGTERM and SIGKILL after 10 seconds (default). In the image dms, Node.js receives the signal itself (process 1); in dms-komplett, tini passes it to the start script, which stops Ablago first and then PostgreSQL. With several processes (DMS_PROZESSE) the main process waits up to 8 seconds for them – below the 10 seconds of docker stop. If a process isn't finished by then, the main process ends it hard itself and writes that to the log ("Beenden: Prozess … nach 8 s noch nicht beendet"); Docker doesn't need to step in. A longer waiting time for the container (stop_grace_period) is therefore not needed for Ablago itself; only dms-komplett needs it for PostgreSQL (see Installation).

Interface

/api/v1 for other programs (API keys), description under /api/openapi.json. The user interface itself uses internal addresses under /api/… that may change.

Help without internet

The image brings the manuals of its version with it, in German and English: start page, How do I get a DMS?, User, Administrator and Developer manual, reachable under /hilfe/ of your own installation (e.g. http://<NAS>:8080/hilfe/, in English under /hilfe/en/), without signing in and already in the setup assistant. The question mark next to a heading and the links to the manual open this version, in the language of the person signed in. It works without internet; only the screenshots are missing – in their place is a link to the same page online. In the footer of every page you get to the online help and to the newest version.

Prefer pictures? Under Workbench → Email and address, Open help online switches this for the whole installation: question marks, the assistant, tips and tours then open the online help on help.ablago.app, with screenshots. The default is off. The built-in manual stays reachable through the link Open built-in manual next to the switch (/hilfe/?eingebaut); the setup assistant does not use the setting yet.

Modules

Every line in the log belongs to a module. For every request to the server, Ablago writes a line with method, path, status, duration and database accesses – in the module of the area the request belongs to (e.g. ablage for folders). Requests that only read – including previews, counts and test runs that the interface sends by POST – are only at level debug, i.e. only in debug mode.

The filter of Workbench → Log lists all modules with their name – including those for which nothing is in the log right now ("(no entries)").

Name in the filter Module What
System system Start, settings, debug mode
Requests (HTTP) http Requests that belong to no other module (e.g. pages of the interface)
User accounts and sign-in konto Sign-in, sign-in protection (blocked accounts and IP addresses), sessions, users, roles, stand-ins
Library ablage Creating, changing, deleting folders; views, bin, notes, tasks
Documents dokumente Uploading, displaying, deleting
Workbench werkbank Folder types, packages, load test data, settings, version check
Data protection datenschutz Access requests, retrieval links, deletion concept
Text recognition texterkennung completed, skipped, failed, restarted, cancelled; settings
Converting files umwandlung Versions from packages (e.g. TIFF → PDF)
Archive version archivfassung PDF/A from packages
Thumbnails vorschau Creating thumbnails
Database datenbank Migrations, connection, long accesses
Email mail Sending and errors when sending
Backup sicherung Backup, emergency sheet, restore and test
Events ereignisse Distributing events to packages and automations
Automations automatisierung Runs of the automations
Packages pakete Package runner and package code: output, errors, crashes, abandoned events

Sign-in and sign-in protection deliberately stay in one module: a block results from failed sign-in attempts – whoever looks for a block sees both together.

Where things are

What Where
Permanent log Container logs: docker logs <app-container>
Log of the last 24 hours Workbench → Log
Long database accesses Workbench → Database connection (table langlaeufer)
Backing up the database best via Workbench → Backup; additionally with two containers docker exec <db-container> pg_dump -U dms dms > dms.sql, with dms-komplett docker exec <container> pg_dump -h 127.0.0.1 -U dms dms > dms.sql
Backing up files Folder files from the Compose template

Versions and updating

The image contains Node.js, Alpine Linux and all libraries; you update by pulling ghcr.io/motom001/dms:stabil again and restarting (see Which image tag?). :stabil moves once a week (early on Tuesday) to the newest tested version, urgent fixes (label sofort-stabil) right after the release; :main gets every state at once.

  • Two containers (recommended): PostgreSQL is an image of its own (postgres:18): minor versions (18.x) by pulling again, independently of Ablago.
  • dms-komplett: PostgreSQL (Alpine package) is in the image ghcr.io/motom001/dms-komplett and comes with its updates. Both images are rebuilt with every change and at least every week, with the Alpine packages of the same day (tag main); fixed version numbers get new Alpine packages with the next release, :stabil with the next stable version (once a week).
  • Changing the major version (e.g. 17 → 18) needs a backup and restore in both cases, see Growing and moving.

The version check in the workbench only asks at the push of a button (by itself once a day only with a switched-on automation “New version available”, and then only GitHub for the stable version): GitHub for Ablago's state, endoflife.date for Node.js, PostgreSQL and Alpine, the npm registry for the libraries. It separates what you update yourself (Ablago image, with two containers PostgreSQL) from what comes with Ablago (Node.js, Alpine, libraries – with dms-komplett also PostgreSQL). For Ablago itself, the yardstick is the stable version – the release marked “Latest” on GitHub, which moves with :stabil once a week; the releases in between are not “Latest”.

The decisions behind the design are in entscheidungen.md.