@scandipwa/magento-scripts 2.0.0-alpha.0 → 2.0.0-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.
Files changed (165) hide show
  1. package/exec.js +71 -0
  2. package/index.js +1 -1
  3. package/lib/commands/cli.js +7 -2
  4. package/lib/commands/execute.js +3 -58
  5. package/lib/commands/import-db.js +1 -1
  6. package/lib/commands/logs.js +1 -1
  7. package/lib/commands/start.js +18 -8
  8. package/lib/commands/status.js +9 -1
  9. package/lib/config/config.js +20 -2
  10. package/lib/config/docker.js +79 -85
  11. package/lib/config/index.js +2 -2
  12. package/lib/config/php/versions/php-7.2.js +1 -0
  13. package/lib/config/php/versions/php-7.3.js +1 -0
  14. package/lib/config/php/versions/php-7.4.js +1 -0
  15. package/lib/config/php/versions/php-8.1.js +1 -0
  16. package/lib/config/php-config.js +4 -3
  17. package/lib/config/port-config.js +1 -1
  18. package/lib/config/services/composer/versions/composer-1.js +8 -0
  19. package/lib/config/services/composer/versions/composer-2.js +8 -0
  20. package/lib/config/services/composer/versions/index.js +4 -0
  21. package/lib/config/services/elasticsearch/base-repo.js +3 -0
  22. package/lib/config/services/elasticsearch/default-es-env.js +6 -0
  23. package/lib/config/services/elasticsearch/versions/elasticsearch-6.8.js +19 -0
  24. package/lib/config/services/elasticsearch/versions/index.js +5 -0
  25. package/lib/config/services/nginx/versions/index.js +3 -0
  26. package/lib/config/services/nginx/versions/nginx-1.18.js +11 -0
  27. package/lib/config/{ssl-terminator → services/ssl-terminator}/index.js +3 -0
  28. package/lib/config/templates/magentorc.template +6 -5
  29. package/lib/config/templates/mariadb.template.cnf +191 -0
  30. package/lib/config/templates/php-debug.template.ini +31 -0
  31. package/lib/config/templates/php-fpm.template.conf +1 -2
  32. package/lib/config/templates/php.template.ini +6 -202
  33. package/lib/config/templates/ssl-terminator.template.conf +10 -3
  34. package/lib/config/templates/varnish.template.vcl +20 -13
  35. package/lib/config/varnish/varnish-6-0.js +4 -0
  36. package/lib/config/varnish/varnish-6-6.js +4 -0
  37. package/lib/config/varnish/varnish-7-0.js +4 -0
  38. package/lib/config/versions/magento-2.3.0.js +7 -12
  39. package/lib/config/versions/magento-2.3.1.js +7 -12
  40. package/lib/config/versions/magento-2.3.2-p1.js +7 -12
  41. package/lib/config/versions/magento-2.3.2-p2.js +7 -12
  42. package/lib/config/versions/magento-2.3.2.js +7 -12
  43. package/lib/config/versions/magento-2.3.3-p1.js +7 -12
  44. package/lib/config/versions/magento-2.3.3.js +7 -12
  45. package/lib/config/versions/magento-2.3.4-p1.js +7 -12
  46. package/lib/config/versions/magento-2.3.4-p2.js +7 -12
  47. package/lib/config/versions/magento-2.3.4.js +7 -12
  48. package/lib/config/versions/magento-2.3.5-p1.js +5 -9
  49. package/lib/config/versions/magento-2.3.5-p2.js +5 -9
  50. package/lib/config/versions/magento-2.3.5.js +5 -9
  51. package/lib/config/versions/magento-2.3.6-p1.js +5 -9
  52. package/lib/config/versions/magento-2.3.6.js +5 -9
  53. package/lib/config/versions/magento-2.3.7-p1.js +5 -9
  54. package/lib/config/versions/magento-2.3.7-p2.js +5 -9
  55. package/lib/config/versions/magento-2.3.7-p3.js +5 -9
  56. package/lib/config/versions/magento-2.3.7-p4.js +40 -0
  57. package/lib/config/versions/magento-2.3.7.js +5 -9
  58. package/lib/config/versions/magento-2.4.0-p1.js +5 -9
  59. package/lib/config/versions/magento-2.4.0.js +5 -9
  60. package/lib/config/versions/magento-2.4.1-p1.js +5 -9
  61. package/lib/config/versions/magento-2.4.1.js +5 -9
  62. package/lib/config/versions/magento-2.4.2-p1.js +5 -9
  63. package/lib/config/versions/magento-2.4.2-p2.js +5 -9
  64. package/lib/config/versions/magento-2.4.2.js +5 -9
  65. package/lib/config/versions/magento-2.4.3-p1.js +5 -9
  66. package/lib/config/versions/magento-2.4.3-p2.js +5 -9
  67. package/lib/config/versions/magento-2.4.3-p3.js +42 -0
  68. package/lib/config/versions/magento-2.4.3.js +5 -9
  69. package/lib/config/versions/magento-2.4.4-p1.js +42 -0
  70. package/lib/config/versions/magento-2.4.4.js +5 -9
  71. package/lib/config/versions/magento-2.4.5.js +42 -0
  72. package/lib/tasks/cleanup.js +1 -1
  73. package/lib/tasks/composer/local-auth-json.js +1 -1
  74. package/lib/tasks/database/connect-to-database.js +120 -0
  75. package/lib/tasks/database/create-magento-database.js +21 -0
  76. package/lib/tasks/database/create-magento-user.js +50 -0
  77. package/lib/tasks/database/default-magento-database.js +3 -0
  78. package/lib/tasks/database/default-magento-user.js +7 -0
  79. package/lib/tasks/{mysql → database}/dump-theme-config.js +3 -3
  80. package/lib/tasks/{mysql → database}/fix-db.js +2 -2
  81. package/lib/tasks/{mysql/import-dump-to-mysql.js → database/import-dump-to-database.js} +21 -20
  82. package/lib/tasks/{mysql → database}/import-remote-db/index.js +0 -0
  83. package/lib/tasks/{mysql/import-remote-db/ssh/mysqldump-command.js → database/import-remote-db/ssh/database-dump-command.js} +2 -2
  84. package/lib/tasks/{mysql → database}/import-remote-db/ssh/index.js +0 -0
  85. package/lib/tasks/{mysql → database}/import-remote-db/ssh/readymage.js +4 -4
  86. package/lib/tasks/{mysql → database}/import-remote-db/ssh/regular-server.js +2 -2
  87. package/lib/tasks/{mysql → database}/index.js +2 -2
  88. package/lib/tasks/{mysql → database}/magento-tables.js +0 -0
  89. package/lib/tasks/{mysql → database}/restore-theme-config.js +4 -4
  90. package/lib/tasks/docker/api.d.ts +25 -1
  91. package/lib/tasks/docker/api.js +31 -1
  92. package/lib/tasks/docker/containers/container-api.d.ts +18 -0
  93. package/lib/tasks/docker/containers/container-api.js +76 -17
  94. package/lib/tasks/docker/containers/tasks.js +32 -1
  95. package/lib/tasks/docker/convert-legacy-volumes.js +8 -7
  96. package/lib/tasks/docker/convert-mysql-to-mariadb.js +284 -0
  97. package/lib/tasks/docker/index.js +6 -1
  98. package/lib/tasks/docker/network/network-api.d.ts +1 -1
  99. package/lib/tasks/docker/project-image-builder.js +7 -9
  100. package/lib/tasks/docker/volume/index.js +9 -0
  101. package/lib/tasks/docker/volume/tasks.js +94 -0
  102. package/lib/tasks/docker/volume/volume-api.d.ts +49 -0
  103. package/lib/tasks/docker/volume/volume-api.js +90 -0
  104. package/lib/tasks/execute.js +100 -0
  105. package/lib/tasks/file-system/create-mariadb-config.js +23 -0
  106. package/lib/tasks/file-system/create-nginx-config.js +3 -5
  107. package/lib/tasks/file-system/create-php-config.js +2 -23
  108. package/lib/tasks/file-system/create-php-debug-config.js +45 -0
  109. package/lib/tasks/file-system/create-php-fpm-config.js +2 -4
  110. package/lib/tasks/file-system/create-phpstorm-config/workspace-config/php-workspace-project-configuration-config.js +1 -1
  111. package/lib/tasks/file-system/create-ssl-terminator-config.js +4 -7
  112. package/lib/tasks/file-system/create-varnish-config.js +4 -7
  113. package/lib/tasks/file-system/index.js +5 -1
  114. package/lib/tasks/import-dump.js +6 -6
  115. package/lib/tasks/link.js +4 -2
  116. package/lib/tasks/magento/enable-magento-composer-plugins.js +85 -30
  117. package/lib/tasks/magento/install-magento-project.js +3 -2
  118. package/lib/tasks/magento/setup-magento/configure-elasticsearch.js +3 -5
  119. package/lib/tasks/magento/setup-magento/create-admin.js +1 -1
  120. package/lib/tasks/magento/setup-magento/delete-admin-users.js +2 -2
  121. package/lib/tasks/magento/setup-magento/delete-customers.js +4 -4
  122. package/lib/tasks/magento/setup-magento/delete-orders.js +4 -4
  123. package/lib/tasks/magento/setup-magento/flush-redis-config.js +3 -6
  124. package/lib/tasks/magento/setup-magento/increase-admin-session-lifetime.js +2 -2
  125. package/lib/tasks/magento/setup-magento/index.js +2 -0
  126. package/lib/tasks/magento/setup-magento/install-magento.js +15 -17
  127. package/lib/tasks/magento/setup-magento/migrate-database.js +5 -11
  128. package/lib/tasks/magento/setup-magento/set-base-url.js +3 -3
  129. package/lib/tasks/magento/setup-magento/set-url-rewrite.js +2 -2
  130. package/lib/tasks/magento/setup-magento/varnish-config.js +8 -13
  131. package/lib/tasks/magento/setup-magento/waiting-for-varnish.js +17 -16
  132. package/lib/tasks/php/php-container.js +7 -3
  133. package/lib/tasks/php/update-env-php.js +7 -6
  134. package/lib/tasks/php/update-env.php +12 -12
  135. package/lib/tasks/requirements/composer-credentials.js +7 -3
  136. package/lib/tasks/requirements/docker/context.js +88 -0
  137. package/lib/tasks/requirements/docker/index.js +110 -19
  138. package/lib/tasks/requirements/docker/install.js +21 -7
  139. package/lib/tasks/requirements/docker/permissions.js +2 -11
  140. package/lib/tasks/requirements/docker/running-status.js +94 -24
  141. package/lib/tasks/requirements/docker/version.js +1 -0
  142. package/lib/tasks/requirements/index.js +0 -2
  143. package/lib/tasks/requirements/php-version.js +4 -2
  144. package/lib/tasks/start.js +32 -31
  145. package/lib/tasks/status/index.js +17 -13
  146. package/lib/tasks/stop.js +2 -0
  147. package/lib/tasks/theme/link-theme.js +2 -2
  148. package/lib/util/config-file-validator.js +29 -13
  149. package/lib/util/database.js +7 -7
  150. package/lib/util/execute-in-container.js +63 -0
  151. package/lib/util/prefix.js +1 -1
  152. package/lib/util/systemctl.js +62 -13
  153. package/package.json +4 -3
  154. package/typings/context.d.ts +12 -5
  155. package/typings/index.d.ts +69 -31
  156. package/lib/tasks/docker/volumes.js +0 -63
  157. package/lib/tasks/execute/index.js +0 -23
  158. package/lib/tasks/mysql/connect-to-mysql.js +0 -127
  159. package/lib/tasks/mysql/create-magento-database.js +0 -18
  160. package/lib/tasks/requirements/dependency/arch.js +0 -50
  161. package/lib/tasks/requirements/dependency/centos.js +0 -36
  162. package/lib/tasks/requirements/dependency/fedora.js +0 -36
  163. package/lib/tasks/requirements/dependency/index.js +0 -33
  164. package/lib/tasks/requirements/dependency/mac.js +0 -124
  165. package/lib/tasks/requirements/dependency/ubuntu.js +0 -83
@@ -0,0 +1,191 @@
1
+ # MariaDB database server configuration file.
2
+ #
3
+ # You can copy this file to one of:
4
+ # - "/etc/mysql/my.cnf" to set global options,
5
+ # - "~/.my.cnf" to set user-specific options.
6
+ #
7
+ # One can use all long options that the program supports.
8
+ # Run program with --help to get a list of available options and with
9
+ # --print-defaults to see which it would actually understand and use.
10
+ #
11
+ # For explanations see
12
+ # http://dev.mysql.com/doc/mysql/en/server-system-variables.html
13
+
14
+ # This will be passed to all mysql clients
15
+ # It has been reported that passwords should be enclosed with ticks/quotes
16
+ # escpecially if they contain "#" chars...
17
+ # Remember to edit /etc/mysql/debian.cnf when changing the socket location.
18
+ [client]
19
+ port = 3306
20
+ socket = /var/run/mysqld/mysqld.sock
21
+
22
+ # Here is entries for some specific programs
23
+ # The following values assume you have at least 32M ram
24
+
25
+ # This was formally known as [safe_mysqld]. Both versions are currently parsed.
26
+ [mysqld_safe]
27
+ socket = /var/run/mysqld/mysqld.sock
28
+ nice = 0
29
+
30
+ [mysqld]
31
+ #
32
+ # * Basic Settings
33
+ #
34
+ #user = mysql
35
+ pid-file = /var/run/mysqld/mysqld.pid
36
+ socket = /var/run/mysqld/mysqld.sock
37
+ port = 3306
38
+ basedir = /usr
39
+ datadir = /var/lib/mysql
40
+ tmpdir = /tmp
41
+ lc_messages_dir = /usr/share/mysql
42
+ lc_messages = en_US
43
+ skip-external-locking
44
+ #q
45
+ # Instead of skip-networking the default is now to listen only on
46
+ # localhost which is more compatible and is not less secure.
47
+ # bind-address = 0.0.0.0
48
+ #
49
+ # * Fine Tuning
50
+ #
51
+ max_connections = 100
52
+ connect_timeout = 200
53
+ wait_timeout = 28800
54
+ max_allowed_packet = 1GB
55
+ thread_cache_size = 128
56
+ sort_buffer_size = 4M
57
+ bulk_insert_buffer_size = 16M
58
+ tmp_table_size = 32M
59
+ max_heap_table_size = 32M
60
+ #
61
+ # * MyISAM
62
+ #
63
+ # This replaces the startup script and checks MyISAM tables if needed
64
+ # the first time they are touched. On error, make copy and try a repair.
65
+ myisam_recover_options = BACKUP
66
+ key_buffer_size = 128M
67
+ #open-files-limit = 2000
68
+ table_open_cache = 400
69
+ myisam_sort_buffer_size = 512M
70
+ concurrent_insert = 2
71
+ read_buffer_size = 2M
72
+ read_rnd_buffer_size = 1M
73
+ #
74
+ # * Query Cache Configuration
75
+ #
76
+ # Cache only tiny result sets, so we can fit more in the query cache.
77
+ query_cache_limit = 128K
78
+ query_cache_size = 64M
79
+ # for more write intensive setups, set to DEMAND or OFF
80
+ #query_cache_type = DEMAND
81
+ #
82
+ # * Logging and Replication
83
+ #
84
+ # Both location gets rotated by the cronjob.
85
+ # Be aware that this log type is a performance killer.
86
+ # As of 5.1 you can enable the log at runtime!
87
+ #general_log_file = /var/log/mysql/mysql.log
88
+ #general_log = 1
89
+ #
90
+ # Error logging goes to syslog due to /etc/mysql/conf.d/mysqld_safe_syslog.cnf.
91
+ #
92
+ # we do want to know about network errors and such
93
+ #log_warnings = 2
94
+ #
95
+ # Enable the slow query log to see queries with especially long duration
96
+ #slow_query_log[={0|1}]
97
+ slow_query_log_file = /var/log/mysql/mariadb-slow.log
98
+ long_query_time = 10
99
+ #log_slow_rate_limit = 1000
100
+ #log_slow_verbosity = query_plan
101
+
102
+ #log-queries-not-using-indexes
103
+ #log_slow_admin_statements
104
+ #
105
+ # The following can be used as easy to replay backup logs or for replication.
106
+ # note: if you are setting up a replication slave, see README.Debian about
107
+ # other settings you may need to change.
108
+ #server-id = 1
109
+ #report_host = master1
110
+ #auto_increment_increment = 2
111
+ #auto_increment_offset = 1
112
+ #log_bin = /var/log/mysql/mariadb-bin
113
+ #log_bin_index = /var/log/mysql/mariadb-bin.index
114
+ # not fab for performance, but safer
115
+ #sync_binlog = 1
116
+ expire_logs_days = 10
117
+ max_binlog_size = 100M
118
+ # slaves
119
+ #relay_log = /var/log/mysql/relay-bin
120
+ #relay_log_index = /var/log/mysql/relay-bin.index
121
+ #relay_log_info_file = /var/log/mysql/relay-bin.info
122
+ #log_slave_updates
123
+ #read_only
124
+ #
125
+ # If applications support it, this stricter sql_mode prevents some
126
+ # mistakes like inserting invalid dates etc.
127
+ #sql_mode = NO_ENGINE_SUBSTITUTION,TRADITIONAL
128
+ #
129
+ # * InnoDB
130
+ #
131
+ # InnoDB is enabled by default with a 10MB datafile in /var/lib/mysql/.
132
+ # Read the manual for more InnoDB related options. There are many!
133
+ default_storage_engine = InnoDB
134
+ innodb_buffer_pool_size = 256M
135
+ innodb_log_buffer_size = 8M
136
+ innodb_file_per_table = 1
137
+ innodb_open_files = 400
138
+ innodb_io_capacity = 400
139
+ innodb_flush_method = O_DIRECT
140
+ #
141
+ # * Security Features
142
+ #
143
+ # Read the manual, too, if you want chroot!
144
+ # chroot = /var/lib/mysql/
145
+ #
146
+ # For generating SSL certificates I recommend the OpenSSL GUI "tinyca".
147
+ #
148
+ # ssl-ca=/etc/mysql/cacert.pem
149
+ # ssl-cert=/etc/mysql/server-cert.pem
150
+ # ssl-key=/etc/mysql/server-key.pem
151
+
152
+ #
153
+ # * Galera-related settings
154
+ #
155
+ [galera]
156
+ # Mandatory settings
157
+ #wsrep_on=ON
158
+ #wsrep_provider=
159
+ #wsrep_cluster_address=
160
+ #binlog_format=row
161
+ #default_storage_engine=InnoDB
162
+ #innodb_autoinc_lock_mode=2
163
+ #
164
+ # Allow server to accept connections on all interfaces.
165
+ #
166
+ #bind-address=0.0.0.0
167
+ #
168
+ # Optional setting
169
+ #wsrep_slave_threads=1
170
+ #innodb_flush_log_at_trx_commit=0
171
+
172
+ [mysqldump]
173
+ quick
174
+ quote-names
175
+ max_allowed_packet = 16M
176
+
177
+ [mysql]
178
+ #no-auto-rehash # faster start of mysql but no tab completion
179
+
180
+ [isamchk]
181
+ key_buffer = 16M
182
+
183
+ #
184
+ # * IMPORTANT: Additional settings that can override those from this file!
185
+ # The files must end with '.cnf', otherwise they'll be ignored.
186
+ #
187
+ [mariadb]
188
+ skip-host-cache
189
+ skip-name-resolve
190
+
191
+ !includedir /etc/mysql/conf.d/
@@ -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.
1841
- 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
-
1815
+ opcache.revalidate_freq=0
1816
+ opcache.validate_timestamps=0
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
@@ -12,20 +12,25 @@ upstream app_backend {
12
12
  server {
13
13
  listen <%= it.hostPort %>;
14
14
  <% if (it.config.ssl.enabled) { %> listen 443 ssl;
15
- server_name <%= it.networkToBindTo %>;
16
15
 
16
+ ssl on;
17
17
  ssl_certificate /etc/nginx/conf.d/ssl_certificate.pem;
18
18
  ssl_certificate_key /etc/nginx/conf.d/ssl_certificate-key.pem;
19
19
  ssl_protocols TLSv1.2;<% } %>
20
20
 
21
- server_name <% if (it.config.host) { %><%= it.config.host %><% } else { %>_<% } %>;
21
+ <% if (it.config.host) { %>
22
+ server_name <%= it.config.host %><% if (it.config.ssl.enabled) { %> <%= it.networkToBindTo %><% } %>;
23
+ <% } else { %>
24
+ server_name <% if (it.config.ssl.enabled) { %> <%= it.networkToBindTo %><% } else { %>_<% } %>;
25
+ <% } %>
22
26
 
23
27
  location / {
24
28
  proxy_buffer_size 128k;
25
29
  proxy_buffers 4 256k;
26
30
  proxy_busy_buffers_size 256k;
27
31
  proxy_set_header X-Real-IP $remote_addr;
28
- proxy_set_header X-Forwarded-For $remote_addr;
32
+ proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
33
+ proxy_set_header X-Forwarded-Proto $scheme;
29
34
  proxy_set_header Host $http_host;
30
35
  proxy_http_version 1.1;
31
36
  proxy_set_header Connection "";
@@ -36,4 +41,6 @@ server {
36
41
 
37
42
  proxy_pass http://app_backend;
38
43
  }
44
+
45
+ client_max_body_size 64M;
39
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
  });
@@ -1,9 +1,11 @@
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');
6
- const { sslTerminator } = require('../ssl-terminator');
5
+ const { composer1 } = require('../services/composer/versions');
6
+ const { elasticsearch68 } = require('../services/elasticsearch/versions');
7
+ const { nginx118 } = require('../services/nginx/versions');
8
+ const { sslTerminator } = require('../services/ssl-terminator');
7
9
  const { varnish66 } = require('../varnish/varnish-6-6');
8
10
 
9
11
  module.exports = ({ templateDir } = {}) => ({
@@ -14,10 +16,7 @@ module.exports = ({ templateDir } = {}) => ({
14
16
  extensions: magento23PHPExtensionList,
15
17
  baseImage: `${ repo }:php-7.2-magento-2.3`
16
18
  }),
17
- nginx: {
18
- version: '1.18.0',
19
- configTemplate: path.join(templateDir || '', 'nginx.template.conf')
20
- },
19
+ nginx: nginx118({ templateDir }),
21
20
  redis: {
22
21
  version: '5.0'
23
22
  },
@@ -27,12 +26,8 @@ module.exports = ({ templateDir } = {}) => ({
27
26
  mariadb: {
28
27
  version: '10.2'
29
28
  },
30
- elasticsearch: {
31
- version: '5.6.16'
32
- },
33
- composer: {
34
- version: '1'
35
- },
29
+ elasticsearch: elasticsearch68(),
30
+ composer: composer1(),
36
31
  varnish: varnish66({ templateDir }),
37
32
  sslTerminator: sslTerminator({ templateDir })
38
33
  },
@@ -1,10 +1,12 @@
1
- const path = require('path');
1
+ const { elasticsearch68 } = require('../services/elasticsearch/versions');
2
2
  const { defaultMagentoConfig } = require('../magento-config');
3
3
  const { magento23PHPExtensionList } = require('../magento/required-php-extensions');
4
4
  const { repo } = require('../php/base-repo');
5
5
  const { php72 } = require('../php/versions');
6
- const { sslTerminator } = require('../ssl-terminator');
6
+ const { sslTerminator } = require('../services/ssl-terminator');
7
7
  const { varnish66 } = require('../varnish/varnish-6-6');
8
+ const { nginx118 } = require('../services/nginx/versions');
9
+ const { composer1 } = require('../services/composer/versions');
8
10
 
9
11
  module.exports = ({ templateDir } = {}) => ({
10
12
  magentoVersion: '2.3.1',
@@ -14,10 +16,7 @@ module.exports = ({ templateDir } = {}) => ({
14
16
  extensions: magento23PHPExtensionList,
15
17
  baseImage: `${ repo }:php-7.2-magento-2.3`
16
18
  }),
17
- nginx: {
18
- version: '1.18.0',
19
- configTemplate: path.join(templateDir || '', 'nginx.template.conf')
20
- },
19
+ nginx: nginx118({ templateDir }),
21
20
  redis: {
22
21
  version: '5'
23
22
  },
@@ -27,12 +26,8 @@ module.exports = ({ templateDir } = {}) => ({
27
26
  mariadb: {
28
27
  version: '10.2'
29
28
  },
30
- elasticsearch: {
31
- version: '6.8.16'
32
- },
33
- composer: {
34
- version: '1'
35
- },
29
+ elasticsearch: elasticsearch68(),
30
+ composer: composer1(),
36
31
  varnish: varnish66({ templateDir }),
37
32
  sslTerminator: sslTerminator({ templateDir })
38
33
  },