GithubHelp home page GithubHelp logo

sasilevi / letsencrypt-gcloud-balancer Goto Github PK

View Code? Open in Web Editor NEW

This project forked from bloomapi/letsencrypt-gcloud-balancer

0.0 0.0 0.0 10.08 MB

Docker Container that issues and updates Let's Encrypt certificates on a Google Compute/GCP/GCE HTTPS load balancer

License: MIT License

Shell 83.86% Makefile 3.50% Dockerfile 12.64%

letsencrypt-gcloud-balancer's Introduction

Let's Encrypt Google Compute HTTP Load Balancer Docker Updater

Run from a machine already in GCP where the machine itself is authorized to update HTTPS load balancer certificates. This container also requires you use GCP as your DNS provider as it uses GCP-DNS-based Let's Encrypt verification.

docker run --env GCE_PROJECT=gcp-project-name --env [email protected] --env TARGET_PROXY=name-of-gcp-target-https-proxy --env DOMAINS_LIST="-d domains.list -d where.each -d is.prefixed.by.a.dash.d" bloomapi/letsencrypt-gcloud-balancer

In production, consider mounting a persistent volume at /root/.lego so you don't loose your Let's Encrypt credentials / certs. That said, the scripts currently only work when one certificate / key pair is stored in the container. If you want to change the domains while using persistant storage, make sure you clear the certs and keys out of the /root/.lego/certificates directory.

If you are testing, its also worth setting --env USE_STAGING_SERVER=true to avoid being rate limited by Let's Encrypt for the month. Keep in mind that since this uses DNS-based verification, it depends on the expiration of DNS TXT records. While this wont matter in production, while testing, you may need to wait 120 seconds between tests.

This container will attempt to renew certificates once a month. The container will also try to have an initial issuing of the certs on first run.

Required Environment Variables

  • GCE_PROJECT Your GCP/GCE project
  • LETSENCRYPT_EMAIL Email to use for Let's Encrypt registration
  • TARGET_PROXY Name of your GCP https proxy. Find it with gcloud compute target-https-proxies list after you've already created a HTTPS load balancer frontent
  • DOMAINS_LIST A list of domains. Each domain must be prefixed with -d. If you want multiple domains, just seperate with a space as demonstrated above.

Optional Variables

  • USE_STAGING_SERVER if set, We'll use the Let's Encrypt staging server. This wont issue usable certs, but will allow you to use / reuse the same domains list. Warning if you re-create this container more than 5 times in a month without a persistent volume, you will be rate limited and you wont be able to get more certificates until the next month.
  • CERT_ID_PREFIX will create new certificates with this string followed by cert-${random string}

Leave the docker container running, and it will attempt to update the cert once a month and remove the older cert once the new cert is installed.

letsencrypt-gcloud-balancer's People

Contributors

jammm avatar sasilevi avatar tkporter avatar untoldone 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.