Fix Matrix credentials modal: write individual credential files and update hub config

Agent-Logs-Url: https://github.com/naturallaw777/staging_alpha/sessions/f4c4df17-1ef8-4b72-be8a-82472a5f4476

Co-authored-by: naturallaw777 <99053422+naturallaw777@users.noreply.github.com>
This commit is contained in:
copilot-swe-agent[bot]
2026-04-03 16:12:00 +00:00
committed by GitHub
parent 9dd08dc2ae
commit b1386ba701
2 changed files with 22 additions and 1 deletions

View File

@@ -61,7 +61,11 @@ let
# ── Communication ────────────────────────────────────────── # ── Communication ──────────────────────────────────────────
++ [ ++ [
{ name = "Matrix-Synapse"; unit = "matrix-synapse.service"; type = "system"; icon = "synapse"; enabled = cfg.services.synapse; category = "communication"; credentials = [ { name = "Matrix-Synapse"; unit = "matrix-synapse.service"; type = "system"; icon = "synapse"; enabled = cfg.services.synapse; category = "communication"; credentials = [
{ label = "Users"; file = "/var/lib/secrets/matrix-users"; multiline = true; } { label = "Homeserver URL"; file = "/var/lib/secrets/matrix-homeserver-url"; }
{ label = "Admin Username"; file = "/var/lib/secrets/matrix-admin-username"; }
{ label = "Admin Password"; file = "/var/lib/secrets/matrix-admin-password"; }
{ label = "Test Username"; file = "/var/lib/secrets/matrix-test-username"; }
{ label = "Test Password"; file = "/var/lib/secrets/matrix-test-password"; }
]; } ]; }
{ name = "Element-Call"; unit = "livekit.service"; type = "system"; icon = "livekit"; enabled = cfg.features.element-calling; category = "communication"; credentials = []; } { name = "Element-Call"; unit = "livekit.service"; type = "system"; icon = "livekit"; enabled = cfg.features.element-calling; category = "communication"; credentials = []; }
] ]

View File

@@ -226,6 +226,23 @@ CREDS
fi fi
chmod 600 "$CREDS_FILE" chmod 600 "$CREDS_FILE"
# Write individual credential files for the hub UI (umask 077 ensures 600 from creation)
PREEXISTING_NOTE="Password set during original setup"
(umask 077; echo "https://$DOMAIN" > /var/lib/secrets/matrix-homeserver-url)
(umask 077; echo "@$ADMIN_USER:$DOMAIN" > /var/lib/secrets/matrix-admin-username)
if [ "$ADMIN_CREATED" = true ]; then
(umask 077; echo "$ADMIN_PASS" > /var/lib/secrets/matrix-admin-password)
else
(umask 077; echo "$PREEXISTING_NOTE" > /var/lib/secrets/matrix-admin-password)
fi
(umask 077; echo "@$TEST_USER:$DOMAIN" > /var/lib/secrets/matrix-test-username)
if [ "$TEST_CREATED" = true ]; then
(umask 077; echo "$TEST_PASS" > /var/lib/secrets/matrix-test-password)
else
(umask 077; echo "$PREEXISTING_NOTE" > /var/lib/secrets/matrix-test-password)
fi
echo "Matrix users setup completed." echo "Matrix users setup completed."
fi fi
''; '';