Commit bcf95c1
authored
### Description
I noticed that when trying to host Monkeytype over a local network or
the internet instead of `localhost`, the frontend crashes with an
`Uncaught TypeError: crypto.randomUUID is not a function` error. This
happens because modern browsers restrict this API to secure contexts
(HTTPS).
When putting a reverse proxy in front to handle HTTPS, it's very easy to
run into Mixed Content blocks or 404 errors due to incorrect `.env`
configurations (like adding a trailing slash to `MONKEYTYPE_FRONTENDURL`
or forgetting to completely recreate the containers).
This PR updates `SELF_HOSTING.md` to:
- Explain the HTTPS requirement for network deployments.
- Detail how to properly configure the backend URL in the `.env` file to
avoid API 404 errors (the trailing slash issue).
- Highlight the importance of using `docker compose up -d
--force-recreate` and clearing the browser cache, since environment
variables are baked into the SPA static files at startup.
### Checks
- [X] Make sure the PR title follows the Conventional Commits standard.
(https://www.conventionalcommits.org for more info)
- [X] Make sure to include your GitHub username prefixed with @ inside
parentheses at the end of the PR title.
1 parent 0cb7f6b commit bcf95c1
1 file changed
Lines changed: 25 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
| 13 | + | |
13 | 14 | | |
14 | 15 | | |
15 | 16 | | |
| |||
36 | 37 | | |
37 | 38 | | |
38 | 39 | | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
39 | 64 | | |
40 | 65 | | |
41 | 66 | | |
| |||
0 commit comments