Skip to content

Commit

Permalink
chore: sslmode
Browse files Browse the repository at this point in the history
  • Loading branch information
itsjoeoui committed Apr 29, 2024
1 parent b24ab0a commit aa24583
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 6 deletions.
4 changes: 1 addition & 3 deletions apps/server/scripts/migrate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,7 @@ import { type DB } from "@cloud/shared";

async function migrate() {
const pool = new pg.Pool({
connectionString:
env.DATABASE_URL +
(process.env.NODE_ENV === "production" ? "?sslmode=require" : ""),
connectionString: env.DATABASE_URL,
});

const db = new Kysely<DB>({
Expand Down
3 changes: 1 addition & 2 deletions apps/server/src/db/kysely.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@ import { Pool, types } from "pg";
import { DB } from "@cloud/shared";

export const pool = new Pool({
connectionString:
env.DATABASE_URL + env.NODE_ENV === "production" ? "?sslmode=require" : "",
connectionString: env.DATABASE_URL,
});

// NOTE: Return bigint as number instead of string
Expand Down
2 changes: 1 addition & 1 deletion terraform/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ resource "azurerm_container_group" "flojoy-cloud-server-container-group" {

environment_variables = {
NODE_ENV = "production"
DATABASE_URL = "postgresql://${azurerm_postgresql_flexible_server.flojoy-cloud-postgres-server.administrator_login}:${azurerm_postgresql_flexible_server.flojoy-cloud-postgres-server.administrator_password}@${azurerm_postgresql_flexible_server.flojoy-cloud-postgres-server.name}.postgres.database.azure.com:5432/${azurerm_postgresql_flexible_server_database.flojoy-cloud-postgres-db.name}"
DATABASE_URL = "postgresql://${azurerm_postgresql_flexible_server.flojoy-cloud-postgres-server.administrator_login}:${azurerm_postgresql_flexible_server.flojoy-cloud-postgres-server.administrator_password}@${azurerm_postgresql_flexible_server.flojoy-cloud-postgres-server.name}.postgres.database.azure.com:5432/${azurerm_postgresql_flexible_server_database.flojoy-cloud-postgres-db.name}?sslmode=require"
WEB_URI = "${var.web-dns-name-label}.${var.location}.azurecontainer.io"
JWT_SECRET = var.jwt-secret

Expand Down

0 comments on commit aa24583

Please sign in to comment.