WIP: Works, but there is still a lot rough edges
Local development HTTPS proxy server meant to simplify working with multi-domain
applications by serving each application on separate domain under .localhost
TLD.
First we need to run our master server that will proxy all requests to the separate applications:
sudo dolores serve
To sign automatic service certificates with a local Certificate Authority, generate one and pass both PEM files to the server. Install the certificate in your browser or system trust store.
dolores gen cert --cert dolores.crt --key dolores.key
sudo dolores serve --ca-cert dolores.crt --ca-key dolores.key
Now, as unprivileged user we can run:
dolores run --name my-app <your command for starting server>
For example
dolores run --name foo mix phx.server
And your application will receive socket to listen on (passed as FD3). It is provided to your application in the same way that systemd socket activation works. In short there are 3 environment variables:
LISTEN_FDS - amount of file descriptors passed in. These are FD 3 up to
FD 3 + LISTEN_FDSLISTEN_FDNAMES - : (colon) separated list of FD names used to differentiate
between themLISTEN_PID - PID of the process that the FD are meant forWith current PoC implementation you can assume that there will be only one FD passes and it will be FD 3.
Now you should be able to visit your application on https://foo.localhost.
MIT
813 followers · starred May 2021
383 followers · starred May 2021
WIP: Works, but there is still a lot rough edges
Local development HTTPS proxy server meant to simplify working with multi-domain
applications by serving each application on separate domain under .localhost
TLD.
First we need to run our master server that will proxy all requests to the separate applications:
sudo dolores serve
To sign automatic service certificates with a local Certificate Authority, generate one and pass both PEM files to the server. Install the certificate in your browser or system trust store.
dolores gen cert --cert dolores.crt --key dolores.key
sudo dolores serve --ca-cert dolores.crt --ca-key dolores.key
Now, as unprivileged user we can run:
dolores run --name my-app <your command for starting server>
For example
dolores run --name foo mix phx.server
And your application will receive socket to listen on (passed as FD3). It is provided to your application in the same way that systemd socket activation works. In short there are 3 environment variables:
LISTEN_FDS - amount of file descriptors passed in. These are FD 3 up to
FD 3 + LISTEN_FDSLISTEN_FDNAMES - : (colon) separated list of FD names used to differentiate
between themLISTEN_PID - PID of the process that the FD are meant forWith current PoC implementation you can assume that there will be only one FD passes and it will be FD 3.
Now you should be able to visit your application on https://foo.localhost.
MIT
813 followers · starred May 2021
383 followers · starred May 2021