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.
- 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
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

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.
docker-compose up --build -d
- this setup was used with an ubuntu aws ec2 container
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.
Tests are located in the tests/ directory at the project root level. The test suite includes:
- 28 unit tests for the Node.js application (Jest)
- 129 bash tests for the automation scripts (BATS)
# Run all tests (unit + bash)
npm test
# Run only unit tests
npm run test:unit
# Run only bash script tests
npm run test:bash
# Run tests in watch mode
npm run test:watch
# Run tests for CI (with coverage)
npm run test:ciSee tests/README.md for detailed test documentation.
ssl-automation/
├── app/ # Node.js application
│ ├── server.js # Express server
│ ├── package.json # App dependencies
│ └── Dockerfile # Container build instructions
├── tests/ # Test files
│ ├── server.test.js # Server endpoint tests
│ └── server.startup.test.js # Server module tests
├── data/
│ └── nginx/ # Nginx configuration
├── .github/
│ └── workflows/ # CI/CD workflows
├── jest.config.js # Jest test configuration
├── package.json # Root dependencies and test scripts
├── setup-agent.sh # Local setup automation
└── deploy-to-ec2.sh # EC2 deployment automation



