Hypha Spike: Persistence 1
Note: Unlike previous spikes, I’m leaving this spike in a non-functional state and instead starting from scratch on the main project. See https://ar.al/2019/02/01/hypha-spike-persistence-1/#post-mortem.
Create keys using mkcert in the /always-on directory:
# If you haven’t used mkcert before, you must first create # and install your local Certificate Authority (CA): mkcert -install # Generate your keys for localhost: mkcert localhost
This will create the
localhost-key.pemfiles used by the server to create a TLS connection.
(Note: for the certificate to be accepted without warning, you must restart your browser after running
Give Node.js permission to bind to ports < 1024 (i.e., 80 and 443) without being root:
sudo setcap 'cap_net_bind_service=+ep' $(which node)
Setup authbind on macOS and, in addition to the instructions in the link-to post, also setup port 444 in addition to ports 443 and 80 as shown there. (Note: Port 80 is not required for this app.)
Run the app:
authbind node always-on/index.js