Case studies
#powershell#debugging#windows#electron#docker#pterodactyl#python#csharp#wpf#bash#security#cpp#git#performance#ci#nodejs#pyside6#react-native
6 posts · #bash
Clear filters·6 min read

A Ruby image for Pterodactyl that reads database.yml with awk to decide on db:prepare
Running db:prepare on a Rails app with no database kills the start; skipping it on one with a database breaks the first request. The start script decides from database.yml and DATABASE_URL.
In short
- The Ruby image has to start whatever the user uploads: Rails, a Rack app, a Sinatra file, or a custom command.
- Whether to run db:prepare depends on whether the current environment names a database, so the script parses config/database.yml with awk and also honours DATABASEURL.
- I ran the awk on two sample files, and it correctly ignored a commented-out production: block.
#ruby#rails#docker#bash#pterodactyl
·5 min read

A Jellyfin image that finishes its own setup wizard from the start script
A fresh Jellyfin server is open to whoever reaches the setup wizard first. My Pterodactyl image closes that gap by completing the wizard over HTTP from a background shell function.
In short
- Jellyfin reads its port from config/network.xml, so the start script rewrites that file on every boot to match the panel allocation.
- A background function polls the server, and if the wizard is still open it completes it with an admin account taken from environment variables.
- If the password variable is empty the script does nothing and says so, rather than inventing a default password.
#docker#bash#jellyfin#pterodactyl#security
·5 min read

A BEAM image for Pterodactyl: SIGTERM, stderr-only scripts, honest hints
The BEAM answers SIGINT with a BREAK menu and waits for a key. What the Elixir and Gleam yolk does about stop signals, stdout capture and Phoenix start-up hints.
In short
- The BEAM answers SIGINT with its interactive BREAK menu and waits for a key, so the image sets STOPSIGNAL SIGTERM and lets the VM run init:stop().
- Every message from the start scripts goes to stderr, because some entrypoints capture the startup command's stdout and execute it.
- The Phoenix hints were rewritten (01c2b8f) to say what the egg does, instead of pointing at a panel tab, and to name the real fix for websocket origins.
#docker#elixir#pterodactyl#signals#bash
·5 min read

Forgejo on a Pterodactyl panel: write app.ini once, then only sed what the panel owns
The Forgejo image for Pterodactyl generates app.ini on first start and afterwards rewrites only six keys the panel controls, so hand edits survive restarts and a failed admin setup retries.
In short
- forgejo-start writes app.ini only when it does not exist, with SQLite, built-in SSH off, install locked and freshly generated secrets.
- On every start it rewrites just six keys (port, bind address, ROOTURL, DOMAIN, registration switch, RUNUSER) with sed, so manual edits to the rest of the file survive.
- The administrator is created once, guarded by a marker file that is written only on success, so a failed attempt is retried on the next start.
#bash#docker#pterodactyl#forgejo#idempotency
·5 min read

Putting Directus on a Pterodactyl panel: uid 1000, tini and a PUBLIC_URL
The official Directus image does not run on Wings as is. Node already owns uid 1000, the panel expands its own startup string, and PUBLIC_URL has to come from one domain field.
In short
- The official Directus image is reused as the base, because the npm package needs native builds of sharp and sqlite3 per platform, which the image already carries.
- Wings needs uid 1000 as a user named container, tini as PID 1, and a startup string it expands itself; the image reproduces all three.
- A start script turns panel variables into Directus settings, including building PUBLICURL from a domain, and a later commit renamed that variable to CMSDOMAIN.
#docker#pterodactyl#bash#directus
·5 min read

Zig images for Pterodactyl: four compiler versions, two tarball names
One Dockerfile builds four Zig releases for amd64 and arm64, and a start script that checks build.zig before passing flags and explains every failure in a sentence.
In short
- One Dockerfile takes ZIGVERSION as a build argument, tries the new tarball name first and falls back to the pre-0.14.1 name.
- The start script only passes -Doptimize when build.zig declares it, and refuses to guess when a build produces zero or several executables.
- CI builds four versions for amd64 and arm64 and rebuilds monthly, so base-image security updates arrive without a code change.
#docker#zig#pterodactyl#github-actions#bash