diff --git a/server/src/config/config.schema.ts b/server/src/config/config.schema.ts index 181a84d5..82d964d2 100644 --- a/server/src/config/config.schema.ts +++ b/server/src/config/config.schema.ts @@ -25,6 +25,7 @@ export const configSchema = object({ name: string(), host: string(), port: number(), + ssl: boolean(), }), }); diff --git a/server/src/config/config.ts b/server/src/config/config.ts index fc316f89..539b10e4 100644 --- a/server/src/config/config.ts +++ b/server/src/config/config.ts @@ -18,6 +18,7 @@ const { DATABASE_NAME, DATABASE_HOST, DATABASE_PORT, + DATABASE_SSL_MODE, } = process.env; const config = { @@ -46,6 +47,7 @@ const config = { name: DATABASE_NAME, host: DATABASE_HOST, port: Number(DATABASE_PORT), + ssl: DATABASE_SSL_MODE === "true", }, }; diff --git a/server/src/database/migration-config.ts b/server/src/database/migration-config.ts index a75de319..623f966c 100644 --- a/server/src/database/migration-config.ts +++ b/server/src/database/migration-config.ts @@ -7,6 +7,7 @@ export default new DataSource({ username: process.env.DATABASE_USERNAME || "postgres", password: process.env.DATABASE_PASSWORD || "postgres", database: process.env.DATABASE_NAME || "keijo_dev", + ssl: process.env.DATABASE_SSL_MODE === "true", /** * Glob pattern is used to make this work both locally and in CI as it appears that * using no wildcards resolves to different paths between the two. This is arguably