purescript / registry-dev

Development work related to the PureScript Registry
https://github.com/purescript/registry
95 stars 80 forks source link

Source env from state dir #653

Closed thomashoneyman closed 1 year ago

thomashoneyman commented 1 year ago

In #641 I assumed that the .env file on the server would be loaded at startup by the Server.purs module. But that is not the case: it attempts to load the one present in the current working directory. We need to source the values from the /var/lib/registry-server directory instead. This PR accomplishes that, while still allowing local overrides via a .env file.

An alternate approach would be to adjust the 'loadEnv' function such that it tries to load the /var/lib/registry-server/.env file, then the local .env file, and do nothing in the module.nix service definition itself.