Skip to content

Commit 024d065

Browse files
committed
Merge branch 'develop'
2 parents 1b1cc1e + 50a4d88 commit 024d065

File tree

387 files changed

+9654
-8689
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

387 files changed

+9654
-8689
lines changed

.docker/data/.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Ignore everything in this directory
2+
*
3+
# Except this file
4+
!.gitignore
5+
!Readme.md

.docker/data/README.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# .docker/data
2+
3+
Please map persistent volumes to this directory on the servers.
4+
5+
If a container needs to persist data between restarts you can map the relevant files in the container to ``docker/data/<container-name>`.
6+
7+
## RabbitMQ example
8+
If you are using RabbitMQ running in a container as a message broker you need to configure a persistent volume for RabbitMQs data directory to avoid losing message on container restarts.
9+
10+
```yaml
11+
# docker-compose.server.override.yml
12+
13+
services:
14+
rabbit:
15+
image: rabbitmq:3.9-management-alpine
16+
hostname: "${COMPOSE_PROJECT_NAME}"
17+
networks:
18+
- app
19+
- frontend
20+
environment:
21+
- "RABBITMQ_DEFAULT_USER=${RABBITMQ_USER}"
22+
- "RABBITMQ_DEFAULT_PASS=${RABBITMQ_PASSWORD}"
23+
- "RABBITMQ_ERLANG_COOKIE=${RABBITMQ_ERLANG_COOKIE}"
24+
volumes:
25+
- ".docker/data/rabbitmq:/var/lib/rabbitmq/mnesia/"
26+
```

.docker/nginx.conf

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
worker_processes auto;
2+
3+
error_log /dev/stderr notice;
4+
pid /tmp/nginx.pid;
5+
6+
events {
7+
worker_connections 1024;
8+
}
9+
10+
11+
http {
12+
proxy_temp_path /tmp/proxy_temp;
13+
client_body_temp_path /tmp/client_temp;
14+
fastcgi_temp_path /tmp/fastcgi_temp;
15+
uwsgi_temp_path /tmp/uwsgi_temp;
16+
scgi_temp_path /tmp/scgi_temp;
17+
18+
include /etc/nginx/mime.types;
19+
default_type application/octet-stream;
20+
21+
set_real_ip_from 172.16.0.0/8;
22+
real_ip_recursive on;
23+
real_ip_header X-Forwarded-For;
24+
25+
log_format main '$http_x_real_ip - $remote_user [$time_local] "$request" '
26+
'$status $body_bytes_sent "$http_referer" '
27+
'"$http_user_agent" "$http_x_forwarded_for"';
28+
29+
access_log /dev/stdout main;
30+
31+
sendfile on;
32+
keepalive_timeout 65;
33+
34+
gzip on;
35+
36+
include /etc/nginx/conf.d/*.conf;
37+
}
Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
server {
2+
listen ${NGINX_PORT};
3+
server_name localhost;
4+
5+
root ${NGINX_WEB_ROOT};
6+
7+
client_max_body_size ${NGINX_MAX_BODY_SIZE};
8+
9+
location = /favicon.ico {
10+
log_not_found off;
11+
access_log off;
12+
}
13+
14+
location = /robots.txt {
15+
allow all;
16+
log_not_found off;
17+
access_log off;
18+
}
19+
20+
location ~* \.(txt|log)$ {
21+
deny all;
22+
}
23+
24+
location ~ \..*/.*\.php$ {
25+
return 403;
26+
}
27+
28+
location ~ ^/sites/.*/private/ {
29+
return 403;
30+
}
31+
32+
# Block access to scripts in site files directory
33+
location ~ ^/sites/[^/]+/files/.*\.php$ {
34+
deny all;
35+
}
36+
37+
# Block access to "hidden" files and directories whose names begin with a
38+
# period.
39+
location ~ (^|/)\. {
40+
return 403;
41+
}
42+
43+
location / {
44+
try_files $uri /index.php?$query_string;
45+
}
46+
47+
location @rewrite {
48+
rewrite ^ /index.php;
49+
}
50+
51+
# Don't allow direct access to PHP files in the vendor directory.
52+
location ~ /vendor/.*\.php$ {
53+
deny all;
54+
return 404;
55+
}
56+
57+
# Protect files and directories from prying eyes.
58+
location ~* \.(engine|inc|install|make|module|profile|po|sh|.*sql|.tar|.gz|.bz2|theme|twig|tpl(\.php)?|xtmpl|yml)(~|\.sw[op]|\.bak|\.orig|\.save)?$|^(\.(?!well-known).*|Entries.*|Repository|Root|Tag|Template|composer\.(json|lock)|web\.config)$|^#.*#$|\.php(~|\.sw[op]|\.bak|\.orig|\.save)$ {
59+
deny all;
60+
return 404;
61+
}
62+
63+
location ~ '\.php$|^/update.php' {
64+
include fastcgi_params;
65+
66+
fastcgi_buffers 16 32k;
67+
fastcgi_buffer_size 64k;
68+
fastcgi_busy_buffers_size 64k;
69+
70+
fastcgi_split_path_info ^(.+?\.php)(|/.*)$;
71+
72+
# Ensure the php file exists. Mitigates CVE-2019-11043
73+
try_files $fastcgi_script_name =404;
74+
75+
fastcgi_param HTTP_PROXY "";
76+
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
77+
fastcgi_param PATH_INFO $fastcgi_path_info;
78+
fastcgi_param QUERY_STRING $query_string;
79+
80+
fastcgi_intercept_errors on;
81+
fastcgi_pass ${NGINX_FPM_SERVICE};
82+
83+
# @TODO Can we fall back to the default value here if NGINX_FASTCGI_READ_TIMEOUT is not defined?
84+
# Cf. https://nginx.org/en/docs/http/ngx_http_fastcgi_module.html#fastcgi_read_timeout
85+
fastcgi_read_timeout ${NGINX_FASTCGI_READ_TIMEOUT};
86+
}
87+
88+
# Enforce clean URLs
89+
#
90+
# Removes index.php from urls like www.example.com/index.php/my-page --> www.example.com/my-page
91+
# Could be done with 301 for permanent or other redirect codes.
92+
if ($request_uri ~* "^(.*/)index\.php/(.*)") {
93+
return 307 $1$2;
94+
}
95+
96+
error_log /dev/stderr;
97+
access_log /dev/stdout main;
98+
}

.docker/vhost.conf

Lines changed: 29 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
# @see https://www.nginx.com/resources/wiki/start/topics/recipes/drupal/
21
server {
3-
listen 80;
2+
listen 8080;
43
server_name localhost;
54

65
root /app/web;
@@ -16,9 +15,7 @@ server {
1615
access_log off;
1716
}
1817

19-
# Very rarely should these ever be accessed outside of your lan
2018
location ~* \.(txt|log)$ {
21-
allow 192.168.0.0/16;
2219
deny all;
2320
}
2421

@@ -35,25 +32,18 @@ server {
3532
deny all;
3633
}
3734

38-
# Allow "Well-Known URIs" as per RFC 5785
39-
location ~* ^/.well-known/ {
40-
allow all;
41-
}
42-
4335
# Block access to "hidden" files and directories whose names begin with a
44-
# period. This includes directories used by version control systems such
45-
# as Subversion or Git to store control files.
36+
# period.
4637
location ~ (^|/)\. {
4738
return 403;
4839
}
4940

5041
location / {
51-
# try_files $uri @rewrite; # For Drupal <= 6
52-
try_files $uri /index.php?$query_string; # For Drupal >= 7
42+
try_files $uri /index.php?$query_string;
5343
}
5444

5545
location @rewrite {
56-
rewrite ^/(.*)$ /index.php?q=$1;
46+
rewrite ^ /index.php;
5747
}
5848

5949
# Don't allow direct access to PHP files in the vendor directory.
@@ -62,47 +52,41 @@ server {
6252
return 404;
6353
}
6454

65-
# In Drupal 8, we must also match new paths where the '.php' appears in
66-
# the middle, such as update.php/selection. The rule we use is strict,
67-
# and only allows this pattern with the update.php front controller.
68-
# This allows legacy path aliases in the form of
69-
# blog/index.php/legacy-path to continue to route to Drupal nodes. If
70-
# you do not have any paths like that, then you might prefer to use a
71-
# laxer rule, such as:
72-
# location ~ \.php(/|$) {
73-
# The laxer rule will continue to work if Drupal uses this new URL
74-
# pattern with front controllers other than update.php in a future
75-
# release.
55+
# Protect files and directories from prying eyes.
56+
location ~* \.(engine|inc|install|make|module|profile|po|sh|.*sql|.tar|.gz|.bz2|theme|twig|tpl(\.php)?|xtmpl|yml)(~|\.sw[op]|\.bak|\.orig|\.save)?$|^(\.(?!well-known).*|Entries.*|Repository|Root|Tag|Template|composer\.(json|lock)|web\.config)$|^#.*#$|\.php(~|\.sw[op]|\.bak|\.orig|\.save)$ {
57+
deny all;
58+
return 404;
59+
}
60+
7661
location ~ '\.php$|^/update.php' {
77-
fastcgi_split_path_info ^(.+?\.php)(|/.*)$;
78-
# Security note: If you're running a version of PHP older than the
79-
# latest 5.3, you should have "cgi.fix_pathinfo = 0;" in php.ini.
80-
# See http://serverfault.com/q/627903/94922 for details.
8162
include fastcgi_params;
82-
# Block httpoxy attacks. See https://httpoxy.org/.
63+
64+
fastcgi_buffers 16 32k;
65+
fastcgi_buffer_size 64k;
66+
fastcgi_busy_buffers_size 64k;
67+
68+
fastcgi_split_path_info ^(.+?\.php)(|/.*)$;
69+
70+
# Ensure the php file exists. Mitigates CVE-2019-11043
71+
try_files $fastcgi_script_name =404;
72+
8373
fastcgi_param HTTP_PROXY "";
8474
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
8575
fastcgi_param PATH_INFO $fastcgi_path_info;
8676
fastcgi_param QUERY_STRING $query_string;
77+
8778
fastcgi_intercept_errors on;
8879
fastcgi_pass phpfpm:9000;
8980
}
9081

91-
# Fighting with Styles? This little gem is amazing.
92-
# location ~ ^/sites/.*/files/imagecache/ { # For Drupal <= 6
93-
location ~ ^/sites/.*/files/styles/ { # For Drupal >= 7
94-
try_files $uri @rewrite;
82+
# Enforce clean URLs
83+
#
84+
# Removes index.php from urls like www.example.com/index.php/my-page --> www.example.com/my-page
85+
# Could be done with 301 for permanent or other redirect codes.
86+
if ($request_uri ~* "^(.*/)index\.php/(.*)") {
87+
return 307 $1$2;
9588
}
9689

97-
# Handle private files through Drupal. Private file's path can come
98-
# with a language prefix.
99-
location ~ ^(/[a-z\-]+)?/system/files/ { # For Drupal >= 7
100-
try_files $uri /index.php?$query_string;
101-
}
102-
103-
location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg)$ {
104-
try_files $uri @rewrite;
105-
expires max;
106-
log_not_found off;
107-
}
90+
error_log /dev/stderr;
91+
access_log /dev/stdout main;
10892
}

.gitattributes

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,29 +19,32 @@
1919
*.config text eol=lf whitespace=blank-at-eol,-blank-at-eof,-space-before-tab,tab-in-indent,tabwidth=2
2020
*.css text eol=lf whitespace=blank-at-eol,-blank-at-eof,-space-before-tab,tab-in-indent,tabwidth=2
2121
*.dist text eol=lf whitespace=blank-at-eol,-blank-at-eof,-space-before-tab,tab-in-indent,tabwidth=2
22-
*.engine text eol=lf whitespace=blank-at-eol,-blank-at-eof,-space-before-tab,tab-in-indent,tabwidth=2 diff=php
22+
*.engine text eol=lf whitespace=blank-at-eol,-blank-at-eof,-space-before-tab,tab-in-indent,tabwidth=2 diff=php linguist-language=php
2323
*.html text eol=lf whitespace=blank-at-eol,-blank-at-eof,-space-before-tab,tab-in-indent,tabwidth=2 diff=html
24-
*.inc text eol=lf whitespace=blank-at-eol,-blank-at-eof,-space-before-tab,tab-in-indent,tabwidth=2 diff=php
25-
*.install text eol=lf whitespace=blank-at-eol,-blank-at-eof,-space-before-tab,tab-in-indent,tabwidth=2 diff=php
24+
*.inc text eol=lf whitespace=blank-at-eol,-blank-at-eof,-space-before-tab,tab-in-indent,tabwidth=2 diff=php linguist-language=php
25+
*.install text eol=lf whitespace=blank-at-eol,-blank-at-eof,-space-before-tab,tab-in-indent,tabwidth=2 diff=php linguist-language=php
2626
*.js text eol=lf whitespace=blank-at-eol,-blank-at-eof,-space-before-tab,tab-in-indent,tabwidth=2
2727
*.json text eol=lf whitespace=blank-at-eol,-blank-at-eof,-space-before-tab,tab-in-indent,tabwidth=2
2828
*.lock text eol=lf whitespace=blank-at-eol,-blank-at-eof,-space-before-tab,tab-in-indent,tabwidth=2
2929
*.map text eol=lf whitespace=blank-at-eol,-blank-at-eof,-space-before-tab,tab-in-indent,tabwidth=2
3030
*.md text eol=lf whitespace=blank-at-eol,-blank-at-eof,-space-before-tab,tab-in-indent,tabwidth=2
31-
*.module text eol=lf whitespace=blank-at-eol,-blank-at-eof,-space-before-tab,tab-in-indent,tabwidth=2 diff=php
32-
*.php text eol=lf whitespace=blank-at-eol,-blank-at-eof,-space-before-tab,tab-in-indent,tabwidth=2 diff=php
31+
*.module text eol=lf whitespace=blank-at-eol,-blank-at-eof,-space-before-tab,tab-in-indent,tabwidth=2 diff=php linguist-language=php
32+
*.php text eol=lf whitespace=blank-at-eol,-blank-at-eof,-space-before-tab,tab-in-indent,tabwidth=2 diff=php linguist-language=php
3333
*.po text eol=lf whitespace=blank-at-eol,-blank-at-eof,-space-before-tab,tab-in-indent,tabwidth=2
34-
*.profile text eol=lf whitespace=blank-at-eol,-blank-at-eof,-space-before-tab,tab-in-indent,tabwidth=2 diff=php
34+
*.profile text eol=lf whitespace=blank-at-eol,-blank-at-eof,-space-before-tab,tab-in-indent,tabwidth=2 diff=php linguist-language=php
3535
*.script text eol=lf whitespace=blank-at-eol,-blank-at-eof,-space-before-tab,tab-in-indent,tabwidth=2
36-
*.sh text eol=lf whitespace=blank-at-eol,-blank-at-eof,-space-before-tab,tab-in-indent,tabwidth=2 diff=php
36+
*.sh text eol=lf whitespace=blank-at-eol,-blank-at-eof,-space-before-tab,tab-in-indent,tabwidth=2 diff=php linguist-language=php
3737
*.sql text eol=lf whitespace=blank-at-eol,-blank-at-eof,-space-before-tab,tab-in-indent,tabwidth=2
3838
*.svg text eol=lf whitespace=blank-at-eol,-blank-at-eof,-space-before-tab,tab-in-indent,tabwidth=2
39-
*.theme text eol=lf whitespace=blank-at-eol,-blank-at-eof,-space-before-tab,tab-in-indent,tabwidth=2 diff=php
39+
*.theme text eol=lf whitespace=blank-at-eol,-blank-at-eof,-space-before-tab,tab-in-indent,tabwidth=2 diff=php linguist-language=php
4040
*.twig text eol=lf whitespace=blank-at-eol,-blank-at-eof,-space-before-tab,tab-in-indent,tabwidth=2
4141
*.txt text eol=lf whitespace=blank-at-eol,-blank-at-eof,-space-before-tab,tab-in-indent,tabwidth=2
4242
*.xml text eol=lf whitespace=blank-at-eol,-blank-at-eof,-space-before-tab,tab-in-indent,tabwidth=2
4343
*.yml text eol=lf whitespace=blank-at-eol,-blank-at-eof,-space-before-tab,tab-in-indent,tabwidth=2
4444

45+
# PHPStan's baseline uses tabs instead of spaces.
46+
core/.phpstan-baseline.php text eol=lf whitespace=blank-at-eol,-blank-at-eof,-space-before-tab,tabwidth=2 diff=php linguist-language=php
47+
4548
# Define binary file attributes.
4649
# - Do not treat them as text.
4750
# - Include binary diff in patches instead of "binary files differ."
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
on: push
2+
3+
name: Docker image
4+
jobs:
5+
build:
6+
name: Build and push
7+
runs-on: ubuntu-latest
8+
steps:
9+
- name: Checkout code
10+
uses: actions/checkout@v2
11+
- name: Setup PHP, with composer and extensions
12+
uses: shivammathur/setup-php@v2
13+
with:
14+
php-version: 8.2
15+
extensions: dom, zip
16+
coverage: none
17+
tools: composer:v2
18+
- name: Install PHP dependencies
19+
run: |
20+
composer install --no-interaction --no-progress
21+
- name: Build theme
22+
working-directory: web/profiles/custom/os2loop/themes/os2loop_theme
23+
run: |
24+
yarn install
25+
yarn build
26+
- name: Set up Docker Buildx
27+
id: buildx
28+
uses: docker/setup-buildx-action@v1
29+
- name: Login to GitHub Container Registry
30+
uses: docker/login-action@v1
31+
# We only push from the default branch, so no need to login from elsewhere.
32+
if: ${{ github.ref == format('refs/heads/{0}', github.event.repository.default_branch) }}
33+
with:
34+
registry: ghcr.io
35+
username: ${{ github.repository_owner }}
36+
password: ${{ secrets.GITHUB_TOKEN }}
37+
- name: Build and push Docker image
38+
uses: docker/build-push-action@v2
39+
with:
40+
builder: ${{ steps.buildx.outputs.name }}
41+
# Only push the image if this is a push to the default branch.
42+
push: ${{ github.ref == format('refs/heads/{0}', github.event.repository.default_branch) }}
43+
context: .
44+
labels: |
45+
org.opencontainers.image.source=https://github.com/${{ github.repository }}
46+
org.opencontainers.image.version=${{ github.sha }}
47+
org.opencontainers.image.revision=${{ github.sha }}
48+
tags: |
49+
ghcr.io/${{ github.repository }}:latest

0 commit comments

Comments
 (0)