Skip to content

Installation

An installation is one stateless binary (decuma, with the web app and the rule data embedded), one PostgreSQL 16 database and one place for Belege (a directory or an S3-compatible bucket). It calls no service of the maintainer.

  • A Linux machine (or macOS, or Windows with WSL 2) with Docker and Compose 2.23 or later, curl, 3 GB of memory and 6 GB of free disk for the first build. Nothing else: no account anywhere, no service of the maintainer.
  • For use beyond this machine: an HTTPS reverse proxy (Caddy, nginx) in front, or the home network over plain http.
  • Optional: an SMTP server for confirmation and password-reset mails. Without one, the server prints one-time links in your terminal instead (see “Without SMTP”).
Terminal window
git clone https://github.com/rapha-red/open-decuma decuma && cd decuma
sh deploy/setup.sh

The setup checks this machine first and changes nothing until every check passes. Each problem is one line saying what to fix:

Checking this machine...
ok folder: /srv/decuma
ok Docker: 28.3.0, with Compose 2.39.1
ok memory: 15 GB
FIX Port 8080 is already in use on this machine. Stop what uses it, or choose another one with --port 8081, then run this again.

Then it asks four questions; Enter takes the default in brackets:

Question Default Choices
Way in lokal lokal: only this machine, at http://127.0.0.1:8080. heimnetz: every device of your home network, over plain http, at this machine’s private address. domain: your own domain behind an HTTPS reverse proxy you run (the setup prints the Caddyfile).
Zeitzone Europe/Berlin The days the law means: deadlines, dates of Belege.
Belegablage ordner ordner: a Docker volume on this machine (<project>_ablage, not a folder you choose; see “Ablage in a folder of the host”). s3: an S3-compatible bucket (endpoint, region, key, secret).
SMTP skip skip, or the host, port, encryption, user and sender address.
Belege by e-mail skip skip, or the domain that receives them (its MX record points to this machine) and the port on this machine (default 25).

It writes .env (readable only by you; lines you add are kept), generates the database passwords and the key for stored secrets (DECUMA_SECRET_KEY), builds the image (the first build compiles from source and takes 10 to 30 minutes), starts PostgreSQL and the server, waits until the server answers, and ends with the one-time link that creates the first account:

To create the first account, open this one-time link in your browser. Anyone who has it can use it, once:
Einrichtungscode 7KQ2-M9XD-H4TP works once, until 11:14 (Europe/Berlin)
Link http://127.0.0.1:8080/#/einrichtung?code=7KQ2M9XDH4TP

The link is printed only when the output is a terminal; in a log it would let whoever reads it create the account. Otherwise, and whenever you need a new one (it works 10 minutes and once):

Terminal window
docker compose exec decuma decuma setup-link

The page behind the link creates the first account (e-mail and password; no confirmation mail, the link proves you have the server), offers the second factor and continues with your first Mandant. The second factor can wait; Decuma asks for it before a Freigabe, a password change, a new API-Schlüssel or a deletion.

Running sh deploy/setup.sh again repairs the install: it keeps your answers as defaults, your passwords and your data. Flags answer every question for scripts (sh deploy/setup.sh --help), for example:

Terminal window
sh deploy/setup.sh --ja --zugang domain --domain decuma.example.com --smtp skip

--check only checks the machine. Keep .env with your backups: the database cannot be opened without its passwords.

Compose prefixes volumes and containers with the project name. The setup writes it to .env as COMPOSE_PROJECT_NAME: the folder name for a new install (decuma for the clone above), decuma for an install from before this line existed, or --projekt NAME. A second install goes into another folder (or gets --projekt decuma2) and another port (--port 8081); its --check then looks at its own volumes only. Every docker compose command run in a folder acts on that folder’s install.

With ordner, the Belege live in the Docker volume <project>_ablage (under Docker’s own directory, docker volume inspect <project>_ablage). To keep them in a folder you choose, map it in compose.override.yaml next to compose.yaml (Compose reads it by itself) before the first start, and make it writable for the server’s user (uid 10001):

services:
decuma:
volumes:
- /srv/decuma/ablage:/var/lib/decuma/ablage
Terminal window
sudo mkdir -p /srv/decuma/ablage && sudo chown 10001 /srv/decuma/ablage

Moving an existing Ablage: stop (docker compose stop decuma), copy the volume’s content into the folder (docker compose run --rm --no-deps -v /srv/decuma/ablage:/ziel --entrypoint sh decuma -c 'cp -a /var/lib/decuma/ablage/. /ziel/'), add the override, docker compose up -d.

The receiver is off until DECUMA_EMAIL_INBOUND is set. The server runs as an unprivileged user, so it listens on 2525 inside the container; deploy/compose.email.yaml publishes it on port 25 of this machine (DECUMA_EMAIL_PORT, DECUMA_EMAIL_BIND). The setup writes these lines when you give a domain; by hand:

Terminal window
COMPOSE_FILE=compose.yaml:deploy/compose.email.yaml
DECUMA_EMAIL_INBOUND=0.0.0.0:2525
DECUMA_EMAIL_DOMAIN=belege.example.com

The domain needs an MX record pointing to this machine, and port 25 must be reachable (many home and cloud providers block it; then put a relay in front and set DECUMA_EMAIL_AUTHSERV_ID).

The open build ships no model provider and reads no Beleg by itself (ADR 0049): every Beleg is captured by typing its lines (or by an agent that reads it), and an E-Rechnung is read from its structure. To add a reading or decision step of your own, implement its port or run a service against the SDK: Ports and hooks.

The image carries the same decuma binary as the CLI and the MCP server. They talk to the REST API and need an API-Schlüssel (or a session).

Order of steps for an agent. Agent work is never done under the person’s session: the Command-Log would show the person as the actor. Instead the person, signed in to the app:

  1. sets up the second factor (Konto > Du > Sicherheit); a new API-Schlüssel needs it,
  2. creates an API-Schlüssel for the Mandant with the Freigabeklassen the agent needs (Konto > Automatisierung > Schnittstellen, or api_key.create; a key without any only reads); the token is shown once,
  3. hands the token to the agent as DECUMA_API_KEY. Every write of the agent is logged with the key as actor; the Freigabe of a Meldung stays with the person.

In the container, from the install’s folder:

Terminal window
docker compose exec -e DECUMA_API_KEY decuma decuma mandant.get
docker compose exec -T -e DECUMA_API_KEY decuma decuma master_data.set_from --payload-file /dev/stdin < payload.json

-e DECUMA_API_KEY passes the variable of your shell. decuma login does not work in the container (its user has no home directory to keep a session in); use the key. A file of the host is not visible in the container: pipe it (--payload-file /dev/stdin) or use the host binary.

On the host, with the binary copied out of the image (Linux x86_64 or arm64, the architecture of the image):

Terminal window
docker compose cp decuma:/usr/local/bin/decuma ./decuma
export DECUMA_URL=http://127.0.0.1:8080 DECUMA_API_KEY=<token>
./decuma mandant.get
./decuma file.store --media-type application/pdf --content @rechnung.pdf # upload by path
./decuma download <hash> --to kopie.pdf # download to a path
./decuma mcp # MCP on stdin/stdout

decuma <command> --help lists every field with its allowed values, nested fields and which are required; the exit codes are at its end. An MCP client starts decuma mcp with DECUMA_URL and DECUMA_API_KEY in its environment.

Remote MCP over HTTPS (AI apps with custom connectors)

Section titled “Remote MCP over HTTPS (AI apps with custom connectors)”

With DECUMA_MCP=an the server answers MCP over Streamable HTTP at <DECUMA_PUBLIC_URL>/mcp: the same tools, the same Freigaberichtlinie and the same refusals as decuma mcp, without a local binary. Off by default (on with an API-Schlüssel under decuma dev). Protocol revision 2026-07-28 and, for older clients, 2025-11-25, 2025-06-18 and 2025-03-26 (no sessions, no stream on GET). Serve it behind TLS (see TLS); the server refuses a browser request from another origin.

  • With an API-Schlüssel (DECUMA_MCP=an or oauth): the client sends Authorization: Bearer <API-Schlüssel> on every request. Claude Code: claude mcp add --transport http decuma https://decuma.example.com/mcp --header "Authorization: Bearer <API-Schlüssel>".
  • With OAuth (DECUMA_MCP=oauth): the installation is its own authorization server (OAuth 2.1, PKCE S256, Client ID Metadata Documents and dynamic client registration, refresh tokens rotated, revocation). An app needs only the address https://decuma.example.com/mcp; the person signs in to Decuma (with the second factor if on), picks one Mandant and what the app may do, and confirms with the second factor. The connection is an API-Schlüssel of that person for that Mandant: it shows under Konto > Automatisierung > Schnittstellen as “verbundene App” and is revoked there. DECUMA_PUBLIC_URL must be the https address the app reaches; it is the issuer and the resource of the tokens. Claude: Settings > Connectors > Add custom connector, address https://decuma.example.com/mcp. ChatGPT (developer mode): a connector with that address and authentication OAuth.

A smaller tool list. Every Command has one area (access.tools names it, access.commands takes areas and answers exactly these, core only when named). /mcp?areas=belege,bank,books lists the tools of these areas and of core; without areas the whole list. Areas: core, belege, bank, books, reports, assets, sales, filings, year_end, payroll, company, administration. They change the size of the list and no right: a key sees only its own tools, and a call outside the set is decided by the Freigaberichtlinie as any other. A next step may name a tool that is not listed: call it by its name, or add its area (the instructions of the connection say so). An app connected over OAuth may carry areas in its address too.

Whichever way: every Command needs a rationale and is logged with the key or the connected app as actor; Commands only a person may do (the Freigabe of a Meldung) and Commands that need the second factor are never executed over MCP and answer needs_human.

  • Windows with WSL 2: the way in heimnetz needs mirrored networking (networkingMode=mirrored in %UserProfile%\.wslconfig, then wsl --shutdown); with the default NAT networking other devices of the home network cannot reach the port, and the address the setup finds is WSL’s own.
  • Disk: removing the image (docker image rm decuma:local) leaves the build cache of several GB; docker builder prune frees it.
  • Optional variables are taken from .env and from the shell that runs docker compose: a variable set but empty in that shell (for example AWS_REGION=) reaches the server as empty. Unset it, or start from a clean shell.

New persons join through an invitation from the Inhaber of a Mandant (Konto > Team); registration is closed (DECUMA_REGISTRATION=geschlossen, the default of the open build). With DECUMA_REGISTRATION=offen in .env anyone who reaches the instance can register; without SMTP such an account counts as confirmed at once, since no mail could confirm it.

  • Invitations: Konto > Team gives you the link to pass on yourself.
  • A forgotten password: the person enters the e-mail address and one of the recovery codes of the second factor, or the operator makes a one-time reset link (printed only to a terminal; the second factor and the recovery codes stay):
Terminal window
docker compose exec decuma decuma reset-access erika@example.com

compose.yaml runs PostgreSQL, applies the migrations and starts the server with Belege on a volume. Without the setup, write .env yourself:

Terminal window
umask 077
cat > .env <<'EOF2'
POSTGRES_PASSWORD=<random>
DECUMA_OWNER_PASSWORD=<random>
DECUMA_APP_PASSWORD=<random>
DECUMA_PUBLIC_URL=https://decuma.example.com
EOF2
docker compose up -d --build
curl -fsS http://127.0.0.1:8080/health
docker compose exec decuma decuma setup-link

Passwords must not contain a single quote. The roles are created when the database volume is new; changing a password later is alter role ... password ... in psql. The server listens on 127.0.0.1:8080 (DECUMA_BIND and DECUMA_PORT change address and port); point the reverse proxy there. DECUMA_PUBLIC_URL must be https unless it is an address of this machine or the home network: serve refuses plain http on a public address. Optional variables (DECUMA_TIME_ZONE, DECUMA_STORAGE, AWS_*, DECUMA_SMTP_*, DECUMA_EMAIL_*, DECUMA_REGISTRATION, DECUMA_FLAGS, DECUMA_EXCHANGE_RATES_URL, DECUMA_KNOWLEDGE_DIR, DECUMA_KNOWLEDGE_URL, DECUMA_ELSTER_HERSTELLER_ID and DECUMA_ELSTER_TESTMERKER (the installation’s own ELSTER Hersteller-ID, five digits, and for test cases the Testmerker, written into the envelope of the Fragebogen data set of formation.fragebogen_file; without the ID no file is made), DECUMA_LINK_*, DECUMA_BUILD_JOBS) are passed to the server only when .env sets them.

Terminal window
(cd app && npm ci && npm run build)
DECUMA_REQUIRE_APP=1 cargo build --release -p decuma-server # target/release/decuma

Create the roles once per cluster as a superuser (ADR 0016):

create role decuma_owner login password '...';
create role decuma_app login nosuperuser nobypassrls password '...';
create role decuma_deletion nologin nosuperuser nobypassrls;
grant decuma_deletion to decuma_owner;
create database decuma owner decuma_owner;

Then, on every install and upgrade:

Terminal window
DECUMA_OWNER_DATABASE_URL=postgres://decuma_owner:...@localhost/decuma decuma migrate
DECUMA_DATABASE_URL=postgres://decuma_app:...@localhost/decuma DECUMA_STORAGE=file:/var/lib/decuma/ablage decuma serve

migrate runs as the owner of the schema; serve runs as decuma_app, which owns nothing and cannot bypass row-level security. serve, setup-link and reset-access refuse to start when their role can read past row-level security: a superuser, a role with BYPASSRLS (also one it is a member of), or the owner of a table (who can switch the policies off). The error names the reason; point DECUMA_DATABASE_URL at decuma_app and start again. There is no switch to override it: decuma dev and the tests already connect as decuma_app. Both connect to PostgreSQL directly or through a pooler that keeps a connection per session; one that hands them out per transaction or statement (PgBouncer transaction) does not work: migrate holds a lock of its session, and statements are prepared per connection. The first account: decuma setup-link with the same DECUMA_DATABASE_URL and DECUMA_STORAGE as serve.

Everything comes from the environment.

Variable Used by Meaning
DECUMA_OWNER_DATABASE_URL migrate Connection as decuma_owner
DECUMA_RULE_DATA_REPLACE migrate 1 replaces built-in rule data versions changed since a pre-release installation loaded them (see Updates)
DECUMA_DATABASE_URL serve Connection as decuma_app; a superuser, a BYPASSRLS role or a table owner is refused at start
DECUMA_STORAGE serve Belegablage: file:/absolute/path or s3://bucket (required)
AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, AWS_REGION, AWS_ENDPOINT_URL, AWS_ALLOW_HTTP, AWS_VIRTUAL_HOSTED_STYLE_REQUEST serve S3 settings, only with s3:// (path-style requests unless the last is true)
DECUMA_LISTEN serve Address and port, default 127.0.0.1:8080
DECUMA_PUBLIC_URL serve, einrichtungslink, zugang-zuruecksetzen Address users reach, used in links; default the listen address. Plain http only on this machine or the home network; then the session cookie is not Secure
DECUMA_REGISTRATION serve, dev geschlossen (default of serve in the open build: new persons by invitation, the first account by Einrichtungslink) or offen (default of dev)
DECUMA_SMTP_HOST, DECUMA_SMTP_PORT, DECUMA_SMTP_ENCRYPTION (starttls default, tls, none), DECUMA_SMTP_USER, DECUMA_SMTP_PASSWORD, DECUMA_SMTP_FROM serve Outgoing mail; DECUMA_SMTP_FROM is required with a host. Without a host, links go to the log and the app says what to do instead (see “Without SMTP”)
DECUMA_SECRET_KEY serve 32 random bytes, base64url (openssl rand -base64 32 | tr '+/' '-_'): the key the instance encrypts stored secrets with (webhook signing secrets, invitation links kept without SMTP). Without it, creating a webhook is refused with a FIX message, and “Link kopieren” is not offered. Keep it in the password manager: secrets stored with it cannot be read without it. The Mandant export leaves these secrets out
DECUMA_WEBHOOK_ALLOWED_NETWORKS serve Comma-separated CIDR of internal networks a webhook may reach (default none: only public addresses)
DECUMA_EMAIL_INBOUND, DECUMA_EMAIL_DOMAIN, DECUMA_EMAIL_MAX_MB, DECUMA_EMAIL_AUTHSERV_ID serve The receiver for Belege by e-mail: listen address (such as 0.0.0.0:25), the receiving domain (an MX record points to this host), size limit (default 30). Off when unset. With a relay in front that checks SPF, DKIM and DMARC, its authserv-id: only then a mail counts as authenticated and a Regel may book its Belege alone
DECUMA_VAPID_PRIVATE_KEY, DECUMA_VAPID_SUBJECT serve with the flag web_push Web push through the browser vendor’s push service: base64url of a P-256 PKCS#8 key and mailto: of the operator
DECUMA_TEAM_MAX serve Ceiling of persons per Mandant (unset: none)
DECUMA_EXCHANGE_RATES_URL serve, dev Where the euro reference rates of the day are fetched from, every six hours, for a Bankkonto in another currency: unset, the ECB’s file of the last 90 days (https://www.ecb.europa.eu/stats/eurofxref/eurofxref-hist-90d.xml) under serve and nothing under dev; any address serving the same XML; off for none. Without it, or offline, a line of a day without a rate is refused until a person records the rate of the day (reference_rate.record)
DECUMA_KNOWLEDGE_DIR serve, dev A directory of Markdown documents (a published knowledge base) for Wissen in the search: read when the server starts and split at the headings of level 2 and 3; a document with status: draft in its front matter and sections headed “Offene Punkte”, “Offen” or “StB-Frage” stay out; symbolic links are not followed. Unset, Wissen is empty
DECUMA_KNOWLEDGE_URL serve, dev The address the documents of DECUMA_KNOWLEDGE_DIR are published under (<url>/<path>#<anchor> is the link of a hit); unset, a hit names the path and opens nothing
DECUMA_EDITION serve selbst (default) or gehostet: the hosted edition names its operator as “uns” in refusals
DECUMA_CONFIRMATION_MINUTES, DECUMA_RESET_MINUTES serve Validity of confirmation (default 1440) and reset links (default 60)
DECUMA_RATE_SIGN_IN, _REGISTRIERUNG, _RESET, _MAIL, _KONTAKT, _API, _OAUTH serve, dev Rate limit per path class as N/MINUTES (like 10/15) or off. Unset: no limit in this edition; with DECUMA_EDITION=gehostet the defaults are 10/15, 5/60, 5/60, 10/60, 5/60, 600/1, 20/15. _API also counts the remote MCP endpoint /mcp; _OAUTH counts /oauth/authorize and /oauth/register (not /oauth/token). Counters are per source address (the peer, or the last hop of X-Forwarded-For from loopback or a trusted proxy, see below), for _MAIL, _KONTAKT and _API per session, API-Schlüssel or app token. Refusal: not_allowed, HTTP 429, Retry-After. Counters live in the process
DECUMA_LINK_AGB, DECUMA_LINK_DATENSCHUTZ, DECUMA_LINK_IMPRESSUM serve Links to the operator’s terms, privacy notice and imprint, shown in the app
DECUMA_TIME_ZONE serve IANA time zone of the days the law means, default Europe/Berlin
DECUMA_FORMULARNAME_TAGE serve Days after which a form name of the catalogue (Anträge, Fragebogen) is shown with the warning formularname_alt, default 365
DECUMA_BELEG_TYPES, DECUMA_BELEG_MAX_MB, DECUMA_BELEG_MAX_PAGES serve Accepted media types (comma-separated), size limit (default 25) and page limit (default 20) per Beleg
DECUMA_READ_AGAIN_MAX serve How often beleg.read_again reads one Beleg whose readings end without fields before it refuses with “Daten von Hand erfassen” (default 5)
DECUMA_ASKS_PER_MANDANT serve How many readings, and how many decisions, one Mandant may have open at a model port at the same time; a further one waits its turn (default 4)
DECUMA_ASKS_TOTAL serve How many questions to a model port are out at the same time, over all Mandanten; a further one waits (default 16)
DECUMA_CAPTURE_LIMITS serve, dev Limits of the quality gate a picture must meet before it is read (ADR 0053), as key=value pairs separated by commas over the defaults: min_text_height=10 (height of a line of text on the prepared page, pixels), min_sharpness=0.2, min_brightness=90 (paper after the contrast step, 0 to 255), max_glare=0.02 (share of the page), min_fill=0.3 (share of the picture); file.quality_limits shows them
DECUMA_FLAGS serve Feature flags that are on, comma-separated (ADR 0015)
DECUMA_MCP serve, dev Remote MCP at /mcp: aus (default of serve), an (API-Schlüssel; default of dev), oauth (also apps connected over OAuth; needs an https DECUMA_PUBLIC_URL)
DECUMA_BANK serve Bank connection, off by default (ADR 0051): http fetches accounts and statements from a service you run in front of your bank, at DECUMA_BANK_URL with optional DECUMA_BANK_API_KEY (bearer token); the JSON contract is in Ports and hooks. Without it bank lines come by file or delivery
DECUMA_BANK_CONSENT serve, dev Live bank access per Mandant through a consent the account holder gives at the bank (ADR 0058), off by default: names the provider of the consent port. enable_banking reads through your own Enable Banking application (ADR 0059; Ports and hooks); under decuma dev, fake offers the test fake (PUT /dev/bank_consent); any other value refuses to start
DECUMA_BANK_EB_APP_ID serve, dev With DECUMA_BANK_CONSENT=enable_banking: the application id of your Enable Banking application
DECUMA_BANK_EB_KEY_FILE serve, dev With DECUMA_BANK_CONSENT=enable_banking: path of the application’s private key (PEM, PKCS#8 or PKCS#1), readable only by the server’s user; in a container, mount the file read-only and give its path inside the container
DECUMA_BANK_SYNC serve, dev off (or false, 0, any case) stops the unattended reads of Bankzugänge (see “Bank reads”); reading by hand (bank_connection.sync) stays. Unset, on, true or 1: on; any other value stops the start

A Bankzugang (a consent the account holder gave at the bank through a provider of live bank access, ADR 0058) is read without anyone present once a day. serve (and decuma dev) checks every 5 minutes which Bankzugänge are due and reads them as the installation, without the headers of a person:

  • once a day, never sooner than 20 hours after the last attempt (failed attempts count: the bank counts them too);
  • after a failure again after 1 hour, then after 4 hours, then the next day; after a rate limit of the provider or the bank after 6 hours;
  • a Bankzugang whose consent has ended is ended at its next check.

Fetched Bankumsätze notify nobody and ask for no approval; their Rückfragen wait in the Eingang. The persons who manage the Mandant are told, by e-mail and in the app unless they switched it off, 14 and 7 days before a consent ends and once after reads have failed on three days; agents read the same as the Events bank_connection.expiring and bank_connection.failing. A person or a program reads a Bankzugang at most every 5 minutes (bank_connection.sync; sooner is refused with the wait). bank_connection.list shows the last attempt, the last success, the failures and the next attempt.

With several processes on one database, one of them reads at a time (an advisory lock of PostgreSQL; a process that stops releases it). DECUMA_BANK_SYNC=off switches the unattended reads off, for instance while another scheduler of yours calls bank_connection.sync. Without a provider of live bank access nothing is read.

The image and the repository never contain ERiC, the official ELSTER library (ADR 0009); scripts/test.sh selfhost proves it for the image and runs a REST smoke test against compose. Without it, a Meldung is transmitted by hand: after the Freigabe the app shows the input sheet with the released values, you type them into Mein ELSTER and record the Transferticket (filing.transmit with weg: "von_hand", then filing.mark_as_transmitted).

Off by default (ADR 0055). It needs a Linux x86_64 host and two things only you can get:

  1. Your own Hersteller-ID. Register as a software developer with ELSTER (https://www.elster.de/eportal/infoseite/entwickler). The number is yours: the project has none to share, and test transmissions need it too.
  2. The library. Accept its licence in the developer area and download the Linux x86_64 package there. Unpack it outside every repository and image, owned by root and readable by the user of the worker. Never use a beta. Sending, test transmissions too, needs release 45 or newer (the one this product is checked with; the tax administration takes 43 since 27 April 2026, an older one is refused by its server), all plugins and libraries from one package; check the developer area regularly, every April the minimum rises.
Variable Meaning
DECUMA_FLAGS add eric. Turning it on adds the declarant to what is released: a Freigabe given before lapses and is given again
DECUMA_ERIC_HOME absolute path of the directory that holds lib/libericapi.so, as the worker sees it
DECUMA_ELSTER_HERSTELLER_ID your number, five digits; a secret of the operator (environment or secret file of the server, never in a repository). The server hands it to the worker with each request
DECUMA_ERIC_MODE test (default: every transmission carries the Testmerker and is deleted on arrival, nothing is filed) or live; the worker has its own copy of the switch
DECUMA_ERIC_JOURNAL absolute path of the journal, a directory of the server’s user; required for live (below, “The journal”)
DECUMA_ERIC_NOTICE_URL where you publish the privacy notice and the DSGVO letter of the tax administration from the licence; nobody can store a certificate before it is set
DECUMA_ERIC_WORKER absolute path of decuma-eric-worker or of your wrapper (default: next to decuma; the image has it), or unix:<path> of a socket (below)
DECUMA_SECRET_KEY required: it encrypts the certificates and PINs

Start with test, transmit once, then switch to live and restart. elster.status lists the duties of the licence and what is missing. The end of the certificate is read when it is stored; an expired one is refused before a Freigabe is asked. A transmission whose outcome is unknown is never repeated: look in Mein ELSTER and record what you found (filing.resolve_attempt, ten minutes after it started). SIGTERM lets a running transmission get to its answer (at most five minutes): give the service that long before it is killed.

The number: it is masked in every text the library answers and never shown to a Mandant. The protocol PDF is kept byte for byte as evidence of the Mandant; the worker reads every stream of it before it hands it over: the digits of everything shown, in order (whatever the string form, the characters around them or the operators they are split over), and withholds it only when the number occurs there more often than in the digits of the released data set (a PLZ or a group of the Steuernummer equal to the number is the Mandant’s own data); a stream with a filter other than FlateDecode, or one it cannot unpack, withholds it too. Then the Mandant gets a notice in place of the PDF, with the Transferticket as the evidence of the transmission (finding protocol_withheld). The preview print of release 45 shows none (scripts/orakel/eric-protokoll-pruefen.py, level 3). It is never logged.

The worker needs an outgoing connection to datenannahme.elster.de:443 in send only, the library, and a temporary directory; nothing else. Before the library is loaded the worker confines itself with Landlock (Linux 5.13 and later): it reads the library, /usr, /lib and of /etc only what TLS and the resolver need (resolv.conf, hosts, nsswitch.conf, ssl/certs and the like), writes only its log directory, puts no socket anywhere, and traces no process outside of itself; from Linux 6.7 on it connects over TCP to port 443 (and 53, a resolver whose answer is too long for UDP) only, so not to a database of this host (a seccomp filter refuses what that rule does not see: MPTCP and other protocols, TCP Fast Open, io_uring); behind a proxy on another port it cannot send; from Linux 6.12 on it signals no other process either. It keeps no file open that its starter left open. Started by the server itself (the default) it runs under the server’s user; a socket of the disk it can still connect to (a database that trusts that user, a container daemon), and on a kernel without Landlock it reads that user’s files, also a secret file of /etc. For live on an installation with more than your own Mandanten give it its own user:

  • Docker: COMPOSE_FILE=compose.yaml:deploy/compose.eric.yaml and DECUMA_ERIC_LIBRARY in .env. The worker is a service of its own (user 10002, read-only, no capabilities, not on the network of the database) behind a socket only the server’s container shares, with at most 64 processes.

  • systemd: a unit that runs the same listener; only the group of the server reaches its directory.

    /etc/systemd/system/decuma-eric.service
    [Service]
    ExecStart=/usr/local/bin/decuma-eric-worker --listen /run/decuma-eric/worker.sock
    Environment=DECUMA_ERIC_HOME=/opt/eric DECUMA_ERIC_MODE=test
    User=decuma-eric
    Group=decuma
    RuntimeDirectory=decuma-eric
    RuntimeDirectoryMode=0750
    PrivateTmp=yes
    ProtectSystem=strict
    ProtectHome=yes
    NoNewPrivileges=yes
    TasksMax=64
    CapabilityBoundingSet=
    RestrictAddressFamilies=AF_UNIX AF_INET AF_INET6 AF_NETLINK
    Restart=on-failure
    [Install]
    WantedBy=multi-user.target

    and DECUMA_ERIC_WORKER=unix:/run/decuma-eric/worker.sock for the server. Start it before the server; stop it after. The listener needs Landlock and does not start without it. It never reads a request, is not dumpable and gains no rights; at most eight workers run at once.

    What a library that turned hostile reaches from there: the certificate and the PIN of its own call, port 443 of any host and UDP (Landlock knows ports, no hosts: a firewall rule for the worker’s user or container names datenannahme.elster.de where you want that). Not those of another Mandant: the other workers and the listener have the same user, but a confined process can neither trace them nor read their memory, open a socket in the place of the service’s, or write a file. Before Linux 6.12 it can signal (end) them: transmissions of that moment are unknown, nothing is collected. Not covered: a fault of the kernel, and what the library sends over its own connection.

  • Your own wrapper (DECUMA_ERIC_WORKER=/path/to/script): it gets DECUMA_ERIC_HOME and DECUMA_ERIC_MODE in an otherwise empty environment (no PATH), must pass both on, pass standard input and output through unchanged, and run one worker per call. A container: exec /usr/bin/docker run --rm -i --user 10002 --read-only --tmpfs /tmp -v /opt/eric:/opt/eric:ro -e DECUMA_ERIC_HOME=/opt/eric -e DECUMA_ERIC_MODE="$DECUMA_ERIC_MODE" --entrypoint decuma-eric-worker decuma:local (the daemon’s rights are the wrapper’s: only where nobody else may start it).

No kill of the server reaches a worker of another user or in a container. The worker therefore ends itself after 140 seconds and refuses to send when it was started more than 90 seconds after it was asked, and nobody can record the outcome of a transmission before ten minutes have passed. Under another user it logs into a new private directory of its temporary directory and removes it; use a private /tmp (as above), so that nothing is left when it is killed. Under the server’s user the directory is the server’s (TMPDIR; a tmpfs is best); what a killed server leaves in decuma-eric-<uid> is removed at the next start. With the flag on the server process is not dumpable (no core dump, no debugger of the same user).

A database restored from a backup does not know what was sent after it, and a copy of it would send the same Meldung again. The journal does know: one file before a live transmission, one with its answer, under DECUMA_ERIC_JOURNAL. It holds the name and period of the Meldung, the ids and hashes of its Freigabe and data set, the outcome and the Transferticket, no values and no certificate; per Mandant one directory, with an id the database has too. Keep it on durable storage apart from the database and its backups; never restore it together with the database, never start an empty one. Back it up continuously if you like (files are only added).

  • A live transmission the database does not know blocks its period on every way, also by hand. A person records each one, the oldest first (filing.attempts lists them, filing.resolve_attempt): that it arrived, with its Transferticket, or that it did not. Where the backup holds the Freigabe, the Meldung is recorded as it was released; where it does not, with its values (filing.record_external, zusammenfassende_meldung.record_external), also as a further version of a period that is filed already. What ELSTER accepted cannot be recorded as not arrived.
  • A journal without the id of the database, or that lacks a transmission the database knows as accepted (an empty or lost directory, a copy of the installation on another host), blocks every live transmission of that Mandant. Only a database restored from before the first live transmission together with a lost journal is not seen.
  • The name of an entry says what it is of (<attempt>.<Meldungsart>.<first day>.<last day>.json, its answer <attempt>.result). One that cannot be read blocks that Meldung and what overlaps its period on every way, by hand too: it is never taken as absent. Record first, then move the file away: compare the period in Mein ELSTER; what arrived is recorded with its Transferticket while the file still blocks (filing.record_external, zusammenfassende_meldung.record_external). One case is the other way round: where filing.attempts shows the attempt itself as unknown (the database has no answer) and its file <attempt>.result is damaged, nothing can be recorded while that file is there. Move only this file away, never the entry (….json): the attempt stays unknown and blocks its period on every way until a person resolves it (filing.resolve_attempt). A repaired file is an entry again. A file of another name is passed over. A directory that cannot be read blocks every way of its Mandant. The Meldung itself can always be read; it says so.
  • A result that could not be written to the database is taken over from the journal, once its own task no longer writes it.
  • A Mandant is not deleted while one of its transmissions runs (try again in a few minutes). The deletion removes its directory while the flag is on; with the flag off remove $DECUMA_ERIC_JOURNAL/<mandant_id> yourself. The journal is no record of the bookkeeping: the Meldung, the Transferticket and the protocol are kept in the database and in the export, which the person is told to take before the deletion; keeping them after it is the Mandant’s own duty (§ 147 AO). A transmission only the journal knew (after a restore, not recorded) is then found in Mein ELSTER alone: record it first.

Restore: set DECUMA_ERIC_MODE=test first. With the journal at hand nothing else is needed: the persons record what it names. Without it, compare every Meldung since the backup with the transmitted forms in Mein ELSTER and record what is missing; that is the Mandant’s own comparison, so it is confirmed per Mandant: write the time of the restore into the file compared of its directory (mkdir -p $DECUMA_ERIC_JOURNAL/<mandant_id> && date -u +%FT%TZ > $DECUMA_ERIC_JOURNAL/<mandant_id>/compared, as the server’s user). It counts for what the database knows from before that time and for nothing later than the file itself; it hides no entry of a journal, and a time in the future is refused. Then set live. A copy for tests never gets live.

Rotating DECUMA_SECRET_KEY: stored secrets open only with the key they were stored with. Remove the certificates (elster.certificate_remove), set the new key, restart, store them again; webhooks need new secrets too. A leaked certificate is revoked in Mein ELSTER, not here. A database backup holds certificates encrypted: keep the key apart from it.

Any reverse proxy works. For example Caddy, which obtains certificates itself:

decuma.example.com {
reverse_proxy 127.0.0.1:8080
}

The server takes the caller’s address (for the limits on sign-in and registration) from X-Forwarded-For only when the request comes from this machine (loopback) or from a proxy named in DECUMA_TRUSTED_PROXIES (comma-separated addresses or CIDRs), and then only the last entry, the one that proxy added. Several X-Forwarded-For lines count as one list in their order. Under Docker the proxy on the host reaches the container from the Docker network’s gateway: DECUMA_TRUSTED_PROXIES must name it, else every caller counts as that one address and one caller’s failed sign-ins throttle everyone’s. For the domain way in, deploy/setup.sh adds deploy/compose.domain.yaml, which gives the network the fixed subnet 172.30.80.0/24 (DECUMA_SUBNET, DECUMA_GATEWAY change it, for example for a second installation on the same machine), and sets DECUMA_TRUSTED_PROXIES to its gateway 172.30.80.1 only; keep DECUMA_BIND at 127.0.0.1 then, or callers from the network could name themselves. An installation set up before needs docker compose down once so the network is made anew. With another setup, set DECUMA_TRUSTED_PROXIES to the address your proxy connects from. A source is an IPv4 address or an IPv6 /64.

A bank returning from a Bankzugang opens /bank/callback?state=...&code=.... The app removes the query from the address at once and sends no Referer, but the proxy’s access log keeps the request line: the state is single use and expires after 30 minutes, the code is useless without the installation’s provider key; leave the query out of the log, or keep the log as private as the database.