fix: don't output secret keys on installs

This commit is contained in:
Julian Sommer
2026-08-10 10:40:50 +10:00
parent 53b31cb76c
commit 3601bb4d36
3 changed files with 8 additions and 4 deletions
+2 -1
View File
@@ -156,7 +156,8 @@ resolvconf -u
# Write the banner (first time, spinifex-banner service will do this on reboot)
/usr/local/bin/spx admin banner --boot-check
# Cluster formation — capture credentials to file for display on console.
# Cluster formation. Output goes to the journal via the systemd unit; spx
# admin init writes credentials to disk and never prints them.
%s 2>&1
# Fix ownership of files spx admin init wrote. spx runs as root under
+2
View File
@@ -68,6 +68,8 @@ ExecStopPost=/bin/sh -c 'if [ "$EXIT_STATUS" != "0" ]; then printf "\n*** Spinif
# ovn-central startup cannot wedge multi-user.target and keep getty from
# ever reaching the login prompt.
TimeoutStartSec=300s
# Install diagnostics land in the journal, which persists for the life of the
# node — nothing this script runs may print secrets to stdout or stderr.
StandardOutput=journal
StandardError=journal
+4 -3
View File
@@ -1405,9 +1405,10 @@ func runAdminInit(cmd *cobra.Command, args []string) {
fmt.Printf(" Key: %s\n", viperblockKeyPath)
if !masterKeyExisted {
fmt.Printf("\n🔑 Generated admin credentials (save these — they won't be shown again):\n")
fmt.Printf(" Access Key: %s\n", adminAccessKey)
fmt.Printf(" Secret Key: %s\n", adminSecretKey)
// Never echo the keys: on an ISO install stdout is the systemd journal,
// which persists them for the life of the node. They are recoverable from
// bootstrap.json and ~/.aws/credentials.
fmt.Printf("\n🔑 Generated admin credentials (written to ~/.aws/credentials)\n")
fmt.Printf(" Account: %s (%s)\n", admin.DefaultAccountName(), admin.DefaultAccountID())
fmt.Printf(" AWS Profile: spinifex\n")
}