From 481fc2bc3fc7535e2c12821ee6708b2fae52c7a2 Mon Sep 17 00:00:00 2001 From: Akis Date: Sat, 31 Dec 2022 15:18:41 +0200 Subject: [PATCH] i hope this works --- .env.example | 7 +++++-- src/lib/db.ts | 9 +++++++-- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/.env.example b/.env.example index e95b3e1..a509dc6 100644 --- a/.env.example +++ b/.env.example @@ -1,8 +1,11 @@ AUTH_SECRET=myauthsecret # generate with https://generate-secret.vercel.app/32 or openssl rand -hex 32 on unix-like -DB_URL=postgres://user:pass@localhost:5432/website +DB_HOST=localhost +DB_PORT=5432 +DB_USERNAME=postgres +DB_PASSWORD=your-db-password AUTH_CLIENT_ID=your-authentik-client-id AUTH_CLIENT_SECRET=your-authentik-client-secret AUTH_ISSUER=https://authentik-domain/application/o/app-name/ HCAPTCHA_SECRET=your-hcaptcha-secret HCAPTCHA_SITEKEY=your-hcaptcha-sitekey -WEBHOOK=your-discord-webhook +WEBHOOK=your-discord-webhook \ No newline at end of file diff --git a/src/lib/db.ts b/src/lib/db.ts index 692ae9b..1d67bd0 100644 --- a/src/lib/db.ts +++ b/src/lib/db.ts @@ -2,8 +2,13 @@ import { Sequelize, DataTypes } from "sequelize"; import consola from "consola"; import { env } from "$env/dynamic/private"; -const sequelize = new Sequelize(env.DB_URL, { - dialect: "postgres" +const sequelize = new Sequelize({ + database: "website", + password: String(env.DB_PASSWORD), + port: Number(env.DB_PORT), + host: String(env.DB_HOST), + dialect: "postgres", + username: String(env.DB_USERNAME), }); sequelize.define("Announcements", {