Files
f7push/scripts/generate-secret.sh
T
root df4e2dddec Add f7push v0.1: FCM device registry and push API for F7cloud.
Portable occ-based config, OCS endpoints for APK registration, notification relay, and server-side push dispatch.
2026-05-24 10:26:36 +03:00

13 lines
470 B
Bash

#!/usr/bin/env bash
# Print or set f7push API secret on this F7cloud server.
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"
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)"
fi