-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.platform.app.yaml
197 lines (178 loc) · 5.9 KB
/
.platform.app.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
# This file describes an application. You can have multiple applications
# in the same project.
#
# See https://docs.platform.sh/user_guide/reference/platform-app-yaml.html
# The name of this app. Must be unique within a project.
name: 'nidirect'
# The runtime the application uses.
type: 'php:8.3'
# Application variables.
# Set non-sensitive variables here only.
# Use Platform CLI or console to set sensitive variables.
variables:
php:
memory_limit: "128M"
dependencies:
php:
composer/composer: '^2'
runtime:
# Enable the redis extension so Drupal can communicate with the Redis cache.
extensions:
- apcu
- redis
# Sizing hints.
sizing_hints:
request_memory: 55
reserved_memory: 70
# The relationships of the application with services or other applications.
#
# The left-hand side is the name of the relationship as it will be exposed
# to the application in the PLATFORM_RELATIONSHIPS variable. The right-hand
# side is in the form `:`.
relationships:
solr: 'solr_8_11:solr'
redis: "redis:redis"
# For MariaDB, the endpoint does not change whether you used the mysql or mariadb service type.
database: 'db:admin'
# The size of the persistent disk of the application (in MB).
disk: 30720
# The 'mounts' describe writable, persistent filesystem mounts in the application.
mounts:
'/web/sites/default/files':
source: local
source_path: 'files'
'/tmp':
source: local
source_path: 'tmp'
'/private':
source: local
source_path: 'private'
'/imports':
source: local
source_path: 'imports'
'/.drush':
source: local
source_path: 'drush'
'/drush-backups':
source: local
source_path: 'drush-backups'
'/.console':
source: local
source_path: 'console'
'/log':
source: local
source_path: 'log'
'/web/.well-known':
source: local
source_path: "well-known"
# Configuration of the build of this application.
build:
flavor: composer
# The hooks executed at various points in the lifecycle of the application.
hooks:
build: |
set -e
echo "Replace vanilla CKEditor config with a custom one to fix the click/drag bug with embedded entities"
git clone https://github.com/dof-dss/ckeditor4-fix-widget-dnd.git
rm -rf web/core/assets/vendor/ckeditor
mv ckeditor4-fix-widget-dnd/build/ckeditor web/core/assets/vendor/ckeditor
rm -rf ckeditor4-fix-widget-dnd
echo "Install Platform CLI tool"
curl -sS https://platform.sh/cli/installer | php
echo "Update robots.txt with NIDirect customisations"
cp -f web/robots_nidirect.txt web/robots.txt
# The deploy hook runs after your application has been deployed and started.
deploy: |
set -e
echo "Create 'Easy Google Analytics Counter' auth file"
printf '%s\n' "$EGAC_GA_AUTH" > /app/private/easy_google_analytics_counter_auth.json
php ./drush/platformsh_generate_drush_yml.php
cd web
# Rebuild caches, run db-updates and import config.
drush -y cache-rebuild
drush -y updatedb
# General config import
drush -y config-import
# Final cache rebuild.
drush -y cache-rebuild
# The configuration of app when it is exposed to the web.
web:
# Specific parameters for different URL prefixes.
locations:
'/':
# The folder from which to serve static assets, for this location.
#
# This is a filesystem path, relative to the application root.
root: 'web'
# How long to allow static assets from this location to be cached.
#
# Can be a time in seconds, or -1 for no caching. Times can be
# suffixed with "s" (seconds), "m" (minutes), "h" (hours), "d"
# (days), "w" (weeks), "M" (months, as 30 days) or "y" (years, as
# 365 days).
expires: 5m
# Whether to forward disallowed and missing resources from this
# location to the application.
#
# Can be true, false or a URI path string.
passthru: '/index.php'
# Deny access to static files in this location.
allow: false
# Apply rules to all static files (dynamic files get rules from your app)
headers:
X-Content-Type-Options: nosniff
# Rules for specific URI patterns.
rules:
# Allow access to common static files.
'\.(jpe?g|png|gif|svgz?|css|js|map|ico|bmp|eot|woff2?|otf|ttf)$':
allow: true
expires: 2w
'^/robots\.txt$':
allow: true
'^/\.well-known/apple-developer-merchantid-domain-association$':
allow: true
'^/\.well-known/apple-developer-merchantid-domain-association\.txt$':
allow: true
'^/\.well-known/security\.txt$':
allow: true
'^/sitemap\.xml$':
allow: true
'^\/themes\/custom\/.+\/favicons\/.+\.webmanifest$':
allow: true
expires: 2w
# Deny direct access to configuration files.
'^/sites/sites\.php$':
scripts: false
'^/sites/[^/]+/settings.*?\.php$':
scripts: false
'/sites/default/files':
# Allow access to all files in the public files directory.
allow: true
expires: 5m
passthru: '/index.php'
root: 'web/sites/default/files'
# Do not execute PHP scripts.
scripts: false
rules:
# Allow a longer Fastly TTL for publication files
'^/sites/default/files/':
headers:
Surrogate-Control: max-age=31536000
# Provide a longer TTL for aggregated CSS and JS files.
'^/sites/default/files/(css|js)':
expires: 1y
# Provide a longer TTL for Drupal image files.
'^/sites/default/files/styles/[^\.]+\.(jpe?g|png|gif|svgz?)$':
expires: 4w
crons:
# Log shipping cron.
logging:
spec: '*/5 * * * *'
commands:
start: '/bin/bash /app/cronjob.sh'
shutdown_timeout: 290
# Workaround for the "mysterious disappearing breadcrumb" saga.
breadcrumb-reveal-thyself:
spec: '0 5 * * *'
commands:
start: 'cd web ; drush cc render'