PostgreSQL backup tool with Point-In-Time-Recovery and restore verification
TypeScript backupbackupsdatabasedatabase-backupdevopsdockergolangkubernetesmariadbmongodbmysqlpgpostgrespostgresqls3self-hostedsystem-administrationtoolsweb-ui
1. Keep the implementation boundary small
- 1.1 Keep the backend local-storage model and PostgreSQL credential code unchanged. Do not add application diagnostic commands or test-only binaries to the production image.
Evidence:
git diff --exit-code -- backendpasses, and the image contains no new diagnostic binary. - 1.2 Keep the production entrypoint inline in the Dockerfile. Do not add external entrypoint scripts, ownership migration state, or version-to-version upgrade fixtures.
Evidence: the entrypoint remains the
COPY <<EOF /app/start.shblock inDockerfile; the change adds one test script and no upgrade fixtures. The existing/postgresus-dataandWAL_V1startup guards remain in place.
2. Filesystem harness
- 2.1 Add
make build-docker-storage-test-imageandmake test-filesystems. Make the harness acceptDATABASUS_IMAGE, select one case throughCASE, label every Docker resource uniquely, and clean all resources on success or failure. Evidence:Makefileexposes both targets;e2e/docker-storage/run.shaccepts both variables and labels resources with a per-run value. Docker container, volume, and network queries returned no labeled resources after the full run. - 2.2 Probe mounted paths directly with
docker exec --user databasusanddocker exec --user postgres. Verify unique-file create, write, read, and remove operations without calling backend storage code. Evidence:probe_pathperforms the four operations throughdocker exec --user; the complete matrix passes.
3. Image identities
- 3.1 Declare
DATABASUS_PUID=65532,DATABASUS_PGID=65532,POSTGRES_PUID=999, andPOSTGRES_PGID=999in Docker image metadata. Verify the image environment, running-container environment, effective IDs, default no-remap behavior, and free explicit overrides. Evidence: thedefault-idscase also mounts failing commands overgroupmodandusermod, so a redundant default remap stops the container. Thedefault-idsandcustom-idscases verify image metadata, container environment, and effective account IDs. Both pass. - 3.2 Keep the four variables out of
.env.example, default Compose configuration, Helm values, the Helm README, root README files, and installation pages. Document them only in all six Advanced Configuration pages. Evidence: repository search finds the four variable names only inDockerfile, the filesystem harness, OpenSpec, and all six Advanced Configuration pages.
4. Filesystem and permission matrix
- 4.1 Add healthy cases for a bind-mounted data root, a Docker named volume, and separate application, temporary, backup, and PostgreSQL mounts.
Evidence:
bind-root,named-volume, andsplit-mountspass in the complete matrix. - 4.2 Add rejected cases for read-only and inaccessible paths. Assert container status and a relevant startup or operation failure.
Evidence:
read-onlyobserves a nonzero container exit;inaccessible-pathobserves the Databasus account's expected permission denial. - 4.3 Add real CIFS and root-squashed NFS cases with digest-pinned fixtures and a prerequisite check for host client support.
Evidence:
cifsandnfs-root-squashpass with digest-pinned server images.run_network_prerequisiteschecks host helpers before either case. - 4.4 Audit open and closed Docker filesystem and permission issues. Map every container-boundary report to a case and record a precise reason for each exclusion.
Evidence: the issue inventory in
e2e/docker-storage/run.shmaps #45, #64, #141, #224, #274, #478, #738, #751, and #763. It excludes #96 and #199 because an arbitrary container user cannot start both services, and excludes #401 and #431 because they concern application transfer behavior rather than container permissions. - 4.5 Fix only Dockerfile or inline-entrypoint defects reproduced by these cases. Do not change backend local-storage behavior.
Evidence: the Dockerfile declares the four IDs, skips default remapping, uses shallow best-effort ownership preparation for pre-owned mounts and the known root-level application files, and fixes process
TMPDIRat/tmp. No backend file changed.
5. CI and final verification
- 5.1 Add an independent
test-filesystemsGitHub Actions job that builds and loads its own candidate without publishing it. Pin every Action to a full commit SHA with a version comment, retain top-levelpermissions: contents: read, and require the job before release and development image publication. Verify the workflow with Actionlint and direct permission and dependency inspection. Evidence: Actionlint passes. The job uses full-SHA Actions,push: false,load: true, and its own local tag. Top-level permissions remaincontents: read; both publication paths depend on the job. - 5.2 Run the targeted cases and the complete
DATABASUS_IMAGE=databasus-storage-test:local make test-filesystemsmatrix. Run Dockerfile, shell, Compose, Helm, workflow, website, and OpenSpec validation, confirm zero labeled Docker resources remain, and obtain final reviewerPASS. Evidence: the rebuilt image passes the full matrix and the direct/postgresus-data, root-file ownership, andWAL_V1checks. The test runs leave no labeled resources. Bash syntax, ShellCheck, Docker build checks, Compose, Helm, Actionlint, website lint/build, OpenSpec validation, and the final reviewer all pass.