Skip to content
This repository has been archived by the owner on Nov 20, 2022. It is now read-only.
/ acmesmith-docker Public archive

Dockerized HTTPS server using Let's Encrypt certificate continuously managed by acmesmith

Notifications You must be signed in to change notification settings

int128/acmesmith-docker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

acmesmith-docker

Dockerized HTTPS server using Let's Encrypt certificate continuously managed by acmesmith.

Prerequisite

  • Docker Compose
  • AWS S3 for Storing the account and certificate
  • AWS Route53 for ACME challenge

How to use

Set up acmesmith

Create an IAM user with following role for S3 and Route53 operation.

{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Effect": "Allow",
      "Action": ["s3:GetObject", "s3:PutObject", "s3:ListBucket"],
      "Resource": ["arn:aws:s3:::YOUR_BUCKET", "arn:aws:s3:::YOUR_BUCKET/cert"]
    },
    {
      "Effect": "Allow",
      "Action": ["route53:ListHostedZones", "route53:GetChange"],
      "Resource": "*"
    },
    {
      "Effect": "Allow",
      "Action": "route53:ChangeResourceRecordSets",
      "Resource": ["arn:aws:route53:::hostedzone/YOUR_HOSTED_ZONE"]
    }
  ]
}

Create acmesmith/acmesmith.yml as the example in same folder.

Now request a certificate.

docker-compose build acmesmith
docker-compose run --rm acmesmith register mailto:[email protected]
docker-compose run --rm acmesmith authorize example.com
docker-compose run --rm acmesmith request example.com
docker-compose run --rm acmesmith list

Set up web server

Change reverse-proxy/nginx.conf to fit your environment. Other web servers such as Apache httpd may work as well.

Now start the web server.

COMMON_NAME=example.com ./renew.sh

Continuously renew the certificate

The script is designed to be idempotent. If the certificate is being expired soon, the web server is restarted with an new certificate. Otherwise, the web server is not restarted.

COMMON_NAME=example.com ./renew.sh

Run the script periodically by the scheduler such as cron.

0 1 * * 0   COMMON_NAME=example.com /opt/acmesmith-docker/renew.sh

Contribution

This is an open source software licensed under Apache-2.0. Feel free to open issues and pull requests.

About

Dockerized HTTPS server using Let's Encrypt certificate continuously managed by acmesmith

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published