From f1ce28cd8f9425a9b079ba683d33e3c7c670a74d Mon Sep 17 00:00:00 2001 From: Tom Moor Date: Mon, 23 May 2022 13:11:52 +0100 Subject: [PATCH] fix: Allow underscores in Postgres and Redis hostnames for docker support closes #3574 --- server/env.ts | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/server/env.ts b/server/env.ts index ad5a5b416..940ec5fe4 100644 --- a/server/env.ts +++ b/server/env.ts @@ -63,14 +63,22 @@ export class Environment { * The url of the database. */ @IsNotEmpty() - @IsUrl({ require_tld: false, protocols: ["postgres"] }) + @IsUrl({ + require_tld: false, + allow_underscores: true, + protocols: ["postgres"], + }) public DATABASE_URL = `${process.env.DATABASE_URL}`; /** * The url of the database pool. */ @IsOptional() - @IsUrl({ require_tld: false, protocols: ["postgres"] }) + @IsUrl({ + require_tld: false, + allow_underscores: true, + protocols: ["postgres"], + }) public DATABASE_CONNECTION_POOL_URL = `${process.env.DATABASE_CONNECTION_POOL_URL}`; /** @@ -106,7 +114,11 @@ export class Environment { */ @IsOptional() @IsNotEmpty() - @IsUrl({ require_tld: false, protocols: ["redis", "rediss", "ioredis"] }) + @IsUrl({ + require_tld: false, + allow_underscores: true, + protocols: ["redis", "rediss", "ioredis"], + }) public REDIS_URL = process.env.REDIS_URL; /**