Skip to content

Commit d639078

Browse files
author
Ruwan
committed
Merge branch 'release/3.x/3.7.0' into 3.x-master
2 parents a1c5caf + 605e25b commit d639078

20 files changed

+460
-226
lines changed

.tugboat/config.yml

Lines changed: 19 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,17 @@
11
services:
22

3-
mysql:
4-
image: tugboatqa/mysql:5
3+
database:
4+
# Use the latest available 5.x version of MySQL
5+
image: tugboatqa/mariadb:10.5
6+
7+
# A set of commands to run while building this service
8+
commands:
9+
# Configure the server for the site to run on.
10+
init:
11+
# Increase the allowed packet size to 512MB.
12+
- mysql -e "SET GLOBAL max_allowed_packet=536870912;"
13+
# Ensure this packet size persists even if MySQL restarts.
14+
- echo "max_allowed_packet=536870912" >> /etc/mysql/conf.d/tugboat.cnf
515

616
app:
717
image: tugboatqa/php:8.1-apache
@@ -10,7 +20,7 @@ services:
1020
# 2. Exposes port 80 to the Tugboat HTTP proxy
1121
# 3. Routes requests to the preview URL to this service
1222
default: true
13-
depends: mysql
23+
depends: database
1424
visualdiffs:
1525
:default:
1626
- /
@@ -31,9 +41,6 @@ services:
3141
# Clean up. This keeps image storage tighter on Tugboat.
3242
- apt-get autoclean && apt-get clean
3343

34-
# Install drush-launcher.
35-
- wget -O /usr/local/bin/drush https://github.com/drush-ops/drush-launcher/releases/download/0.6.0/drush.phar && chmod +x /usr/local/bin/drush
36-
3744
# Install/update packages managed by composer, including drush.
3845
- composer selfupdate && composer clear
3946
- COMPOSER_MEMORY_LIMIT=-1 composer install --prefer-dist
@@ -69,14 +76,13 @@ services:
6976
- chmod 0664 ${DOCROOT}/sites/default/default.services.yml
7077

7178
# Install the site.
72-
- drush -r "${DOCROOT}" site:install govcms install_configure_form.update_status_module='array(FALSE,FALSE)' -y
79+
- bin/drush -r "${DOCROOT}" site:install govcms install_configure_form.update_status_module='array(FALSE,FALSE)' -y
80+
- bin/drush en module_permissions -y
7381

7482
# Commands when building a new branch/PR update.
7583
build:
7684
- COMPOSER_MEMORY_LIMIT=-1 composer update
77-
- drush cache:rebuild
78-
# Partial importing is still having some issues with Drush 10 and Drupal 9.
79-
#- drush config-import --partial --source="${TUGBOAT_ROOT}/config/test" -y
80-
- drush en module_permissions -y
81-
- drush updatedb -y
82-
- drush cache:rebuild
85+
- bin/drush cache:rebuild
86+
- bin/drush config-import --partial --source="${TUGBOAT_ROOT}/config/test" -y
87+
- bin/drush updatedb -y
88+
- bin/drush cache:rebuild

.tugboat/settings.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
'username' => 'tugboat',
1515
'password' => 'tugboat',
1616
'prefix' => '',
17-
'host' => 'mysql',
17+
'host' => 'database',
1818
'port' => '3306',
1919
'namespace' => 'Drupal\\Core\\Database\\Driver\\mysql',
2020
'driver' => 'mysql',

composer.json

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,8 @@
4848
"drupal/consumers": "1.17.0",
4949
"drupal/contact_storage": "1.3.0",
5050
"drupal/context": "5.0.0-rc1",
51-
"drupal/core-composer-scaffold": "10.1.6",
52-
"drupal/core-recommended": "10.1.6",
51+
"drupal/core-composer-scaffold": "10.1.7",
52+
"drupal/core-recommended": "10.1.7",
5353
"drupal/crop": "2.3.0",
5454
"drupal/ctools": "3.14.0",
5555
"drupal/devel": "5.1.2",
@@ -84,11 +84,11 @@
8484
"drupal/media_file_delete": "1.3.0",
8585
"drupal/media_vimeo_domain_privacy": "1.1",
8686
"drupal/menu_block": "1.10.0",
87-
"drupal/menu_trail_by_path": "2.0.0",
87+
"drupal/menu_trail_by_path": "2.0.1",
8888
"drupal/metatag": "2.0.0",
8989
"drupal/migrate_file": "2.1.2",
9090
"drupal/migrate_plus": "6.0.1",
91-
"drupal/migrate_source_csv": "3.5.0",
91+
"drupal/migrate_source_csv": "3.6.0",
9292
"drupal/migrate_tools": "6.0.2",
9393
"drupal/minisite": "2.0.0",
9494
"drupal/modifiers": "1.5.0",
@@ -111,14 +111,14 @@
111111
"drupal/securitytxt": "1.4.0",
112112
"drupal/shield": "1.7.0",
113113
"drupal/simple_oauth": "5.2.5",
114-
"drupal/simple_sitemap": "4.1.6",
114+
"drupal/simple_sitemap": "4.1.8",
115115
"drupal/swiftmailer": "2.4.0",
116116
"drupal/symfony_mailer": "1.4.0",
117-
"drupal/tfa": "1.3.0",
117+
"drupal/tfa": "1.4.0",
118118
"drupal/token": "1.13.0",
119119
"drupal/twig_tweak": "3.2.1",
120120
"drupal/username_enumeration_prevention": "1.3.0",
121-
"drupal/webform": "6.2.0",
121+
"drupal/webform": "6.2.2",
122122
"egulias/email-validator": "4.0.1 as 3.2.6",
123123
"govcms-assets/chosen": "2.2.1",
124124
"oomphinc/composer-installers-extender": "^2.0",

config/optional/password_policy.password_policy.austism.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ policy_constraints:
1919
id: password_length
2020
character_length: 14
2121
character_operation: minimum
22-
send_reset_email: 0
22+
send_reset_email: false
2323
send_pending_email:
2424
- 0
2525
roles:

config/test/encrypt.profile.tfa_encryption.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,5 @@ dependencies:
88
id: tfa_encryption
99
label: 'TFA Encryption'
1010
encryption_method: real_aes
11-
encryption_key: tfa_key
1211
encryption_method_configuration: { }
12+
encryption_key: tfa_key

config/test/key.key.tfa_key.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ key_type_settings:
99
key_size: 256
1010
key_provider: config
1111
key_provider_settings:
12-
base64_encoded: false
1312
key_value: 'UGN~?-#RfgR+wJg4Yh/Sp2~Z^wb{C^2X'
13+
base64_encoded: false
1414
key_input: text_field
1515
key_input_settings:
16-
base64_encoded: false
16+
base64_encoded: false

config/test/tfa.settings.yml

Lines changed: 19 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,50 @@
1-
enabled: 1
1+
enabled: true
22
required_roles:
33
authenticated: authenticated
44
govcms_content_author: '0'
55
govcms_content_approver: '0'
66
govcms_site_administrator: '0'
77
send_plugins: { }
88
login_plugins: { }
9+
login_plugin_settings:
10+
tfa_trusted_browser:
11+
cookie_allow_subdomains: true
12+
cookie_expiration: 30
13+
cookie_name: tfa-trusted-browser
14+
allowed_validation_plugins:
15+
tfa_email_code: tfa_email_code
916
default_validation_plugin: tfa_email_code
1017
validation_plugin_settings:
18+
tfa_email_code:
19+
code_validity_period: 60
20+
email_setting:
21+
subject: '[site:name] Authentication code'
22+
body: "[user:display-name],\r\n\r\nThis code is valid for [length] minutes. Your code is: [code]\r\n\r\nThis code will be expired after login."
1123
tfa_hotp:
1224
counter_window: 10
1325
site_name_prefix: 1
1426
name_prefix: TFA
1527
issuer: GovCMS
28+
tfa_recovery_code:
29+
recovery_codes_amount: 10
1630
tfa_totp:
1731
time_skew: 2
1832
site_name_prefix: 1
1933
name_prefix: TFA
2034
issuer: GovCMS
21-
tfa_email_code:
22-
code_validity_period: 60
23-
email_setting:
24-
subject: '[site:name] Authentication code'
25-
body: "[user:display-name],\r\n\r\nThis code is valid for [length] minutes. Your code is: [code]\r\n\r\nThis code will be expired after login."
26-
tfa_recovery_code:
27-
recovery_codes_amount: 10
28-
allowed_validation_plugins:
29-
tfa_email_code: tfa_email_code
30-
help_text: 'Contact support to reset your access'
3135
validation_skip: 3
36+
reset_pass_skip_enabled: true
3237
encryption: tfa_encryption
33-
trust_cookie_expiration: 2592000
34-
cookie_name: TFA
3538
tfa_flood_uid_only: 1
3639
tfa_flood_window: 300
3740
tfa_flood_threshold: 6
41+
help_text: 'Contact support to reset your access'
3842
mail:
3943
tfa_enabled_configuration:
4044
subject: 'Your [site:name] account now has two-factor authentication'
4145
body: "[user:display-name],\r\n\r\nThanks for configuring two-factor authentication on your [site:name] account!\r\n\r\nThis additional level of security will help to ensure that only you are able to log in to your account.\r\n\r\nIf you ever lose the device you configured, you should act quickly to delete its association with this account.\r\n\r\n--\r\n[site:name] team"
4246
tfa_disabled_configuration:
4347
subject: 'Your [site:name] account no longer has two-factor authentication'
4448
body: "[user:display-name],\r\n\r\nTwo-factor authentication has been disabled on your [site:name] account.\r\n\r\nIf you did not take this action, please contact a site administrator immediately.\r\n\r\n--\r\n[site:name] team"
49+
trust_cookie_expiration: 2592000
50+
cookie_name: TFA

docker-compose.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ services:
1313
- /var/www/html/sites
1414
- $PWD/modules:/app/web/profiles/govcms/modules
1515
- $PWD/themes:/app/web/profiles/govcms/themes
16+
- $PWD/src:/app/web/profiles/govcms/src
17+
- $PWD/tests:/app/web/profiles/govcms/tests
1618
develop:
1719
watch:
1820
- action: sync
@@ -21,6 +23,8 @@ services:
2123
ignore:
2224
- modules/
2325
- themes/
26+
- src/
27+
- tests/
2428
- action: rebuild
2529
path: composer.json
2630

govcms.info.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ type: profile
33
description: 'A GovCMS Drupal Distribution for government and the public sector in Australia.'
44
core_version_requirement: ^10
55
project: 'govcms'
6-
version: '3.6.0'
6+
version: '3.7.0'
77

88
distribution:
99
name: GovCMS

govcms.install

Lines changed: 41 additions & 80 deletions
Original file line numberDiff line numberDiff line change
@@ -8,124 +8,85 @@
88
use Drupal\shortcut\Entity\Shortcut;
99
use Drupal\menu_link_content\Entity\MenuLinkContent;
1010

11-
// Define a default theme constant.
12-
const GOVCMS_DEFAULT_THEME = 'govcms_bartik';
13-
14-
// Define the admin theme.
15-
const GOVCMS_DEFAULT_ADMIN_THEME = 'claro';
16-
1711
// GovCMS update hooks.
1812
include_once __DIR__ . '/includes/govcms.update.inc';
1913

2014
/**
2115
* Implements hook_install().
2216
*
23-
* Perform actions to set up the site for GovCMS Profile.
17+
* Sets up the GovCMS profile during installation.
2418
*
2519
* @see system_install()
2620
*/
2721
function govcms_install() {
28-
// Restrict user registration to admin role creation.
29-
\Drupal::configFactory()
30-
->getEditable('user.settings')
31-
->set('register', \Drupal\user\UserInterface::REGISTER_ADMINISTRATORS_ONLY)
32-
->save(TRUE);
33-
34-
// Populate the default shortcut set.
35-
Shortcut::create(
36-
[
37-
'shortcut_set' => 'default',
38-
'title' => t('Add content'),
39-
'weight' => 1,
40-
'link' => ['uri' => 'internal:/node/add'],
41-
]
42-
)->save();
22+
// Create default shortcut for adding content.
23+
Shortcut::create([
24+
'shortcut_set' => 'default',
25+
'title' => t('Add content'),
26+
'weight' => 1,
27+
'link' => ['uri' => 'internal:/node/add'],
28+
])->save();
4329

44-
MenuLinkContent::create(
45-
[
46-
'title' => 'Accessibility',
30+
// Create footer menu links.
31+
$footerMenuLinks = ['Accessibility', 'Copyright', 'Disclaimers', 'Privacy'];
32+
foreach ($footerMenuLinks as $linkTitle) {
33+
MenuLinkContent::create([
34+
'title' => $linkTitle,
4735
'link' => ['uri' => 'https://www.govcms.gov.au'],
4836
'menu_name' => 'footer',
49-
]
50-
)->save();
37+
])->save();
38+
}
5139

52-
MenuLinkContent::create(
40+
// Create custom menu links.
41+
$customMenuLinks = [
5342
[
54-
'title' => 'Copyright',
55-
'link' => ['uri' => 'https://www.govcms.gov.au'],
56-
'menu_name' => 'footer',
57-
]
58-
)->save();
59-
60-
MenuLinkContent::create(
43+
'title' => 'Our community',
44+
'path' => '/our-community',
45+
'menu_name' => 'govcms-community',
46+
],
6147
[
62-
'title' => 'Disclaimers',
63-
'link' => ['uri' => 'https://www.govcms.gov.au'],
64-
'menu_name' => 'footer',
65-
]
66-
)->save();
67-
68-
MenuLinkContent::create(
69-
[
70-
'title' => 'Privacy',
71-
'link' => ['uri' => 'https://www.govcms.gov.au'],
72-
'menu_name' => 'footer',
73-
]
74-
)->save();
75-
76-
MenuLinkContent::create([
77-
'title' => 'Our community',
78-
'link' => ['uri' => 'https://www.govcms.gov.au/our-community'],
79-
'menu_name' => 'govcms-community',
80-
])->save();
81-
82-
MenuLinkContent::create([
83-
'title' => 'About GovCMS',
84-
'link' => ['uri' => 'https://www.govcms.gov.au/about'],
85-
'menu_name' => 'govcms-about',
86-
])->save();
48+
'title' => 'About GovCMS',
49+
'path' => '/about',
50+
'menu_name' => 'govcms-about',
51+
],
52+
];
53+
foreach ($customMenuLinks as $customLink) {
54+
MenuLinkContent::create([
55+
'title' => $customLink['title'],
56+
'link' => ['uri' => 'https://www.govcms.gov.au' . $customLink['path']],
57+
'menu_name' => $customLink['menu_name'],
58+
])->save();
59+
}
8760

88-
// Don't do anything else during config sync.
61+
// Skip further actions during config sync.
8962
if (\Drupal::isConfigSyncing()) {
9063
return;
9164
}
9265

9366
// Set front page to "node".
67+
$frontPagePath = '/node';
9468
\Drupal::configFactory()
9569
->getEditable('system.site')
96-
->set('page.front', '/node')
97-
->save(TRUE);
98-
99-
// Set the default and admin theme.
100-
\Drupal::configFactory()
101-
->getEditable('system.theme')
102-
->set('default', GOVCMS_DEFAULT_THEME)
103-
->set('admin', GOVCMS_DEFAULT_ADMIN_THEME)
104-
->save(TRUE);
105-
106-
// Enable the admin theme.
107-
\Drupal::configFactory()
108-
->getEditable('node.settings')
109-
->set('use_admin_theme', TRUE)
70+
->set('page.front', $frontPagePath)
11071
->save(TRUE);
11172

112-
// Set the path to the logo, favicon and README file based on install directory.
113-
$govcms_path = \Drupal::service('extension.list.profile')->getPath('govcms');
73+
// Set paths for the logo, favicon, and README file based on install directory.
74+
$govcmsPath = \Drupal::service('extension.list.profile')->getPath('govcms');
11475
\Drupal::configFactory()
11576
->getEditable('system.theme.global')
11677
->set('logo', [
117-
'path' => $govcms_path . '/logo.svg',
78+
'path' => $govcmsPath . '/logo.svg',
11879
'url' => '',
11980
'use_default' => TRUE,
12081
])
12182
->set('favicon', [
12283
'mimetype' => 'image/vnd.microsoft.icon',
123-
'path' => $govcms_path . '/favicon.ico',
84+
'path' => $govcmsPath . '/favicon.ico',
12485
'url' => '',
12586
'use_default' => FALSE,
12687
])
12788
->save(TRUE);
12889

129-
// Grant the default permissions.
90+
// Grant default permissions.
13091
govcms_default_permissions();
13192
}

0 commit comments

Comments
 (0)