diff --git a/frontend/src/routes/docs/self-host.svelte b/frontend/src/routes/docs/self-host.svelte index bdd521f..ade1d99 100644 --- a/frontend/src/routes/docs/self-host.svelte +++ b/frontend/src/routes/docs/self-host.svelte @@ -45,6 +45,12 @@

Optional

Installation

@@ -53,22 +59,19 @@
git clone https://github.com/mawoka-myblock/classquiz && cd ClassQuiz
-

- Now, set a VALID Redis-URI in frontend/Dockerfile and, if you want Sentry, - set a valid Sentry-DSN. -

-

- You must set a valid hCaptcha-Sitekey in the frontend/Dockerfile. -

-

- You'll also have to provide a valid VITE_MAPBOX_ACCESS_TOKEN in - frontend/Dockerfile, if you don't run ClassQuiz under one of the following - domains: -

+

Now, you'll configure your frontend. You'll have to change the following:

Configuration

@@ -97,6 +100,37 @@ Before you can start your stack, you have to set some environment-variables in your docker-compose.yml.

+

GitHub/Google-Auth

+

+ This step is purely optional, but it will enable users to log in using their + Google/GitHub-accounts. +

+

Google

+

+ First, go to console.cloud.google.com/apis/dashboard and create a new project and select it. Then, go to the "OAuth consent screen" and set it up. + Next, go to the "Credentials"-tab and click on "Create Credentials" and create a new "OAuth Client + ID". This ID should be from the application-type "Web application". Afterwards, add a new "Authorised + JavaScript origin", which is just the base-domain (with https) of your ClassQuiz-installation. + Then, add a new "Authorised redirect URI". This URI will have the following scheme: +

+
https://[BASE_URL]/api/v1/users/oauth/google/auth
+

You're done! Not the client-secret and the client-id down, you'll need it later.

+ +

GitHub

+

+ First, go to github.com/settings/developers and create a "new OAuth App". The "Authorization callback URL" has the following schema: +

+
https://[BASE_URL]/api/v1/users/oauth/github/auth
+

+ That's it. Click on "Register application" and generate a new client secret and save it for + later, together with your client-id. +

+ +

Docker-Compose File

version: "3"
 
@@ -110,8 +144,8 @@ services:
       - redis
       - api
     environment:
-	  REDIS_URL: redis://redis:6379/0?decode_responses=True # For runtime
-      API_URL: http://api:80 # For runtime
+	  REDIS_URL: redis://redis:6379/0?decode_responses=True # don't change
+      API_URL: http://api:80 # don't change
   api:
     build:
       context: .
@@ -122,19 +156,19 @@ services:
       - redis
 
     environment:
-      ROOT_ADDRESS: "https://classquiz.mawoka.eu" # Base-URL
-      DB_URL: "postgresql://postgres:classquiz@db:5432/classquiz"
-      MAIL_ADDRESS: "classquiz@mawoka.eu" # Email-Address
-      MAIL_PASSWORD: "MAIL_PASSWORD" # Email-Password
-      MAIL_USERNAME: "classquiz@mawoka.eu" # Email-Username
-      MAIL_SERVER: "smtp.gmail.com" # SMTP-Server
+      ROOT_ADDRESS: "https://classquiz.mawoka.eu" # Base-URL (change it)
+      DB_URL: "postgresql://postgres:classquiz@db:5432/classquiz" # don't change
+      MAIL_ADDRESS: "classquiz@mawoka.eu" # Email-Address (change it)
+      MAIL_PASSWORD: "MAIL_PASSWORD" # Email-Password (change it)
+      MAIL_USERNAME: "classquiz@mawoka.eu" # Email-Username (change it)
+      MAIL_SERVER: "smtp.gmail.com" # SMTP-Server (change it)
+	  MAIL_PORT: "587" # SMTP-Port
       MAX_WORKERS: "1" # Very important and don't change it!
-      MAIL_PORT: "587" # SMTP-Port
-      REDIS: "redis://redis:6379/0?decode_responses=True" # decode_response is important!
+      REDIS: "redis://redis:6379/0?decode_responses=True" # don't change
       SECRET_KEY: "TOP_SECRET" # openssl rand -hex 32
-	  MEILISEARCH_URL: "http://meilisearch:7700"
-      ACCESS_TOKEN_EXPIRE_MINUTES: 30
-      HCAPTCHA_KEY: "" # Private hCaptcha key for verification
+	  MEILISEARCH_URL: "http://meilisearch:7700" # don't change
+      ACCESS_TOKEN_EXPIRE_MINUTES: 30 # don't change
+      HCAPTCHA_KEY: "" # Private hCaptcha key for verification (change it)
 	  STORAGE_BACKEND: "deta" # MUST BE EITHER "deta" OR "local"
 
 	  # If STORAGE_BACKEND is "deta"
@@ -143,6 +177,16 @@ services:
 
 	  # If STORAGE_BACKEND is "local"
 	  STORAGE_PATH: "/var/storage"
+
+	  # GOOGLE_AUTH
+      GOOGLE_CLIENT_ID: # Your Google-Client ID, or leave it unset if you don't want it.
+      GOOGLE_CLIENT_SECRET: # Your Google-Client Secret, or leave it unset if you don't want it.
+
+	  # GITHUB_AUTH
+	  GITHUB_CLIENT_ID: # Your GitHub-Client ID, or leave it unset if you don't want it.
+      GITHUB_CLIENT_SECRET: # Your GitHub-Client Secret, or leave it unset if you don't want it.
+
+
   redis:
     image: redis:alpine
     restart: always