feat: made changes to worker and server packages to use global-agent to setup proxy from env variables

This commit is contained in:
Vinoth Kirubakaran 2022-04-20 16:00:03 +05:30
parent c53c350879
commit ad87bc2bcf
9 changed files with 230 additions and 5303 deletions

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -78,6 +78,7 @@
"@koa/router": "8.0.0", "@koa/router": "8.0.0",
"@sendgrid/mail": "7.1.1", "@sendgrid/mail": "7.1.1",
"@sentry/node": "^6.0.0", "@sentry/node": "^6.0.0",
"@types/global-agent": "^2.1.1",
"airtable": "0.10.1", "airtable": "0.10.1",
"arangojs": "7.2.0", "arangojs": "7.2.0",
"aws-sdk": "^2.767.0", "aws-sdk": "^2.767.0",
@ -91,6 +92,7 @@
"fix-path": "3.0.0", "fix-path": "3.0.0",
"form-data": "^4.0.0", "form-data": "^4.0.0",
"fs-extra": "8.1.0", "fs-extra": "8.1.0",
"global-agent": "^3.0.0",
"google-auth-library": "^7.11.0", "google-auth-library": "^7.11.0",
"google-spreadsheet": "^3.2.0", "google-spreadsheet": "^3.2.0",
"jimp": "0.16.1", "jimp": "0.16.1",

View File

@ -1,3 +1,4 @@
import { bootstrap } from "global-agent"
const fixPath = require("fix-path") const fixPath = require("fix-path")
const { checkDevelopmentEnvironment } = require("./utilities/fileSystem") const { checkDevelopmentEnvironment } = require("./utilities/fileSystem")
@ -6,6 +7,8 @@ function runServer() {
// will print an error explaining what to do // will print an error explaining what to do
checkDevelopmentEnvironment() checkDevelopmentEnvironment()
fixPath() fixPath()
// this will setup http and https proxies form env variables
bootstrap()
require("./app") require("./app")
} }

File diff suppressed because it is too large Load Diff

View File

@ -36,9 +36,11 @@
"@koa/router": "^8.0.0", "@koa/router": "^8.0.0",
"@sentry/node": "^6.0.0", "@sentry/node": "^6.0.0",
"@techpass/passport-openidconnect": "^0.3.0", "@techpass/passport-openidconnect": "^0.3.0",
"@types/global-agent": "^2.1.1",
"aws-sdk": "^2.811.0", "aws-sdk": "^2.811.0",
"bcryptjs": "^2.4.3", "bcryptjs": "^2.4.3",
"dotenv": "^8.2.0", "dotenv": "^8.2.0",
"global-agent": "^3.0.0",
"got": "^11.8.1", "got": "^11.8.1",
"joi": "^17.4.0", "joi": "^17.4.0",
"koa": "^2.7.0", "koa": "^2.7.0",

View File

@ -2,6 +2,7 @@
import { Scope } from "@sentry/node" import { Scope } from "@sentry/node"
import { Event } from "@sentry/types/dist/event" import { Event } from "@sentry/types/dist/event"
import Application from "koa" import Application from "koa"
import { bootstrap } from "global-agent"
const env = require("./environment") const env = require("./environment")
const CouchDB = require("./db") const CouchDB = require("./db")
@ -17,6 +18,9 @@ const api = require("./api")
const redis = require("./utilities/redis") const redis = require("./utilities/redis")
const Sentry = require("@sentry/node") const Sentry = require("@sentry/node")
// this will setup http and https proxies form env variables
bootstrap()
const app: Application = new Koa() const app: Application = new Koa()
app.keys = ["secret", "key"] app.keys = ["secret", "key"]

File diff suppressed because it is too large Load Diff