root fca77d92b5 Exclude reproducible framework code from Mautic/Nextcloud PVC backups
Mautic (node_modules/, vendor/) and Nextcloud (apps/, core/, dist/,
3rdparty/, lib/) share one PVC mount with their real user data, and were
backing up ~700MB-1GB of app/vendor code that's identical to what ships in
the image, alongside the actual user data. Excluded both via tar --exclude
in the PVC capture step: Mautic backup drops from ~185MB to ~90MB
compressed, Nextcloud from ~379MB to ~107MB.

Verified the "the image lays these down fresh on start" assumption before
relying on it — it does NOT hold for either app as a naive exclude:
  - Mautic's entrypoint has no logic at all to reconstruct node_modules/
    vendor if missing (confirmed empty by reading /entrypoint.sh).
  - Nextcloud's entrypoint only rsyncs from /usr/src/nextcloud when
    image_version > installed_version (read from version.php). Since
    version.php itself isn't excluded, a restored version.php already
    matches the running image's version, so that path never fires.

So restore-k8s-apps.sh now explicitly re-seeds these dirs from the app's
own live image (both images bake them in at /var/www/html independently of
any volume mount) via a loader pod with the PVC mounted at a different
path, after the normal PVC-data restore and before scaling the app back
up. If that re-seed fails, the app is deliberately left at 0 replicas
instead of coming back up broken (missing vendor/autoload.php is a hard
crash, not a degraded state) — found this the hard way in testing when a
90s wait timed out mid image-pull and scale-up proceeded anyway with
vendor/ missing; fixed by gating scale-up on the re-seed outcome and
raising the timeout to 240s with imagePullPolicy: IfNotPresent (the image
is already on-node, pulled off the live Deployment spec).

Verified end-to-end: real backup + restore of Mautic on the live cluster,
confirming size drop, vendor/autoload.php present post-restore, app
serving 200s, and all 433,681 leads intact via the DB restore.

Also found and left unfixed (pre-existing, unrelated): secret.yaml apply
during restore can hit a resourceVersion conflict from kubectl apply
against a captured manifest — the mautic-secrets apply failed on this
restore test with a benign "object has been modified" error since the
secret already existed with correct values; app was unaffected. Separate
bug from this change, flagging for later.
2026-08-21 11:07:02 +02:00
2026-06-21 18:56:18 +01:00

CloudOps - Infrastructure Management & Disaster Recovery Platform

Overview

This repository contains the complete infrastructure code for Navitrends' backup and disaster recovery platform.

Components

  • Platform: Flask web application for backup/restore management
  • Scripts: Backup, restore, and sync scripts
  • Docker Compose: Configuration for all 5 applications

Applications Managed

  • Nextcloud (File sharing)
  • Odoo (ERP/CRM)
  • Frappe/ERPNext
  • Mautic (Marketing automation)
  • n8n (Workflow automation)

Servers

  • Main Server: 173.249.20.244
  • Backup VM: 192.168.152.128
Description
Cloud Infrastructure Management & Disaster Recovery Platform
Readme 40 MiB
Languages
PHP 66.6%
JavaScript 15.8%
Twig 8.6%
CSS 4.4%
Less 2.1%
Other 2.4%