Adjust Readme code blocks

This commit is contained in:
Ladd Hoffman 2023-07-11 21:13:39 -05:00
parent 022c1808ca
commit 52aacec792
1 changed files with 23 additions and 9 deletions

View File

@ -13,7 +13,7 @@ The `main` branch is [served](https://dao-governance-framework.gitlab.io/forum-l
For a more convenient local URL,
add `forum.dev` as an alias for `127.0.0.1` in your `/etc/hosts` file.
Add `forum.dev` as an alias for `127.0.0.1` in your `/etc/hosts` file
Install [mkcert](https://github.com/FiloSottile/mkcert/#installation)
@ -21,20 +21,28 @@ Install [nginx](https://nginx.org/en/docs/install.html)
Add the root CA for self-signed certificates
```bash
mkcert -install
```
Generate a certificate for `forum.dev`
```bash
mkcert forum.dev
```
Move the certificate to nginx config directory
```bash
sudo mkdir -p /etc/nginx/certs
sudo cp forum.dev{,-key}.pem /etc/nginx/certs/
```
Make your home directory readable to the webserver (hacky way):
Make your home directory readable to the webserver. One way to do this is to add the webserver daemon's user to your user group. The following command would work if your user's group has the same name as your user, and the webserver user is `www-data`:
chown a+r ~/
```bash
sudo groupmems --group $USER --add www-data
```
Configure `nginx` by adding a file `/etc/nginx/sites-available/forum_dev`, with content similar to the following:
@ -55,14 +63,20 @@ server {
}
```
Replace `/home/ladd/dgf/forum-logic` with the path to this repository on your filesystem.
Replace `/home/ladd/dgf/forum-logic` with the path to this repository on your filesystem
Enable the site
```bash
sudo ln -s /etc/nginx/sites-available/forum_dev /etc/nginx/sites-enabled/
```
Now restart `nginx` and the site should be available at https://forum.dev.
```bash
sudo systemctl restart nginx
```
Note that browsers may cache assets, so after modifying source code, you may need to refresh your browser while holding `Shift` to bypass the browser cache.
# TODO