diff --git a/src/app/config/config.ts b/src/app/config/config.ts index 524f95ad72..f242b94ec4 100644 --- a/src/app/config/config.ts +++ b/src/app/config/config.ts @@ -97,10 +97,16 @@ const s3 = new aws.S3({ // using aws-sdk v3 (FRM-993) const virusScannerLambda = new Lambda({ region: basicVars.awsConfig.region, - // Endpoint is set for development mode to point to the separate docker container running the lambda function. + // For dev mode or where specified, endpoint is set to point to the separate docker container running the lambda function. // host.docker.internal is a special DNS name which resolves to the internal IP address used by the host. // Reference: https://docs.docker.com/desktop/networking/#i-want-to-connect-from-a-container-to-a-service-on-the-host - ...(isDev ? { endpoint: 'http://host.docker.internal:9999' } : undefined), + ...(isDev || basicVars.awsConfig.virusScannerLambdaEndpoint + ? { + endpoint: + basicVars.awsConfig.virusScannerLambdaEndpoint || + 'http://host.docker.internal:9999', + } + : undefined), }) const awsConfig: AwsConfig = { diff --git a/src/app/config/schema.ts b/src/app/config/schema.ts index e17f25d980..ee6361f134 100644 --- a/src/app/config/schema.ts +++ b/src/app/config/schema.ts @@ -297,6 +297,12 @@ export const optionalVarsSchema: Schema = { default: '', env: 'VIRUS_SCANNER_LAMBDA_FUNCTION_NAME', }, + virusScannerLambdaEndpoint: { + doc: 'Endpoint address for virus scanner lambda function. Specify this if the lambda is hosted neither on AWS nor your local dev environment.', + format: String, + default: '', + env: 'VIRUS_SCANNER_LAMBDA_ENDPOINT', + }, }, core: { port: { diff --git a/src/types/config.ts b/src/types/config.ts index 0c85b6d056..e76271230b 100644 --- a/src/types/config.ts +++ b/src/types/config.ts @@ -168,6 +168,7 @@ export interface IOptionalVarsSchema { region: string customCloudWatchGroup: string virusScannerLambdaFunctionName: string + virusScannerLambdaEndpoint: string } mail: { from: string