GithubHelp home page GithubHelp logo

jelko / certbot-heroku-renewal Goto Github PK

View Code? Open in Web Editor NEW

This project forked from jamesseanwright/certbot-heroku-renewal

1.0 2.0 0.0 5 KB

Automate the renewal of Certbot SSL certificates and their deployment to Heroku SSL

Shell 100.00%

certbot-heroku-renewal's Introduction

Certbot & Heroku SSL Renewal Script

A shell script to automate the renewal of Certbot SSL certificates and their deployment to Heroku SSL.

Usage

(First use: Setup the Heroku app to provide a challenge endpoint, see below.)

sudo ./renew.sh DOMAIN HEROKU_APP_NAME

  • DOMAIN - the main domain name of the website you wish to renew. Can be found under /etc/letsencrypt/live
  • HEROKU_APP_NAME the name of the Heroku app against which the SSL certificates will be updated

e.g. sudo ./renew.sh foobar.co.uk foo-bar-app

Due to the opinionated directory permissions required by Certbot, this script must be run as root.

Verification: ACME Challenge Endpoint

certbot requires the Domain to be verified via a challenge by HTTP request (or DNS lookup). The Heroku app must respond to these endpoint requests during verification.

A request might look like this:
GET /.well-known/acme-challenge/-fWyC20cYj2QO6CrrdfJ5RkCEM5RHMExcuVP2WojRIk

And should return a verification code like:
-fWyC20cYj2QO6CrrdfJ5RkCEM5RHMExcuVP2WojRIk.rJ8qm6vdIGyqtJLe8wjza8o4IpwobjKCv3M9Z5Yuyi0

To accomplish this, this script sets three Heroku environment variables via the Heroku CLI:

  • ACME_ENABLED = 1 or 0 (on or off)
  • ACME_URL = the request token
  • ACME_RESPONSE = the response string

After the renewal ACME_ENABLED is set to 0.

The Heroku app therefore must implement reading the environment variables and responding to requests at /.well-known/acme-challenge/ correctly. The endpoint does only need to be available during the verification; it can be toggled via ACME_ENABLED.

certbot-heroku-renewal's People

Contributors

jamesseanwright avatar jelko avatar

Stargazers

 avatar

Watchers

 avatar  avatar

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.