Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a letsencrypt script to the shell-scripts #7

Open
3 of 4 tasks
sunbiz opened this issue Mar 29, 2019 · 3 comments
Open
3 of 4 tasks

Add a letsencrypt script to the shell-scripts #7

sunbiz opened this issue Mar 29, 2019 · 3 comments
Assignees
Milestone

Comments

@sunbiz
Copy link
Member

sunbiz commented Mar 29, 2019

Just like the shell-scripts/dynaswap-useradd , also add a script that does the following:

  • 1. add nginx as a reverse proxy
  • 2. points all OpenMRS endpoints to 443
  • 3. points all 8000 endpoints to 443
  • 4. adds a letsencrypt ACME script that will create an SSL for the nginx
@sunbiz
Copy link
Member Author

sunbiz commented May 14, 2019

This will need a domain, because letsencrypt does not allow for IP based certificates. @johnnyliu1992 have you tried to look for an alternative solution?

@sunbiz
Copy link
Member Author

sunbiz commented Nov 8, 2019

We are trying to add subdomains automatically when someone spawns a new VM using our image and assign it as a subdomain to xxx-xxx-xxx-xxx.dynaswap.info where the IP with dashes as a subdomain.

We will then try to get a LetEncrypt handshake (using ACME? maybe?) for this subdomain to get a valid SSL certificate

@sunbiz
Copy link
Member Author

sunbiz commented May 8, 2020

After deploying the openmrs-base v1.4 image, the following commands will achieve the SSL certificate

# Call DAR to create an A record
curl -X POST "https://dynaswap.info/DAR" -d "{\"ip\": \"$(curl https://diagnostic.opendns.com/myip)\"}"
 
# edit the server domain on nginx
sudo sed -i "s/___/$(echo $(curl -s https://diagnostic.opendns.com/myip).dynaswap.info | tr '.' '-' | sed 's/-/./g4')/" /etc/nginx/sites-enabled/default
 
# get SSL certificate for the new domain
sudo certbot --nginx -n -d $(echo $(curl -s https://diagnostic.opendns.com/myip).dynaswap.info | tr '.' '-' | sed 's/-/./g4') --agree-tos --email [email protected]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants