@scandipwa/magento-scripts 2.0.0-alpha.22 → 2.0.0-alpha.23

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.
@@ -181,7 +181,8 @@ module.exports = async (ctx, overridenConfiguration, baseConfig) => {
181
181
  * Mount volumes directly on linux
182
182
  */
183
183
  mountVolumes: [
184
- `${ !isDockerDesktop ? path.join(cacheDir, 'ssl-terminator', 'conf.d') : volumes.sslTerminator.name }:/etc/nginx/conf.d`
184
+ `${ !isDockerDesktop ? path.join(cacheDir, 'ssl-terminator', 'conf.d') : volumes.sslTerminator.name }:/etc/nginx/conf.d`,
185
+ `${ path.join(cacheDir, 'ssl-terminator', 'fastcgi_params') }:/etc/nginx/fastcgi_params`
185
186
  ],
186
187
  restart: 'on-failure:5',
187
188
  network: isDockerDesktop ? network.name : 'host',
@@ -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;
@@ -87,7 +87,25 @@ const createSSLTerminatorConfig = () => ({
87
87
  }
88
88
  });
89
89
  } catch (e) {
90
- throw new UnknownError(`Unexpected error accrued during ssl terminator config creation\n\n${e}`);
90
+ throw new UnknownError(`Unexpected error appeared during ssl terminator config creation\n\n${e}`);
91
+ }
92
+
93
+ // fixes ngrok error "ngrok.io redirected you too many times"
94
+ try {
95
+ await setConfigFile({
96
+ configPathname: path.join(
97
+ baseConfig.cacheDir,
98
+ 'ssl-terminator',
99
+ 'fastcgi_params'
100
+ ),
101
+ template: path.join(baseConfig.templateDir, 'nginx.fastcgi_params.template'),
102
+ overwrite: true,
103
+ templateArgs: {
104
+ isNgrok: host.endsWith('ngrok.io')
105
+ }
106
+ });
107
+ } catch (e) {
108
+ throw new UnknownError(`Unexpected error appeared during ssl terminator fastcgi_params config creation\n\n${e}`);
91
109
  }
92
110
  }
93
111
  });
@@ -17,7 +17,7 @@ module.exports = () => ({
17
17
  databaseConnection
18
18
  } = ctx;
19
19
  const isNgrok = host.endsWith('ngrok.io');
20
- const enableSecureFrontend = (ctx.config.overridenConfiguration.configuration.varnish.enabled && ssl.enabled) ? '1' : '0';
20
+ const enableSecureFrontend = (isNgrok || ssl.enabled) ? '1' : '0';
21
21
  const location = `${host}${ !isNgrok && ports.sslTerminator !== 80 ? `:${ports.sslTerminator }` : '' }/`;
22
22
  const secureLocation = `${host}/`; // SSL will work only on port 443, so you cannot run multiple projects with SSL at the same time.
23
23
  const httpUrl = `http://${location}`;
@@ -28,6 +28,7 @@ module.exports = () => ({
28
28
  { path: 'web/secure/base_url', value: httpsUrl },
29
29
  { path: 'web/secure/use_in_frontend', value: enableSecureFrontend },
30
30
  { path: 'web/secure/use_in_adminhtml', value: enableSecureFrontend },
31
+ { path: 'web/secure/enable_upgrade_insecure', value: enableSecureFrontend },
31
32
  { path: 'web/cookie/cookie_domain', value: null }
32
33
  ], { databaseConnection, task });
33
34
  }
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": "2.0.0-alpha.22",
6
+ "version": "2.0.0-alpha.23",
7
7
  "main": "./index.js",
8
8
  "types": "./typings/index.d.ts",
9
9
  "license": "OSL-3.0",
@@ -54,5 +54,5 @@
54
54
  "mysql",
55
55
  "scandipwa"
56
56
  ],
57
- "gitHead": "60dcb5fae28c349ebb6aaa207168a4d7395a7d12"
57
+ "gitHead": "9a079bfe17ed5e03d1e302d1b7841b7187da9228"
58
58
  }