From 843cbe2380b887936369ca91b74836cf37c891ea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B6ren=20Michaels?= Date: Sun, 21 Jan 2024 12:45:36 +0100 Subject: [PATCH 1/2] feat: improve selfhosting --- .env.example | 22 ++++++++++----- Backend/src/helpers/api.ts | 2 ++ Frontend/Dockerfile | 2 +- .../src/lib/components/DonationPopup.svelte | 9 ------- Frontend/yarn.lock | 11 +++----- docker-compose.yml | 12 ++++----- nginx.conf | 27 +++++++++++++++++++ 7 files changed, 53 insertions(+), 32 deletions(-) create mode 100644 nginx.conf diff --git a/.env.example b/.env.example index b7bbf41..6a019a5 100644 --- a/.env.example +++ b/.env.example @@ -1,8 +1,16 @@ -# only necessary for setup with supabase +# twitch bot +# domain for the bot message +#domain=https://geobingo.io #name=TwitchUser3000____ -#VITE_DOMAIN=8000 -#domain=https://geobingo.io //domain for the bot message -#token=oauth:asdsdasldaksd123988jl12j3123g12 -#supabasekey=eyASdJKASdj // should have service role -#supabaseurl=https://asdsdasldaksd123988jl12j3123g12.supabase.co -#jwtpriv=sdalsjd-123hjla-asdjasd-asdlasdj-asd // jwt secret from supabase to validate tokens +#token=oauth:XXX +# user login and saving words +#supabasekey= // should have service role +#supabaseurl= +# jwt secret from supabase to validate tokens +#jwtpriv= +# needed for restricting countries +#bigdatacloudkey= +#VITE_GMAPSAPI= +# Make sure to use the anon key +#VITE_SUPABASE_KEY= +#VITE_SUPABASE_URL= diff --git a/Backend/src/helpers/api.ts b/Backend/src/helpers/api.ts index b8d2c30..4c667e2 100644 --- a/Backend/src/helpers/api.ts +++ b/Backend/src/helpers/api.ts @@ -27,6 +27,8 @@ export const addWordToDB = async (word: { word: string; tags: string[] }) => { const LANGUAGES = ["en", "nl", "es", "de", "fr", "pt", "pl", "id"] export const backUpDBAndTranslate = async (words: { word: { word: string | { [lng: string]: string } } }[]) => { + // FIXME: only translate with api key + return if (!supabaseProvided) return // console.log(words) const langWords = words.map(async word => { diff --git a/Frontend/Dockerfile b/Frontend/Dockerfile index 31ba72d..a519527 100644 --- a/Frontend/Dockerfile +++ b/Frontend/Dockerfile @@ -1,4 +1,4 @@ -FROM node:17.7.2-bullseye as builder +FROM node:20 as builder # Create app directory diff --git a/Frontend/src/lib/components/DonationPopup.svelte b/Frontend/src/lib/components/DonationPopup.svelte index 208ecf4..9327a27 100644 --- a/Frontend/src/lib/components/DonationPopup.svelte +++ b/Frontend/src/lib/components/DonationPopup.svelte @@ -15,15 +15,6 @@ title="soerenmichaels" />
-

Help me keep the site alive.

-

- Since the recent rise in users, I cannot justify paying for the Google - Maps API on my own anymore and I will have to put the site offline if - the usage keeps being this high. Please consider donating on Ko-fi.com/soerenmichaels.

Have fun playing,
Sören -

Date: Sun, 21 Jan 2024 13:43:01 +0100 Subject: [PATCH 2/2] feat: update readme --- README.md | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 9153184..420e083 100644 --- a/README.md +++ b/README.md @@ -13,10 +13,17 @@ an open source multiplayer street view bingo game my discord tag: **Sören#1141** **You want to contribute? See this [issue here](https://github.com/s0er3n/GeoBingo.io/issues/1)** +# Self hosting with docker-compose +1. Set the Environment Variables from .env.example (only VITE_GMAPSAPI is needed for the base game) -# ⚡ How to run it yourself -- install node 16.5 +2. run `docker-compose up --build` + +3. the game should be running on port 3000 + + +# ⚡ How to run it yourself for development +- install node 20 - clone repository