Repository navigation
stackconfdump: export the shape of a project from a database dump as JSON or YAML #5539
Rezarys
started this conversation in
Show and tell
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
I built a small command line tool that reads a Dokploy database dump and writes the shape of one project as a portable JSON or YAML file, without runtime data and without secrets.
What it covers, per environment: applications with their git source or docker image, build type, replicas and resource limits, domains, published ports, redirects and mounts; compose services; and databases with their engine, image, database name and user. Environment blocks come out as key names only, so API_KEY is listed and its value is not.
Why I wrote it: there is an open issue asking for a text description of a project, and the use case written there is standing up a mirror of a production project on a second server without re-creating every application by hand. Transferring services between servers already exists and it solves a different problem: it moves things, it does not give you a file you can read, diff and keep in git.
On secrets, since this reads a backup: the tool works from an allow list, not from a filter on suspicious names. A column reaches the output only if the tool names it, so a column added later is absent until someone adds it on purpose. Passwords, registry credentials, refresh tokens, basic auth entries and the body of file mounts are never exported, and the raw compose file is left out by default because inline environment values in it are secrets. Custom git URLs and registry URLs come out with the user info part removed, so an embedded token goes with it. Two holes are documented rather than hidden: free text fields such as a description or a start command are copied as written, and advanced swarm settings are not exported at all.
What is not verified: I have not run this against a real instance. The schema comes from this repository and the tests run on an example dump written for the tests. If it reads something wrong on a real backup, or lets through something it should not, an issue with the column name is the fastest way to get it fixed.
MIT, no dependencies, Python 3.9 and up.
https://github.com/Rezarys/stackconfdump
https://pypi.org/project/stackconfdump/
Built with AI assistance, reviewed and tested by me. Not affiliated with Dokploy.
Younes Z.
All reactions