|
| 1 | +# Letsencrypt automation wrapper |
| 2 | + |
| 3 | +## Using it |
| 4 | + |
| 5 | +Clone this repository and change the origin to an internal private git repo of your choice. This repo will in the end contain the certificates you register. Make sure adequate permissions are set up! |
| 6 | + |
| 7 | +### Requirements |
| 8 | + |
| 9 | +To run this you need at least: |
| 10 | + |
| 11 | + * Git |
| 12 | + * Docker |
| 13 | + * Ruby (>= 2) |
| 14 | + |
| 15 | +### Config |
| 16 | + |
| 17 | +Create a file called `config.json` alongside the `config.default.json` and fill in the changes you want. An example of all available config settings is given here: |
| 18 | + |
| 19 | +``` |
| 20 | +{ |
| 21 | + "docker_environment": { |
| 22 | + "https_proxy": "http://proxy.service.com:5678", |
| 23 | + "http_proxy": "http://proxy.service.com:5678", |
| 24 | + "no_proxy": ".service.com" |
| 25 | + }, |
| 26 | + "certbot": { |
| 27 | + "docker_image": "docker.local/certbot/dns-route53:v0.22.0", |
| 28 | + "docker_container": "certbot", |
| 29 | + "aws_credentials": "~/.aws/credentials", |
| 30 | + |
| 31 | + "server": "https://acme-staging-v02.api.letsencrypt.org/directory" |
| 32 | + }, |
| 33 | + "chef": { |
| 34 | + "docker_image": "docker.local/chef/chefdk:v2", |
| 35 | + "data_bag": "letsencrypt", |
| 36 | + "admins": ["admin1", "admin2"] |
| 37 | + }, |
| 38 | + "backends": [ |
| 39 | + "chef_vault" |
| 40 | + ], |
| 41 | + "certificates": { |
| 42 | + "_star_.my.domain.com": { |
| 43 | + "domains": ["*.my.domain.com", "my.domain.com"], |
| 44 | + "chef_vault": { |
| 45 | + "clients": ["client1", "client2"], |
| 46 | + "search": "search term" |
| 47 | + } |
| 48 | + }, |
| 49 | + "sometest.domain.com": { |
| 50 | + "domains": ["sometest.domain.com", "some-test.domain.com"], |
| 51 | + "hashicorp_vault": { |
| 52 | + "permissions_to_set": "a" |
| 53 | + } |
| 54 | + } |
| 55 | + } |
| 56 | +} |
| 57 | +``` |
| 58 | + |
| 59 | +The two public ACME Servers are: |
| 60 | + |
| 61 | + * https://acme-staging-v02.api.letsencrypt.org/directory |
| 62 | + * https://acme-v02.api.letsencrypt.org/directory |
| 63 | + |
| 64 | +### Run manually |
| 65 | + |
| 66 | +To run the tasks manually check out the available rake tasks with `rake -T`. To initialize the project you have to register an account at LetsEncrypt once. To do so run: |
| 67 | + |
| 68 | +``` |
| 69 | +rake init |
| 70 | +rake certbot:register |
| 71 | +``` |
| 72 | + |
| 73 | +once and commit the changes. |
| 74 | + |
| 75 | +### Running in Jenkins |
| 76 | + |
| 77 | +There is a Jenkinsfile available in this repo which should do everything for you once you are set up. |
| 78 | + |
| 79 | +## Updating |
| 80 | + |
| 81 | +Add this repo as a remote |
| 82 | + |
| 83 | +``` |
| 84 | +git remote add update https://github.com/bytesourceoss/letsencrypt-automation.git |
| 85 | +``` |
| 86 | + |
| 87 | +And fetch the changes you want |
| 88 | + |
| 89 | +``` |
| 90 | +git fetch update master # Fetch changes from master |
| 91 | +git fetch update refs/tags/1.0.0 # Fetch a specific tag |
| 92 | +``` |
| 93 | + |
| 94 | +# ToDo |
| 95 | + |
| 96 | +Pretty much everything I guess... |
| 97 | + |
| 98 | + * How to upload only changed certificates |
| 99 | + * Read state from git? |
| 100 | + * Keep state file with changes? |
0 commit comments