Rename apns-dev to push-dev and unify 1Password credentials

- Rename script from apns-dev to push-dev (handles both APNs and FCM)
- Fetch credentials from Deploy/Fizzy Production (same as Kamal)
- Use _B64 env vars to avoid escaping issues with multiline keys
- Update bin/dev flag from --apns to --push

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Rosa Gutierrez
2026-01-24 13:35:57 +01:00
parent dbfb141b6f
commit d1500ad4ec
4 changed files with 54 additions and 58 deletions
+9 -9
View File
@@ -2,27 +2,27 @@
PORT=3006
USE_TAILSCALE=0
USE_APNS=0
USE_PUSH=0
for arg in "$@"; do
case $arg in
--tailscale) USE_TAILSCALE=1 ;;
--apns) USE_APNS=1 ;;
--push) USE_PUSH=1 ;;
esac
done
if [ "$USE_APNS" = "1" ]; then
if [ "$USE_PUSH" = "1" ]; then
if [ ! -f tmp/saas.txt ]; then
echo "Enabling SaaS mode for APNs..."
echo "Enabling SaaS mode for push notifications..."
./bin/rails saas:enable
fi
echo "Loading APNs credentials from 1Password..."
if ! eval "$(BUNDLE_GEMFILE=Gemfile.saas bundle exec apns-dev)"; then
echo "Error: failed to load APNs credentials. Are you signed into 1Password?" >&2
echo "Loading push credentials from 1Password..."
if ! eval "$(BUNDLE_GEMFILE=Gemfile.saas bundle exec push-dev)"; then
echo "Error: failed to load push credentials. Are you signed into 1Password?" >&2
exit 1
fi
if [ -z "$APNS_ENCRYPTION_KEY" ] || [ -z "$APNS_KEY_ID" ]; then
echo "Error: APNs credentials not set. Missing APNS_ENCRYPTION_KEY or APNS_KEY_ID." >&2
if [ -z "$APNS_ENCRYPTION_KEY_B64" ] || [ -z "$APNS_KEY_ID" ]; then
echo "Error: Push credentials not set. Missing APNS_ENCRYPTION_KEY_B64 or APNS_KEY_ID." >&2
exit 1
fi
fi