diff --git a/docker-compose.yml b/docker-compose.yml index 2f5ee36..04e8cd2 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -5,6 +5,8 @@ services: - "3000:3000" environment: - DATABASE_URL=postgres://adventurelog:PO24VjITwGgk@db:5432/adventurelog + # ORIGIN is only necessary when not using a reverse proxy or hosting that includes https + - ORIGIN=http://localhost:3000 depends_on: - db db: diff --git a/startup.sh b/startup.sh index 1801a18..07e73f8 100644 --- a/startup.sh +++ b/startup.sh @@ -23,5 +23,6 @@ npm run generate # Run database migration npm run migrate +echo "The orgin to be set is: $ORIGIN" # Start the application -node build/index.js +ORIGIN=$ORIGIN node build diff --git a/svelte.config.js b/svelte.config.js index c2bb7a1..fe1cd45 100644 --- a/svelte.config.js +++ b/svelte.config.js @@ -14,6 +14,7 @@ const config = { preprocess: vitePreprocess(), kit: { adapter: adapter(), + csrf: { checkOrigin: true, } }, };