✨ Added pre-commit
This commit is contained in:
+1
-1
@@ -41,4 +41,4 @@ COPY --from=builder /usr/src/app/node_modules ./node_modules
|
||||
EXPOSE 3000
|
||||
|
||||
# the command that starts our app
|
||||
CMD ["pnpm", "run", "run:prod"]
|
||||
CMD ["pnpm", "run", "run:prod"]
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<script lang='ts'>
|
||||
<script lang="ts">
|
||||
import { onMount } from 'svelte';
|
||||
import '$lib/hljs.css';
|
||||
|
||||
@@ -11,12 +11,12 @@
|
||||
<svelte:head>
|
||||
<title>ClassQuiz/docs - Self-Host</title>
|
||||
<meta
|
||||
name='description'
|
||||
content='How to self-host ClassQuiz, the open-source quiz-application'
|
||||
name="description"
|
||||
content="How to self-host ClassQuiz, the open-source quiz-application"
|
||||
/>
|
||||
</svelte:head>
|
||||
<article
|
||||
class='prose prose-sm sm:prose lg:prose-lg xl:prose-xl mx-auto mt-10 prose-slate px-4 dark:prose-invert'
|
||||
class="prose prose-sm sm:prose lg:prose-lg xl:prose-xl mx-auto mt-10 prose-slate px-4 dark:prose-invert"
|
||||
>
|
||||
<h1>Self-Hosting</h1>
|
||||
<p>Since ClassQuiz is open-source, it can also be self-hosted.</p>
|
||||
@@ -30,35 +30,35 @@
|
||||
<h2>Requirements</h2>
|
||||
<h3>Software</h3>
|
||||
<ul>
|
||||
<li><a href='https://docker.com'>Docker</a></li>
|
||||
<li><a href='https://git-scm.com/'>Git</a></li>
|
||||
<li><a href="https://docker.com">Docker</a></li>
|
||||
<li><a href="https://git-scm.com/">Git</a></li>
|
||||
<li>
|
||||
A <a href='https://redis.com'>Redis</a>-Server
|
||||
A <a href="https://redis.com">Redis</a>-Server
|
||||
</li>
|
||||
</ul>
|
||||
<h3>3rd-Parties</h3>
|
||||
<h4>Required</h4>
|
||||
<ul>
|
||||
<li><a href='https://hcaptcha.com'>hCaptcha (Captcha)</a></li>
|
||||
<li><a href='https://www.mapbox.com/'>Mapbox (Maps)</a></li>
|
||||
<li><a href="https://hcaptcha.com">hCaptcha (Captcha)</a></li>
|
||||
<li><a href="https://www.mapbox.com/">Mapbox (Maps)</a></li>
|
||||
</ul>
|
||||
<h4>Optional</h4>
|
||||
<ul>
|
||||
<li><a href='https://sentry.io'>Sentry (Error-Logging)</a></li>
|
||||
<li><a href="https://sentry.io">Sentry (Error-Logging)</a></li>
|
||||
</ul>
|
||||
|
||||
<h2>Installation</h2>
|
||||
<p>At first, clone the repo:</p>
|
||||
|
||||
<pre><code class='language-bash'
|
||||
>git clone https://github.com/mawoka-myblock/classquiz && cd ClassQuiz</code
|
||||
></pre>
|
||||
<pre><code class="language-bash"
|
||||
>git clone https://github.com/mawoka-myblock/classquiz && cd ClassQuiz</code
|
||||
></pre>
|
||||
<p>
|
||||
Now, set a <b>VALID</b> Redis-URI in <code>frontend/Dockerfile</code> and, if you want Sentry,
|
||||
set a valid Sentry-DSN. Note: The problem is that the frontend-container tries to connect to Redis during the
|
||||
build-process. For that, you'll need to provide an available Redis-Instance. For that, I would recommend
|
||||
Upstash, because you get a free Redis-Instance which is available over the internet. This instance won't be used
|
||||
at runtime.
|
||||
set a valid Sentry-DSN. Note: The problem is that the frontend-container tries to connect to
|
||||
Redis during the build-process. For that, you'll need to provide an available Redis-Instance.
|
||||
For that, I would recommend Upstash, because you get a free Redis-Instance which is available
|
||||
over the internet. This instance won't be used at runtime.
|
||||
</p>
|
||||
<p>
|
||||
You must set a valid hCaptcha-Sitekey in the <code>frontend/Dockerfile</code>.
|
||||
@@ -77,11 +77,10 @@
|
||||
<h3>Storage Provider</h3>
|
||||
<p>
|
||||
You'll have to set up a storage provider for some pictures (these getting imported from
|
||||
KAHOOT!). For now, you can use <a href='https://deta.sh'>Deta</a> or the local filesystem.
|
||||
Please note that I would <b>NOT</b> use the local file system because of <a
|
||||
href='https://wiki.owasp.org/index.php/Path_Traversal'>Path Traversals</a>. I tried to prevent these attacks,
|
||||
but I really wouldn't trust it. You'll have
|
||||
to set the
|
||||
KAHOOT!). For now, you can use <a href="https://deta.sh">Deta</a> or the local filesystem.
|
||||
Please note that I would <b>NOT</b> use the local file system because of
|
||||
<a href="https://wiki.owasp.org/index.php/Path_Traversal">Path Traversals</a>. I tried to
|
||||
prevent these attacks, but I really wouldn't trust it. You'll have to set the
|
||||
<code>STORAGE_BACKEND</code>-environment-variable to either <code>deta</code> or
|
||||
<code>local</code>.
|
||||
</p>
|
||||
@@ -99,8 +98,8 @@
|
||||
Before you can start your stack, you have to set some environment-variables in your
|
||||
<code>docker-compose.yml</code>.
|
||||
</p>
|
||||
<pre><code class='language-yaml'
|
||||
>version: "3"
|
||||
<pre><code class="language-yaml"
|
||||
>version: "3"
|
||||
|
||||
services:
|
||||
frontend:
|
||||
@@ -184,7 +183,10 @@ volumes:
|
||||
data:
|
||||
meilisearch-data:
|
||||
</code></pre>
|
||||
<p>Run the following command to generate and set the secret up automatically</p><pre><code class='language-bash'>sed -i "s/TOP_SECRET/$(openssl rand -hex 32)/g" docker-compose.yml</code></pre>
|
||||
<p>Run the following command to generate and set the secret up automatically</p>
|
||||
<pre><code class="language-bash"
|
||||
>sed -i "s/TOP_SECRET/$(openssl rand -hex 32)/g" docker-compose.yml</code
|
||||
></pre>
|
||||
<p>Now build and deploy:</p>
|
||||
<pre><code>docker compose build && docker compose up -d</code></pre>
|
||||
<p>You'll have to create an index in Meilisearch with the following command:</p>
|
||||
|
||||
@@ -1 +1 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="1440" height="1440" preserveAspectRatio="xMidYMid meet" version="1.0" viewBox="0 0 1080 1080"><metadata>Created by potrace 1.14, written by Peter Selinger 2001-2017</metadata><g fill="#000" stroke="none"><path d="M5128 10795 c-1 -1 -43 -5 -93 -9 -152 -9 -225 -17 -370 -37 -181 -26 -182 -26 -300 -50 -55 -12 -111 -23 -125 -26 -42 -7 -261 -63 -335 -85 -38 -11 -72 -20 -75 -20 -14 -1 -325 -110 -395 -139 -11 -5 -60 -24 -108 -44 -97 -39 -309 -138 -397 -185 -30 -16 -80 -42 -110 -57 -30 -15 -56 -31 -58 -35 -2 -5 -8 -8 -12 -8 -37 0 -603 -378 -696 -464 -7 -6 -27 -22 -44 -36 -18 -14 -40 -32 -49 -40 -9 -8 -44 -37 -76 -65 -212 -176 -512 -488 -694 -720 -39 -49 -75 -95 -80 -101 -5 -6 -36 -49 -70 -95 -33 -46 -65 -89 -71 -96 -5 -7 -10 -16 -10 -22 0 -5 -4 -11 -8 -13 -8 -3 -72 -95 -72 -104 0 -3 -5 -10 -10 -17 -22 -25 -90 -137 -90 -147 0 -5 -4 -10 -10 -10 -5 0 -10 -4 -10 -10 0 -5 -13 -31 -28 -57 -109 -185 -236 -444 -322 -658 -18 -44 -36 -89 -41 -100 -11 -26 -79 -215 -85 -235 -2 -8 -18 -60 -35 -115 -28 -91 -67 -228 -74 -265 -2 -8 -8 -35 -15 -60 -13 -48 -18 -70 -26 -110 -3 -14 -7 -32 -9 -40 -3 -8 -7 -33 -10 -55 -4 -22 -10 -56 -15 -75 -5 -19 -11 -57 -15 -84 -3 -27 -8 -52 -9 -55 -2 -3 -7 -37 -11 -76 -4 -38 -8 -72 -10 -75 -2 -3 -6 -37 -10 -75 -4 -39 -8 -83 -10 -100 -27 -234 -27 -786 -1 -1030 2 -16 7 -61 11 -100 3 -38 8 -77 10 -85 2 -8 7 -39 10 -69 4 -30 9 -63 11 -75 2 -12 9 -48 14 -81 9 -52 53 -270 64 -315 2 -8 14 -53 26 -100 12 -47 23 -89 24 -95 21 -91 136 -430 201 -590 66 -163 229 -501 305 -630 29 -49 60 -104 71 -122 38 -67 197 -312 209 -323 3 -3 30 -39 60 -80 29 -41 56 -77 60 -80 4 -3 11 -12 16 -21 16 -30 164 -208 267 -324 88 -98 308 -318 402 -402 107 -95 113 -100 215 -182 52 -42 97 -79 98 -83 2 -5 10 -8 18 -8 8 0 14 -4 14 -8 0 -4 32 -30 71 -57 39 -28 84 -60 99 -72 15 -13 32 -23 38 -23 6 0 12 -3 14 -8 2 -4 35 -27 73 -52 39 -24 72 -47 75 -50 5 -6 130 -80 265 -157 65 -38 234 -126 245 -129 3 0 46 -20 95 -43 140 -66 185 -86 260 -116 39 -15 84 -33 100 -40 54 -23 388 -133 470 -155 95 -26 260 -67 295 -74 124 -25 232 -46 265 -50 23 -4 52 -9 65 -11 14 -3 41 -8 60 -10 19 -3 49 -7 65 -10 29 -4 93 -11 180 -20 278 -28 793 -28 1050 0 345 38 755 118 1002 196 212 67 291 93 318 104 17 7 66 27 110 43 268 101 595 263 869 430 33 20 66 40 71 45 6 4 55 37 110 74 122 80 362 259 391 290 12 13 24 23 28 23 7 0 15 6 64 50 15 14 59 52 97 85 88 77 363 352 436 435 165 190 319 383 319 400 0 5 4 10 8 10 4 0 16 13 25 30 10 16 23 35 30 42 14 15 180 266 190 288 4 8 16 29 26 45 219 353 404 775 556 1265 12 39 51 188 60 230 2 8 13 53 24 100 20 84 64 329 77 425 3 28 7 57 9 65 2 8 6 47 10 85 4 39 8 81 10 93 20 127 28 733 12 897 -5 44 -10 105 -13 135 -3 30 -7 71 -9 90 -3 19 -7 58 -10 85 -3 28 -8 61 -10 75 -2 14 -7 45 -10 70 -4 25 -16 92 -27 150 -11 58 -22 116 -24 130 -3 14 -10 43 -16 65 -11 42 -16 64 -24 105 -24 119 -143 492 -217 680 -101 256 -260 581 -382 781 -5 10 -23 40 -40 68 -16 28 -33 51 -37 51 -5 0 -8 5 -8 12 0 19 -217 332 -290 418 -8 10 -22 28 -30 40 -17 25 -46 60 -144 174 -178 208 -455 481 -641 631 -20 17 -42 35 -49 40 -6 6 -40 33 -76 60 -36 28 -67 52 -70 55 -3 3 -21 17 -40 30 -19 14 -39 28 -45 32 -31 25 -172 121 -250 171 -49 31 -95 60 -101 64 -12 9 -41 26 -103 60 -25 14 -50 29 -56 33 -67 49 -471 242 -672 321 -13 5 -33 13 -45 19 -13 5 -50 19 -83 30 -33 12 -69 25 -80 30 -57 25 -298 95 -477 140 -190 47 -477 101 -613 116 -33 3 -62 8 -65 9 -3 2 -48 6 -100 10 -52 4 -108 9 -125 12 -34 5 -661 13 -667 8z" transform="translate(0.000000,1080.000000) scale(0.100000,-0.100000)"/></g></svg>
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="1440" height="1440" preserveAspectRatio="xMidYMid meet" version="1.0" viewBox="0 0 1080 1080"><metadata>Created by potrace 1.14, written by Peter Selinger 2001-2017</metadata><g fill="#000" stroke="none"><path d="M5128 10795 c-1 -1 -43 -5 -93 -9 -152 -9 -225 -17 -370 -37 -181 -26 -182 -26 -300 -50 -55 -12 -111 -23 -125 -26 -42 -7 -261 -63 -335 -85 -38 -11 -72 -20 -75 -20 -14 -1 -325 -110 -395 -139 -11 -5 -60 -24 -108 -44 -97 -39 -309 -138 -397 -185 -30 -16 -80 -42 -110 -57 -30 -15 -56 -31 -58 -35 -2 -5 -8 -8 -12 -8 -37 0 -603 -378 -696 -464 -7 -6 -27 -22 -44 -36 -18 -14 -40 -32 -49 -40 -9 -8 -44 -37 -76 -65 -212 -176 -512 -488 -694 -720 -39 -49 -75 -95 -80 -101 -5 -6 -36 -49 -70 -95 -33 -46 -65 -89 -71 -96 -5 -7 -10 -16 -10 -22 0 -5 -4 -11 -8 -13 -8 -3 -72 -95 -72 -104 0 -3 -5 -10 -10 -17 -22 -25 -90 -137 -90 -147 0 -5 -4 -10 -10 -10 -5 0 -10 -4 -10 -10 0 -5 -13 -31 -28 -57 -109 -185 -236 -444 -322 -658 -18 -44 -36 -89 -41 -100 -11 -26 -79 -215 -85 -235 -2 -8 -18 -60 -35 -115 -28 -91 -67 -228 -74 -265 -2 -8 -8 -35 -15 -60 -13 -48 -18 -70 -26 -110 -3 -14 -7 -32 -9 -40 -3 -8 -7 -33 -10 -55 -4 -22 -10 -56 -15 -75 -5 -19 -11 -57 -15 -84 -3 -27 -8 -52 -9 -55 -2 -3 -7 -37 -11 -76 -4 -38 -8 -72 -10 -75 -2 -3 -6 -37 -10 -75 -4 -39 -8 -83 -10 -100 -27 -234 -27 -786 -1 -1030 2 -16 7 -61 11 -100 3 -38 8 -77 10 -85 2 -8 7 -39 10 -69 4 -30 9 -63 11 -75 2 -12 9 -48 14 -81 9 -52 53 -270 64 -315 2 -8 14 -53 26 -100 12 -47 23 -89 24 -95 21 -91 136 -430 201 -590 66 -163 229 -501 305 -630 29 -49 60 -104 71 -122 38 -67 197 -312 209 -323 3 -3 30 -39 60 -80 29 -41 56 -77 60 -80 4 -3 11 -12 16 -21 16 -30 164 -208 267 -324 88 -98 308 -318 402 -402 107 -95 113 -100 215 -182 52 -42 97 -79 98 -83 2 -5 10 -8 18 -8 8 0 14 -4 14 -8 0 -4 32 -30 71 -57 39 -28 84 -60 99 -72 15 -13 32 -23 38 -23 6 0 12 -3 14 -8 2 -4 35 -27 73 -52 39 -24 72 -47 75 -50 5 -6 130 -80 265 -157 65 -38 234 -126 245 -129 3 0 46 -20 95 -43 140 -66 185 -86 260 -116 39 -15 84 -33 100 -40 54 -23 388 -133 470 -155 95 -26 260 -67 295 -74 124 -25 232 -46 265 -50 23 -4 52 -9 65 -11 14 -3 41 -8 60 -10 19 -3 49 -7 65 -10 29 -4 93 -11 180 -20 278 -28 793 -28 1050 0 345 38 755 118 1002 196 212 67 291 93 318 104 17 7 66 27 110 43 268 101 595 263 869 430 33 20 66 40 71 45 6 4 55 37 110 74 122 80 362 259 391 290 12 13 24 23 28 23 7 0 15 6 64 50 15 14 59 52 97 85 88 77 363 352 436 435 165 190 319 383 319 400 0 5 4 10 8 10 4 0 16 13 25 30 10 16 23 35 30 42 14 15 180 266 190 288 4 8 16 29 26 45 219 353 404 775 556 1265 12 39 51 188 60 230 2 8 13 53 24 100 20 84 64 329 77 425 3 28 7 57 9 65 2 8 6 47 10 85 4 39 8 81 10 93 20 127 28 733 12 897 -5 44 -10 105 -13 135 -3 30 -7 71 -9 90 -3 19 -7 58 -10 85 -3 28 -8 61 -10 75 -2 14 -7 45 -10 70 -4 25 -16 92 -27 150 -11 58 -22 116 -24 130 -3 14 -10 43 -16 65 -11 42 -16 64 -24 105 -24 119 -143 492 -217 680 -101 256 -260 581 -382 781 -5 10 -23 40 -40 68 -16 28 -33 51 -37 51 -5 0 -8 5 -8 12 0 19 -217 332 -290 418 -8 10 -22 28 -30 40 -17 25 -46 60 -144 174 -178 208 -455 481 -641 631 -20 17 -42 35 -49 40 -6 6 -40 33 -76 60 -36 28 -67 52 -70 55 -3 3 -21 17 -40 30 -19 14 -39 28 -45 32 -31 25 -172 121 -250 171 -49 31 -95 60 -101 64 -12 9 -41 26 -103 60 -25 14 -50 29 -56 33 -67 49 -471 242 -672 321 -13 5 -33 13 -45 19 -13 5 -50 19 -83 30 -33 12 -69 25 -80 30 -57 25 -298 95 -477 140 -190 47 -477 101 -613 116 -33 3 -62 8 -65 9 -3 2 -48 6 -100 10 -52 4 -108 9 -125 12 -34 5 -661 13 -667 8z" transform="translate(0.000000,1080.000000) scale(0.100000,-0.100000)"/></g></svg>
|
||||
|
||||
|
Before Width: | Height: | Size: 3.5 KiB After Width: | Height: | Size: 3.5 KiB |
Reference in New Issue
Block a user