From 121ceae8b54077a353415102744ad82097774ad9 Mon Sep 17 00:00:00 2001 From: Joey Yu Date: Mon, 29 Apr 2024 17:01:46 -0400 Subject: [PATCH] chore: ssl --- apps/server/src/db/kysely.ts | 3 ++- terraform/main.tf | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/apps/server/src/db/kysely.ts b/apps/server/src/db/kysely.ts index 1c31187b3..da7dc0906 100644 --- a/apps/server/src/db/kysely.ts +++ b/apps/server/src/db/kysely.ts @@ -5,7 +5,8 @@ import { Pool, types } from "pg"; import { DB } from "@cloud/shared"; export const pool = new Pool({ - connectionString: env.DATABASE_URL, + connectionString: + env.DATABASE_URL + env.NODE_ENV === "production" ? "?sslmode=require" : "", }); // NOTE: Return bigint as number instead of string diff --git a/terraform/main.tf b/terraform/main.tf index 7bcf43ff8..b4cc3bb43 100644 --- a/terraform/main.tf +++ b/terraform/main.tf @@ -126,7 +126,7 @@ resource "azurerm_storage_share" "caddy-storage-share" { } resource "azurerm_postgresql_flexible_server" "flojoy-cloud-postgres-server" { - name = "flojoy-cloud-postgres-server" + name = "flojoy-cloud-postgres-flexible-server" resource_group_name = azurerm_resource_group.flojoy-cloud-rg.name location = azurerm_resource_group.flojoy-cloud-rg.location version = 12 @@ -148,7 +148,7 @@ resource "azurerm_postgresql_flexible_server_configuration" "flojoy-cloud-postgr } resource "azurerm_postgresql_flexible_server_database" "flojoy-cloud-postgres-db" { - name = "flojoy-cloud-postgres-db" + name = "flojoy-cloud-postgres-flexible-db" server_id = azurerm_postgresql_flexible_server.flojoy-cloud-postgres-server.id charset = "utf8" collation = "en_US.utf8"