Skip to content

Commit

Permalink
fix: self-hosting failing to run without valid serviceAccountKey.json…
Browse files Browse the repository at this point in the history
… (fehmer) (#5255)

!nuf
  • Loading branch information
fehmer authored Apr 2, 2024
1 parent e497a19 commit ef72ca6
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 6 deletions.
11 changes: 9 additions & 2 deletions SELF_HOSTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@
- create a new directory, e.g. `monkeytype` and open it.
- download the [docker-compose.yml](https://github.com/monkeytypegame/monkeytype/tree/master/docker/docker-compose.yml)
- create an `.env` file, you can copy the content from the [example.env](https://github.com/monkeytypegame/monkeytype/tree/master/docker/example.env).
- create an `serviceAccountKey.json` file. you can copy the content from the [serviceAccountKey-example.json](https://github.com/monkeytypegame/monkeytype/tree/master/docker/serviceAccountKey-example.json).
- download the [backend-configuration.json](https://github.com/monkeytypegame/monkeytype/tree/master/docker/backend-configuration.json)
- run `docker compose up -d`
- After the command exits successfully you can access [http://localhost:8080](http://localhost:8080)
Expand All @@ -40,6 +39,7 @@
## Account System

User signup/login is disabled by default. To allow users to signup you'll need to setup a Firebase project.
Stop the running docker containers using `docker compose down` before making any changes.

### Setup Firebase

Expand All @@ -56,6 +56,14 @@ User signup/login is disabled by default. To allow users to signup you'll need t
- go to `Service accounts`
- click `Generate new private key`. This will download a `.json` file.
- store the `.json` file as `serviceAccountKey.json`
- update the `docker-compose.yml` file and uncomment the first volume from the `monkeytype-backend` container
```yaml
#uncomment to enable the account system, check the SELF_HOSTING.md file
- type: bind
source: ./serviceAccountKey.json
target: /src/credentials/serviceAccountKey.json
read_only: true
```
- update the `.env` file
- open the [firebase console](https://console.firebase.google.com/) and open your project
Expand Down Expand Up @@ -113,7 +121,6 @@ User signup/login is disabled by default. To allow users to signup you'll need t
```



## Enable daily leaderboards

To enable daily leaderboards update the `backend-configuration.json` file and add/modify
Expand Down
9 changes: 5 additions & 4 deletions docker/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,11 @@ services:
- FRONTEND_URL=${MONKEYTYPE_FRONTENDURL}
- RECAPTCHA_SECRET=${RECAPTCHA_SECRET:-""}
volumes:
- type: bind
source: ./serviceAccountKey.json
target: /src/credentials/serviceAccountKey.json
read_only: true
#uncomment to enable the account system, check the SELF_HOSTING.md file
#- type: bind
# source: ./serviceAccountKey.json
# target: /src/credentials/serviceAccountKey.json
# read_only: true
- type: bind
source: ./backend-configuration.json
target: /app/backend-configuration.json
Expand Down

0 comments on commit ef72ca6

Please sign in to comment.