@scandipwa/magento-scripts 1.14.1-alpha.0 → 1.14.1-alpha.11
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/index.js +13 -0
- package/lib/commands/cli.js +28 -1
- package/lib/commands/execute.js +2 -1
- package/lib/commands/logs.js +1 -0
- package/lib/commands/start.js +18 -5
- package/lib/config/dependencies-for-platforms.js +12 -2
- package/lib/config/docker.js +89 -15
- package/lib/config/get-port-config.js +9 -3
- package/lib/config/index.js +2 -1
- package/lib/config/php/extensions/libsodium.js +2 -1
- package/lib/config/port-config.js +3 -1
- package/lib/config/scandipwa-versions.js +2 -1
- package/lib/config/ssl-terminator/index.js +10 -0
- package/lib/config/system-config.js +34 -5
- package/lib/config/templates/magentorc.template +3 -5
- package/lib/config/templates/nginx.template.conf +0 -14
- package/lib/config/templates/php.template.ini +6 -4
- package/lib/config/templates/ssl-terminator.template.conf +27 -0
- package/lib/config/templates/varnish.template.vcl +250 -0
- package/lib/config/varnish/varnish-6-0.js +11 -0
- package/lib/config/varnish/varnish-6-6.js +11 -0
- package/lib/config/varnish/varnish-7-0.js +11 -0
- package/lib/config/versions/magento-2.3.0.js +9 -1
- package/lib/config/versions/magento-2.3.1.js +9 -1
- package/lib/config/versions/magento-2.3.2-p2.js +9 -1
- package/lib/config/versions/magento-2.3.2.js +9 -1
- package/lib/config/versions/magento-2.3.3-p1.js +9 -1
- package/lib/config/versions/magento-2.3.3.js +9 -1
- package/lib/config/versions/magento-2.3.4-p2.js +9 -1
- package/lib/config/versions/magento-2.3.4.js +9 -1
- package/lib/config/versions/magento-2.3.5-p1.js +9 -1
- package/lib/config/versions/magento-2.3.5-p2.js +9 -1
- package/lib/config/versions/magento-2.3.5.js +9 -1
- package/lib/config/versions/magento-2.3.6-p1.js +9 -1
- package/lib/config/versions/magento-2.3.6.js +9 -1
- package/lib/config/versions/magento-2.3.7-p1.js +9 -1
- package/lib/config/versions/magento-2.3.7-p2.js +9 -1
- package/lib/config/versions/magento-2.3.7-p3.js +9 -1
- package/lib/config/versions/magento-2.3.7.js +9 -1
- package/lib/config/versions/magento-2.4.0-p1.js +9 -1
- package/lib/config/versions/magento-2.4.0.js +9 -1
- package/lib/config/versions/magento-2.4.1-p1.js +9 -1
- package/lib/config/versions/magento-2.4.1.js +9 -1
- package/lib/config/versions/magento-2.4.2-p1.js +9 -1
- package/lib/config/versions/magento-2.4.2-p2.js +9 -1
- package/lib/config/versions/magento-2.4.2.js +9 -1
- package/lib/config/versions/magento-2.4.3-p1.js +9 -1
- package/lib/config/versions/magento-2.4.3-p2.js +9 -1
- package/lib/config/versions/magento-2.4.3.js +9 -1
- package/lib/config/versions/magento-2.4.4.js +9 -1
- package/lib/errors/known-error.js +15 -0
- package/lib/errors/unknown-error.js +15 -0
- package/lib/tasks/cli/create-bashrc-config.js +7 -3
- package/lib/tasks/composer/index.js +5 -3
- package/lib/tasks/composer/local-auth-json.js +4 -2
- package/lib/tasks/docker/containers.js +13 -8
- package/lib/tasks/docker/network.js +2 -1
- package/lib/tasks/docker/volumes.js +4 -4
- package/lib/tasks/file-system/create-nginx-config.js +9 -40
- package/lib/tasks/file-system/create-php-config.js +2 -1
- package/lib/tasks/file-system/create-php-fpm-config.js +2 -1
- package/lib/tasks/file-system/create-php-storm-config.js +6 -5
- package/lib/tasks/file-system/create-ssl-terminator-config.js +96 -0
- package/lib/tasks/file-system/create-varnish-config.js +53 -0
- package/lib/tasks/file-system/create-vscode-config.js +3 -2
- package/lib/tasks/file-system/index.js +5 -1
- package/lib/tasks/magento/enable-magento-composer-plugins.js +3 -2
- package/lib/tasks/magento/install-magento.js +7 -5
- package/lib/tasks/magento/setup-magento/configure-elasticsearch.js +1 -1
- package/lib/tasks/magento/setup-magento/disable-2fa.js +4 -12
- package/lib/tasks/magento/setup-magento/disable-full-page-cache.js +20 -0
- package/lib/tasks/magento/setup-magento/flush-redis-config.js +2 -1
- package/lib/tasks/magento/setup-magento/increase-admin-session-lifetime.js +14 -16
- package/lib/tasks/magento/setup-magento/index.js +3 -1
- package/lib/tasks/magento/setup-magento/install-magento.js +2 -1
- package/lib/tasks/magento/setup-magento/migrate-database.js +24 -11
- package/lib/tasks/magento/setup-magento/set-base-url.js +7 -2
- package/lib/tasks/magento/setup-magento/upgrade-magento.js +27 -3
- package/lib/tasks/magento/setup-magento/varnish-config.js +69 -0
- package/lib/tasks/magento/setup-magento/waiting-for-varnish.js +41 -0
- package/lib/tasks/mysql/connect-to-mysql.js +2 -1
- package/lib/tasks/mysql/fix-db.js +2 -2
- package/lib/tasks/mysql/import-dump-to-mysql.js +4 -2
- package/lib/tasks/mysql/import-remote-db/index.js +2 -1
- package/lib/tasks/mysql/import-remote-db/ssh/index.js +2 -1
- package/lib/tasks/mysql/import-remote-db/ssh/regular-server.js +2 -1
- package/lib/tasks/php/bundled-extensions.js +28 -0
- package/lib/tasks/php/compile-options.js +18 -48
- package/lib/tasks/php/compile.js +4 -3
- package/lib/tasks/php/configure.js +7 -66
- package/lib/tasks/php/extensions/index.js +71 -0
- package/lib/tasks/php/index.js +8 -7
- package/lib/tasks/php/update-env-php.js +16 -1
- package/lib/tasks/php/update-env.php +56 -12
- package/lib/tasks/php/update-phpbrew.js +2 -1
- package/lib/tasks/php/validate-php.js +67 -0
- package/lib/tasks/php-fpm/start-php-fpm.js +2 -1
- package/lib/tasks/requirements/composer.js +5 -3
- package/lib/tasks/requirements/dependency/arch.js +2 -1
- package/lib/tasks/requirements/dependency/centos.js +2 -1
- package/lib/tasks/requirements/dependency/fedora.js +2 -1
- package/lib/tasks/requirements/docker/index.js +7 -4
- package/lib/tasks/requirements/docker/install.js +13 -12
- package/lib/tasks/requirements/docker/running-status.js +138 -0
- package/lib/tasks/requirements/docker/version.js +3 -0
- package/lib/tasks/requirements/index.js +5 -5
- package/lib/tasks/requirements/node-version.js +2 -1
- package/lib/tasks/requirements/php-version.js +8 -4
- package/lib/tasks/requirements/phpbrew/index.js +2 -1
- package/lib/tasks/requirements/phpbrew/install.js +2 -1
- package/lib/tasks/requirements/phpbrew/version.js +2 -1
- package/lib/tasks/requirements/platform.js +3 -2
- package/lib/tasks/start.js +11 -10
- package/lib/tasks/status/index.js +25 -9
- package/lib/tasks/theme/build-theme.js +27 -8
- package/lib/tasks/theme/install-theme.js +18 -5
- package/lib/tasks/theme/link-theme.js +2 -2
- package/lib/tasks/theme/retrieve-theme-data.js +2 -1
- package/lib/tasks/theme/setup-persisted-query.js +5 -4
- package/lib/tasks/theme/setup-themes.js +5 -3
- package/lib/tasks/theme/symlink-theme.js +20 -4
- package/lib/util/analytics.js +337 -0
- package/lib/util/config-file-validator.js +14 -2
- package/lib/util/config-php-json.js +20 -0
- package/lib/util/env-php-json.js +3 -2
- package/lib/util/get-installed-magento-version.js +3 -2
- package/lib/util/get-jsonfile-data.js +2 -1
- package/lib/util/install-dependencies-task.js +4 -4
- package/lib/util/instance-metadata.js +11 -4
- package/lib/util/ip.js +45 -1
- package/lib/util/is-running-root.js +3 -0
- package/lib/util/magento-task.js +20 -9
- package/lib/util/match-filesystem.js +2 -1
- package/lib/util/php-task.js +6 -2
- package/lib/util/request.js +0 -0
- package/lib/util/resolve-configuration-with-overrides.js +2 -1
- package/lib/util/run-composer.js +3 -2
- package/lib/util/run-magento.js +3 -2
- package/lib/util/run-php.js +10 -3
- package/lib/util/systemctl.js +46 -0
- package/lib/util/wait-for-it.js +3 -2
- package/package.json +4 -3
- package/typings/context.d.ts +5 -1
- package/typings/index.d.ts +32 -1
- package/lib/tasks/magento/setup-magento/adjust-magento-configuration.js +0 -27
- package/lib/tasks/magento/setup-magento/disable-page-cache.js +0 -11
package/lib/util/php-task.js
CHANGED
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
const runPhpCode = require('./run-php');
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
|
-
* @type {(
|
|
4
|
+
* @type {(
|
|
5
|
+
* command: string,
|
|
6
|
+
* options: { noTitle: boolean, env: Record<string, string> }
|
|
7
|
+
* ) => import('listr2').ListrTask<import('../../typings/context').ListrContext>}
|
|
5
8
|
*/
|
|
6
9
|
const phpTask = (command, options = {}) => ({
|
|
7
10
|
title: !options.noTitle ? `Running command 'php ${command}` : undefined,
|
|
@@ -10,7 +13,8 @@ const phpTask = (command, options = {}) => ({
|
|
|
10
13
|
task.output = t;
|
|
11
14
|
},
|
|
12
15
|
throwNonZeroCode: true,
|
|
13
|
-
magentoVersion
|
|
16
|
+
magentoVersion,
|
|
17
|
+
env: options.env
|
|
14
18
|
})
|
|
15
19
|
});
|
|
16
20
|
|
|
File without changes
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
const path = require('path');
|
|
2
|
+
const UnknownError = require('../errors/unknown-error');
|
|
2
3
|
const { configFileSchema } = require('./config-file-validator');
|
|
3
4
|
const { deepmerge } = require('./deepmerge');
|
|
4
5
|
const pathExists = require('./path-exists');
|
|
@@ -11,7 +12,7 @@ const resolveConfigurationWithOverrides = async (configuration, baseConfig, proj
|
|
|
11
12
|
try {
|
|
12
13
|
await configFileSchema.validateAsync(userConfiguration);
|
|
13
14
|
} catch (e) {
|
|
14
|
-
throw new
|
|
15
|
+
throw new UnknownError(`Configuration file validation error!\n\n${e.message}`);
|
|
15
16
|
}
|
|
16
17
|
|
|
17
18
|
const overridenConfiguration = deepmerge(configuration, userConfiguration);
|
package/lib/util/run-composer.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
const { execAsyncSpawn } = require('./exec-async-command');
|
|
2
2
|
const { getConfigFromMagentoVersion, defaultConfiguration } = require('../config');
|
|
3
|
+
const UnknownError = require('../errors/unknown-error');
|
|
3
4
|
/**
|
|
4
5
|
* Execute composer command
|
|
5
6
|
* @param {String} command composer command
|
|
@@ -24,8 +25,8 @@ const runComposerCommand = async (command, options = {}) => {
|
|
|
24
25
|
});
|
|
25
26
|
|
|
26
27
|
if (throwNonZeroCode && code !== 0) {
|
|
27
|
-
throw new
|
|
28
|
-
|
|
28
|
+
throw new UnknownError(`Code: ${code}
|
|
29
|
+
Response: ${result}`);
|
|
29
30
|
}
|
|
30
31
|
|
|
31
32
|
return { code, result };
|
package/lib/util/run-magento.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
const { execAsyncSpawn } = require('./exec-async-command');
|
|
2
2
|
const { getConfigFromMagentoVersion, defaultConfiguration, magento } = require('../config');
|
|
3
|
+
const UnknownError = require('../errors/unknown-error');
|
|
3
4
|
/**
|
|
4
5
|
* Execute magento command
|
|
5
6
|
* @param {String} command magento command
|
|
@@ -27,8 +28,8 @@ const runMagentoCommand = async (command, options = {}) => {
|
|
|
27
28
|
});
|
|
28
29
|
|
|
29
30
|
if (throwNonZeroCode && code !== 0) {
|
|
30
|
-
throw new
|
|
31
|
-
|
|
31
|
+
throw new UnknownError(`Code: ${code}
|
|
32
|
+
Response: ${result}`);
|
|
32
33
|
}
|
|
33
34
|
|
|
34
35
|
return { code, result };
|
package/lib/util/run-php.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
const { execAsyncSpawn } = require('./exec-async-command');
|
|
2
2
|
const { getConfigFromMagentoVersion, defaultConfiguration } = require('../config');
|
|
3
|
+
const UnknownError = require('../errors/unknown-error');
|
|
3
4
|
/**
|
|
4
5
|
* Execute PHP code
|
|
5
6
|
* @param {String} command magento command
|
|
@@ -10,6 +11,7 @@ const { getConfigFromMagentoVersion, defaultConfiguration } = require('../config
|
|
|
10
11
|
* @param {() => {}} options.callback
|
|
11
12
|
* @param {Boolean} options.throwNonZeroCode Throw if command return non 0 code.
|
|
12
13
|
* @param {String} options.magentoVersion Magento version for config
|
|
14
|
+
* @param {Record<string, string>} options.env Environment variables
|
|
13
15
|
*/
|
|
14
16
|
const runPhpCode = async (command, options = {}) => {
|
|
15
17
|
const {
|
|
@@ -17,14 +19,19 @@ const runPhpCode = async (command, options = {}) => {
|
|
|
17
19
|
magentoVersion = defaultConfiguration.magentoVersion
|
|
18
20
|
} = options;
|
|
19
21
|
const { php } = await getConfigFromMagentoVersion(magentoVersion);
|
|
20
|
-
|
|
22
|
+
let spawnCommand = `${php.binPath} -c ${php.iniPath} ${command}`;
|
|
23
|
+
if (options.env && Object.keys(options.env).length > 0) {
|
|
24
|
+
const env = Object.entries(options.env).map(([key, value]) => `${key}=${value}`).join(' ');
|
|
25
|
+
spawnCommand = `${env} ${spawnCommand}`;
|
|
26
|
+
}
|
|
27
|
+
const { code, result } = await execAsyncSpawn(spawnCommand, {
|
|
21
28
|
...options,
|
|
22
29
|
withCode: true
|
|
23
30
|
});
|
|
24
31
|
|
|
25
32
|
if (throwNonZeroCode && code !== 0) {
|
|
26
|
-
throw new
|
|
27
|
-
|
|
33
|
+
throw new UnknownError(`Code: ${code}
|
|
34
|
+
Response: ${result}`);
|
|
28
35
|
}
|
|
29
36
|
|
|
30
37
|
return { code, result };
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
const { execAsyncSpawn } = require('./exec-async-command');
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* @param {String} cmd
|
|
5
|
+
* @param {String} serviceName
|
|
6
|
+
* @param {{ now: boolean }} options
|
|
7
|
+
*/
|
|
8
|
+
const run = (cmd, serviceName, options = {}) => execAsyncSpawn(
|
|
9
|
+
`systemctl ${ cmd }${ serviceName ? ` ${ serviceName }` : '' }${ options.now ? ' --now' : ''}`,
|
|
10
|
+
{
|
|
11
|
+
withCode: true
|
|
12
|
+
}
|
|
13
|
+
);
|
|
14
|
+
|
|
15
|
+
const daemonReload = () => run('daemon-reload');
|
|
16
|
+
|
|
17
|
+
const systemctlControl = (serviceName) => ({
|
|
18
|
+
disable: () => run('disable', serviceName),
|
|
19
|
+
enable: () => run('enable', serviceName),
|
|
20
|
+
enableAndStart: () => run('enable', serviceName, { now: true }),
|
|
21
|
+
restart: () => run('restart', serviceName),
|
|
22
|
+
start: () => run('start', serviceName),
|
|
23
|
+
stop: () => run('stop', serviceName),
|
|
24
|
+
isEnabled: async () => {
|
|
25
|
+
try {
|
|
26
|
+
const { result } = await run('is-enabled', serviceName);
|
|
27
|
+
return result.includes('enabled');
|
|
28
|
+
} catch (e) {
|
|
29
|
+
return false;
|
|
30
|
+
}
|
|
31
|
+
},
|
|
32
|
+
isRunning: async () => {
|
|
33
|
+
try {
|
|
34
|
+
const { result } = await run('status', serviceName);
|
|
35
|
+
|
|
36
|
+
return result.includes('active (running)');
|
|
37
|
+
} catch (e) {
|
|
38
|
+
return false;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
});
|
|
42
|
+
|
|
43
|
+
module.exports = {
|
|
44
|
+
systemctlControl,
|
|
45
|
+
daemonReload
|
|
46
|
+
};
|
package/lib/util/wait-for-it.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
const net = require('net');
|
|
2
|
+
const UnknownError = require('../errors/unknown-error');
|
|
2
3
|
const sleep = require('./sleep');
|
|
3
4
|
|
|
4
5
|
const connectToHostPort = ({ host, port }) => new Promise((resolve, reject) => {
|
|
@@ -14,7 +15,7 @@ const connectToHostPort = ({ host, port }) => new Promise((resolve, reject) => {
|
|
|
14
15
|
});
|
|
15
16
|
socket.on('timeout', () => {
|
|
16
17
|
socket.end();
|
|
17
|
-
reject(new
|
|
18
|
+
reject(new UnknownError('Connection timeout'));
|
|
18
19
|
});
|
|
19
20
|
});
|
|
20
21
|
|
|
@@ -29,7 +30,7 @@ const waitForIt = async ({
|
|
|
29
30
|
// eslint-disable-next-line no-await-in-loop
|
|
30
31
|
await Promise.race([
|
|
31
32
|
sleep(300).then(() => {
|
|
32
|
-
throw new
|
|
33
|
+
throw new UnknownError('Connection timeout');
|
|
33
34
|
}),
|
|
34
35
|
connectToHostPort({ host, port })
|
|
35
36
|
]);
|
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.14.1-alpha.
|
|
6
|
+
"version": "1.14.1-alpha.11",
|
|
7
7
|
"main": "./index.js",
|
|
8
8
|
"types": "./typings/index.d.ts",
|
|
9
9
|
"license": "OSL-3.0",
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
"arm64"
|
|
23
23
|
],
|
|
24
24
|
"dependencies": {
|
|
25
|
-
"@scandipwa/scandipwa-dev-utils": "0.1.
|
|
25
|
+
"@scandipwa/scandipwa-dev-utils": "0.1.13",
|
|
26
26
|
"conf": "10.1.1",
|
|
27
27
|
"enquirer": "2.3.6",
|
|
28
28
|
"eta": "1.12.3",
|
|
@@ -35,6 +35,7 @@
|
|
|
35
35
|
"mysql2": "2.3.2",
|
|
36
36
|
"node-ssh": "12.0.0",
|
|
37
37
|
"semver": "7.3.5",
|
|
38
|
+
"smol-request": "2.1.1",
|
|
38
39
|
"systeminformation": "5.11.7",
|
|
39
40
|
"yargs": "17.3.1"
|
|
40
41
|
},
|
|
@@ -51,5 +52,5 @@
|
|
|
51
52
|
"mysql",
|
|
52
53
|
"scandipwa"
|
|
53
54
|
],
|
|
54
|
-
"gitHead": "
|
|
55
|
+
"gitHead": "3e86a5870f29d0b24ac3f65ff5fdbe96ef5bd025"
|
|
55
56
|
}
|
package/typings/context.d.ts
CHANGED
|
@@ -12,9 +12,12 @@ export interface ListrContext {
|
|
|
12
12
|
mysql: number
|
|
13
13
|
redis: number
|
|
14
14
|
elasticsearch: number
|
|
15
|
+
varnish: number
|
|
16
|
+
sslTerminator: number
|
|
15
17
|
}
|
|
16
18
|
arch: 'arm64' | 'x64'
|
|
17
19
|
isArm: boolean
|
|
20
|
+
isWsl: boolean
|
|
18
21
|
platform?: NodeJS.Platform
|
|
19
22
|
platformVersion?: string
|
|
20
23
|
/**
|
|
@@ -51,7 +54,7 @@ export interface ListrContext {
|
|
|
51
54
|
o: string
|
|
52
55
|
}
|
|
53
56
|
}>
|
|
54
|
-
getContainers(): Record<'nginx' | 'redis' | 'mysql' | 'elasticsearch', {
|
|
57
|
+
getContainers(): Record<'nginx' | 'redis' | 'mysql' | 'elasticsearch' | 'varnish', {
|
|
55
58
|
_: string
|
|
56
59
|
ports: string[]
|
|
57
60
|
healthCheck: {
|
|
@@ -88,4 +91,5 @@ export interface ListrContext {
|
|
|
88
91
|
useNonOverlappingPorts: boolean
|
|
89
92
|
}
|
|
90
93
|
mysqlConnection: mysql2.Connection
|
|
94
|
+
isSetupUpgradeNeeded?: boolean
|
|
91
95
|
}
|
package/typings/index.d.ts
CHANGED
|
@@ -10,7 +10,14 @@ export interface ServiceWithVersion {
|
|
|
10
10
|
version: string
|
|
11
11
|
}
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
export interface SSLTerminatorConfiguration extends ServiceWithVersion {
|
|
14
|
+
/**
|
|
15
|
+
* Configuration file location
|
|
16
|
+
*
|
|
17
|
+
* @example ./my-ssl-terminator-config.conf
|
|
18
|
+
*/
|
|
19
|
+
configTemplate: string
|
|
20
|
+
}
|
|
14
21
|
|
|
15
22
|
export interface NginxConfiguration extends ServiceWithVersion {
|
|
16
23
|
/**
|
|
@@ -21,6 +28,20 @@ export interface NginxConfiguration extends ServiceWithVersion {
|
|
|
21
28
|
configTemplate: string
|
|
22
29
|
}
|
|
23
30
|
|
|
31
|
+
export interface VarnishConfiguration extends ServiceWithVersion {
|
|
32
|
+
/**
|
|
33
|
+
* Enable or disable Varnish in the project
|
|
34
|
+
*/
|
|
35
|
+
enabled: boolean
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* Configuration file location
|
|
39
|
+
*
|
|
40
|
+
* @example ./my-varnish-config.vcl
|
|
41
|
+
*/
|
|
42
|
+
configTemplate: string
|
|
43
|
+
}
|
|
44
|
+
|
|
24
45
|
export interface PHPExtension extends Record<string, unknown> {
|
|
25
46
|
version?: string
|
|
26
47
|
/**
|
|
@@ -175,6 +196,16 @@ export interface CMAConfiguration {
|
|
|
175
196
|
* Composer configuration
|
|
176
197
|
*/
|
|
177
198
|
composer: ServiceWithVersion
|
|
199
|
+
|
|
200
|
+
/**
|
|
201
|
+
* Varnish configuration
|
|
202
|
+
*/
|
|
203
|
+
varnish: VarnishConfiguration
|
|
204
|
+
|
|
205
|
+
/**
|
|
206
|
+
* SSL Terminator configuration
|
|
207
|
+
*/
|
|
208
|
+
sslTerminator: SSLTerminatorConfiguration
|
|
178
209
|
}
|
|
179
210
|
/**
|
|
180
211
|
* Magento configuration
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
const { isTableExists } = require('../../../util/database');
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* @type {() => import('listr2').ListrTask<import('../../../../typings/context').ListrContext>}
|
|
5
|
-
*/
|
|
6
|
-
const adjustMagentoConfiguration = () => ({
|
|
7
|
-
title: 'Adjusting Magento Database Configuration',
|
|
8
|
-
skip: async (ctx) => !(await isTableExists('magento', 'core_config_data', ctx)),
|
|
9
|
-
task: async (ctx) => {
|
|
10
|
-
const { mysqlConnection } = ctx;
|
|
11
|
-
|
|
12
|
-
// delete varnish configuration if exists
|
|
13
|
-
await mysqlConnection.query(`
|
|
14
|
-
DELETE FROM core_config_data WHERE path LIKE '%varnish%';
|
|
15
|
-
`);
|
|
16
|
-
|
|
17
|
-
// update cache policy to not use varnish
|
|
18
|
-
// 0 - magento cache, 2 - varnish cache
|
|
19
|
-
await mysqlConnection.query(`
|
|
20
|
-
UPDATE core_config_data
|
|
21
|
-
SET value = ?
|
|
22
|
-
WHERE path = ?;
|
|
23
|
-
`, ['0', 'system/full_page_cache/caching_application']);
|
|
24
|
-
}
|
|
25
|
-
});
|
|
26
|
-
|
|
27
|
-
module.exports = adjustMagentoConfiguration;
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
const magentoTask = require('../../../util/magento-task');
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* @type {() => import('listr2').ListrTask<import('../../../../typings/context').ListrContext>}
|
|
5
|
-
*/
|
|
6
|
-
const disablePageCache = () => ({
|
|
7
|
-
title: 'Disabling full_page cache in Magento',
|
|
8
|
-
task: (ctx, task) => task.newListr(magentoTask('cache:disable full_page'))
|
|
9
|
-
});
|
|
10
|
-
|
|
11
|
-
module.exports = disablePageCache;
|