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:
@@ -1,5 +1,20 @@
|
|||||||
# Changelog
|
# Changelog
|
||||||
|
|
||||||
|
## 2026-06-26 — crafty-controller: seed a felhom-generated admin password (replaces Crafty's ugly random one)
|
||||||
|
- **crafty-controller**: instead of reading Crafty's auto-generated (long, symbol-laden) random admin
|
||||||
|
password, we now **seed** a clean felhom-generated one — same pattern as gokapi, so initial passwords are
|
||||||
|
consistent across the catalog.
|
||||||
|
- Crafty's image ships `app/config_original/default.json = {"username":"admin","password":"crafty"}`;
|
||||||
|
"crafty" is 6 chars < Crafty's 8-char minimum, so Crafty rejected it and generated a random password.
|
||||||
|
- New `CRAFTY_PASSWORD` deploy field (`type: password`, `generate: password:24`, locked after deploy —
|
||||||
|
mirrors gokapi's `GOKAPI_PASSWORD`). The compose **entrypoint** overwrites the `default.json` template
|
||||||
|
with this password before the launcher runs; on fresh install Crafty creates the `admin` user with it.
|
||||||
|
- `initial_credentials.file` repointed `default-creds.txt` → `default.json` (same json/username/password
|
||||||
|
keys), so the controller's app-page "Kezdeti belépési adatok" card shows the **seeded** password — the
|
||||||
|
customer sees the same value at deploy time and on the app page.
|
||||||
|
- Catalog-only change (reuses felhom-controller v0.84.0's initial_credentials reader + the gokapi-style
|
||||||
|
seed). Requires a fresh install to take effect (the seed is only read on first run).
|
||||||
|
|
||||||
## 2026-06-26 — crafty-controller: surface the auto-generated initial admin password on the app page
|
## 2026-06-26 — crafty-controller: surface the auto-generated initial admin password on the app page
|
||||||
- **crafty-controller**: Crafty writes a random admin password to `/crafty/app/config/default-creds.txt`
|
- **crafty-controller**: Crafty writes a random admin password to `/crafty/app/config/default-creds.txt`
|
||||||
at first boot (its built-in default is rejected as "too short"). Customers had to read the container
|
at first boot (its built-in default is rejected as "too short"). Customers had to read the container
|
||||||
|
|||||||
@@ -32,6 +32,13 @@ deploy_fields:
|
|||||||
locked_after_deploy: true
|
locked_after_deploy: true
|
||||||
description: "Az alkalmazás aldomainje"
|
description: "Az alkalmazás aldomainje"
|
||||||
|
|
||||||
|
- env_var: CRAFTY_PASSWORD
|
||||||
|
label: "Admin jelszó"
|
||||||
|
type: password
|
||||||
|
generate: password:24
|
||||||
|
locked_after_deploy: true
|
||||||
|
description: "A Crafty admin felhasználó (admin) kezdeti jelszava — ezzel tudsz belépni a kezelőfelületre"
|
||||||
|
|
||||||
# --- App info (info page content) ---
|
# --- App info (info page content) ---
|
||||||
app_info:
|
app_info:
|
||||||
tagline: "Minecraft szerver kezelő - hozd létre a saját világodat"
|
tagline: "Minecraft szerver kezelő - hozd létre a saját világodat"
|
||||||
@@ -61,13 +68,13 @@ healthcheck:
|
|||||||
- type: tcp
|
- type: tcp
|
||||||
port: 8443
|
port: 8443
|
||||||
|
|
||||||
# --- Initial auto-generated login ---
|
# --- Initial login (felhom-seeded) ---
|
||||||
# Crafty writes a random admin password to this file on first boot (its built-in default is rejected
|
# The admin password is seeded into default.json by the compose entrypoint (CRAFTY_PASSWORD deploy
|
||||||
# as "too short"). The controller reads + parses it live and shows it on the app page so customers
|
# field). The controller reads it back from default.json and shows it on the app page under "Kezdeti
|
||||||
# don't have to dig through the container logs.
|
# belépési adatok" — same value the customer set at deploy time.
|
||||||
initial_credentials:
|
initial_credentials:
|
||||||
file: /crafty/app/config/default-creds.txt
|
file: /crafty/app/config/default.json
|
||||||
format: json
|
format: json
|
||||||
username_key: username
|
username_key: username
|
||||||
password_key: password
|
password_key: password
|
||||||
note: "Kezdeti, automatikusan generált jelszó. Az első belépés után változtasd meg a Crafty felületén (ez a fájl a régi jelszót mutatja, nem itt módosítható)."
|
note: "Kezdeti admin jelszó (a telepítéskor beállított). Az első belépés után változtasd meg a Crafty felületén — ez a kártya továbbra is a kezdeti jelszót mutatja."
|
||||||
|
|||||||
@@ -5,6 +5,15 @@
|
|||||||
#
|
#
|
||||||
# Environment variables:
|
# Environment variables:
|
||||||
# DOMAIN - Your domain (e.g., demo-felhom.eu)
|
# 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:
|
services:
|
||||||
crafty-controller:
|
crafty-controller:
|
||||||
@@ -13,6 +22,16 @@ services:
|
|||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
environment:
|
environment:
|
||||||
- TZ=Europe/Budapest
|
- 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:
|
volumes:
|
||||||
- crafty_backups:/crafty/backups
|
- crafty_backups:/crafty/backups
|
||||||
- crafty_logs:/crafty/logs
|
- crafty_logs:/crafty/logs
|
||||||
|
|||||||
Reference in New Issue
Block a user