df4e2dddec
Portable occ-based config, OCS endpoints for APK registration, notification relay, and server-side push dispatch.
13 lines
470 B
Bash
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
|