No description
  • PHP 86.9%
  • CSS 3.9%
  • Twig 3.1%
  • Python 2.6%
  • Shell 2.3%
  • Other 1.2%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Bart Dupon 26bfbcc1f8
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
Merge pull request 'Remove the purge and bunny_cdn packages' (#29) from staging into main
Reviewed-on: #29
2026-11-21 08:20:41 +00:00
.ddev Add Drupal 11 codebase with Dutch base install 2026-10-10 19:56:24 +02:00
.setup Drop Bunny CDN: origin auth, purge split and deploy purge 2026-11-21 09:02:44 +01:00
config Drop Bunny CDN: origin auth, purge split and deploy purge 2026-11-21 09:02:44 +01:00
deploy Drop Bunny CDN: origin auth, purge split and deploy purge 2026-11-21 09:02:44 +01:00
docker Drop Bunny CDN: origin auth, purge split and deploy purge 2026-11-21 09:02:44 +01:00
docs/superpowers Account menu as icons with a settings link 2026-10-15 22:03:49 +02:00
tests Phone menu, clickable attendees, drop Letterboxd score sync 2026-10-13 09:09:51 +02:00
web Give the automator test user basic_html access 2026-11-03 10:43:15 +01:00
.dockerignore Remove Hugo, the migration code and the smoke test 2026-10-13 21:17:07 +02:00
.gitignore Remove Hugo, the migration code and the smoke test 2026-10-13 21:17:07 +02:00
.woodpecker.yml Drop Bunny CDN: origin auth, purge split and deploy purge 2026-11-21 09:02:44 +01:00
composer.json Remove the purge and bunny_cdn packages 2026-11-21 09:08:57 +01:00
composer.lock Remove the purge and bunny_cdn packages 2026-11-21 09:08:57 +01:00
Dockerfile Drop Bunny CDN: origin auth, purge split and deploy purge 2026-11-21 09:02:44 +01:00
LICENSE Initial commit 2019-04-02 10:54:43 +02:00
phpunit.xml Add filmclub_core module and kernel test harness 2026-10-10 20:00:12 +02:00
README.md Drop Bunny CDN: origin auth, purge split and deploy purge 2026-11-21 09:02:44 +01:00
renovate.json Update composer.lock and enable Renovate lockFileMaintenance 2026-11-03 10:01:57 +01:00

filmclub.brussels

status-badge

The website of the filmclub: planned and past screenings, attendance, leden and their Letterboxd profiles. Drupal 11 on PHP 8.4 and MariaDB, developed with DDEV.

Branch Deploys to
staging https://staging.filmclub.brussels
main https://filmclub.brussels

Work on staging. A release is a merge of staging into main.

Getting started

git clone ssh://git@git.m44.be:2222/bdu/filmclub.git && cd filmclub
git switch staging
cp .setup/settings.local.php.example web/sites/default/settings.local.php
printf 'ANTHROPIC_API_KEY=\nTMDB_API_KEY=\n' > .ddev/.env   # optional keys
ddev start
ddev composer install

Then get a database, either a restore of prod or an empty site.

Restore of prod (the usual way). Images load from prod through stage_file_proxy (settings.local.php).

ssh <vps> docker exec filmclub-drupal-prod drush sql:dump > prod.sql
ddev import-db --file=prod.sql
ddev drush cim -y && ddev drush uli

The dump contains the real email addresses of leden. Keep it out of git and delete it when you are done. A restore of staging works the same way (filmclub-drupal-staging).

Empty site, with no films or leden:

ddev drush site:install --existing-config --account-name=bdu -y
for po in web/modules/custom/*/translations/*.po \
          web/themes/custom/filmclub/translations/*.po; do
  ddev drush locale:import nl "/var/www/html/$po" \
    --type=not-customized --override=not-customized
done
ddev drush php:script .setup/seed-content.php
ddev drush uli

The keys in .ddev/.env are only needed for AI summaries and TMDB lookups.

Working on it

Test before you push. CI only checks that the PHP parses; the suites run here. Add --filter ListRenderTest to run one class.

ddev exec vendor/bin/phpunit -c phpunit.xml web/modules/custom   # slow
python3 -m pytest web/themes/custom/filmclub/tests tests -q

Config lives in config/sync. Change it in the UI, then run ddev drush cex -y and commit. Check git diff config/sync first: importing translations can change block labels in the database, and those should not end up in a commit. Local-only modules (stage_file_proxy, potx) are in the local config split, switched on by settings.local.php.

Text. Code strings are English. The Dutch translations sit next to the code in translations/*.nl.po; add new strings there. The site's default language is Dutch.

Secrets never go into git or config. API keys come from environment variables: .ddev/.env here, Woodpecker secrets on the server.

Where things are

Custom modules are in web/modules/custom/:

Module What
filmclub_core Films, screenings, attendance, leden, homepage
filmclub_ai TMDB, AI summaries, /plannen
Path What
web/themes/custom/filmclub Theme: cards, screenings, light, dark
config/sync Drupal configuration
.setup/ Seed and setup scripts
Dockerfile, docker/ The image and docker/deploy.sh
deploy/ Compose files, the pull script, tests

The film lists (/gepland with the proposals, /archief) and the next films on the homepage are the view films. Its templates are in the theme (views-view--films*.html.twig).

Dependency updates

Renovate (self-hosted on the VPS, see renovate.json) opens pull requests against staging for Composer packages and the base image. Drupal core is one grouped pull request, and major versions wait for approval in the dependency dashboard. renovate.json is read from main, so it only works once a release has put it there.

A green pull request only means the image builds. Before merging one, run it here, because an update can change active configuration and cim on deploy would import the old config/sync over that change:

git fetch && git switch renovate/<branch> && ddev composer install
ddev drush updatedb -y && ddev drush cex -y   # then read git diff config/sync
ddev exec vendor/bin/phpunit -c phpunit.xml web/modules/custom

Commit any config change to the same branch, merge into staging, check staging, then release to main as usual.

Deploying

Woodpecker (.woodpecker.yml) runs on the VPS for every push to staging or main:

  1. Build: builds the image filmclub/drupal:staging or filmclub/drupal:prod and lints the custom PHP inside it.
  2. Deploy: starts the stack and runs docker/deploy.sh staging|prod in the container.
    • Every deploy runs updatedb, cim and the translations. It never touches content.
    • Both environments refuse an empty database: restore a prod dump into a new one first.

deploy/test-deploy-guard.sh checks this behaviour against the real script in the image with a stub drush (needs Docker). deploy/test-pull-script.sh tests the guards of the pull script.

Staging Prod
Stack /opt/stacks/filmclub-staging /opt/stacks/filmclub-brussels
Container filmclub-drupal-staging filmclub-drupal-prod
Files /opt/sites/filmclub/{files,private}_staging /opt/sites/filmclub/{files,private}
Secrets FILMCLUB_STAGING_* FILMCLUB_PROD_*

Woodpecker secrets: both sets have …_DB_NAME, …_DB_USER, …_DB_PASSWORD and …_HASH_SALT (openssl rand -base64 55). The shared secrets are ANTHROPIC_API_KEY and TMDB_API_KEY.

Databases are on the shared MariaDB: host mariadb on shared_internal_net. Each user needs all rights on its own database. The files_* and private_* folders are created by hand.

Copying data: deploy/pull-prod-to-staging.sh refreshes staging from prod: the database, files and private files. Staging can then send mail to the real addresses of leden, so use it with care. Redeploy staging afterwards.

Useful commands on the VPS (S is the container):

S=filmclub-drupal-prod   # or filmclub-drupal-staging
docker exec $S drush uli --uri=https://filmclub.brussels --name=bdu

Hosting

visitor ─▶ filmclub.brussels ─────────▶ Pangolin ─▶ drupal-prod
tester  ─▶ staging.filmclub.brussels ─▶ Pangolin ─▶ drupal-staging
                                      (VPS 49.12.98.181)
  • Pangolin (pangolin.m44.be) routes the hostnames to the containers on port 80 and terminates TLS. The Traefik labels in the compose files are not used for routing.
  • DNS is on Bunny: @, www and staging are A records to the VPS.
  • Caching: no CDN. Drupal's page cache serves anonymous pages; browsers keep them for 5 minutes (page.max_age in system.performance).
  • Staging sends X-Robots-Tag: noindex.
  • Mail: only prod sends, from the site address (noreply@filmclub.brussels, the site email in config/sync), through the shared Postfix relay to Brevo. The address must be a sender in Brevo, and filmclub.brussels must be in Postfix's ALLOWED_SENDER_DOMAINS. Staging and local containers only collect mail in Drupal's state, so a restored copy of prod can never email leden.
  • Analytics: Umami (umami.m44.be), proxied by the container's nginx under /umami/, so it is first-party.