fix(mudcraft): substitute LP_PASSWORD in LuckPerms config at init time

LuckPerms reads config.yml as a literal string — ${LP_PASSWORD} was
never being substituted, causing auth failures against PostgreSQL.
initContainer now has the secret injected as an env var and uses sed
to write the real password into the config before LuckPerms reads it.

Also adds faultexception to WHITELIST so they can connect.
This commit is contained in:
Will Anderson
2026-03-29 20:41:39 -05:00
parent 8588def1ab
commit 63d54d9ea0
2 changed files with 9 additions and 2 deletions
@@ -22,6 +22,7 @@ data:
ENFORCE_WHITELIST: "true" ENFORCE_WHITELIST: "true"
WHITELIST_ENABLED: "true" WHITELIST_ENABLED: "true"
OPS: "faultexception" OPS: "faultexception"
WHITELIST: "faultexception"
ENABLE_RCON: "true" ENABLE_RCON: "true"
RCON_PORT: "25575" RCON_PORT: "25575"
MOTD: "MUDCraft — Private Beta" MOTD: "MUDCraft — Private Beta"
+8 -2
View File
@@ -17,7 +17,7 @@ spec:
labels: labels:
app: mudcraft app: mudcraft
annotations: annotations:
kubectl.kubernetes.io/restartedAt: "2026-03-30T02:30:00Z" kubectl.kubernetes.io/restartedAt: "2026-03-30T02:45:00Z"
spec: spec:
terminationGracePeriodSeconds: 120 terminationGracePeriodSeconds: 120
securityContext: securityContext:
@@ -32,6 +32,12 @@ spec:
securityContext: securityContext:
runAsUser: 1000 runAsUser: 1000
runAsGroup: 1000 runAsGroup: 1000
env:
- name: LP_PASSWORD
valueFrom:
secretKeyRef:
name: mudcraft-secrets
key: db-password
command: command:
- sh - sh
- -c - -c
@@ -39,7 +45,7 @@ spec:
rm -rf /target/*.jar rm -rf /target/*.jar
cp -r /plugins/* /target/ cp -r /plugins/* /target/
mkdir -p /target/LuckPerms mkdir -p /target/LuckPerms
cp /luckperms-config/config.yml /target/LuckPerms/config.yml sed "s|\${LP_PASSWORD}|${LP_PASSWORD}|g" /luckperms-config/config.yml > /target/LuckPerms/config.yml
mkdir -p /target/PurpurExtras mkdir -p /target/PurpurExtras
cp /purpurextras-config/config.yml /target/PurpurExtras/config.yml cp /purpurextras-config/config.yml /target/PurpurExtras/config.yml
echo 'Plugins installed' echo 'Plugins installed'