Skip to content

Commit dae94fd

Browse files
authored
Merge pull request #128 from itk-dev/hotfix/set_real_ip_from-value
Fix nginx set_real_ip_from conf
2 parents 115c1b4 + fff7397 commit dae94fd

File tree

21 files changed

+47
-25
lines changed

21 files changed

+47
-25
lines changed

.github/workflows/pr.yaml

Lines changed: 27 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ jobs:
66
strategy:
77
fail-fast: false
88
matrix:
9-
version:
9+
version: &template_version
1010
- drupal-7
1111
- drupal-8
1212
- drupal-9
@@ -21,14 +21,36 @@ jobs:
2121

2222
- name: Validate local docker compose files
2323
run: |
24-
DC=$(COMPOSE_DOMAIN=test.itkdev.dk docker compose --file templates/${{ matrix.version }}/docker-compose.yml config --quiet 2>&1)
24+
DC=$(COMPOSE_DOMAIN=example.org docker compose --file templates/${{ matrix.version }}/docker-compose.yml config --quiet 2>&1)
2525
[ -z "$DC" ] || { echo $DC; exit 1; }
2626
2727
- name: Validate server docker compose files
2828
run: |
29-
DC=$(COMPOSE_SERVER_DOMAIN=test.itkdev.dk docker compose --file templates/${{ matrix.version }}/docker-compose.server.yml config --quiet 2>&1)
29+
DC=$(COMPOSE_SERVER_DOMAIN=example.org docker compose --file templates/${{ matrix.version }}/docker-compose.server.yml config --quiet 2>&1)
3030
[ -z "$DC" ] || { echo $DC; exit 1; }
31-
DC=$(COMPOSE_SERVER_DOMAIN=test.itkdev.dk docker compose --file templates/${{ matrix.version }}/docker-compose.server.yml --file templates/${{ matrix.version }}/docker-compose.dev.yml config --quiet 2>&1)
31+
DC=$(COMPOSE_SERVER_DOMAIN=example.org docker compose --file templates/${{ matrix.version }}/docker-compose.server.yml --file templates/${{ matrix.version }}/docker-compose.dev.yml config --quiet 2>&1)
3232
[ -z "$DC" ] || { echo $DC; exit 1; }
33-
DC=$(COMPOSE_SERVER_DOMAIN=test.itkdev.dk docker compose --file templates/${{ matrix.version }}/docker-compose.server.yml --file templates/${{ matrix.version }}/docker-compose.redirect.yml config --quiet 2>&1)
33+
DC=$(COMPOSE_SERVER_DOMAIN=example.org docker compose --file templates/${{ matrix.version }}/docker-compose.server.yml --file templates/${{ matrix.version }}/docker-compose.redirect.yml config --quiet 2>&1)
3434
[ -z "$DC" ] || { echo $DC; exit 1; }
35+
36+
validate-nginx-conf:
37+
runs-on: ubuntu-latest
38+
strategy:
39+
fail-fast: false
40+
matrix:
41+
version: *template_version
42+
compose_file:
43+
- docker-compose.yml
44+
- docker-compose.server.yml
45+
46+
name: Validate nginx conf (${{ matrix.version }}/${{ matrix.compose_file}})
47+
steps:
48+
- uses: actions/checkout@v5
49+
50+
- name: Create docker network
51+
run: |
52+
docker network create frontend
53+
54+
- name: Validate nginx conf
55+
run: |
56+
COMPOSE_DOMAIN=example.org docker compose --file templates/${{ matrix.version }}/${{ matrix.compose_file}} run --rm nginx nginx -t

templates/drupal-10/.docker/nginx.conf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ http {
1717
include /etc/nginx/mime.types;
1818
default_type application/octet-stream;
1919

20-
# Note: set_real_ip_from is only set in the server block to make i configurable
20+
# Note: set_real_ip_from is set in the server block
2121

2222
log_format main '$http_x_real_ip - $remote_user [$time_local] "$request" '
2323
'$status $body_bytes_sent "$http_referer" '

templates/drupal-10/.docker/templates/default.conf.template

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ server {
77
client_max_body_size ${NGINX_MAX_BODY_SIZE};
88

99
set_real_ip_from 172.16.0.0/16;
10-
set_real_ip_from ${NGINX_SET_REAL_IP_FROM:-192.168.39.0/24};
10+
set_real_ip_from 192.168.39.0/24;
1111
real_ip_recursive on;
1212
real_ip_header X-Forwarded-For;
1313

templates/drupal-11/.docker/nginx.conf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ http {
1717
include /etc/nginx/mime.types;
1818
default_type application/octet-stream;
1919

20-
# Note: set_real_ip_from is only set in the server block to make i configurable
20+
# Note: set_real_ip_from is set in the server block
2121

2222
log_format main '$http_x_real_ip - $remote_user [$time_local] "$request" '
2323
'$status $body_bytes_sent "$http_referer" '

templates/drupal-11/.docker/templates/default.conf.template

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ server {
77
client_max_body_size ${NGINX_MAX_BODY_SIZE};
88

99
set_real_ip_from 172.16.0.0/16;
10-
set_real_ip_from ${NGINX_SET_REAL_IP_FROM:-192.168.39.0/24};
10+
set_real_ip_from 192.168.39.0/24;
1111
real_ip_recursive on;
1212
real_ip_header X-Forwarded-For;
1313

templates/drupal-7/.docker/nginx.conf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ http {
1717
include /etc/nginx/mime.types;
1818
default_type application/octet-stream;
1919

20-
# Note: set_real_ip_from is only set in the server block to make i configurable
20+
# Note: set_real_ip_from is set in the server block
2121

2222
log_format main '$http_x_real_ip - $remote_user [$time_local] "$request" '
2323
'$status $body_bytes_sent "$http_referer" '

templates/drupal-7/.docker/templates/default.conf.template

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ server {
77
client_max_body_size ${NGINX_MAX_BODY_SIZE};
88

99
set_real_ip_from 172.16.0.0/16;
10-
set_real_ip_from ${NGINX_SET_REAL_IP_FROM:-192.168.39.0/24};
10+
set_real_ip_from 192.168.39.0/24;
1111
real_ip_recursive on;
1212
real_ip_header X-Forwarded-For;
1313

templates/drupal-7/docker-compose.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ services:
7979
# - "traefik.http.middlewares.redirect-to-https.redirectscheme.scheme=https"
8080

8181
memcached:
82-
image: "memcached:latest"
82+
image: memcached:alpine
8383
networks:
8484
- app
8585
ports:

templates/drupal-8/.docker/nginx.conf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ http {
1717
include /etc/nginx/mime.types;
1818
default_type application/octet-stream;
1919

20-
# Note: set_real_ip_from is only set in the server block to make i configurable
20+
# Note: set_real_ip_from is set in the server block
2121

2222
log_format main '$http_x_real_ip - $remote_user [$time_local] "$request" '
2323
'$status $body_bytes_sent "$http_referer" '

templates/drupal-8/.docker/templates/default.conf.template

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ server {
77
client_max_body_size ${NGINX_MAX_BODY_SIZE};
88

99
set_real_ip_from 172.16.0.0/16;
10-
set_real_ip_from ${NGINX_SET_REAL_IP_FROM:-192.168.39.0/24};
10+
set_real_ip_from 192.168.39.0/24;
1111
real_ip_recursive on;
1212
real_ip_header X-Forwarded-For;
1313

0 commit comments

Comments
 (0)