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:
1 parent
6d105355f4
commit
b910932394
2 files changed
+6
-4
No files matched your search
@@ -74,8 +74,10 @@ 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
|
||||
pub="$(openssl ec -in "${tmp}.vapid" -pubout -outform DER 2>/dev/null | tail -c 65 | base64 | tr '/+' '_-' | tr -d '=\n')"
|
||||
priv="$(openssl ec -in "${tmp}.vapid" -outform DER 2>/dev/null | tail -c +8 | head -c 32 | base64 | tr '/+' '_-' | tr -d '=\n')"
|
||||
# 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"
|
||||
echo "FLUXER_VAPID_PRIVATE_KEY=$priv"
|
||||
echo "FLUXER_POSTGRES_MEMORY_LIMIT=1gb"
|
||||
|
||||
Reference in new issue
Block a user