Skip to content

Commit b493e10

Browse files
Merge branch 'master' into hash-salt-logic
2 parents 222d1c0 + ce3d8ab commit b493e10

18 files changed

+1474
-182
lines changed

.blackfire.yml

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
tests:
2+
'The homepage should be fast':
3+
path:
4+
- '/'
5+
assertions:
6+
- 'main.wall_time <= 250ms'
7+
'Some Composer dependencies have known security issues and should be upgraded':
8+
path:
9+
- '/.*'
10+
assertions:
11+
- { expression: 'not has_vulnerable_dependencies()' }
12+
'"assert.active" is a dev_only feature and should be disabled in production':
13+
path:
14+
- '/.*'
15+
assertions:
16+
- { expression: 'runtime.configuration.assert_active === false' }
17+
'"display_errors" should be disabled':
18+
path:
19+
- '/.*'
20+
assertions:
21+
- { expression: 'not is_configuration_enabled("display_errors")' }
22+
'"display_startup_errors" should not be enabled':
23+
path:
24+
- '/.*'
25+
assertions:
26+
- { expression: 'not is_configuration_enabled("display_startup_errors")' }
27+
'"max_execution_time" should be less than 30 seconds for Web requests':
28+
path:
29+
- '/.*'
30+
assertions:
31+
- { expression: 'runtime.configuration.max_execution_time <= 30' }
32+
'"session.use_strict_mode" should be enabled':
33+
path:
34+
- '/.*'
35+
assertions:
36+
- { expression: 'runtime.configuration.session_use_strict_mode === true' }
37+
'"zend.detect_unicode" should be disabled as BOMs are not portable':
38+
path:
39+
- '/.*'
40+
assertions:
41+
- { expression: 'runtime.configuration.zend_detect_unicode === false' }
42+
'The realpath cache ttl should be more than one hour in production':
43+
path:
44+
- '/.*'
45+
assertions:
46+
- { expression: 'runtime.configuration.realpath_cache_ttl >= 3600' }
47+
'The session garbage collector should be disabled in production':
48+
path:
49+
- '/.*'
50+
assertions:
51+
- { expression: 'runtime.configuration.session_gc_probability === 0' }
52+
53+
scenarios: |
54+
#!blackfire-player
55+
56+
name "Drupal Scenarios"
57+
58+
group homepages
59+
visit url("/")
60+
name "Homepage (English)"
61+
expect status_code() == 200
62+
visit url("/es")
63+
name "Homepage (Español)"
64+
expect status_code() == 200
65+
66+
group articles
67+
visit url("/en/articles")
68+
name "Articles"
69+
expect status_code() == 200
70+
71+
group admin_anonymous
72+
visit url("/en/admin/content")
73+
expect status_code() == 403
74+
visit url("/en/admin/structure")
75+
expect status_code() == 403
76+
77+
scenario
78+
name "Anonymous Visit"
79+
include homepages
80+
include articles
81+
include admin_anonymous

.ddev/config.yaml

Lines changed: 207 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,207 @@
1+
name: api
2+
type: drupal9
3+
docroot: web
4+
php_version: "8.0"
5+
webserver_type: nginx-fpm
6+
router_http_port: "8000"
7+
router_https_port: "8443"
8+
xdebug_enabled: false
9+
additional_hostnames: []
10+
additional_fqdns: []
11+
database:
12+
type: mariadb
13+
version: "10.3"
14+
nfs_mount_enabled: false
15+
mutagen_enabled: false
16+
use_dns_when_possible: true
17+
composer_version: "2"
18+
web_environment: []
19+
nodejs_version: "16"
20+
21+
# Key features of ddev's config.yaml:
22+
23+
# name: <projectname> # Name of the project, automatically provides
24+
# http://projectname.ddev.site and https://projectname.ddev.site
25+
26+
# type: <projecttype> # drupal6/7/8, backdrop, typo3, wordpress, php
27+
28+
# docroot: <relative_path> # Relative path to the directory containing index.php.
29+
30+
# php_version: "7.4" # PHP version to use, "5.6", "7.0", "7.1", "7.2", "7.3", "7.4", "8.0", "8.1"
31+
32+
# You can explicitly specify the webimage but this
33+
# is not recommended, as the images are often closely tied to ddev's' behavior,
34+
# so this can break upgrades.
35+
36+
# webimage: <docker_image> # nginx/php docker image.
37+
38+
# database:
39+
# type: <dbtype> # mysql, mariadb
40+
# version: <version> # database version, like "10.3" or "8.0"
41+
# Note that mariadb_version or mysql_version from v1.18 and earlier
42+
# will automatically be converted to this notation with just a "ddev config --auto"
43+
44+
# router_http_port: <port> # Port to be used for http (defaults to port 80)
45+
# router_https_port: <port> # Port for https (defaults to 443)
46+
47+
# xdebug_enabled: false # Set to true to enable xdebug and "ddev start" or "ddev restart"
48+
# Note that for most people the commands
49+
# "ddev xdebug" to enable xdebug and "ddev xdebug off" to disable it work better,
50+
# as leaving xdebug enabled all the time is a big performance hit.
51+
52+
# xhprof_enabled: false # Set to true to enable xhprof and "ddev start" or "ddev restart"
53+
# Note that for most people the commands
54+
# "ddev xhprof" to enable xhprof and "ddev xhprof off" to disable it work better,
55+
# as leaving xhprof enabled all the time is a big performance hit.
56+
57+
# webserver_type: nginx-fpm # or apache-fpm
58+
59+
# timezone: Europe/Berlin
60+
# This is the timezone used in the containers and by PHP;
61+
# it can be set to any valid timezone,
62+
# see https://en.wikipedia.org/wiki/List_of_tz_database_time_zones
63+
# For example Europe/Dublin or MST7MDT
64+
65+
# composer_root: <relative_path>
66+
# Relative path to the composer root directory from the project root. This is
67+
# the directory which contains the composer.json and where all Composer related
68+
# commands are executed.
69+
70+
# composer_version: "2"
71+
# if composer_version:"2" it will use the most recent composer v2
72+
# It can also be set to "1", to get most recent composer v1
73+
# or "" for the default v2 created at release time.
74+
# It can be set to any existing specific composer version.
75+
# After first project 'ddev start' this will not be updated until it changes
76+
77+
# nodejs_version: "16"
78+
# change from the default system Node.js version to another supported version, like 12, 14, 17.
79+
# Note that you can use 'ddev nvm' or nvm inside the web container to provide nearly any
80+
# Node.js version, including v6, etc.
81+
82+
# additional_hostnames:
83+
# - somename
84+
# - someothername
85+
# would provide http and https URLs for "somename.ddev.site"
86+
# and "someothername.ddev.site".
87+
88+
# additional_fqdns:
89+
# - example.com
90+
# - sub1.example.com
91+
# would provide http and https URLs for "example.com" and "sub1.example.com"
92+
# Please take care with this because it can cause great confusion.
93+
94+
# upload_dir: custom/upload/dir
95+
# would set the destination path for ddev import-files to <docroot>/custom/upload/dir
96+
97+
# working_dir:
98+
# web: /var/www/html
99+
# db: /home
100+
# would set the default working directory for the web and db services.
101+
# These values specify the destination directory for ddev ssh and the
102+
# directory in which commands passed into ddev exec are run.
103+
104+
# omit_containers: [db, dba, ddev-ssh-agent]
105+
# Currently only these containers are supported. Some containers can also be
106+
# omitted globally in the ~/.ddev/global_config.yaml. Note that if you omit
107+
# the "db" container, several standard features of ddev that access the
108+
# database container will be unusable. In the global configuration it is also
109+
# possible to omit ddev-router, but not here.
110+
111+
# nfs_mount_enabled: false
112+
# Great performance improvement but requires host configuration first.
113+
# See https://ddev.readthedocs.io/en/stable/users/performance/#using-nfs-to-mount-the-project-into-the-container
114+
115+
# mutagen_enabled: false
116+
# Experimental performance improvement using mutagen asynchronous updates.
117+
# See https://ddev.readthedocs.io/en/latest/users/performance/#using-mutagen
118+
119+
# fail_on_hook_fail: False
120+
# Decide whether 'ddev start' should be interrupted by a failing hook
121+
122+
# host_https_port: "59002"
123+
# The host port binding for https can be explicitly specified. It is
124+
# dynamic unless otherwise specified.
125+
# This is not used by most people, most people use the *router* instead
126+
# of the localhost port.
127+
128+
# host_webserver_port: "59001"
129+
# The host port binding for the ddev-webserver can be explicitly specified. It is
130+
# dynamic unless otherwise specified.
131+
# This is not used by most people, most people use the *router* instead
132+
# of the localhost port.
133+
134+
# host_db_port: "59002"
135+
# The host port binding for the ddev-dbserver can be explicitly specified. It is dynamic
136+
# unless explicitly specified.
137+
138+
# phpmyadmin_port: "8036"
139+
# phpmyadmin_https_port: "8037"
140+
# The PHPMyAdmin ports can be changed from the default 8036 and 8037
141+
142+
# host_phpmyadmin_port: "8036"
143+
# The phpmyadmin (dba) port is not normally bound on the host at all, instead being routed
144+
# through ddev-router, but it can be specified and bound.
145+
146+
# mailhog_port: "8025"
147+
# mailhog_https_port: "8026"
148+
# The MailHog ports can be changed from the default 8025 and 8026
149+
150+
# host_mailhog_port: "8025"
151+
# The mailhog port is not normally bound on the host at all, instead being routed
152+
# through ddev-router, but it can be bound directly to localhost if specified here.
153+
154+
# webimage_extra_packages: [php7.4-tidy, php-bcmath]
155+
# Extra Debian packages that are needed in the webimage can be added here
156+
157+
# dbimage_extra_packages: [telnet,netcat]
158+
# Extra Debian packages that are needed in the dbimage can be added here
159+
160+
# use_dns_when_possible: true
161+
# If the host has internet access and the domain configured can
162+
# successfully be looked up, DNS will be used for hostname resolution
163+
# instead of editing /etc/hosts
164+
# Defaults to true
165+
166+
# project_tld: ddev.site
167+
# The top-level domain used for project URLs
168+
# The default "ddev.site" allows DNS lookup via a wildcard
169+
# If you prefer you can change this to "ddev.local" to preserve
170+
# pre-v1.9 behavior.
171+
172+
# ngrok_args: --subdomain mysite --auth username:pass
173+
# Provide extra flags to the "ngrok http" command, see
174+
# https://ngrok.com/docs#http or run "ngrok http -h"
175+
176+
# disable_settings_management: false
177+
# If true, ddev will not create CMS-specific settings files like
178+
# Drupal's settings.php/settings.ddev.php or TYPO3's AdditionalConfiguration.php
179+
# In this case the user must provide all such settings.
180+
181+
# You can inject environment variables into the web container with:
182+
# web_environment:
183+
# - SOMEENV=somevalue
184+
# - SOMEOTHERENV=someothervalue
185+
186+
# no_project_mount: false
187+
# (Experimental) If true, ddev will not mount the project into the web container;
188+
# the user is responsible for mounting it manually or via a script.
189+
# This is to enable experimentation with alternate file mounting strategies.
190+
# For advanced users only!
191+
192+
# bind_all_interfaces: false
193+
# If true, host ports will be bound on all network interfaces,
194+
# not just the localhost interface. This means that ports
195+
# will be available on the local network if the host firewall
196+
# allows it.
197+
198+
# Many ddev commands can be extended to run tasks before or after the
199+
# ddev command is executed, for example "post-start", "post-import-db",
200+
# "pre-composer", "post-composer"
201+
# See https://ddev.readthedocs.io/en/stable/users/extending-commands/ for more
202+
# information on the commands that can be extended and the tasks you can define
203+
# for them. Example:
204+
#hooks:
205+
# post-import-db:
206+
# - exec: drush cr
207+
# - exec: drush updb

.ddev/providers/platform.yaml

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
#ddev-generated
2+
# Example Platform.sh provider configuration.
3+
4+
# To use this configuration,
5+
6+
# 1. Check out the site from platform.sh and then configure it with `ddev config`. You'll want to use `ddev start` and make sure the basic functionality is working.
7+
# 2. Obtain and configure an API token.
8+
# a. Login to the Platform.sh Dashboard and go to Account->API Tokens to create an API token for ddev to use.
9+
# b. Add the API token to the `web_environment` section in your global ddev configuration at ~/.ddev/global_config.yaml:
10+
# ```yaml
11+
# web_environment:
12+
# - PLATFORMSH_CLI_TOKEN=abcdeyourtoken
13+
# ```
14+
# 3. `ddev restart`
15+
# 4. Obtain your project id with `ddev exec platform`. The platform tool should show you all the information about your account and project.
16+
# 5. In your project's .ddev/providers directory, copy platform.yaml.example to platform.yaml and edit the `project_id` and `environment_name`.
17+
# 6. Run `ddev pull platform`. After you agree to the prompt, the current upstream database and files will be downloaded.
18+
# 7. Optionally use `ddev push platform` to push local files and database to platform.sh. Note that `ddev push` is a command that can potentially damage your production site, so this is not recommended.
19+
20+
# Debugging: Use `ddev exec platform` to see what platform.sh knows about
21+
# your configuration and whether it's working correctly.
22+
23+
environment_variables:
24+
project_id: yourproject
25+
environment: main
26+
application: drupal
27+
28+
auth_command:
29+
command: |
30+
set -eu -o pipefail
31+
if [ -z "${PLATFORMSH_CLI_TOKEN:-}" ]; then echo "Please make sure you have set PLATFORMSH_CLI_TOKEN in ~/.ddev/global_config.yaml" && exit 1; fi
32+
33+
db_pull_command:
34+
command: |
35+
set -x # You can enable bash debugging output by uncommenting
36+
set -eu -o pipefail
37+
ls /var/www/html/.ddev >/dev/null # This just refreshes stale NFS if possible
38+
platform db:dump --yes --gzip --file=/var/www/html/.ddev/.downloads/db.sql.gz --project="${project_id}" --environment="${environment}" --app="${application}"
39+
40+
files_pull_command:
41+
command: |
42+
set -x # You can enable bash debugging output by uncommenting
43+
set -eu -o pipefail
44+
ls /var/www/html/.ddev >/dev/null # This just refreshes stale NFS if possible
45+
platform mount:download --yes --quiet --project="${project_id}" --environment="${environment}" --app="${application}" --mount=web/sites/default/files --target=/var/www/html/.ddev/.downloads/files
46+
47+
48+
# push is a dangerous command. If not absolutely needed it's better to delete these lines.
49+
db_push_command:
50+
command: |
51+
set -x # You can enable bash debugging output by uncommenting
52+
set -eu -o pipefail
53+
ls /var/www/html/.ddev >/dev/null # This just refreshes stale NFS if possible
54+
pushd /var/www/html/.ddev/.downloads >/dev/null;
55+
gzip -dc db.sql.gz | platform db:sql --project="${project_id}" --environment="${environment}"
56+
57+
# push is a dangerous command. If not absolutely needed it's better to delete these lines.
58+
files_push_command:
59+
command: |
60+
set -x # You can enable bash debugging output by uncommenting
61+
set -eu -o pipefail
62+
ls "${DDEV_FILES_DIR}" >/dev/null # This just refreshes stale NFS if possible
63+
platform mount:upload --yes --quiet --project="${project_id}" --environment="${environment}" --source="${DDEV_FILES_DIR}" --mount=web/sites/default/files

.editorconfig

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,6 @@ insert_final_newline = true
1515

1616
[composer.{json,lock}]
1717
indent_size = 4
18+
19+
[.platform.app.yaml]
20+
indent_size = 4

0 commit comments

Comments
 (0)