This repository has been archived by the owner on Jan 23, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
feat(cleanup): remove redundant conf file #396
Merged
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,7 @@ | |
|
||
### Introduction | ||
|
||
Let's Encrypt is a nonprofit Certificate Authority run by the Internet | ||
Let's Encrypt is a nonprofit Certificate Authority run by the Internet | ||
Security Research Group (ISRG) that provides free SSL certificates. | ||
|
||
Isomer takes advantage of this through: | ||
|
@@ -14,21 +14,20 @@ Isomer takes advantage of this through: | |
|
||
This document shall focus on the latter usecase. | ||
|
||
|
||
### Background and Motivations | ||
|
||
Isomer serves web traffic on `www.example.gov.sg`, and 301 redirects | ||
requests to `example.gov.sg` to the www subdomain. These are served | ||
over HTTPS by separate services, respectively, a CDN and an EC2 instance | ||
Isomer serves web traffic on `www.example.gov.sg`, and 301 redirects | ||
requests to `example.gov.sg` to the www subdomain. These are served | ||
over HTTPS by separate services, respectively, a CDN and an EC2 instance | ||
(the redirection server). | ||
|
||
Historically, Isomer users were asked to provide an Extended Validation | ||
certificate for use on both services. Given that this is no longer needed, | ||
Isomer can make use of built-in LetsEncrypt certificate provisioning | ||
found on CDNs. | ||
found on CDNs. | ||
|
||
The redirection server also needs SSL certificates, and given that it | ||
accounts for less than 0.1% of web traffic coming to Isomer, it makes | ||
accounts for less than 0.1% of web traffic coming to Isomer, it makes | ||
very little sense to allocate resources to manually procure and install | ||
a certificate. Given that LetsEncrypt certificates are free and only | ||
available through automated means, integration with Isomer's redirection | ||
|
@@ -37,25 +36,25 @@ server makes sense. | |
### Implementation Overview | ||
|
||
Jonas Alfredsson (@JonasAlfredsson) maintains a Docker image originally written | ||
by Eliot Saba (@staticfloat) which incorporates certbot into the standard nginx | ||
by Eliot Saba (@staticfloat) which incorporates certbot into the standard nginx | ||
image. At runtime, the image runs: | ||
|
||
- a bootstrap script that inspects and disables/enables config at `/etc/nginx/conf.d/` | ||
if they reference missing SSL files before enabling nginx, and; | ||
|
||
- a long-running while loop that does the following both at the start | ||
- a long-running while loop that does the following both at the start | ||
as well once every week: | ||
|
||
- run certbot to obtain certificates for domain names implied by | ||
`ssl_certificate_key` if the path is of the form | ||
`ssl_certificate_key` if the path is of the form | ||
`/etc/letsencrypt/live/<domain.gov.sg>/privkey.pem` and the file | ||
is either missing or expired, and; | ||
|
||
- enable the config once the certificates are obtained by reloading nginx. | ||
|
||
Elastic Beanstalk does not have its CloudWatch logger immediately enabled at | ||
Elastic Beanstalk does not have its CloudWatch logger immediately enabled at | ||
runtime, so to ensure we have everything logged into CloudWatch, we introduce | ||
a script into [`/docker-entrypoint.d/`](https://github.com/nginxinc/docker-nginx/tree/master/entrypoint) | ||
a script into [`/docker-entrypoint.d/`](https://github.com/nginxinc/docker-nginx/tree/master/entrypoint) | ||
that makes nginx sleep for ten seconds | ||
|
||
The contact e-mail for these certificates is configured by the env var | ||
|
@@ -64,15 +63,12 @@ The contact e-mail for these certificates is configured by the env var | |
Certifcates are stored in an AWS Elastic File System mounted into the EC2 | ||
instance at `/etc/letsencrypt`. | ||
|
||
Nginx has been configured to reroute requests for `/.well-known` on port 80 | ||
Nginx has been configured to reroute requests for `/.well-known` on port 80 | ||
to certbot's internal web service. This allows certbot to prove to LetsEncrypt | ||
that Isomer has control of the domain that we are requesting a certificate for, | ||
via an [HTTP-01 challenge](https://letsencrypt.org/docs/challenge-types/). | ||
|
||
Custom SSL certificates are still supported by adding nginx server config blocks | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Note to reviewer: Main change is here, since we are no longer supported custom certs moving forward |
||
to `https_www_redirects.conf` | ||
|
||
### Further Reading | ||
|
||
Further information can be found at the relevant GitHub | ||
Further information can be found at the relevant GitHub | ||
[repository](https://github.com/JonasAlfredsson/docker-nginx-certbot). |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
bunch of prettier changes