Skip to content

Commit c289ab0

Browse files
committed
Revert "🚑 Avoid core to crash when proxy fails"
**Problem** Since enabling Node proxying, we’ve encountered a Node.js bug that causes the application to crash when an HTTP request is made to an invalid discovery URL. See the Node.js PR: nodejs/node#60699 To work around this issue and preserve the previous behavior, we restored the `global-agent` library to prevent the application from crashing. **Proposal** Remove the usage of `global-agent`. **Prerequisites** * Use a patched version of Node.js once it becomes available. * Restore the previous environment variables in all environments (see: proconnect-gouv/infra-legacy#120).
1 parent d644547 commit c289ab0

5 files changed

Lines changed: 8 additions & 88 deletions

File tree

back/apps/core-fca-low/src/app.module.ts

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
import { bootstrap } from 'global-agent';
2-
31
import { DynamicModule, Module } from '@nestjs/common';
42
import { APP_FILTER } from '@nestjs/core';
53
import { CqrsModule } from '@nestjs/cqrs';
@@ -50,12 +48,6 @@ import {
5048

5149
@Module({})
5250
export class AppModule {
53-
onModuleInit() {
54-
// Temporary workaround to prevent the app from crashing when the proxy returns an error.
55-
// This should be removed after upgrading oidc-client to version >6.
56-
void bootstrap();
57-
}
58-
5951
static forRoot(configService: ConfigService): DynamicModule {
6052
return {
6153
module: AppModule,

back/package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,6 @@
5555
"ejs": "^3.1.10",
5656
"express": "^4.21.1",
5757
"express-session": "^1.18.2",
58-
"global-agent": "^3.0.0",
5958
"helmet": "^8.1.0",
6059
"ioredis": "^5.8.2",
6160
"jose-v2": "npm:jose@^2.0.5",

back/yarn.lock

Lines changed: 2 additions & 75 deletions
Original file line numberDiff line numberDiff line change
@@ -2197,11 +2197,6 @@ body-parser@^2.2.1:
21972197
raw-body "^3.0.1"
21982198
type-is "^2.0.1"
21992199

2200-
boolean@^3.0.1:
2201-
version "3.2.0"
2202-
resolved "https://registry.yarnpkg.com/boolean/-/boolean-3.2.0.tgz#9e5294af4e98314494cbb17979fa54ca159f116b"
2203-
integrity sha512-d0II/GO9uf9lfUHH2BQsjxzRJZBdsjgsBiW4BvhWk/3qoKwQFjIDVN19PfX8F2D/r9PCMTtLWjYVCFrpeYUzsw==
2204-
22052200
brace-expansion@^1.1.7:
22062201
version "1.1.11"
22072202
resolved "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz"
@@ -2860,11 +2855,6 @@ detect-newline@^3.0.0:
28602855
resolved "https://registry.npmjs.org/detect-newline/-/detect-newline-3.1.0.tgz"
28612856
integrity sha512-TLz+x/vEXm/Y7P7wn1EJFNLxYpUD4TgMosxY6fAVJUnJMbupHBOncxyWUG9OpTaH9EBD7uFI5LfEgmMOc54DsA==
28622857

2863-
detect-node@^2.0.4:
2864-
version "2.1.0"
2865-
resolved "https://registry.yarnpkg.com/detect-node/-/detect-node-2.1.0.tgz#c9c70775a49c3d03bc2c06d9a73be550f978f8b1"
2866-
integrity sha512-T0NIuQpnTvFDATNuHN5roPwSBG83rFsuO+MXXH9/3N1eFbn4wcPjttvjMLEPWJ0RGUYgQE7cGgS3tNxbqCGM7g==
2867-
28682858
diff-sequences@^29.6.3:
28692859
version "29.6.3"
28702860
resolved "https://registry.npmjs.org/diff-sequences/-/diff-sequences-29.6.3.tgz"
@@ -3079,11 +3069,6 @@ es-to-primitive@^1.3.0:
30793069
is-date-object "^1.0.5"
30803070
is-symbol "^1.0.4"
30813071

3082-
es6-error@^4.1.1:
3083-
version "4.1.1"
3084-
resolved "https://registry.yarnpkg.com/es6-error/-/es6-error-4.1.1.tgz#9e3af407459deed47e9a91f9b885a84eb05c561d"
3085-
integrity sha512-Um/+FxMr9CISWh0bi5Zv0iOD+4cFh5qLeks1qhAopKVAJw3drgKbKySikp7wGhDL0HPeaja0P5ULZrxLkniUVg==
3086-
30873072
escalade@^3.1.1, escalade@^3.2.0:
30883073
version "3.2.0"
30893074
resolved "https://registry.npmjs.org/escalade/-/escalade-3.2.0.tgz"
@@ -3758,18 +3743,6 @@ glob@^7.1.3, glob@^7.1.4:
37583743
once "^1.3.0"
37593744
path-is-absolute "^1.0.0"
37603745

3761-
global-agent@^3.0.0:
3762-
version "3.0.0"
3763-
resolved "https://registry.yarnpkg.com/global-agent/-/global-agent-3.0.0.tgz#ae7cd31bd3583b93c5a16437a1afe27cc33a1ab6"
3764-
integrity sha512-PT6XReJ+D07JvGoxQMkT6qji/jVNfX/h364XHZOWeRzy64sSFr+xJ5OX7LI3b4MPQzdL4H8Y8M0xzPpsVMwA8Q==
3765-
dependencies:
3766-
boolean "^3.0.1"
3767-
es6-error "^4.1.1"
3768-
matcher "^3.0.0"
3769-
roarr "^2.15.3"
3770-
semver "^7.3.2"
3771-
serialize-error "^7.0.1"
3772-
37733746
globals@^11.1.0:
37743747
version "11.12.0"
37753748
resolved "https://registry.npmjs.org/globals/-/globals-11.12.0.tgz"
@@ -3782,7 +3755,7 @@ globals@^13.19.0:
37823755
dependencies:
37833756
type-fest "^0.20.2"
37843757

3785-
globalthis@^1.0.1, globalthis@^1.0.4:
3758+
globalthis@^1.0.4:
37863759
version "1.0.4"
37873760
resolved "https://registry.npmjs.org/globalthis/-/globalthis-1.0.4.tgz"
37883761
integrity sha512-DpLKbNU4WylpxJykQujfCcwYWiV/Jhm50Goo0wrVILAv5jOr9d+H+UR3PhSCD2rCCEIg0uc+G+muBTwD54JhDQ==
@@ -4896,11 +4869,6 @@ json-stable-stringify-without-jsonify@^1.0.1:
48964869
resolved "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz"
48974870
integrity sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw==
48984871

4899-
json-stringify-safe@^5.0.1:
4900-
version "5.0.1"
4901-
resolved "https://registry.yarnpkg.com/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz#1296a2d58fd45f19a0f6ce01d65701e2c735b6eb"
4902-
integrity sha512-ZClg6AaYvamvYEE82d3Iyd3vSSIjQ+odgjaTzRuO3s7toCdFKczob2i0zCh7JE8kWn17yvAWhUVxvqGwUalsRA==
4903-
49044872
json5@^1.0.2:
49054873
version "1.0.2"
49064874
resolved "https://registry.yarnpkg.com/json5/-/json5-1.0.2.tgz#63d98d60f21b313b77c4d6da18bfa69d80e1d593"
@@ -5195,13 +5163,6 @@ makeerror@1.0.12:
51955163
dependencies:
51965164
tmpl "1.0.5"
51975165

5198-
matcher@^3.0.0:
5199-
version "3.0.0"
5200-
resolved "https://registry.yarnpkg.com/matcher/-/matcher-3.0.0.tgz#bd9060f4c5b70aa8041ccc6f80368760994f30ca"
5201-
integrity sha512-OkeDaAZ/bQCxeFAozM55PKcKU0yJMPGifLwV4Qgjitu+5MoAfSQN4lsLJeXZ1b8w0x+/Emda6MZgXS1jvsapng==
5202-
dependencies:
5203-
escape-string-regexp "^4.0.0"
5204-
52055166
math-intrinsics@^1.1.0:
52065167
version "1.1.0"
52075168
resolved "https://registry.yarnpkg.com/math-intrinsics/-/math-intrinsics-1.1.0.tgz#a0dd74be81e2aa5c2f27e65ce283605ee4e2b7f9"
@@ -6377,18 +6338,6 @@ rimraf@^3.0.2:
63776338
dependencies:
63786339
glob "^7.1.3"
63796340

6380-
roarr@^2.15.3:
6381-
version "2.15.4"
6382-
resolved "https://registry.yarnpkg.com/roarr/-/roarr-2.15.4.tgz#f5fe795b7b838ccfe35dc608e0282b9eba2e7afd"
6383-
integrity sha512-CHhPh+UNHD2GTXNYhPWLnU8ONHdI+5DI+4EYIAOaiD63rHeYlZvyh8P+in5999TTSFgUYuKUAjzRI4mdh/p+2A==
6384-
dependencies:
6385-
boolean "^3.0.1"
6386-
detect-node "^2.0.4"
6387-
globalthis "^1.0.1"
6388-
json-stringify-safe "^5.0.1"
6389-
semver-compare "^1.0.0"
6390-
sprintf-js "^1.1.2"
6391-
63926341
run-parallel@^1.1.9:
63936342
version "1.2.0"
63946343
resolved "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz"
@@ -6472,17 +6421,12 @@ schema-utils@^4.3.0:
64726421
ajv-formats "^2.1.1"
64736422
ajv-keywords "^5.1.0"
64746423

6475-
semver-compare@^1.0.0:
6476-
version "1.0.0"
6477-
resolved "https://registry.yarnpkg.com/semver-compare/-/semver-compare-1.0.0.tgz#0dee216a1c941ab37e9efb1788f6afc5ff5537fc"
6478-
integrity sha512-YM3/ITh2MJ5MtzaM429anh+x2jiLVjqILF4m4oyQB18W7Ggea7BfqdH/wGMK7dDiMghv/6WG7znWMwUDzJiXow==
6479-
64806424
semver@^6.0.0, semver@^6.3.0, semver@^6.3.1:
64816425
version "6.3.1"
64826426
resolved "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz"
64836427
integrity sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==
64846428

6485-
semver@^7.3.2, semver@^7.3.4, semver@^7.3.5, semver@^7.5.3, semver@^7.5.4, semver@^7.6.0, semver@^7.7.3:
6429+
semver@^7.3.4, semver@^7.3.5, semver@^7.5.3, semver@^7.5.4, semver@^7.6.0, semver@^7.7.3:
64866430
version "7.7.3"
64876431
resolved "https://registry.yarnpkg.com/semver/-/semver-7.7.3.tgz#4b5f4143d007633a8dc671cd0a6ef9147b8bb946"
64886432
integrity sha512-SdsKMrI9TdgjdweUSR9MweHA4EJ8YxHn8DFaDisvhVlUOe4BF1tLD7GAj0lIqWVl+dPb/rExr0Btby5loQm20Q==
@@ -6506,13 +6450,6 @@ send@0.19.0:
65066450
range-parser "~1.2.1"
65076451
statuses "2.0.1"
65086452

6509-
serialize-error@^7.0.1:
6510-
version "7.0.1"
6511-
resolved "https://registry.yarnpkg.com/serialize-error/-/serialize-error-7.0.1.tgz#f1360b0447f61ffb483ec4157c737fab7d778e18"
6512-
integrity sha512-8I8TjW5KMOKsZQTvoxjuSIa7foAwPWGOts+6o7sgjz41/qMD9VQHEDxi6PBvK2l0MXUmqZyNpUK+T2tQaaElvw==
6513-
dependencies:
6514-
type-fest "^0.13.1"
6515-
65166453
serialize-javascript@^6.0.2:
65176454
version "6.0.2"
65186455
resolved "https://registry.yarnpkg.com/serialize-javascript/-/serialize-javascript-6.0.2.tgz#defa1e055c83bf6d59ea805d8da862254eb6a6c2"
@@ -6698,11 +6635,6 @@ split2@^4.0.0, split2@^4.1.0:
66986635
resolved "https://registry.npmjs.org/split2/-/split2-4.2.0.tgz"
66996636
integrity sha512-UcjcJOWknrNkF6PLX83qcHM6KHgVKNkV62Y8a5uYDVv9ydGQVwAHMKqHdJje1VTWpljG0WYpCDhrCdAOYH4TWg==
67006637

6701-
sprintf-js@^1.1.2:
6702-
version "1.1.3"
6703-
resolved "https://registry.yarnpkg.com/sprintf-js/-/sprintf-js-1.1.3.tgz#4914b903a2f8b685d17fdf78a70e917e872e444a"
6704-
integrity sha512-Oo+0REFV59/rz3gfJNKQiBlwfHaSESl1pcGyABQsnnIfWOFt6JNj5gCog2U6MLZ//IGYD+nA8nI+mTShREReaA==
6705-
67066638
sprintf-js@~1.0.2:
67076639
version "1.0.3"
67086640
resolved "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz"
@@ -7129,11 +7061,6 @@ type-detect@4.0.8:
71297061
resolved "https://registry.npmjs.org/type-detect/-/type-detect-4.0.8.tgz"
71307062
integrity sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g==
71317063

7132-
type-fest@^0.13.1:
7133-
version "0.13.1"
7134-
resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.13.1.tgz#0172cb5bce80b0bd542ea348db50c7e21834d934"
7135-
integrity sha512-34R7HTnG0XIJcBSn5XhDd7nNFPRcXYRZrBB2O2jdKqYODldSzBAqzsWoZYYvduky73toYS/ESqxPvkDf/F0XMg==
7136-
71377064
type-fest@^0.20.2:
71387065
version "0.20.2"
71397066
resolved "https://registry.npmjs.org/type-fest/-/type-fest-0.20.2.tgz"

docker/compose/fca-low/.env/core-rie.env

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,5 +77,6 @@ MAILER_FROM_NAME=NE PAS RÉPONDRE
7777
BLUEBIRD_LONG_STACK_TRACES=0
7878
BLUEBIRD_DEBUG=0
7979
## Proxy settings
80-
GLOBAL_AGENT_HTTP_PROXY=http://squid:3128
81-
GLOBAL_AGENT_HTTPS_PROXY=http://squid:3128
80+
NODE_USE_ENV_PROXY=1
81+
HTTP_PROXY=http://squid:3128
82+
HTTPS_PROXY=http://squid:3128

docker/compose/fca-low/.env/core.env

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,5 +77,6 @@ MAILER_FROM_NAME=NE PAS RÉPONDRE
7777
BLUEBIRD_LONG_STACK_TRACES=0
7878
BLUEBIRD_DEBUG=0
7979
## Proxy settings
80-
GLOBAL_AGENT_HTTP_PROXY=http://squid:3128
81-
GLOBAL_AGENT_HTTPS_PROXY=http://squid:3128
80+
NODE_USE_ENV_PROXY=1
81+
HTTP_PROXY=http://squid:3128
82+
HTTPS_PROXY=http://squid:3128

0 commit comments

Comments
 (0)