diff --git a/.env.example b/.env.example index 8f5d482..e95b3e1 100644 --- a/.env.example +++ b/.env.example @@ -1 +1,8 @@ -AUTH_SECRET=myauthsecret # generate with https://generate-secret.vercel.app/32 or openssl rand -hex 32 on unix-like \ No newline at end of file +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 +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 diff --git a/.gitignore b/.gitignore index ccbc0b9..dc61a8d 100644 --- a/.gitignore +++ b/.gitignore @@ -6,5 +6,4 @@ node_modules .env .env.* !.env.example -config/config.yml package-lock.json \ No newline at end of file diff --git a/compose.yml b/compose.yml index 44921b2..b385bac 100644 --- a/compose.yml +++ b/compose.yml @@ -6,8 +6,6 @@ services: build: context: . dockerfile: Dockerfile - environment: - AUTH_SECRET: ${AUTH_SECRET} ports: - 1337:4173 volumes: diff --git a/config/config.example.yml b/config/config.example.yml deleted file mode 100644 index e861780..0000000 --- a/config/config.example.yml +++ /dev/null @@ -1,12 +0,0 @@ -db: - url: "postgres://user:password@host:5432/database" - -app: - auth: - clientId: "authentik-client-id" - clientSecret: "authentik-client-secret" - issuer: "https://yourdomain.com/application/o/app-name/" - hcaptcha: - secret: "your-hcaptcha-secret" - sitekey: "your-hcaptcha-sitekey" - webhook: "your-discord-webhook-url" \ No newline at end of file diff --git a/src/hooks.server.ts b/src/hooks.server.ts index c854589..ef25271 100644 --- a/src/hooks.server.ts +++ b/src/hooks.server.ts @@ -1,14 +1,14 @@ import { SvelteKitAuth } from "@auth/sveltekit" import Authentik from '@auth/core/providers/authentik'; -import config from "$lib/config"; +import { env } from "$env/dynamic/private"; export const handle = SvelteKitAuth({ providers: [ //@ts-ignore Authentik({ - clientId: config.app.auth.clientId, - clientSecret: config.app.auth.clientSecret, - issuer: config.app.auth.issuer + clientId: env.AUTH_CLIENT_ID, + clientSecret: env.AUTH_CLIENT_SECRET, + issuer: env.AUTH_ISSUER }) ] }) \ No newline at end of file diff --git a/src/lib/Form/Captcha.svelte b/src/lib/Form/Captcha.svelte index be10897..e2ea033 100644 --- a/src/lib/Form/Captcha.svelte +++ b/src/lib/Form/Captcha.svelte @@ -1,13 +1,14 @@ - diff --git a/src/lib/Nav.svelte b/src/lib/Nav.svelte index d294dfc..a0b1e60 100644 --- a/src/lib/Nav.svelte +++ b/src/lib/Nav.svelte @@ -56,7 +56,7 @@