crafty-controller: seed felhom-generated admin password (gokapi pattern) instead of Crafty's random one; app-page card reads default.json

This commit is contained in:
2026-06-26 11:22:26 +02:00
parent 8fd9c007af
commit 5a403d1003
3 changed files with 47 additions and 6 deletions
@@ -5,6 +5,15 @@
#
# Environment variables:
# DOMAIN - Your domain (e.g., demo-felhom.eu)
# CRAFTY_PASSWORD - felhom-generated initial admin password (seeded into default.json, see below)
#
# Initial admin password (seeding): Crafty's image ships
# app/config_original/default.json = {"username":"admin","password":"crafty"} — only 6 chars, below
# Crafty's 8-char minimum, so Crafty rejects it and generates an ugly random password into
# default-creds.txt. The entrypoint below overwrites that template with a felhom-generated password
# BEFORE the launcher runs; on fresh install the launcher copies it into the config volume and Crafty
# creates the admin user with it. The seeded default.json stays in the volume as the source the
# controller reads for the "Kezdeti belépési adatok" card (initial_credentials in .felhom.yml).
services:
crafty-controller:
@@ -13,6 +22,16 @@ services:
restart: unless-stopped
environment:
- TZ=Europe/Budapest
- CRAFTY_PASSWORD=${CRAFTY_PASSWORD}
# Seed the felhom-generated admin password via Crafty's default.json template, then hand off to the
# image's normal launcher (entrypoint /crafty/docker_launcher.sh, default cmd "-d -i"). $$ escapes
# the compose interpolation so CRAFTY_PASSWORD is read from the container env at runtime.
entrypoint:
- /bin/sh
- -c
- |
printf '{"username":"admin","password":"%s"}\n' "$${CRAFTY_PASSWORD}" > /crafty/app/config_original/default.json
exec /crafty/docker_launcher.sh -d -i
volumes:
- crafty_backups:/crafty/backups
- crafty_logs:/crafty/logs