Files
growstuff/env-example
google-labs-jules[bot] d828fd5c35 feat: Add web push notifications
This commit introduces web push notifications to the application.

Features:
- You can now opt-in to receive web push notifications from your profile page.
- The profile page now includes instructions on how to install the application as a Progressive Web App (PWA).
- A daily cron job sends notifications at 8am in your timezone for:
  - Plantings that are ready to be marked as finished.
  - Activities that are due on the current day.

Implementation details:
- Adds `web-push` and `serviceworker-rails` gems.
- Adds a `timezone` column to the `members` table.
- Adds a `PushSubscription` model to store user subscriptions.
- Adds a service worker to handle push events.
- Adds a `PushSubscriptionsController` to manage subscriptions.
- Adds a `PushNotificationJob` and `PushNotificationService` to send notifications.

NOTE: I was unable to run any tests due to technical difficulties. The code is therefore untested and may contain errors.
2025-08-10 00:56:40 +00:00

79 lines
3.4 KiB
Plaintext

# This file is a sample file which you (i.e. Growstuff developers) can
# copy and use to store your API credentials for external APIs used by
# the Growstuff application.
# We are progressively moving config variables out of
# config/environments/*.rb and into this application.yml config instead.
# Please do not add new config variables to config/environments.
# There are however a couple of exceptions to this, particularly config
# variables used by the assets pipeline, which cannot access ENV. These
# include:
# mapbox_map_id
# To use it, copy env-example.yml or application.yml.example to application.yml (which is
# .gitignored) and fill in the appropriate values.
# Settings in this file will be available to you as ENV['WHATEVER']
# NOTE=please prefix all environment variables with GROWSTUFF_ to make
# it easy to identify which were set by us vs. the system or anyone else
##############################################################################
# Default (this is basically what's used in the development environment
##############################################################################
# This secret token is used by Rails to generate cookies.
# It's the only one without "GROWSTUFF_" prefix.
# To generate a real one, use 'rake secret' (you don't need to for
# dev, though.)
RAILS_SECRET_TOKEN="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
# name that appears on the site, eg. in page titles
GROWSTUFF_SITE_NAME="Growstuff (dev)"
# Mailchimp is used for subscribing/unsubscribing people from the newsletter
# To fetch list IDs using Gibbon (and thus find the ID of your newsletter):
# $ rails c
# Gibbon::API.api_key = '...'
# gb = Gibbon::API.new
# puts gb.lists.list.to_yaml
GROWSTUFF_MAILCHIMP_APIKEY=""
GROWSTUFF_MAILCHIMP_NEWSLETTER_ID=""
# Used for connecting member accounts to Twitter
# Get Twitter key from https://dev.twitter.com/apps
GROWSTUFF_TWITTER_KEY=""
GROWSTUFF_TWITTER_SECRET=""
# Used for connecting member accounts to Flickr
# Get Flickr key from http://www.flickr.com/services/apps/create/apply/
GROWSTUFF_FLICKR_KEY=""
GROWSTUFF_FLICKR_SECRET=""
# Elasticsearch is used for flexible search and it requires another component
# to be installed. To make it easy for people who don't need to test this feature
# it's been turned off for test and development environment as a default.
# If you want to test this functionality, install elasticsearch and
# set this flag to "true".
GROWSTUFF_ELASTICSEARCH="true"
GROWSTUFF_EMAIL='noreply@dev.growstuff.org'
ELASTIC_SEARCH_VERSION="7.5.1-amd64"
# We also now use SMTP2GO in prod and Mailgun in staging
# and recaptcha to solve our email issues after SendGrid stopped working
MAILGUN_SMTP_LOGIN=""
MAILGUN_SMTP_PASSWORD=""
MAILGUN_SMTP_PORT=""
MAILGUN_SMTP_SERVER=""
# These recaptcha values are the official Google test ones from
# https://developers.google.com/recaptcha/docs/faq#id-like-to-run-automated-tests-with-recaptcha.-what-should-i-do
# In production, replace them with real ones
RECAPTCHA_SITE_KEY="6LeIxAcTAAAAAJcZVRqyHh71UMIEGNQ_MXjiZKhI"
RECAPTCHA_SECRET_KEY="6LeIxAcTAAAAAGG-vFI1TnRWxMZNFuojJ4WifJWe"
# VAPID keys for web push notifications
# These are insecure and should be replaced with real keys in production
# Generate new keys with `bundle exec rake webpush:generate_keys`
GROWSTUFF_VAPID_PUBLIC_KEY="BFf_pM3_3q0g1hIUiWf_nQdYj524I4E-mp3jW_j_7X-B-xWpW-j_8X_8X_8X_8X_8X_8X_8X_8X_8"
GROWSTUFF_VAPID_PRIVATE_KEY="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"