@scandipwa/magento-scripts 1.16.0-alpha.0 → 1.16.0-alpha.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/config/docker.js +5 -4
- package/lib/config/templates/nginx.template.conf +3 -0
- package/lib/config/templates/ssl-terminator.template.conf +7 -1
- package/lib/tasks/docker/containers.js +4 -2
- package/lib/tasks/magento/enable-magento-composer-plugins.js +1 -1
- package/lib/tasks/php/extensions/index.js +3 -5
- package/package.json +2 -2
package/lib/config/docker.js
CHANGED
|
@@ -206,9 +206,10 @@ module.exports = async ({ configuration, ssl, host }, config) => {
|
|
|
206
206
|
'--log_bin_trust_function_creators=1',
|
|
207
207
|
'--default-authentication-plugin=mysql_native_password',
|
|
208
208
|
'--max_allowed_packet=1GB',
|
|
209
|
-
'--bind-address=0.0.0.0'
|
|
210
|
-
|
|
211
|
-
|
|
209
|
+
'--bind-address=0.0.0.0'
|
|
210
|
+
]
|
|
211
|
+
.concat(!isArm ? ['--secure-file-priv=NULL'] : [])
|
|
212
|
+
.join(' '),
|
|
212
213
|
securityOptions: [
|
|
213
214
|
'seccomp=unconfined'
|
|
214
215
|
],
|
|
@@ -281,7 +282,7 @@ module.exports = async ({ configuration, ssl, host }, config) => {
|
|
|
281
282
|
restart: 'on-failure:30',
|
|
282
283
|
network: isNotNativeLinux ? network.name : 'host',
|
|
283
284
|
// eslint-disable-next-line max-len
|
|
284
|
-
command: `/bin/bash -c "varnishd -a :${ isNotNativeLinux ? 80 : ports.varnish } -t 600 -f /etc/varnish/default.vcl -s malloc,512m && varnishlog"`,
|
|
285
|
+
command: `/bin/bash -c "varnishd -a :${ isNotNativeLinux ? 80 : ports.varnish } -t 600 -f /etc/varnish/default.vcl -s malloc,512m -p http_resp_hdr_len=70000 -p http_resp_size=100000 && varnishlog"`,
|
|
285
286
|
tmpfs: [
|
|
286
287
|
'/var/lib/varnish:exec'
|
|
287
288
|
]
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
upstream fastcgi_backend {
|
|
2
2
|
# use tcp connection
|
|
3
3
|
server <%= it.hostMachine %>:<%= it.ports.fpm %>;
|
|
4
|
+
|
|
5
|
+
keepalive 16;
|
|
4
6
|
}
|
|
5
7
|
|
|
6
8
|
server {
|
|
@@ -163,6 +165,7 @@ server {
|
|
|
163
165
|
fastcgi_read_timeout 600s;
|
|
164
166
|
fastcgi_connect_timeout 600s;
|
|
165
167
|
|
|
168
|
+
fastcgi_keep_conn on;
|
|
166
169
|
fastcgi_index index.php;
|
|
167
170
|
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
|
|
168
171
|
include fastcgi_params;
|
|
@@ -3,6 +3,12 @@ set_real_ip_from 10.0.0.0/8;
|
|
|
3
3
|
set_real_ip_from 172.0.0.0/8;
|
|
4
4
|
real_ip_recursive on;
|
|
5
5
|
|
|
6
|
+
upstream app_backend {
|
|
7
|
+
server <%= it.hostMachine %>:<% if (it.config.configuration.varnish.enabled) { %><%= it.ports.varnish %><% } else { %><%= it.ports.app %><% } %>;
|
|
8
|
+
|
|
9
|
+
keepalive 16;
|
|
10
|
+
}
|
|
11
|
+
|
|
6
12
|
server {
|
|
7
13
|
listen <%= it.hostPort %>;
|
|
8
14
|
<% if (it.config.ssl.enabled) { %> listen 443 ssl;
|
|
@@ -28,6 +34,6 @@ server {
|
|
|
28
34
|
proxy_read_timeout 300;
|
|
29
35
|
send_timeout 300;
|
|
30
36
|
|
|
31
|
-
proxy_pass http
|
|
37
|
+
proxy_pass http://app_backend;
|
|
32
38
|
}
|
|
33
39
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
/* eslint-disable max-len */
|
|
2
2
|
const { execAsyncSpawn } = require('../../util/exec-async-command');
|
|
3
|
+
const logger = require('@scandipwa/scandipwa-dev-utils/logger');
|
|
3
4
|
|
|
4
5
|
/**
|
|
5
6
|
* @param {Object} options
|
|
@@ -89,7 +90,8 @@ const pullContainers = () => ({
|
|
|
89
90
|
.join(' ');
|
|
90
91
|
const existingImages = await execAsyncSpawn(`docker images ${containerFilters}`);
|
|
91
92
|
const missingContainerImages = containers.filter((container) => !existingImages.split('\n')
|
|
92
|
-
.some((line) => line.includes(container.imageDetails.name) && line.includes(container.imageDetails.tag)))
|
|
93
|
+
.some((line) => line.includes(container.imageDetails.name) && line.includes(container.imageDetails.tag)))
|
|
94
|
+
.reduce((acc, val) => acc.concat(acc.some((c) => c.imageDetails.name === val.imageDetails.name && c.imageDetails.tag === val.imageDetails.tag) ? [] : val), []);
|
|
93
95
|
|
|
94
96
|
if (missingContainerImages.length === 0) {
|
|
95
97
|
task.skip();
|
|
@@ -98,7 +100,7 @@ const pullContainers = () => ({
|
|
|
98
100
|
|
|
99
101
|
return task.newListr(
|
|
100
102
|
missingContainerImages.map((container) => ({
|
|
101
|
-
title: `Pulling ${container.
|
|
103
|
+
title: `Pulling ${ logger.style.file(`${container.imageDetails.name}:${container.imageDetails.tag}`) } image`,
|
|
102
104
|
task: () => pull(`${container.imageDetails.name}:${container.imageDetails.tag}`)
|
|
103
105
|
})), {
|
|
104
106
|
concurrent: true,
|
|
@@ -75,7 +75,7 @@ const enableMagentoComposerPlugins = () => ({
|
|
|
75
75
|
return;
|
|
76
76
|
}
|
|
77
77
|
|
|
78
|
-
task.title = 'Checking allowed
|
|
78
|
+
task.title = 'Checking allowed Composer plugins...';
|
|
79
79
|
|
|
80
80
|
const composerPlugins = await getInstalledComposerPlugins();
|
|
81
81
|
const composerJsonData = await getJsonfileData(composerJsonPath);
|
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
/* eslint-disable max-len */
|
|
2
2
|
const path = require('path');
|
|
3
3
|
const fs = require('fs');
|
|
4
|
-
const os = require('os');
|
|
5
4
|
const { execAsyncSpawn } = require('../../../util/exec-async-command');
|
|
6
5
|
const pathExists = require('../../../util/path-exists');
|
|
7
6
|
const phpbrewConfig = require('../../../config/phpbrew');
|
|
8
|
-
const { getArch } = require('../../../util/arch');
|
|
9
7
|
|
|
10
8
|
/**
|
|
11
9
|
* Get enabled extensions list with versions
|
|
@@ -13,9 +11,9 @@ const { getArch } = require('../../../util/arch');
|
|
|
13
11
|
* @returns {Promise<{[key: string]: string}}>}
|
|
14
12
|
*/
|
|
15
13
|
const getEnabledExtensions = async ({ php }) => {
|
|
16
|
-
const isArmMac = await getArch() === 'arm64' && os.platform() === 'darwin';
|
|
17
14
|
const output = await execAsyncSpawn(
|
|
18
|
-
`${
|
|
15
|
+
`${ php.binPath } -c ${php.iniPath} -r 'foreach (get_loaded_extensions() as $extension) echo "$extension:" . phpversion($extension) . "\n";'`,
|
|
16
|
+
{ useRosetta2: true }
|
|
19
17
|
);
|
|
20
18
|
|
|
21
19
|
return output
|
|
@@ -49,7 +47,7 @@ const getDisabledExtensions = async ({ php }) => {
|
|
|
49
47
|
}
|
|
50
48
|
);
|
|
51
49
|
|
|
52
|
-
return extensionIniList.filter((f) => f.isFile() && f.name.endsWith('.disabled')).map((f) => f.name.replace('.disabled', ''));
|
|
50
|
+
return extensionIniList.filter((f) => f.isFile() && f.name.endsWith('.disabled')).map((f) => f.name.replace('.ini.disabled', ''));
|
|
53
51
|
};
|
|
54
52
|
|
|
55
53
|
/**
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"description": "Scripts and configuration used by CMA.",
|
|
4
4
|
"homepage": "https://docs.create-magento-app.com/",
|
|
5
5
|
"repository": "github:scandipwa/create-magento-app",
|
|
6
|
-
"version": "1.16.0-alpha.
|
|
6
|
+
"version": "1.16.0-alpha.3",
|
|
7
7
|
"main": "./index.js",
|
|
8
8
|
"types": "./typings/index.d.ts",
|
|
9
9
|
"license": "OSL-3.0",
|
|
@@ -53,5 +53,5 @@
|
|
|
53
53
|
"mysql",
|
|
54
54
|
"scandipwa"
|
|
55
55
|
],
|
|
56
|
-
"gitHead": "
|
|
56
|
+
"gitHead": "1801104ed104a124f8d08cc81008d21b792857e4"
|
|
57
57
|
}
|