Skip to content

Commit 40c026c

Browse files
committed
Merge branch 'production' into test
Bring the nginx routing restructure, network-scoped /members/ Profiles redirects, container healthchecks, and CI updates onto the test deployment branch. WordPress stays on 6.8.1 (the WP7 upgrade on dev is excluded, matching production and main). # Conflicts: # config/test/nginx/templates/25-buddypress-redirects.conf.template
2 parents 6758f19 + 9108987 commit 40c026c

14 files changed

Lines changed: 798 additions & 298 deletions

Dockerfile.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,5 +161,8 @@
161161
> /app/site/web/.version.json && \
162162
chown www-data:www-data /app/site/web/.version.json
163163

164+
# used for health check endpoint
165+
RUN apk add --no-cache fcgi
166+
164167
ENTRYPOINT ["/app/scripts/build-scripts/docker-php-entrypoint.sh"]
165168
CMD ["php-fpm"]

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@
134134
"wp-plugin/tainacan": "^1.0.1",
135135
"wp-plugin/cool-timeline": "^3.0.8",
136136
"mesh-research/cc-client": "dev-main",
137-
"mesh-research/kcworks-on-wp": "1.0.3",
137+
"mesh-research/kcworks-on-wp": "1.3.1",
138138
"wp-plugin/feedzy-rss-feeds": "^4.4",
139139
"wp-plugin/zotpress": "^7.4.1",
140140
"php-http/guzzle7-adapter": "^1.0",

composer.lock

Lines changed: 349 additions & 294 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

config/all/nginx/templates/00-hcommons.conf.template

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,18 @@ map $http_origin $allow_origin {
1010
default "";
1111
}
1212

13+
#
14+
# Resolve the network a request belongs to, for the /members/ redirects to
15+
# the Profiles application. Hosts on their own (custom) domains are mapped
16+
# to a network name by the per-environment alias file; every other host
17+
# falls back to the subdomain captured from the server_name regex below.
18+
#
19+
map $host $network_subdomain {
20+
hostnames;
21+
default $subdomain;
22+
include /etc/nginx/conf.d/05-network-domain-aliases.conf;
23+
}
24+
1325
server {
1426
listen [::]:80;
1527
listen 80;
@@ -79,6 +91,12 @@ server {
7991
deny all;
8092
}
8193

94+
# Container healthcheck endpoint
95+
location = /healthz {
96+
access_log off;
97+
return 200 "ok";
98+
}
99+
82100
# Prevent BuddyPress docs from being accessed directly.
83101
location /app/uploads/bp-attachments/ {
84102
rewrite ^/app/uploads/bp-attachments/([0-9]+)/(.*) https://$http_x_forwarded_host/?p=$1&bp-attachment=$2 permanent;
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# Custom-domain -> network aliases, included into the $network_subdomain
2+
# map in 00-hcommons.conf.template.
3+
#
4+
# Sites that live on their own domains (rather than a subdomain of
5+
# DOMAIN_NAME) cannot have their network inferred from the Host header,
6+
# so list them here. Each entry maps a hostname to the network subdomain
7+
# used on the Profiles application host.
8+
#
9+
# A leading dot matches the domain itself and any subdomain of it:
10+
#
11+
# .commons.msu.edu msu;
12+
#
13+
# sends commons.msu.edu/members/ (and asite.commons.msu.edu/members/)
14+
# to https://msu.profile.<instance domain>/members/.
15+
#
16+
# This file is the environment-neutral default and defines no aliases.
17+
# Per-environment entries live in
18+
# config/<env>/nginx/templates/05-network-domain-aliases.conf.template,
19+
# which overrides this file at image build time.

config/all/php/www.conf

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,6 @@ pm.max_children = ${PM_MAX_CHILDREN}
99
pm.start_servers = ${PM_START_SERVERS}
1010
pm.min_spare_servers = ${PM_MIN_SPARE_SERVERS}
1111
pm.max_spare_servers = ${PM_MAX_SPARE_SERVERS}
12-
pm.max_requests = ${PM_MAX_REQUESTS}
12+
pm.max_requests = ${PM_MAX_REQUESTS}
13+
ping.path = /ping
14+
ping.response = pong
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Custom-domain -> network aliases for dev. See
2+
# config/all/nginx/templates/05-network-domain-aliases.conf.template
3+
# for the entry format.
4+
5+
.msucommons-dev.org msu;

config/dev/nginx/templates/25-buddypress-redirects.conf.template

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,14 @@
11
# this has to be ordered after 20-buddypress.conf.template has been loaded
22

3-
# Member profile redirects to new Profiles application
3+
# Member profile redirects to new Profiles application.
4+
# Requests belonging to a network (resolved by the $network_subdomain map
5+
# in 00-hcommons.conf.template, from either the request subdomain or a
6+
# custom-domain alias) carry the network as a subdomain of the Profiles
7+
# host so Profiles can scope the member list to that network.
48
location /members/ {
9+
if ($network_subdomain) {
10+
return 301 https://$network_subdomain.profile.hcommons-dev.org$request_uri;
11+
}
512
return 301 https://profile.hcommons-dev.org$request_uri;
613
}
714

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# Custom-domain -> network aliases for production. See
2+
# config/all/nginx/templates/05-network-domain-aliases.conf.template
3+
# for the entry format.
4+
5+
# iteach.msu.edu needs no entry: 40-redirects.conf.template redirects it
6+
# wholesale to iteach.commons.msu.edu, which the .commons.msu.edu entry
7+
# covers.
8+
.commons.msu.edu msu;
9+
.action.mla.org mla;
10+
.symposium.mla.org mla;
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# this has to be ordered after 20-buddypress.conf.template has been loaded
2+
3+
# Member profile redirects to new Profiles application.
4+
# Requests belonging to a network (resolved by the $network_subdomain map
5+
# in 00-hcommons.conf.template, from either the request subdomain or a
6+
# custom-domain alias) carry the network as a subdomain of the Profiles
7+
# host so Profiles can scope the member list to that network.
8+
location /members/ {
9+
if ($network_subdomain) {
10+
return 301 https://$network_subdomain.profile.hcommons.org$request_uri;
11+
}
12+
return 301 https://profile.hcommons.org$request_uri;
13+
}
14+
15+
# Member registration page redirects to new Profiles application
16+
location /membership/ {
17+
return 301 https://profile.hcommons.org/registration/start/;
18+
}

0 commit comments

Comments
 (0)