Skip to content

Latest commit

 

History

History
81 lines (55 loc) · 2.48 KB

NOTES.md

File metadata and controls

81 lines (55 loc) · 2.48 KB

Notes

Thoughts and things of interest.

Back to the main README.md

Transfer Existing Rails DB to Elixir

SSL In Local Dev

See https://www.freecodecamp.org/news/how-to-get-https-working-on-your-local-development-environment-in-5-minutes-7af615770eec/

To create domain names in local, create domain names that end with .localdev like eps.localdev. In the ect/hosts file, add something like:

127.0.0.1       eps.localdev
127.0.0.1       www.eps.localdev

Localhost can now be accessed at eps.localdev. For example, if the app is running on port 4000, access the app at http://eps.localdev:4000.

Once the steps in the above article have been completed run the following in the project root to generate the self signed certs:

mix phx.gen.cert

In the config/dev.exs file, uncomment the following lines in the endpoint configuration:

https: [
    port: ssl_application_port,
    cipher_suite: :strong,
    keyfile: "priv/cert/selfsigned_key.pem",
    certfile: "priv/cert/selfsigned.pem"
  ],

WARNING: only use the generated certificate for testing in a closed network environment, such as running a development server on localhost. For production, staging, or testing servers on the public internet, obtain a proper certificate, for example from Let's Encrypt.

NOTE: when using Google Chrome, open chrome://flags/#allow-insecure-localhost to enable the use of self-signed certificates on localhost.

Temporary Deployment

Once the new image has been built (tagged :latest) and pushed to the ECR, run this from the bastion:

for I in api-{a,b,c}01; do ssh ${I} sudo chef-client; done
parallel-chef --help
parallel-chef --node-pattern eps-dev-api.* uptime
parallel-chef --node-pattern eps-dev-api.* sudo chef-client

For Alert API

parallel-chef --node-pattern eps-dev-alert-api.* sudo chef-client