From 0b3f7a5a6bc0736ec8eb209fe951f487969e86a6 Mon Sep 17 00:00:00 2001 From: Greg Price Date: Thu, 2 Nov 2023 16:42:01 -0700 Subject: [PATCH] push_notifs: In dev, automatically use dev APNs cert if provided This lets us simplify the instructions for testing push notifications with a development client on iOS. --- .gitignore | 1 + zproject/dev_settings.py | 7 +++++++ 2 files changed, 8 insertions(+) diff --git a/.gitignore b/.gitignore index b0b0c62114..871fdd6b53 100644 --- a/.gitignore +++ b/.gitignore @@ -17,6 +17,7 @@ # See `git help ignore` for details on the format. ## Config files for the dev environment +/zproject/apns-dev.pem /zproject/dev-secrets.conf /tools/conf.ini /tools/custom_provision diff --git a/zproject/dev_settings.py b/zproject/dev_settings.py index 80d75cf1e4..b039f032b2 100644 --- a/zproject/dev_settings.py +++ b/zproject/dev_settings.py @@ -100,6 +100,13 @@ USING_PGROONGA = True # Flush cache after migration. POST_MIGRATION_CACHE_FLUSHING = True +# If a sandbox APNs cert is provided, use it. +# To create such a cert, see instructions at: +# https://github.com/zulip/zulip-mobile/blob/main/docs/howto/push-notifications.md#ios +_candidate_apns_cert_file = "zproject/apns-dev.pem" +if os.path.isfile(_candidate_apns_cert_file): + APNS_CERT_FILE = _candidate_apns_cert_file + # Don't require anything about password strength in development PASSWORD_MIN_LENGTH = 0 PASSWORD_MIN_GUESSES = 0