Skip to content

Releases: heyvaldemar/mattermost-data-retention-docker-compose

v1.0.0 — working cleanup on distroless Mattermost, secrets out of the script

Choose a tag to compare

@heyvaldemar heyvaldemar released this 01 Sep 01:49

First semver release, and it fixes a silent failure: the file-deletion half of the script stopped working when the Mattermost images went distroless — no shell, no shred, no find inside the container, so every docker exec cleanup call failed while the database rows were still deleted. Result: retention looked like it worked, but expired uploads piled up on disk forever. Cleanup now runs in a throwaway debian:stable-slim helper container that shares the Mattermost container's volumes, which works against any image, distroless or not.

Also act on this: the database password is no longer hardcoded in the tracked script. Put it in mattermost-retention.conf next to the script (gitignored) or pass it via the environment — and rotate the previously hardcoded value if your deployment reused it.

Smaller fixes: portable cutoff computation (date +%s arithmetic instead of GNU-only --date, with a numeric guard before any SQL runs), a mktemp paths list with cleanup, space-safe file deletion, -mindepth 1 on the empty-directory prune, and an INSTALL_CRON=false switch.

CI now runs the script against a real PostgreSQL with Mattermost-shaped tables and a seeded data volume, asserting that expired posts and files are removed while current ones survive.

Full changelog: https://github.com/heyvaldemar/mattermost-data-retention-docker-compose/blob/main/CHANGELOG.md