Skip to content

Commit 234ca8e

Browse files
committed
feat: adds local cert generation instructions and template env file to README
1 parent 43a3178 commit 234ca8e

File tree

1 file changed

+36
-2
lines changed

1 file changed

+36
-2
lines changed

README.md

+36-2
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,43 @@ To build this site:
3737
- Run `npm run dev`
3838
- The site will be available in real time via a localhost URL
3939

40+
### Generate a self-signed certificate
41+
42+
In order to browse with TLS locally, you'll need a certificate. A self-signed certificate is satisfactory for this purpose. Here's how to set one up.
43+
44+
Used for development in a local environment (such as on your personal computer). You only need to do this once. If you've already done this for a different project, just copy your existing `localhost_cert.pem` and `localhost_key.pem` files from `~/.ssh` into the root directory of this repo and skip the rest of this step.
45+
46+
- [Install mkcert and generate certificate](https://github.com/FiloSottile/mkcert) by running the commands below, in this order:
47+
```zsh
48+
cd ~/.ssh
49+
brew install mkcert # replace with another package manager for linux distro
50+
brew install nss # need to install certutil before running `mkcert -install` so the CA can be automatically installed in Firefox
51+
52+
# at this point, open any https website in Firefox before running the below commands
53+
54+
mkcert -install
55+
mkcert -key-file localhost_key.pem -cert-file localhost_cert.pem localhost 127.0.0.1
56+
cat localhost_cert.pem > localhost_fullchain.pem
57+
cat "$(mkcert -CAROOT)/rootCA.pem" >> localhost_fullchain.pem
58+
```
59+
- Copy the new `localhost_cert.pem` and `localhost_key.pem` files to the root directory of this repo
60+
61+
The above tutorial is specifically for MacOS machines with `brew` installed. For other \*nix OS's replace the installation step with your preferred package manager (e.g. `apt install mkcert`).
62+
63+
### Environment variables
64+
65+
Add the following `.env` file to the repo root
66+
67+
```ini
68+
NODE_ENV=stable
69+
SERVER_ENV=development
70+
AIRTABLE_SINGULARITY_ACCESS_TOKEN=<entry>
71+
72+
```
73+
4074
## Updating dependencies
4175

42-
Please use `npm ci` in place of `npm i` when not explicitly upgrading dependencies. `npm ci` will only install versions of packages provided in the lockfile, leading to more stability.
76+
Please use `npm ci` in place of `npm i` when not explicitly upgrading dependencies. `npm ci` will only install versions of packages provided in the lockfile, leading to more stability.
4377

4478
Always regression test the site if upgrading packages, as they may contain breaking changes.
4579

@@ -82,6 +116,6 @@ To better display the components available on the site, their properties, and th
82116

83117
## [Release Please](https://github.com/googleapis/release-please)
84118

85-
- Release Please automates CHANGELOG generation, the creation of GitHub releases, and version bumps for your projects.
119+
- Release Please automates CHANGELOG generation, the creation of GitHub releases, and version bumps for your projects.
86120
- It is currently setup as a github action in this repo
87121
- See [documentation](https://github.com/googleapis/release-please) on how to use

0 commit comments

Comments
 (0)