Skip to content

Commit 85543ff

Browse files
fehmerMiodec
andauthored
fix(docker): fix deeplinks and update documentation (@fehmer) (monkeytypegame#6640)
- support deep links like `/login` - fix some typos closes monkeytypegame#6628 --------- Co-authored-by: Jack <[email protected]>
1 parent ebfa8be commit 85543ff

File tree

5 files changed

+26
-5
lines changed

5 files changed

+26
-5
lines changed

docker/example.env

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ MONKEYTYPE_FRONTENDURL=http://myserver:8080
44
#url of the backend server, this must be accessible by your clients browser
55
MONKEYTYPE_BACKENDURL=http://myserver:5005
66

7-
# below config is only needed, if you need user accounts
7+
# uncomment below config if you need user accounts
88
# firebase config
99
#FIREBASE_APIKEY=
1010
#FIREBASE_AUTHDOMAIN=
@@ -13,7 +13,11 @@ MONKEYTYPE_BACKENDURL=http://myserver:5005
1313
#FIREBASE_MESSAGINGSENDERID=
1414
#FIREBASE_APPID=
1515

16-
# google recapture
16+
# google recaptcha
17+
# uncomment below config if you need user accounts
18+
# you can use these defaults if you host this privately
19+
#RECAPTCHA_SITE_KEY=6LeIxAcTAAAAAJcZVRqyHh71UMIEGNQ_MXjiZKhI
20+
#RECAPTCHA_SECRET=6LeIxAcTAAAAAGG-vFI1TnRWxMZNFuojJ4WifJWe
1721
RECAPTCHA_SITE_KEY=
1822
RECAPTCHA_SECRET=
1923

@@ -29,4 +33,4 @@ RECAPTCHA_SECRET=
2933
# REDIS_PORT=6379
3034

3135
# port of the mongodb server, not exposed by default
32-
# MONGO_PORT:27017
36+
# MONGO_PORT:27017

docker/frontend/Dockerfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ RUN npm i -g pnpm && \
2121
FROM nginx:mainline-alpine
2222

2323
COPY --from=builder /app/frontend/dist /usr/share/nginx/html
24+
COPY docker/frontend/nginx.conf /etc/nginx/conf.d/default.conf
2425
COPY docker/frontend/updateConfig.sh /docker-entrypoint.d/updateConfig.sh
2526
RUN chmod +x /docker-entrypoint.d/updateConfig.sh
2627

docker/frontend/nginx.conf

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
server {
2+
listen 80;
3+
listen [::]:80;
4+
5+
server_name frontend;
6+
location / {
7+
root /usr/share/nginx/html;
8+
try_files $uri $uri/ /index.html;
9+
}
10+
11+
}

docker/frontend/updateConfig.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/bin/sh
22
cd /usr/share/nginx/html
3-
echo "repace firebase config"
3+
echo "replace firebase config appid: ${FIREBASE_APPID}"
44
sed -i "s/###FIREBASE_APIKEY###/${FIREBASE_APIKEY}/g" js/firebase.*.js
55
sed -i "s/###FIREBASE_AUTHDOMAIN###/${FIREBASE_AUTHDOMAIN}/g" js/firebase.*.js
66
sed -i "s/###FIREBASE_PROJECTID###/${FIREBASE_PROJECTID}/g" js/firebase.*.js
@@ -12,5 +12,5 @@ sed -i "s/###FIREBASE_APPID###/${FIREBASE_APPID}/g" js/firebase.*.js
1212
echo "use backend url ${MONKEYTYPE_BACKENDURL}"
1313
sed -i "s/###MONKEYTYPE_BACKENDURL###/${MONKEYTYPE_BACKENDURL//\//\\/}/g" js/*.js
1414

15-
echo "use recapture ${RECAPTCHA_SITE_KEY}"
15+
echo "use recaptcha ${RECAPTCHA_SITE_KEY}"
1616
sed -i "s/###RECAPTCHA_SITE_KEY###/${RECAPTCHA_SITE_KEY//\//\\/}/g" js/*.js

docs/SELF_HOSTING.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,11 @@ Stop the running docker containers using `docker compose down` before making any
120120
RECAPTCHA_SECRET="your secret key"
121121
```
122122

123+
If you host privately you can use these defaults:
124+
```
125+
RECAPTCHA_SITE_KEY=6LeIxAcTAAAAAJcZVRqyHh71UMIEGNQ_MXjiZKhI
126+
RECAPTCHA_SECRET=6LeIxAcTAAAAAGG-vFI1TnRWxMZNFuojJ4WifJWe
127+
```
123128

124129
## Enable daily leaderboards
125130

0 commit comments

Comments
 (0)