@scandipwa/magento-scripts 2.0.0-alpha.8 → 2.0.0

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.
Files changed (141) hide show
  1. package/lib/commands/cli.js +18 -1
  2. package/lib/commands/logs.js +28 -2
  3. package/lib/commands/start.js +24 -3
  4. package/lib/commands/status.js +9 -1
  5. package/lib/config/config.js +20 -2
  6. package/lib/config/dependencies-for-platforms.js +1 -1
  7. package/lib/config/docker.js +94 -54
  8. package/lib/config/get-project-configuration.js +5 -0
  9. package/lib/config/index.js +10 -3
  10. package/lib/config/php/versions/php-7.2.js +1 -0
  11. package/lib/config/php/versions/php-7.3.js +1 -0
  12. package/lib/config/php/versions/php-7.4.js +1 -0
  13. package/lib/config/php/versions/php-8.1.js +1 -0
  14. package/lib/config/php-config.js +4 -3
  15. package/lib/config/port-config.js +3 -1
  16. package/lib/config/services/composer/versions/composer-1.js +13 -0
  17. package/lib/config/services/composer/versions/composer-2.js +8 -0
  18. package/lib/config/services/composer/versions/index.js +4 -0
  19. package/lib/config/services/maildev/index.js +7 -0
  20. package/lib/config/services/nginx/versions/index.js +3 -0
  21. package/lib/config/services/nginx/versions/nginx-1.18.js +11 -0
  22. package/lib/config/{ssl-terminator → services/ssl-terminator}/index.js +3 -0
  23. package/lib/config/templates/magentorc.template +12 -5
  24. package/lib/config/templates/nginx.fastcgi_params.template +29 -0
  25. package/lib/config/templates/php-debug.template.ini +31 -0
  26. package/lib/config/templates/php-fpm.template.conf +1 -2
  27. package/lib/config/templates/php.template.ini +5 -201
  28. package/lib/config/templates/ssl-terminator.template.conf +2 -0
  29. package/lib/config/templates/varnish.template.vcl +20 -13
  30. package/lib/config/varnish/varnish-6-0.js +4 -0
  31. package/lib/config/varnish/varnish-6-6.js +4 -0
  32. package/lib/config/varnish/varnish-7-0.js +4 -0
  33. package/lib/config/versions/magento-2.2.10.js +41 -0
  34. package/lib/config/versions/magento-2.3.0.js +8 -10
  35. package/lib/config/versions/magento-2.3.1.js +8 -10
  36. package/lib/config/versions/magento-2.3.2-p1.js +8 -10
  37. package/lib/config/versions/magento-2.3.2-p2.js +8 -10
  38. package/lib/config/versions/magento-2.3.2.js +8 -10
  39. package/lib/config/versions/magento-2.3.3-p1.js +8 -10
  40. package/lib/config/versions/magento-2.3.3.js +8 -10
  41. package/lib/config/versions/magento-2.3.4-p1.js +8 -10
  42. package/lib/config/versions/magento-2.3.4-p2.js +8 -10
  43. package/lib/config/versions/magento-2.3.4.js +8 -10
  44. package/lib/config/versions/magento-2.3.5-p1.js +8 -10
  45. package/lib/config/versions/magento-2.3.5-p2.js +8 -10
  46. package/lib/config/versions/magento-2.3.5.js +8 -10
  47. package/lib/config/versions/magento-2.3.6-p1.js +8 -10
  48. package/lib/config/versions/magento-2.3.6.js +8 -10
  49. package/lib/config/versions/magento-2.3.7-p1.js +8 -10
  50. package/lib/config/versions/magento-2.3.7-p2.js +8 -10
  51. package/lib/config/versions/magento-2.3.7-p3.js +8 -10
  52. package/lib/config/versions/magento-2.3.7-p4.js +8 -10
  53. package/lib/config/versions/magento-2.3.7.js +8 -10
  54. package/lib/config/versions/magento-2.4.0-p1.js +8 -10
  55. package/lib/config/versions/magento-2.4.0.js +8 -10
  56. package/lib/config/versions/magento-2.4.1-p1.js +8 -10
  57. package/lib/config/versions/magento-2.4.1.js +8 -10
  58. package/lib/config/versions/magento-2.4.2-p1.js +8 -10
  59. package/lib/config/versions/magento-2.4.2-p2.js +8 -10
  60. package/lib/config/versions/magento-2.4.2.js +8 -10
  61. package/lib/config/versions/magento-2.4.3-p1.js +8 -10
  62. package/lib/config/versions/magento-2.4.3-p2.js +8 -10
  63. package/lib/config/versions/magento-2.4.3-p3.js +8 -10
  64. package/lib/config/versions/magento-2.4.3.js +8 -10
  65. package/lib/config/versions/magento-2.4.4-p1.js +8 -10
  66. package/lib/config/versions/magento-2.4.4.js +8 -10
  67. package/lib/config/versions/magento-2.4.5.js +8 -10
  68. package/lib/tasks/cli/create-bashrc-config.js +4 -2
  69. package/lib/tasks/composer/local-auth-json.js +1 -1
  70. package/lib/tasks/database/connect-to-database.js +6 -3
  71. package/lib/tasks/database/create-magento-database.js +5 -2
  72. package/lib/tasks/database/create-magento-user.js +50 -0
  73. package/lib/tasks/database/default-magento-database.js +3 -0
  74. package/lib/tasks/database/default-magento-user.js +7 -0
  75. package/lib/tasks/database/import-dump-to-database.js +3 -2
  76. package/lib/tasks/docker/api.d.ts +25 -1
  77. package/lib/tasks/docker/api.js +31 -1
  78. package/lib/tasks/docker/containers/container-api.d.ts +21 -0
  79. package/lib/tasks/docker/containers/container-api.js +82 -17
  80. package/lib/tasks/docker/containers/tasks.js +44 -13
  81. package/lib/tasks/docker/convert-composer-home-to-composer-cache-volume.js +52 -0
  82. package/lib/tasks/docker/convert-mysql-to-mariadb.js +2 -2
  83. package/lib/tasks/docker/image/image-api.d.ts +44 -0
  84. package/lib/tasks/docker/image/image-api.js +30 -2
  85. package/lib/tasks/docker/index.js +6 -1
  86. package/lib/tasks/docker/project-image-builder.js +37 -14
  87. package/lib/tasks/docker/system/index.js +5 -0
  88. package/lib/tasks/docker/system/system-api.d.ts +71 -0
  89. package/lib/tasks/docker/system/system-api.js +29 -0
  90. package/lib/tasks/docker/volume/index.js +2 -1
  91. package/lib/tasks/docker/volume/tasks.js +67 -9
  92. package/lib/tasks/docker/volume/volume-api.d.ts +40 -0
  93. package/lib/tasks/docker/volume/volume-api.js +54 -1
  94. package/lib/tasks/execute.js +11 -9
  95. package/lib/tasks/file-system/create-nginx-config.js +3 -5
  96. package/lib/tasks/file-system/create-php-config.js +2 -23
  97. package/lib/tasks/file-system/create-php-debug-config.js +45 -0
  98. package/lib/tasks/file-system/create-php-fpm-config.js +2 -4
  99. package/lib/tasks/file-system/create-phpstorm-config/exclude-folder-config.js +13 -3
  100. package/lib/tasks/file-system/create-phpstorm-config/index.js +2 -1
  101. package/lib/tasks/file-system/create-ssl-terminator-config.js +23 -8
  102. package/lib/tasks/file-system/create-varnish-config.js +4 -7
  103. package/lib/tasks/file-system/create-vscode-config.js +2 -1
  104. package/lib/tasks/file-system/index.js +3 -2
  105. package/lib/tasks/magento/setup-magento/configure-elasticsearch.js +2 -4
  106. package/lib/tasks/magento/setup-magento/flush-redis-config.js +3 -6
  107. package/lib/tasks/magento/setup-magento/index.js +2 -0
  108. package/lib/tasks/magento/setup-magento/install-magento.js +8 -13
  109. package/lib/tasks/magento/setup-magento/set-base-url.js +2 -1
  110. package/lib/tasks/magento/setup-magento/set-mail-config.js +22 -0
  111. package/lib/tasks/magento/setup-magento/varnish-config.js +4 -9
  112. package/lib/tasks/magento/setup-magento/waiting-for-varnish.js +15 -16
  113. package/lib/tasks/php/php-container.js +1 -1
  114. package/lib/tasks/php/update-env-php.js +3 -5
  115. package/lib/tasks/{prefix → project-config}/index.js +6 -6
  116. package/lib/tasks/requirements/composer-credentials.js +7 -3
  117. package/lib/tasks/requirements/docker/context.js +88 -0
  118. package/lib/tasks/requirements/docker/index.js +111 -19
  119. package/lib/tasks/requirements/docker/install.js +21 -7
  120. package/lib/tasks/requirements/docker/permissions.js +2 -11
  121. package/lib/tasks/requirements/docker/running-status.js +94 -24
  122. package/lib/tasks/requirements/docker/version.js +1 -0
  123. package/lib/tasks/requirements/index.js +0 -2
  124. package/lib/tasks/requirements/php-version.js +4 -2
  125. package/lib/tasks/start.js +27 -8
  126. package/lib/tasks/status/index.js +60 -21
  127. package/lib/tasks/stop.js +2 -0
  128. package/lib/tasks/theme/retrieve-theme-data.js +12 -2
  129. package/lib/util/config-file-validator.js +17 -3
  130. package/lib/util/execute-in-container.js +35 -5
  131. package/lib/util/instance-metadata.js +14 -2
  132. package/lib/util/systemctl.js +62 -13
  133. package/package.json +2 -2
  134. package/typings/context.d.ts +11 -0
  135. package/typings/index.d.ts +46 -1
  136. package/lib/tasks/requirements/dependency/arch.js +0 -50
  137. package/lib/tasks/requirements/dependency/centos.js +0 -36
  138. package/lib/tasks/requirements/dependency/fedora.js +0 -36
  139. package/lib/tasks/requirements/dependency/index.js +0 -33
  140. package/lib/tasks/requirements/dependency/mac.js +0 -124
  141. package/lib/tasks/requirements/dependency/ubuntu.js +0 -83
@@ -5,17 +5,18 @@ const path = require('path');
5
5
  * @param {import('../../typings/context').ListrContext['config']['baseConfig']} baseConfig
6
6
  */
7
7
  module.exports = (overridenConfiguration, baseConfig) => {
8
- const { php } = overridenConfiguration;
8
+ const { configuration: { php } } = overridenConfiguration;
9
9
 
10
10
  const { cacheDir } = baseConfig;
11
11
 
12
12
  const phpConfiguration = {
13
13
  iniPath: path.join(cacheDir, 'php.ini'),
14
14
  iniTemplatePath: php.configTemplate,
15
+ debugIniPath: path.join(cacheDir, 'xdebug.ini'),
16
+ debugTemplatePath: php.debugTemplate,
15
17
  fpmTemplatePath: php.fpmConfigTemplate,
16
18
  fpmConfPath: path.join(cacheDir, 'php-fpm.conf'),
17
- extensions: php.extensions,
18
- version: php.version
19
+ extensions: php.extensions
19
20
  };
20
21
 
21
22
  return phpConfiguration;
@@ -60,7 +60,9 @@ const defaultPorts = {
60
60
  fpm: 9000,
61
61
  mariadb: 3306,
62
62
  redis: 6379,
63
- elasticsearch: 9200
63
+ elasticsearch: 9200,
64
+ maildevSMTP: 1025,
65
+ maildevWeb: 1080
64
66
  };
65
67
 
66
68
  /**
@@ -0,0 +1,13 @@
1
+ /**
2
+ * @returns {import('../../../../../typings/index').ComposerConfiguration}
3
+ */
4
+ const composer1 = () => ({
5
+ version: '1',
6
+ plugins: {
7
+ 'hirak/prestissimo': {
8
+ enabled: true
9
+ }
10
+ }
11
+ });
12
+
13
+ module.exports = composer1;
@@ -0,0 +1,8 @@
1
+ /**
2
+ * @returns {import('../../../../../typings/index').ComposerConfiguration}
3
+ */
4
+ const composer2 = () => ({
5
+ version: '2'
6
+ });
7
+
8
+ module.exports = composer2;
@@ -0,0 +1,4 @@
1
+ module.exports = {
2
+ composer1: require('./composer-1'),
3
+ composer2: require('./composer-2')
4
+ };
@@ -0,0 +1,7 @@
1
+ const maildev = () => ({
2
+ image: 'maildev/maildev'
3
+ });
4
+
5
+ module.exports = {
6
+ maildev
7
+ };
@@ -0,0 +1,3 @@
1
+ module.exports = {
2
+ nginx118: require('./nginx-1.18')
3
+ };
@@ -0,0 +1,11 @@
1
+ const path = require('path');
2
+
3
+ /**
4
+ * @returns {import('../../../../../typings/index').NginxConfiguration}
5
+ */
6
+ const nginx118 = ({ templateDir }) => ({
7
+ version: '1.18.0',
8
+ configTemplate: path.join(templateDir || '', 'nginx.template.conf')
9
+ });
10
+
11
+ module.exports = nginx118;
@@ -1,5 +1,8 @@
1
1
  const path = require('path');
2
2
 
3
+ /**
4
+ * @returns {import('../../../../typings/index').SSLTerminatorConfiguration}
5
+ */
3
6
  const sslTerminator = ({ templateDir }) => ({
4
7
  version: '1.18.0',
5
8
  configTemplate: path.join(templateDir || '', 'ssl-terminator.template.conf')
@@ -1,17 +1,24 @@
1
1
  RED='\033[0;31m'
2
2
  GREEN='\033[0;32m'
3
+ YELLOW='\033[1;33m'
4
+ ORANGE='\033[0;33m'
5
+ BLUE='\033[0;34m'
3
6
  NC='\033[0m' # No Color
4
7
 
5
- alias php="node ./node_modules/.bin/magento-scripts-exec php php"
8
+ alias exec="node ./node_modules/.bin/magento-scripts-exec"
9
+ alias php="exec php php"
6
10
  alias magento="php bin/magento"
7
11
  alias magneto="echo -e 'Not ${RED}magneto${NC} but ${GREEN}magento${NC} please! or at least ${GREEN}m${NC}!' && magento"
8
12
  alias m="magento"
9
- alias composer="node ./node_modules/.bin/magento-scripts-exec php composer"
13
+ alias composer="exec php composer"
10
14
  alias c="composer"
11
15
  <% if (it.varnishEnabled) { %>
12
- alias cvc="node ./node_modules/.bin/magento-scripts-exec varnish varnishadm ban req.url '~ /' && echo 'Varnish cache cleared!'"
16
+ alias cvc="exec varnish varnishadm ban req.url '~ /' && echo 'Varnish cache cleared!'"
13
17
  <% } %>
14
- alias mariadb="node ./node_modules/.bin/magento-scripts-exec mariadb 'mysql -umagento -pmagento'"
15
- alias mariadbroot="node ./node_modules/.bin/magento-scripts-exec mariadb 'mysql -uroot -pscandipwa'"
18
+ alias mariadb="exec mariadb 'mysql -umagento -pmagento'"
19
+ alias mariadbroot="exec mariadb 'mysql -uroot -pscandipwa'"
16
20
 
21
+ # silence warning on macos
17
22
  export BASH_SILENCE_DEPRECATION_WARNING=1
23
+
24
+ export PS1="[${YELLOW}cli${NC}] \w [${YELLOW}<%~ it.magentoVersion %>${NC}] [${GREEN}\t${NC}] \nbash \v: "
@@ -0,0 +1,29 @@
1
+
2
+ fastcgi_param QUERY_STRING $query_string;
3
+ fastcgi_param REQUEST_METHOD $request_method;
4
+ fastcgi_param CONTENT_TYPE $content_type;
5
+ fastcgi_param CONTENT_LENGTH $content_length;
6
+
7
+ fastcgi_param SCRIPT_NAME $fastcgi_script_name;
8
+ fastcgi_param REQUEST_URI $request_uri;
9
+ fastcgi_param DOCUMENT_URI $document_uri;
10
+ fastcgi_param DOCUMENT_ROOT $document_root;
11
+ fastcgi_param SERVER_PROTOCOL $server_protocol;
12
+ fastcgi_param REQUEST_SCHEME $scheme;
13
+ <% if (it.isNgrok) { %>
14
+ fastcgi_param HTTPS on;
15
+ <% } else { %>
16
+ fastcgi_param HTTPS $https if_not_empty;
17
+ <% } %>
18
+
19
+ fastcgi_param GATEWAY_INTERFACE CGI/1.1;
20
+ fastcgi_param SERVER_SOFTWARE nginx/$nginx_version;
21
+
22
+ fastcgi_param REMOTE_ADDR $remote_addr;
23
+ fastcgi_param REMOTE_PORT $remote_port;
24
+ fastcgi_param SERVER_ADDR $server_addr;
25
+ fastcgi_param SERVER_PORT $server_port;
26
+ fastcgi_param SERVER_NAME $server_name;
27
+
28
+ # PHP only, required if PHP was built with --enable-force-cgi-redirect
29
+ fastcgi_param REDIRECT_STATUS 200;
@@ -0,0 +1,31 @@
1
+ [xdebug]
2
+ error_reporting=E_ALL
3
+
4
+ xdebug.idekey=PHPSTORM
5
+
6
+ <% if (it.isXDebug2) { %>
7
+ xdebug.remote_autostart=1
8
+ xdebug.remote_enable=1
9
+
10
+ xdebug.remote_host=<%~ it.hostMachine %>
11
+
12
+ xdebug.remote_port=9003
13
+
14
+ xdebug.remote_log=<%~ it.mageRoot %>/var/log/xdebug.log
15
+
16
+ <% } else { %>
17
+
18
+ xdebug.mode=debug
19
+ xdebug.client_host=<%~ it.hostMachine %>
20
+
21
+ xdebug.client_port=9003
22
+
23
+ ; THIS THING WILL BREAK PHP
24
+ ; xdebug.start_with_request=yes
25
+
26
+ xdebug.discover_client_host=false
27
+ xdebug.start_upon_error=yes
28
+
29
+ xdebug.log=<%~ it.mageRoot %>/var/log/xdebug.log
30
+
31
+ <% } %>
@@ -3,6 +3,7 @@ daemonize = no
3
3
  log_level = debug
4
4
 
5
5
  [www]
6
+ clear_env = no
6
7
  user = nobody
7
8
  ;; Commented because if it is not set, php-fpm will use default group.
8
9
  ;; https://www.php.net/manual/en/install.fpm.configuration.php#group
@@ -17,5 +18,3 @@ pm.max_requests = 5000
17
18
  pm.process_idle_timeout = 10s
18
19
  pm.status_path = /fpmstatus
19
20
  listen = <%~ it.port %>
20
-
21
- env[PATH] = $PATH
@@ -1811,159 +1811,13 @@ ldap.max_links = -1
1811
1811
  ;dba.default_handler=
1812
1812
 
1813
1813
  [opcache]
1814
- ; Determines if Zend OPCache is enabled
1815
1814
  opcache.enable=1
1816
-
1817
- ; Determines if Zend OPCache is enabled for the CLI version of PHP
1818
- ;opcache.enable_cli=0
1819
-
1820
- ; The OPcache shared memory storage size.
1821
- ;opcache.memory_consumption=128
1822
-
1823
- ; The amount of memory for interned strings in Mbytes.
1824
- ;opcache.interned_strings_buffer=8
1825
-
1826
- ; The maximum number of keys (scripts) in the OPcache hash table.
1827
- ; Only numbers between 200 and 1000000 are allowed.
1828
- ;opcache.max_accelerated_files=10000
1829
-
1830
- ; The maximum percentage of "wasted" memory until a restart is scheduled.
1831
- ;opcache.max_wasted_percentage=5
1832
-
1833
- ; When this directive is enabled, the OPcache appends the current working
1834
- ; directory to the script key, thus eliminating possible collisions between
1835
- ; files with the same name (basename). Disabling the directive improves
1836
- ; performance, but may break existing applications.
1837
- ;opcache.use_cwd=1
1838
-
1839
- ; When disabled, you must reset the OPcache manually or restart the
1840
- ; webserver for changes to the filesystem to take effect.
1815
+ opcache.revalidate_freq=0
1841
1816
  opcache.validate_timestamps=1
1842
-
1843
- ; How often (in seconds) to check file timestamps for changes to the shared
1844
- ; memory storage allocation. ("1" means validate once per second, but only
1845
- ; once per request. "0" means always validate)
1846
- opcache.revalidate_freq=2
1847
-
1848
- ; Enables or disables file search in include_path optimization
1849
- ;opcache.revalidate_path=0
1850
-
1851
- ; If disabled, all PHPDoc comments are dropped from the code to reduce the
1852
- ; size of the optimized code.
1853
- opcache.save_comments=1
1854
-
1855
- ; If enabled, compilation warnings (including notices and deprecations) will
1856
- ; be recorded and replayed each time a file is included. Otherwise, compilation
1857
- ; warnings will only be emitted when the file is first cached.
1858
- ;opcache.record_warnings=0
1859
-
1860
- ; Allow file existence override (file_exists, etc.) performance feature.
1861
- ;opcache.enable_file_override=0
1862
-
1863
- ; A bitmask, where each bit enables or disables the appropriate OPcache
1864
- ; passes
1865
- ;opcache.optimization_level=0x7FFFBFFF
1866
-
1867
- ;opcache.dups_fix=0
1868
-
1869
- ; The location of the OPcache blacklist file (wildcards allowed).
1870
- ; Each OPcache blacklist file is a text file that holds the names of files
1871
- ; that should not be accelerated. The file format is to add each filename
1872
- ; to a new line. The filename may be a full path or just a file prefix
1873
- ; (i.e., /var/www/x blacklists all the files and directories in /var/www
1874
- ; that start with 'x'). Line starting with a ; are ignored (comments).
1875
- ;opcache.blacklist_filename=
1876
-
1877
- ; Allows exclusion of large files from being cached. By default all files
1878
- ; are cached.
1879
- ;opcache.max_file_size=0
1880
-
1881
- ; Check the cache checksum each N requests.
1882
- ; The default value of "0" means that the checks are disabled.
1883
- ;opcache.consistency_checks=0
1884
-
1885
- ; How long to wait (in seconds) for a scheduled restart to begin if the cache
1886
- ; is not being accessed.
1887
- ;opcache.force_restart_timeout=180
1888
-
1889
- ; OPcache error_log file name. Empty string assumes "stderr".
1890
- ;opcache.error_log=
1891
-
1892
- ; All OPcache errors go to the Web server log.
1893
- ; By default, only fatal errors (level 0) or errors (level 1) are logged.
1894
- ; You can also enable warnings (level 2), info messages (level 3) or
1895
- ; debug messages (level 4).
1896
- ;opcache.log_verbosity_level=1
1897
-
1898
- ; Preferred Shared Memory back-end. Leave empty and let the system decide.
1899
- ;opcache.preferred_memory_model=
1900
-
1901
- ; Protect the shared memory from unexpected writing during script execution.
1902
- ; Useful for internal debugging only.
1903
- ;opcache.protect_memory=0
1904
-
1905
- ; Allows calling OPcache API functions only from PHP scripts which path is
1906
- ; started from specified string. The default "" means no restriction
1907
- ;opcache.restrict_api=
1908
-
1909
- ; Mapping base of shared memory segments (for Windows only). All the PHP
1910
- ; processes have to map shared memory into the same address space. This
1911
- ; directive allows to manually fix the "Unable to reattach to base address"
1912
- ; errors.
1913
- ;opcache.mmap_base=
1914
-
1915
- ; Facilitates multiple OPcache instances per user (for Windows only). All PHP
1916
- ; processes with the same cache ID and user share an OPcache instance.
1917
- ;opcache.cache_id=
1918
-
1919
- ; Enables and sets the second level cache directory.
1920
- ; It should improve performance when SHM memory is full, at server restart or
1921
- ; SHM reset. The default "" disables file based caching.
1922
- ;opcache.file_cache=
1923
-
1924
- ; Enables or disables opcode caching in shared memory.
1925
- ;opcache.file_cache_only=0
1926
-
1927
- ; Enables or disables checksum validation when script loaded from file cache.
1928
- ;opcache.file_cache_consistency_checks=1
1929
-
1930
- ; Implies opcache.file_cache_only=1 for a certain process that failed to
1931
- ; reattach to the shared memory (for Windows only). Explicitly enabled file
1932
- ; cache is required.
1933
- ;opcache.file_cache_fallback=1
1934
-
1935
- ; Enables or disables copying of PHP code (text segment) into HUGE PAGES.
1936
- ; This should improve performance, but requires appropriate OS configuration.
1937
- ;opcache.huge_code_pages=1
1938
-
1939
- ; Validate cached file permissions.
1940
- ;opcache.validate_permission=0
1941
-
1942
- ; Prevent name collisions in chroot'ed environment.
1943
- ;opcache.validate_root=0
1944
-
1945
- ; If specified, it produces opcode dumps for debugging different stages of
1946
- ; optimizations.
1947
- ;opcache.opt_debug_level=0
1948
-
1949
- ; Specifies a PHP script that is going to be compiled and executed at server
1950
- ; start-up.
1951
- ; https://php.net/opcache.preload
1952
- ;opcache.preload=
1953
-
1954
- ; Preloading code as root is not allowed for security reasons. This directive
1955
- ; facilitates to let the preloading to be run as another user.
1956
- ; https://php.net/opcache.preload_user
1957
- ;opcache.preload_user=
1958
-
1959
- ; Prevents caching files that are less than this number of seconds old. It
1960
- ; protects from caching of incompletely updated files. In case all file updates
1961
- ; on your site are atomic, you may increase performance by setting it to "0".
1962
- ;opcache.file_update_protection=2
1963
-
1964
- ; Absolute path used to store shared lockfiles (for *nix only).
1965
- ;opcache.lockfile_path=/tmp
1966
-
1817
+ opcache.max_accelerated_files=100000
1818
+ opcache.memory_consumption=192
1819
+ opcache.max_wasted_percentage=10
1820
+ opcache.interned_strings_buffer=16
1967
1821
  [curl]
1968
1822
  ; A default value for the CURLOPT_CAINFO option. This is required to be an
1969
1823
  ; absolute path.
@@ -1996,53 +1850,3 @@ opcache.save_comments=1
1996
1850
 
1997
1851
  ; List of headers files to preload, wildcard patterns allowed.
1998
1852
  ;ffi.preload=
1999
-
2000
- [xdebug]
2001
- <% if (it.debug) { %>
2002
- error_reporting=E_ALL
2003
-
2004
- xdebug.idekey=PHPSTORM
2005
-
2006
- <% if (it.isXDebug2) { %>
2007
- xdebug.remote_autostart=1
2008
- xdebug.remote_enable=1
2009
-
2010
- xdebug.remote_host=<%~ it.hostMachine %>
2011
-
2012
- xdebug.remote_port=9003
2013
-
2014
- xdebug.remote_log=<%~ it.mageRoot %>/var/log/xdebug.log
2015
-
2016
- <% } else { %>
2017
-
2018
- xdebug.mode=debug
2019
- xdebug.client_host=<%~ it.hostMachine %>
2020
-
2021
- xdebug.client_port=9003
2022
-
2023
- ; THIS THING WILL BREAK PHP
2024
- ; xdebug.start_with_request=yes
2025
-
2026
- xdebug.discover_client_host=false
2027
- xdebug.start_upon_error=yes
2028
-
2029
- xdebug.log=<%~ it.mageRoot %>/var/log/xdebug.log
2030
-
2031
- <% } %>
2032
-
2033
- <% } else { %>
2034
-
2035
- <% if (it.isXDebug2) { %>
2036
-
2037
- xdebug.remote_autostart=0
2038
- xdebug.remote_enable=0
2039
-
2040
- <% } else { %>
2041
-
2042
- xdebug.mode=off
2043
-
2044
- <% } %>
2045
-
2046
- <% } %>
2047
-
2048
- apc.enabled=1
@@ -41,4 +41,6 @@ server {
41
41
 
42
42
  proxy_pass http://app_backend;
43
43
  }
44
+
45
+ client_max_body_size 64M;
44
46
  }
@@ -5,24 +5,31 @@ import std;
5
5
  # The minimal Varnish version is 6.0
6
6
  # For SSL offloading, pass the following header in your proxy server or load balancer: 'X-Forwarded-Proto: https'
7
7
 
8
+ <% if (it.healthCheck) { %>
9
+ probe healthcheck {
10
+ # .url = "/health_check.php";
11
+ .request =
12
+ "GET /health_check.php HTTP/1.1"
13
+ "Host: localhost"
14
+ "Connection: close"
15
+ "User-Agent: Varnish Health Probe";
16
+ .interval = 10s;
17
+ .timeout = 5s;
18
+ .window = 8;
19
+ .threshold = 3;
20
+ .initial = 3;
21
+ }
22
+ <% } %>
23
+
8
24
  backend default {
9
25
  .host = "<%= it.hostMachine %>";
10
26
  .host_header = "Host: localhost";
11
27
  .port = "<%= it.nginxPort %>";
12
28
  .first_byte_timeout = 600s;
13
- .probe = {
14
- # .url = "/health_check.php";
15
- .request =
16
- "GET /health_check.php HTTP/1.1"
17
- "Host: localhost"
18
- "Connection: close"
19
- "User-Agent: Varnish Health Probe";
20
- .interval = 10s;
21
- .timeout = 5s;
22
- .window = 5;
23
- .threshold = 3;
24
- }
25
- }
29
+ .connect_timeout = 10s;
30
+ <% if (it.healthCheck) { %>
31
+ .probe = healthcheck;
32
+ <% } %>}
26
33
 
27
34
  acl purge {
28
35
  "<%= it.hostMachine %>";
@@ -1,7 +1,11 @@
1
1
  const path = require('path');
2
2
 
3
+ /**
4
+ * @returns {import('../../../typings/index').VarnishConfiguration}
5
+ */
3
6
  const varnish60 = ({ templateDir }) => ({
4
7
  enabled: true,
8
+ healthCheck: false,
5
9
  version: '6.0',
6
10
  configTemplate: path.join(templateDir || '', 'varnish.template.vcl')
7
11
  });
@@ -1,7 +1,11 @@
1
1
  const path = require('path');
2
2
 
3
+ /**
4
+ * @returns {import('../../../typings/index').VarnishConfiguration}
5
+ */
3
6
  const varnish66 = ({ templateDir }) => ({
4
7
  enabled: true,
8
+ healthCheck: false,
5
9
  version: '6.6',
6
10
  configTemplate: path.join(templateDir || '', 'varnish.template.vcl')
7
11
  });
@@ -1,7 +1,11 @@
1
1
  const path = require('path');
2
2
 
3
+ /**
4
+ * @returns {import('../../../typings/index').VarnishConfiguration}
5
+ */
3
6
  const varnish70 = ({ templateDir }) => ({
4
7
  enabled: true,
8
+ healthCheck: false,
5
9
  version: '7.0',
6
10
  configTemplate: path.join(templateDir || '', 'varnish.template.vcl')
7
11
  });
@@ -0,0 +1,41 @@
1
+ const { defaultMagentoConfig } = require('../magento-config');
2
+ const { magento23PHPExtensionList } = require('../magento/required-php-extensions');
3
+ const { repo } = require('../php/base-repo');
4
+ const { php72 } = require('../php/versions');
5
+ const { composer1 } = require('../services/composer/versions');
6
+ const { elasticsearch68 } = require('../services/elasticsearch/versions');
7
+ const { maildev } = require('../services/maildev');
8
+ const { nginx118 } = require('../services/nginx/versions');
9
+ const { sslTerminator } = require('../services/ssl-terminator');
10
+ const { varnish66 } = require('../varnish/varnish-6-6');
11
+
12
+ module.exports = ({ templateDir } = {}) => ({
13
+ magentoVersion: '2.2.10',
14
+ configuration: {
15
+ php: php72({
16
+ templateDir,
17
+ extensions: magento23PHPExtensionList,
18
+ baseImage: `${ repo }:php-7.2-magento-2.3`
19
+ }),
20
+ nginx: nginx118({ templateDir }),
21
+ redis: {
22
+ version: '5.0'
23
+ },
24
+ mysql: {
25
+ version: '5.7'
26
+ },
27
+ mariadb: {
28
+ version: '10.2'
29
+ },
30
+ elasticsearch: elasticsearch68(),
31
+ composer: composer1(),
32
+ varnish: varnish66({ templateDir }),
33
+ sslTerminator: sslTerminator({ templateDir }),
34
+ maildev: maildev()
35
+ },
36
+ magento: defaultMagentoConfig,
37
+ host: 'localhost',
38
+ ssl: {
39
+ enabled: false
40
+ }
41
+ });
@@ -1,10 +1,12 @@
1
- const path = require('path');
2
1
  const { defaultMagentoConfig } = require('../magento-config');
3
2
  const { magento23PHPExtensionList } = require('../magento/required-php-extensions');
4
3
  const { repo } = require('../php/base-repo');
5
4
  const { php72 } = require('../php/versions');
5
+ const { composer1 } = require('../services/composer/versions');
6
6
  const { elasticsearch68 } = require('../services/elasticsearch/versions');
7
- const { sslTerminator } = require('../ssl-terminator');
7
+ const { maildev } = require('../services/maildev');
8
+ const { nginx118 } = require('../services/nginx/versions');
9
+ const { sslTerminator } = require('../services/ssl-terminator');
8
10
  const { varnish66 } = require('../varnish/varnish-6-6');
9
11
 
10
12
  module.exports = ({ templateDir } = {}) => ({
@@ -15,10 +17,7 @@ module.exports = ({ templateDir } = {}) => ({
15
17
  extensions: magento23PHPExtensionList,
16
18
  baseImage: `${ repo }:php-7.2-magento-2.3`
17
19
  }),
18
- nginx: {
19
- version: '1.18.0',
20
- configTemplate: path.join(templateDir || '', 'nginx.template.conf')
21
- },
20
+ nginx: nginx118({ templateDir }),
22
21
  redis: {
23
22
  version: '5.0'
24
23
  },
@@ -29,11 +28,10 @@ module.exports = ({ templateDir } = {}) => ({
29
28
  version: '10.2'
30
29
  },
31
30
  elasticsearch: elasticsearch68(),
32
- composer: {
33
- version: '1'
34
- },
31
+ composer: composer1(),
35
32
  varnish: varnish66({ templateDir }),
36
- sslTerminator: sslTerminator({ templateDir })
33
+ sslTerminator: sslTerminator({ templateDir }),
34
+ maildev: maildev()
37
35
  },
38
36
  magento: defaultMagentoConfig,
39
37
  host: 'localhost',
@@ -1,11 +1,13 @@
1
- const path = require('path');
2
1
  const { elasticsearch68 } = require('../services/elasticsearch/versions');
3
2
  const { defaultMagentoConfig } = require('../magento-config');
4
3
  const { magento23PHPExtensionList } = require('../magento/required-php-extensions');
5
4
  const { repo } = require('../php/base-repo');
6
5
  const { php72 } = require('../php/versions');
7
- const { sslTerminator } = require('../ssl-terminator');
6
+ const { sslTerminator } = require('../services/ssl-terminator');
8
7
  const { varnish66 } = require('../varnish/varnish-6-6');
8
+ const { nginx118 } = require('../services/nginx/versions');
9
+ const { composer1 } = require('../services/composer/versions');
10
+ const { maildev } = require('../services/maildev');
9
11
 
10
12
  module.exports = ({ templateDir } = {}) => ({
11
13
  magentoVersion: '2.3.1',
@@ -15,10 +17,7 @@ module.exports = ({ templateDir } = {}) => ({
15
17
  extensions: magento23PHPExtensionList,
16
18
  baseImage: `${ repo }:php-7.2-magento-2.3`
17
19
  }),
18
- nginx: {
19
- version: '1.18.0',
20
- configTemplate: path.join(templateDir || '', 'nginx.template.conf')
21
- },
20
+ nginx: nginx118({ templateDir }),
22
21
  redis: {
23
22
  version: '5'
24
23
  },
@@ -29,11 +28,10 @@ module.exports = ({ templateDir } = {}) => ({
29
28
  version: '10.2'
30
29
  },
31
30
  elasticsearch: elasticsearch68(),
32
- composer: {
33
- version: '1'
34
- },
31
+ composer: composer1(),
35
32
  varnish: varnish66({ templateDir }),
36
- sslTerminator: sslTerminator({ templateDir })
33
+ sslTerminator: sslTerminator({ templateDir }),
34
+ maildev: maildev()
37
35
  },
38
36
  magento: defaultMagentoConfig,
39
37
  host: 'localhost',