Files
arr-init/tests/default.nix
Simon Gardling 6dde2a3e0d servarr: add configXml option with preStart hook
Adds services.arrInit.<name>.configXml for declaratively ensuring XML
elements exist in a Servarr config.xml before the service starts.

Generates a preStart hook on the main service that runs a Python helper
to patch or create config.xml. Undeclared elements are preserved;
declared elements are written with exact values.

Primary use case: preventing recurring Prowlarr 'not listening on port'
failures when config.xml loses the <Port> element — now guaranteed to
exist before Prowlarr starts.

Hardening:
- Atomic writes (tmp + rename): power loss cannot corrupt config.xml
- Malformed XML recovery: fresh <Config> root instead of blocking boot
- Secure default mode (0600) for new files containing ApiKey
- Preserves existing file mode on rewrite
- Assertion against duplicate serviceName targeting

Tests (10 subtests): creates-from-missing, patches-existing, preserves-
undeclared, corrects-tampered, idempotent, malformed-recovery,
ownership-preserved, not-world-readable.
2026-04-17 00:45:21 -04:00

21 lines
953 B
Nix

{
pkgs,
lib,
self,
}:
{
integration = import ./integration.nix { inherit pkgs lib self; };
partial-config = import ./partial-config.nix { inherit pkgs lib self; };
multiple-clients = import ./multiple-clients.nix { inherit pkgs lib self; };
bazarr = import ./bazarr.nix { inherit pkgs lib self; };
error-handling = import ./error-handling.nix { inherit pkgs lib self; };
edge-cases = import ./edge-cases.nix { inherit pkgs lib self; };
health-checks = import ./health-checks.nix { inherit pkgs lib self; };
delayed-start = import ./delayed-start.nix { inherit pkgs lib self; };
jellyseerr = import ./jellyseerr.nix { inherit pkgs lib self; };
naming = import ./naming.nix { inherit pkgs lib self; };
network-namespace = import ./network-namespace.nix { inherit pkgs lib self; };
permanent-failure = import ./permanent-failure.nix { inherit pkgs lib self; };
config-xml = import ./config-xml.nix { inherit pkgs self; };
}