Giter Site home page Giter Site logo

ssl-automation's Introduction

ssl-automation

A repo to deploy and secure single server node applications/websites This is made under the assumption that you have a working ip/domain for your website. You are able to run and test these commands local as well as in an ec2 shell.

Step 1. Install Docker && docker-compose

Step 2. Place working application in the app folder.

  • the Dockerfile is preset to install the latest version of node and for the app to start with the command npm start
  • You will also need to add this code in your server assuming it is an express server
app.use(express.static(".well-known/acme-challenge/"));

Step 3. Replace <domain> with your ip address or domain for your website in the data/nginx/app.conf file

init_file init_file init_file

Step 4. Run the following command

curl -L https://raw.githubusercontent.com/wmnnd/nginx-certbot/master/init-letsencrypt.sh > init-letsencrypt.sh

followed by

chmod +x init-letsencrypt.sh
  • this command will download a file that will produce the certificate.
  • Make sure to review the file so that you can stage your attempts before hitting a rate limit and that it hits the proper domain/ip init_file

Step 5 Run the following command

sudo ./init-letsencrypt.sh
  • You should see Succesfully received certificate in the console. Once you see that message change the staging value in the init-letsencrypt.sh file back to 0 and repeat this step again.

post_staging

Step 6. Run the following command

docker-compose up --build -d

For deployment

  • this setup was used with an ubuntu aws ec2 container

Step 1. Create aws ec2 ubuntu container

Step 2. Follow instruction to ssh into container

Step 3. Download Docker && docker-compose

Step 4. Run the following command

scp -r -i yourkeyname.pem ~/path/to/your/project/folder/from/root ec2-user@<ec2-IPv4-publicIp>:~/

  • make sure the path to your pem file is accurate.
  • make sure to add in your public ip
  • This step will securely copy the contents of your project over to the ec2 shell.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.