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
1 file changed
+2
+2
View File
@@ -74,6 +74,8 @@ hex32() { openssl rand -hex 32; }
echo "FLUXER_MEDIA_PROXY_UPLOAD_RELAY_SECRET_BASE64=$(openssl rand -base64 32 | tr -d '\n')"
echo "FLUXER_ACTIVITYPUB_SIGNING_KEY_BASE64=$(openssl genpkey -algorithm RSA -pkeyopt rsa_keygen_bits:2048 -outform DER 2>/dev/null | base64 | tr -d '\n')"
openssl ecparam -name prime256v1 -genkey -noout -out "${tmp}.vapid" 2>/dev/null
# Counts are attached (-c65, not -c 65). Unraid's tail treats a separated
# number as a filename.
pub="$(openssl ec -in "${tmp}.vapid" -pubout -outform DER 2>/dev/null | tail -c65 | base64 | tr '/+' '_-' | tr -d '=\n')"
priv="$(openssl ec -in "${tmp}.vapid" -outform DER 2>/dev/null | tail -c+8 | head -c32 | base64 | tr '/+' '_-' | tr -d '=\n')"
echo "FLUXER_VAPID_PUBLIC_KEY=$pub"