Events can now target members.Group audiences alongside teams, or go club_wide (every ACTIVE ClubMembership member for the event's season) instead of specific teams/groups -- the two are mutually exclusive, enforced in EventForm/EventSeriesForm.clean() since an M2M can't be validated via a DB CheckConstraint or Event.clean() (no PK yet). Attendance sync (events/signals.py) now reacts to GroupMembership and ClubMembership changes the same way it already did for TeamMembership. Authorization: club.services.access.groups_manageable_by mirrors teams_managed_by (all groups for an ADMIN, else only the ones the user belongs to -- Group has no manager/owner concept); a non-admin needs at least one managed team or belonged-to group to create/edit an event, club_wide stays admin-only, and EventManagerRequiredMixin gained a get_groups() hook so a non-admin who creates a group-only event isn't immediately locked out of managing it. Also adds rosterchief.mail.ResendEmailBackend, an HTTP-API-based Django email backend for Resend (resend.com) using the existing `requests` dependency -- no new SDK. Opt in via DJANGO_EMAIL_BACKEND and RESEND_API_KEY; every Django-sent email (allauth's password reset included) follows whichever EMAIL_BACKEND is configured, so this covers all of them for free. Resend's own SMTP relay remains a valid code-free alternative, documented alongside it in .env.production.example. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
62 lines
2.6 KiB
Plaintext
62 lines
2.6 KiB
Plaintext
# Copy to .env.production and fill in. Everything here is read by python-decouple.
|
|
|
|
# --- Django ---
|
|
DJANGO_SECRET_KEY= # python -c "import secrets; print(secrets.token_urlsafe(64))"
|
|
DJANGO_DEBUG=False
|
|
# The leading dot matches every club subdomain.
|
|
DJANGO_ALLOWED_HOSTS=.rosterchief.app
|
|
DJANGO_CSRF_TRUSTED_ORIGINS=https://rosterchief.app,https://*.rosterchief.app
|
|
DJANGO_TIME_ZONE=Europe/Brussels
|
|
|
|
# --- Tenancy ---
|
|
# Drives subdomain resolution, the shared session cookie, and the WebAuthn RP ID (one passkey
|
|
# across every club).
|
|
ROSTERCHIEF_BASE_DOMAIN=rosterchief.app
|
|
ROSTERCHIEF_RP_NAME=RosterChief
|
|
|
|
# --- Services ---
|
|
DJANGO_DATABASE_URL=postgres://rosterchief:CHANGEME@db:5432/rosterchief
|
|
DJANGO_REDIS_URL=redis://redis:6379/0
|
|
|
|
# --- HTTPS (off by default in code; the deploy is what turns them on) ---
|
|
DJANGO_SECURE_SSL_REDIRECT=True
|
|
DJANGO_SESSION_COOKIE_SECURE=True
|
|
DJANGO_CSRF_COOKIE_SECURE=True
|
|
DJANGO_SECURE_HSTS_SECONDS=31536000
|
|
DJANGO_SECURE_HSTS_INCLUDE_SUBDOMAINS=True
|
|
# Preload is a one-way door — turn it on only once the wildcard cert has proven itself.
|
|
DJANGO_SECURE_HSTS_PRELOAD=False
|
|
|
|
# --- Static ---
|
|
DJANGO_STATICFILES_BACKEND=whitenoise.storage.CompressedManifestStaticFilesStorage
|
|
|
|
# --- Uploads: set these and club logos move off local disk (required for >1 app server) ---
|
|
# AWS_STORAGE_BUCKET_NAME=rosterchief-media
|
|
# AWS_S3_ENDPOINT_URL=https://fsn1.your-objectstorage.com
|
|
# AWS_S3_REGION_NAME=fsn1
|
|
# AWS_ACCESS_KEY_ID=
|
|
# AWS_SECRET_ACCESS_KEY=
|
|
|
|
# --- Email: any SMTP provider. Left unset, mail is PRINTED TO THE LOG and never delivered,
|
|
# which means send_billing_reminders will look like it worked while no club hears from you.
|
|
DJANGO_EMAIL_BACKEND=django.core.mail.backends.smtp.EmailBackend
|
|
DJANGO_EMAIL_HOST=smtp.example.com
|
|
DJANGO_EMAIL_PORT=587
|
|
DJANGO_EMAIL_HOST_USER=
|
|
DJANGO_EMAIL_HOST_PASSWORD=
|
|
DJANGO_EMAIL_USE_TLS=True
|
|
DJANGO_DEFAULT_FROM_EMAIL=RosterChief <noreply@rosterchief.app>
|
|
# Where a club is told to reply with a billing question.
|
|
ROSTERCHIEF_BILLING_CONTACT_EMAIL=billing@rosterchief.app
|
|
|
|
# --- Email via Resend (resend.com), as an alternative to the SMTP block above ---
|
|
# Two ways to use Resend; pick one, don't set both:
|
|
# 1. Resend's SMTP relay -- no code involved, just point the SMTP settings above at it:
|
|
# DJANGO_EMAIL_HOST=smtp.resend.com
|
|
# DJANGO_EMAIL_HOST_USER=resend
|
|
# DJANGO_EMAIL_HOST_PASSWORD=<your Resend API key>
|
|
# 2. Resend's HTTP API via rosterchief.mail.ResendEmailBackend (see that module):
|
|
# DJANGO_EMAIL_BACKEND=rosterchief.mail.ResendEmailBackend
|
|
# RESEND_API_KEY=<your Resend API key>
|
|
RESEND_API_KEY=
|