Fix password hash extraction bug in deploy script and sudo issue in setup script
- deploy-homelab.sh: Fix password hash extraction from Docker output - Changed from 'grep || tail' fallback to 'sed | grep' pipeline - Properly strips 'Digest: ' prefix before extracting hash - Prevents corrupted hash format that caused Authelia crash loop - setup-homelab.sh: Fix automatic deployment call - Added 'sudo' when running deploy script from setup - Prevents 'Please run as root' error during automatic deployment
This commit is contained in:
@@ -200,8 +200,8 @@ elif [ -n "${AUTHELIA_ADMIN_USER}" ] && [ -n "${AUTHELIA_ADMIN_EMAIL}" ] && [ -n
|
|||||||
echo "ADMIN_PASSWORD=$ADMIN_PASSWORD" >> /opt/stacks/.setup-temp/authelia_admin_credentials.tmp
|
echo "ADMIN_PASSWORD=$ADMIN_PASSWORD" >> /opt/stacks/.setup-temp/authelia_admin_credentials.tmp
|
||||||
chmod 600 /opt/stacks/.setup-temp/authelia_admin_credentials.tmp
|
chmod 600 /opt/stacks/.setup-temp/authelia_admin_credentials.tmp
|
||||||
|
|
||||||
# Extract just the hash line
|
# Extract just the hash (remove "Digest: " prefix if present)
|
||||||
grep '^\$argon2' /tmp/authelia_password_hash_from_env.tmp > /opt/stacks/.setup-temp/authelia_password_hash.tmp || tail -1 /tmp/authelia_password_hash_from_env.tmp > /opt/stacks/.setup-temp/authelia_password_hash.tmp
|
sed 's/^Digest: //' /tmp/authelia_password_hash_from_env.tmp | grep '^\$argon2' > /opt/stacks/.setup-temp/authelia_password_hash.tmp
|
||||||
chmod 600 /opt/stacks/.setup-temp/authelia_password_hash.tmp
|
chmod 600 /opt/stacks/.setup-temp/authelia_password_hash.tmp
|
||||||
rm -f /tmp/authelia_password_hash_from_env.tmp
|
rm -f /tmp/authelia_password_hash_from_env.tmp
|
||||||
|
|
||||||
|
|||||||
@@ -608,9 +608,9 @@ if [ "${NVIDIA_REBOOT_NEEDED:-false}" != true ]; then
|
|||||||
echo " cd ~/AI-Homelab && ./scripts/deploy-homelab.sh"
|
echo " cd ~/AI-Homelab && ./scripts/deploy-homelab.sh"
|
||||||
echo ""
|
echo ""
|
||||||
else
|
else
|
||||||
# Run deployment script as the actual user
|
# Run deployment script as the actual user with sudo
|
||||||
cd "$(dirname "$0")/.." || exit 1
|
cd "$(dirname "$0")/.." || exit 1
|
||||||
su - "$ACTUAL_USER" -c "cd $PWD && ./scripts/deploy-homelab.sh"
|
su - "$ACTUAL_USER" -c "cd $PWD && sudo ./scripts/deploy-homelab.sh"
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
log_info "Deployment skipped. Run it manually when ready:"
|
log_info "Deployment skipped. Run it manually when ready:"
|
||||||
|
|||||||
Reference in New Issue
Block a user