Case studies
#powershell#debugging#windows#electron#docker#pterodactyl#python#csharp#wpf#bash#security#cpp#git#performance#ci#nodejs#pyside6#react-native
14 posts · #pterodactyl
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

Pterodactyl yolks · Story
A Crystal image that built fine but could not link: the tarball's static libgc
The official Crystal tarball bundles a static libgc.a built for a newer glibc than Debian bookworm. The Dockerfile deletes it so the linker uses the system libgc instead.
In short
- The official Crystal tarball ships a static libgc.a that needs a symbol (isoc23strtol) newer than glibc in Debian bookworm.
- The Dockerfile deletes /opt/crystal/lib/crystal/libgc.a and installs libgc-dev, so the linker uses Debian's own libgc.
- One image per Crystal version, picked by a build argument, with the C library headers Crystal links against installed up front.
#docker#crystal#glibc#linker#pterodactyl
·5 min read

Rust image for Pterodactyl: sizing cargo jobs from the cgroup CPU quota
Cargo counts the host's cores, not the container's quota. The Rust yolk reads cpu.max, pins the toolchain and finds the binary through cargo's JSON output.
In short
- Cargo sizes its parallelism from the host's core count, but a Pterodactyl container is capped by a cgroup CPU quota, and every extra rustc job costs memory at the peak of a build.
- The start script reads /sys/fs/cgroup/cpu.max, rounds the quota up to whole CPUs and exports it as CARGOBUILDJOBS unless the user already set it.
- Two smaller decisions made the image behave: pinning RUSTUPTOOLCHAIN against a project's rust-toolchain.toml, and asking cargo for JSON output to find the binary to run.
#docker#rust#cgroups#pterodactyl
·5 min read

Pterodactyl yolks · Story
Vaultwarden on a game-server panel: hashing the admin token at every start
A panel variable should be something a person can type. The Vaultwarden image hashes the admin password with argon2 on each boot, and unsets the token when the field is empty.
In short
- The panel variable VWADMINPASSWORD is hashed with the argon2 CLI at each start and exported as ADMINTOKEN; an empty variable unsets the token and disables /admin.
- The image is the official Vaultwarden one, re-based to run as an unprivileged container user, with all state under /home/container/data and the port taken from the panel's allocation.
- The script also warns when a saved config.json exists, because settings saved on the admin page override the panel's variables, and it turns a bare domain into an https:// one.
#docker#bash#vaultwarden#pterodactyl#argon2
·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