Skip to content

installer: step 4 overwrites dynamic/coolify-tweaks.yml, destroying custom routers, with no backup #66

Description

@techwithanirudh

Summary

Step 4 of dynamic-config.sh writes dynamic/coolify-tweaks.yml with an unconditional heredoc:

cat >"$DYNAMIC_FILE" <<EOF

Any router the user added to that file is destroyed. Unlike .env and the proxy docker-compose.yml, this file is never backed up — the SKIP_BACKUP logic covers only those two, so there is nothing to restore from.

This is not a hypothetical edge case: the docs tell users to put custom routers in exactly this file.

Why this bites the documented path

dynamic-config.mdx → "Option B: Custom Domain" says to add, in addition to the port router:

http:
  routers:
    coolify-https-inject:
      entryPoints: [https]
      rule: "Host(`coolify.yourdomain.com`) && !PathPrefix(`/app`) && !PathPrefix(`/terminal/ws`)"
      service: coolify
      middlewares: [coolify-tweaks]
      tls:
        certResolver: letsencrypt
      priority: 2000

Step 4's heredoc emits only the coolify-dashboard router on the coolify_dashboard entrypoint. So a user who followed Option B and later re-runs the installer — to pick up a fix, or change the CSS URL — silently loses their HTTPS injector. On a custom-domain-only setup that router is the only thing injecting the stylesheet, so tweaks stop working entirely with no error and no backup.

Repro

  1. Install, then add the Option B coolify-https-inject router to dynamic/coolify-tweaks.yml as documented.
  2. Re-run dynamic-config.sh.
  3. coolify-https-inject is gone. No .bak for the file exists anywhere.

Confirmed on a live host (2026-08-01). My setup is custom-domain-only, so injection on the domain was the only working path; step 4 removed it. I had taken my own backup, so recovery was clean — a user following the docs would not have.

Suggested fix

Either would resolve it:

  • Back the file up alongside the other two, honouring SKIP_BACKUP:
    cp "$DYNAMIC_FILE" "$DYNAMIC_FILE.bak-$DATE"
  • Preserve unknown routers — merge with yq instead of a heredoc, rewriting only the keys the installer owns (middlewares.rb-*, middlewares.coolify-tweaks, services.coolify, routers.coolify-dashboard) and leaving everything else untouched. This is the better fix, since it makes re-running idempotent for customized hosts.

At minimum, the installer should warn before clobbering a file containing routers it does not recognise.

Related: #62, #63. Companion issues: #67 (pre-flight port check), #68 (additive Traefik merge).

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions