|
| 1 | +# Let's Encrypt with DNS challenge on platform.sh |
| 2 | + |
| 3 | +[Platform.sh](https://platform.sh) currently doesn't support using |
| 4 | +Let's Encrypt certificates (at least not with domain verification and |
| 5 | +automatic renewal). |
| 6 | + |
| 7 | +This image uses [lego](https://github.com/xenolf/lego) to obtain a |
| 8 | +certificate via Let's Encrypts DNS challenge and uploads the |
| 9 | +certificate to platform.sh using their commmand line client. |
| 10 | + |
| 11 | +Experimental. YMMV. |
| 12 | + |
| 13 | +Necessary configuration via environment variables, .i.e.: |
| 14 | + |
| 15 | + * `[email protected]` (used for registering with Let's Encrypt) |
| 16 | + * `DOMAINS="example.com www.example.com"` (space separated list -- |
| 17 | + must already be added to the project at Platform.sh) |
| 18 | + * `DNS_PROVIDER=dnsimple` (your DNS provider, see below for supported |
| 19 | + providers and additional needed configuration) |
| 20 | + * `PLATFORMSH_API_TOKEN=mytoken` (an APIv1 token) |
| 21 | + * `PLATFORMSH_PROJECT_ID=myprojectid` |
| 22 | + |
| 23 | + |
| 24 | +You also need to provide environment variables required by the DNS provider challenge chosen: |
| 25 | + |
| 26 | + * cloudflare: `CLOUDFLARE_EMAIL`, `CLOUDFLARE_API_KEY` |
| 27 | + * digitalocean: `DO_AUTH_TOKEN` |
| 28 | + * dnsimple: `DNSIMPLE_EMAIL`, `DNSIMPLE_API_KEY` |
| 29 | + * dnsmadeeasy: `DNSMADEEASY_API_KEY`, `DNSMADEEASY_API_SECRET` |
| 30 | + * gandi: `GANDI_API_KEY` |
| 31 | + * gcloud: `GCE_PROJECT` |
| 32 | + * namecheap: `NAMECHEAP_API_USER`, `NAMECHEAP_API_KEY` |
| 33 | + * rfc2136: `RFC2136_TSIG_KEY`, `RFC2136_TSIG_SECRET`, `RFC2136_TSIG_ALGORITHM`, `RFC2136_NAMESERVER` |
| 34 | + * route53: `AWS_ACCESS_KEY_ID`, `AWS_SECRET_ACCESS_KEY`, `AWS_REGION` |
| 35 | + * dyn: `DYN_CUSTOMER_NAME`, `DYN_USER_NAME`, `DYN_PASSWORD` |
| 36 | + * vultr: `VULTR_API_KEY` |
| 37 | + * ovh: `OVH_ENDPOINT`, `OVH_APPLICATION_KEY`, `OVH_APPLICATION_SECRET`, `OVH_CONSUMER_KEY` |
| 38 | + * pdns: `PDNS_API_KEY`, `PDNS_API_URL` |
| 39 | + |
| 40 | +Optional configuration via environment variables: |
| 41 | + |
| 42 | +``` |
| 43 | +SERVER=https://acme-staging.api.letsencrypt.org/directory |
| 44 | +``` |
0 commit comments