Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 25 additions & 4 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
version: '3.4'

x-apache-image: &apache-image
ghcr.io/mardi4nfdi/apache-assets-production:1.46
x-elasticsearch-image: &elasticsearch-image
docker-registry.wikimedia.org/releng/cirrus-elasticsearch:7.10.2-s0
x-formulasearch-image: &formulasearch-image
Expand All @@ -15,11 +17,11 @@ x-quickstatements-image: &quickstatements-image
x-redis: &redis-image
redis:7
x-redis-jobrunner: &redis-jobrunner-image
ghcr.io/mardi4nfdi/docker-redis-jobrunner:1.44
ghcr.io/mardi4nfdi/redis-jobrunner-production:1.46
x-traefik-image: &traefik-image
traefik:v2.8
x-wikibase: &wikibase-image
ghcr.io/mardi4nfdi/docker-wikibase:1.44
ghcr.io/mardi4nfdi/wikibase-production:1.46
x-wdqs-image: &wdqs-image
ghcr.io/wmde/wikibase/wdqs:dev-9186217118
x-wdqs-frontend-image: &wdqs-frontend-image
Expand Down Expand Up @@ -55,7 +57,7 @@ x-common-variables: &wikibase_variables
TRAEFIK_HTTP_PORT: ${TRAEFIK_HTTP_PORT:-80}
services:
wikibase:
image: *wikibase-image
image: *apache-image
container_name: mardi-wikibase
links:
- mysql
Expand All @@ -74,13 +76,15 @@ services:
- quickstatements-data:/quickstatements/data
- formulasearch_harvests:/var/www/html/w/my_harvests/
- apache_logs:/var/log/apache2/
- ./mediawiki/images:/var/www/html/w/images_repo:ro
networks:
default:
aliases:
- wikibase-docker.svc
- wikibase.svc
environment:
<<: *wikibase_variables
WIKIBASE_HOST: php-fpm-mardi-wikibase
labels:
Comment on lines 86 to 88
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# First, let's verify the file structure
git ls-files | grep -E "(docker-compose|LocalSettings)" | head -20

Repository: MaRDI4NFDI/portal-compose

Length of output: 830


🏁 Script executed:

# Run the verification script provided in the review
rg -n "WIKIBASE_HOST|PHP_FPM_HOST" docker-compose.yml

Repository: MaRDI4NFDI/portal-compose

Length of output: 1479


🏁 Script executed:

# Check if LocalSettings.d directory exists and search it
if [ -d "mediawiki/LocalSettings.d" ]; then
  rg -n "WIKIBASE_HOST|PHP_FPM_HOST" mediawiki/LocalSettings.d
else
  find . -name "LocalSettings*" -type f 2>/dev/null | head -10
fi

Repository: MaRDI4NFDI/portal-compose

Length of output: 688


🏁 Script executed:

# Let's see the full docker-compose.yml file context around lines 86-88
wc -l docker-compose.yml
head -100 docker-compose.yml | tail -30

Repository: MaRDI4NFDI/portal-compose

Length of output: 1594


🏁 Script executed:

# Look at the php-fpm-wikibase service definition
sed -n '95,120p' docker-compose.yml

Repository: MaRDI4NFDI/portal-compose

Length of output: 1087


🏁 Script executed:

# Check for Apache configuration files
find . -name "*.conf" -o -name "apache*" -type f 2>/dev/null | grep -E "(apache|php)" | head -20

Repository: MaRDI4NFDI/portal-compose

Length of output: 51


🏁 Script executed:

# Check if there's any mention of FPM upstream in config files
rg -l "FPM|fastcgi|upstream" --type conf --type php

Repository: MaRDI4NFDI/portal-compose

Length of output: 97


🏁 Script executed:

# Check docker-compose for wikibase service definition to confirm
sed -n '60,95p' docker-compose.yml

Repository: MaRDI4NFDI/portal-compose

Length of output: 1512


🏁 Script executed:

# Look for any Apache or PHP-FPM configuration in mediawiki directory
find mediawiki -type f \( -name "*.conf" -o -name "*.conf.d" \) 2>/dev/null

Repository: MaRDI4NFDI/portal-compose

Length of output: 51


🏁 Script executed:

# Check if there's any FastCGI or FPM configuration in LocalSettings.d files
rg -n "fastcgi|FastCGI|FPM|fpm|php-fpm" mediawiki/

Repository: MaRDI4NFDI/portal-compose

Length of output: 51


Don't override WIKIBASE_HOST with the internal FPM container name—it breaks Traefik routing and canonical URLs.

The current setup at line 87 immediately breaks the Traefik routing labels in the same service (lines 89, 94): they will attempt to route traffic to Host(php-fpm-mardi-wikibase, swmath.php-fpm-mardi-wikibase) instead of the public hostname. Additionally, this breaks all LocalSettings.d configurations that depend on WIKIBASE_HOST for canonical URLs, email (IDHost), VisualEditor, Matomo Analytics, and Quickstatements.

Keep WIKIBASE_HOST as the public host and introduce a separate PHP_FPM_HOST variable for the internal FPM upstream connection.

💡 Suggested change
     environment:
       <<: *wikibase_variables
-      WIKIBASE_HOST: php-fpm-mardi-wikibase
+      # keep public host for canonical URLs and Traefik routing
+      PHP_FPM_HOST: php-fpm-mardi-wikibase
🤖 Prompt for AI Agents
In `@docker-compose.yml` around lines 86 - 88, The WIKIBASE_HOST env var must
remain the public hostname (used by Traefik labels and LocalSettings.d) instead
of the internal FPM container name; change the docker-compose service to stop
overriding WIKIBASE_HOST with "php-fpm-mardi-wikibase" and introduce a new
variable (e.g., PHP_FPM_HOST) set to that internal container name; update any
places that reference the internal FPM upstream (Traefik labels, proxy
upstreams, or LocalSettings.d references to the FPM host) to use PHP_FPM_HOST
while leaving WIKIBASE_HOST as the public host so Traefik routing and canonical
URLs keep working.

- traefik.http.routers.service-wikibase.rule=Host(`${WIKIBASE_HOST}`,`swmath.${WIKIBASE_HOST}`)
- traefik.http.routers.service-wikibase.entrypoints=websecure
Expand All @@ -92,7 +96,24 @@ services:
- traefik.http.routers.service-wikimongo.tls.certResolver=le
- traefik.http.routers.service-wikimongo.service=wikimongo-service
- traefik.http.services.wikimongo-service.loadbalancer.server.port=8081

php-fpm-wikibase:
image: *wikibase-image
container_name: php-fpm-mardi-wikibase
links:
- wikibase
restart: unless-stopped
volumes:
## This shares the configuration with jobrunner
- shared_mardi_wikibase:/shared/:rw
- ./mediawiki/LocalSettings.d:/shared/LocalSettings.d
- ./mediawiki/LocalSettings.d:/var/www/html/w/LocalSettings.d
- shared_mediawiki_images:/var/www/html/w/images/:rw
- quickstatements-data:/quickstatements/data
- formulasearch_harvests:/var/www/html/w/my_harvests/
- apache_logs:/var/log/apache2/
environment:
<<: *wikibase_variables

mysql:
image: *mysql-image
container_name: mardi-mysql
Expand Down
14 changes: 0 additions & 14 deletions mediawiki/LocalSettings.d/LinkedWiki.php

This file was deleted.