Fix VAPID key generation on Unraid tail.

Unraid treats a separated byte count as a filename, so the counts are attached to the tail and head flags.
This commit is contained in:
Michael Sloan committed 2026-11-23 22:13:12 -05:00
1 parent 6d105355f4
commit b910932394
2 files changed
+6 -4

No files matched your search

+2 -2
View File
@@ -229,8 +229,8 @@ if [[ ! -f "$STACK/.env" ]]; then
if [[ -z "$(env_value FLUXER_VAPID_PUBLIC_KEY "$STACK/.env")" || -z "$(env_value FLUXER_VAPID_PRIVATE_KEY "$STACK/.env")" ]]; then
vapid="$STACK/vapid.pem"
openssl ecparam -name prime256v1 -genkey -noout -out "$vapid" 2>/dev/null
pub="$(openssl ec -in "$vapid" -pubout -outform DER 2>/dev/null | tail -c 65 | base64 | tr '/+' '_-' | tr -d '=\n')"
priv="$(openssl ec -in "$vapid" -outform DER 2>/dev/null | tail -c +8 | head -c 32 | base64 | tr '/+' '_-' | tr -d '=\n')"
pub="$(openssl ec -in "$vapid" -pubout -outform DER 2>/dev/null | tail -c65 | base64 | tr '/+' '_-' | tr -d '=\n')"
priv="$(openssl ec -in "$vapid" -outform DER 2>/dev/null | tail -c+8 | head -c32 | base64 | tr '/+' '_-' | tr -d '=\n')"
rm -f "$vapid"
set_env "FLUXER_VAPID_PUBLIC_KEY" "$pub" "$STACK/.env"
set_env "FLUXER_VAPID_PRIVATE_KEY" "$priv" "$STACK/.env"