Skip to content

Commit

Permalink
feat(web): allow unsecure ssl proxy on file-server
Browse files Browse the repository at this point in the history
Fix usage of self-signed certificates while using a proxy in file-server executor.

  See #5118
  • Loading branch information
yannickglt committed Oct 20, 2021
1 parent ecbbc19 commit 1ca8c42
Show file tree
Hide file tree
Showing 9 changed files with 76 additions and 3 deletions.
6 changes: 6 additions & 0 deletions docs/angular/api-web/executors/file-server.md
Expand Up @@ -48,6 +48,12 @@ Type: `string`

URL to proxy unhandled requests to.

### secure

Type: `boolean`

True if you want to verify the SSL Certs.

### ssl

Default: `false`
Expand Down
6 changes: 6 additions & 0 deletions docs/node/api-web/executors/file-server.md
Expand Up @@ -48,6 +48,12 @@ Type: `string`

URL to proxy unhandled requests to.

### secure

Type: `boolean`

True if you want to verify the SSL Certs.

### ssl

Default: `false`
Expand Down
6 changes: 6 additions & 0 deletions docs/react/api-web/executors/file-server.md
Expand Up @@ -48,6 +48,12 @@ Type: `string`

URL to proxy unhandled requests to.

### secure

Type: `boolean`

True if you want to verify the SSL Certs.

### ssl

Default: `false`
Expand Down
2 changes: 1 addition & 1 deletion package.json
Expand Up @@ -152,7 +152,7 @@
"fork-ts-checker-webpack-plugin": "6.2.10",
"fs-extra": "^9.1.0",
"html-webpack-plugin": "^3.2.0",
"http-server": "0.12.3",
"http-server": "14.0.0",
"husky": "^6.0.0",
"identity-obj-proxy": "3.0.0",
"ignore": "^5.0.4",
Expand Down
2 changes: 1 addition & 1 deletion packages/web/package.json
Expand Up @@ -109,7 +109,7 @@
"webpack-subresource-integrity": "^1.5.2",
"worker-plugin": "3.2.0",
"webpack-dev-server": "^4.3.1",
"http-server": "0.12.3",
"http-server": "14.0.0",
"ignore": "^5.0.4"
}
}
3 changes: 3 additions & 0 deletions packages/web/src/executors/file-server/file-server.impl.ts
Expand Up @@ -26,6 +26,9 @@ function getHttpServerArgs(options: Schema) {
if (options.proxyUrl) {
args.push(`-P ${options.proxyUrl}`);
}
if (typeof options.secure === 'boolean') {
args.push(`--proxy-options.secure ${options.secure}`);
}
return args;
}

Expand Down
1 change: 1 addition & 0 deletions packages/web/src/executors/file-server/schema.d.ts
Expand Up @@ -5,6 +5,7 @@ export interface Schema {
sslKey?: string;
sslCert?: string;
proxyUrl?: string;
secure?: boolean;
buildTarget: string;
parallel: boolean;
maxParallel?: number;
Expand Down
4 changes: 4 additions & 0 deletions packages/web/src/executors/file-server/schema.json
Expand Up @@ -48,6 +48,10 @@
"proxyUrl": {
"type": "string",
"description": "URL to proxy unhandled requests to."
},
"secure": {
"type": "boolean",
"description": "True if you want to verify the SSL Certs."
}
},
"additionalProperties": false,
Expand Down
49 changes: 48 additions & 1 deletion yarn.lock
Expand Up @@ -8199,6 +8199,13 @@ basic-auth@^1.0.3:
resolved "https://registry.yarnpkg.com/basic-auth/-/basic-auth-1.1.0.tgz#45221ee429f7ee1e5035be3f51533f1cdfd29884"
integrity sha1-RSIe5Cn37h5QNb4/UVM/HN/SmIQ=

basic-auth@^2.0.1:
version "2.0.1"
resolved "https://registry.yarnpkg.com/basic-auth/-/basic-auth-2.0.1.tgz#b998279bf47ce38344b4f3cf916d4679bbf51e3a"
integrity sha512-NF+epuEdnUYVlGuhaxbbq+dvJttwLnGY+YixlXlME5KpQ5W3CnXA5cVTneY3SPbPDRkcjMbifrwmFYcClgOZeg==
dependencies:
safe-buffer "5.1.2"

batch-processor@1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/batch-processor/-/batch-processor-1.0.0.tgz#75c95c32b748e0850d10c2b168f6bdbe9891ace8"
Expand Down Expand Up @@ -13974,6 +13981,13 @@ html-encoding-sniffer@^2.0.1:
dependencies:
whatwg-encoding "^1.0.5"

html-encoding-sniffer@^3.0.0:
version "3.0.0"
resolved "https://registry.yarnpkg.com/html-encoding-sniffer/-/html-encoding-sniffer-3.0.0.tgz#2cb1a8cf0db52414776e5b2a7a04d5dd98158de9"
integrity sha512-oWv4T4yJ52iKrufjnyZPkrN0CH3QnrUqdB6In1g5Fe1mia8GmF36gnfNySxoZtxD5+NmYw1EElVXiBk93UeskA==
dependencies:
whatwg-encoding "^2.0.0"

html-entities@^1.2.0, html-entities@^1.2.1, html-entities@^1.3.1:
version "1.4.0"
resolved "https://registry.yarnpkg.com/html-entities/-/html-entities-1.4.0.tgz#cfbd1b01d2afaf9adca1b10ae7dffab98c71d2dc"
Expand Down Expand Up @@ -14178,6 +14192,25 @@ http-server@0.12.3:
secure-compare "3.0.1"
union "~0.5.0"

http-server@14.0.0:
version "14.0.0"
resolved "https://registry.yarnpkg.com/http-server/-/http-server-14.0.0.tgz#bd214952a60b93ce8ca9bbe8ba181faf7f9821b0"
integrity sha512-XTePIXAo5x72bI8SlKFSqsg7UuSHwsOa4+RJIe56YeMUvfTvGDy7TxFkTEhfIRmM/Dnf6x29ut541ythSBZdkQ==
dependencies:
basic-auth "^2.0.1"
colors "^1.4.0"
corser "^2.0.1"
he "^1.2.0"
html-encoding-sniffer "^3.0.0"
http-proxy "^1.18.1"
mime "^1.6.0"
minimist "^1.2.5"
opener "^1.5.1"
portfinder "^1.0.28"
secure-compare "3.0.1"
union "~0.5.0"
url-join "^4.0.1"

http-signature@~1.2.0:
version "1.2.0"
resolved "https://registry.yarnpkg.com/http-signature/-/http-signature-1.2.0.tgz#9aecd925114772f3d95b65a60abb8f7c18fbace1"
Expand Down Expand Up @@ -14250,6 +14283,13 @@ iconv-lite@0.4.24, iconv-lite@^0.4.24, iconv-lite@^0.4.4:
dependencies:
safer-buffer ">= 2.1.2 < 3"

iconv-lite@0.6.3:
version "0.6.3"
resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.6.3.tgz#a52f80bf38da1952eb5c681790719871a1a72501"
integrity sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==
dependencies:
safer-buffer ">= 2.1.2 < 3.0.0"

iconv-lite@^0.6.2:
version "0.6.2"
resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.6.2.tgz#ce13d1875b0c3a674bd6a04b7f76b01b1b6ded01"
Expand Down Expand Up @@ -24999,7 +25039,7 @@ urix@^0.1.0:
resolved "https://registry.yarnpkg.com/urix/-/urix-0.1.0.tgz#da937f7a62e21fec1fd18d49b35c2935067a6c72"
integrity sha1-2pN/emLiH+wf0Y1Js1wpNQZ6bHI=

url-join@4.0.1:
url-join@4.0.1, url-join@^4.0.1:
version "4.0.1"
resolved "https://registry.yarnpkg.com/url-join/-/url-join-4.0.1.tgz#b642e21a2646808ffa178c4c5fda39844e12cde7"
integrity sha512-jk1+QP6ZJqyOiuEI9AEWQfju/nB2Pw466kbA0LEZljHwKeMgd9WrAEgEGxjPDD2+TNbbb37rTyhEfrCXfuKXnA==
Expand Down Expand Up @@ -25785,6 +25825,13 @@ whatwg-encoding@^1.0.1, whatwg-encoding@^1.0.5:
dependencies:
iconv-lite "0.4.24"

whatwg-encoding@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/whatwg-encoding/-/whatwg-encoding-2.0.0.tgz#e7635f597fd87020858626805a2729fa7698ac53"
integrity sha512-p41ogyeMUrw3jWclHWTQg1k05DSVXPLcVxRTYsXUk+ZooOCZLcoYgPZ/HL/D/N+uQPOtcp1me1WhBEaX02mhWg==
dependencies:
iconv-lite "0.6.3"

whatwg-mimetype@^2.2.0, whatwg-mimetype@^2.3.0:
version "2.3.0"
resolved "https://registry.yarnpkg.com/whatwg-mimetype/-/whatwg-mimetype-2.3.0.tgz#3d4b1e0312d2079879f826aff18dbeeca5960fbf"
Expand Down

0 comments on commit 1ca8c42

Please sign in to comment.