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", {