From 52aacec792ecdaf7549d421a9df9ec03be7b3b7b Mon Sep 17 00:00:00 2001 From: Ladd Hoffman Date: Tue, 11 Jul 2023 21:13:39 -0500 Subject: [PATCH] Adjust Readme code blocks --- README.md | 32 +++++++++++++++++++++++--------- 1 file changed, 23 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 6dc07e5..baee3ba 100644 --- a/README.md +++ b/README.md @@ -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 - mkcert -install +```bash +mkcert -install +``` Generate a certificate for `forum.dev` - mkcert forum.dev +```bash +mkcert forum.dev +``` Move the certificate to nginx config directory - sudo mkdir -p /etc/nginx/certs - sudo cp forum.dev{,-key}.pem /etc/nginx/certs/ +```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 - sudo ln -s /etc/nginx/sites-available/forum_dev /etc/nginx/sites-enabled/ +```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