Document F7_PUSH_SECRET for support webhook and sync f7support secret on regenerate.

This commit is contained in:
root
2026-05-24 12:49:00 +03:00
parent df4e2dddec
commit 0c6bc1ae16
2 changed files with 103 additions and 12 deletions
+3 -2
View File
@@ -1,12 +1,13 @@
#!/usr/bin/env bash
# Print or set f7push API secret on this F7cloud server.
# Print or set f7push API secret (F7_PUSH_SECRET for support.f7cloud.ru webhook).
set -euo pipefail
cd /var/www/f7cloud
if [[ "${1:-}" == "--regenerate" ]]; then
SECRET=$(openssl rand -base64 36 | tr -d '/+=' | head -c 48)
sudo -u www-data php occ config:app:set f7push api_secret --value="$SECRET"
sudo -u www-data php occ config:app:set f7support push_webhook_secret --value="$SECRET"
echo "$SECRET"
else
sudo -u www-data php occ config:app:get f7push api_secret 2>/dev/null || true
echo "(If empty, call POST /push once or run with --regenerate)"
echo "(If empty, run with --regenerate)"
fi