Skip to content

Commit

Permalink
Improve README.md for Docker
Browse files Browse the repository at this point in the history
  • Loading branch information
roy-bongers committed Feb 11, 2020
1 parent 69237ec commit a1031f7
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 14 deletions.
18 changes: 9 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,13 +53,13 @@ To automatically renew your certificate add the Certbot renew command in a cron

## Docker
There is also a docker container which you can use. You can either bind mount the `config` and / or `logs` folder or use
`ENV` variables.
`ENV` variables. The application runs in the `/opt/certbot-dns-transip` directory.

```shell
```shell script
docker run -ti \
-v "${PWD}/letsencrypt:/etc/letsencrypt" \
-v "${PWD}/config:/opt/certbot-dns-transip/config" \
-v "${PWD}/logs:/opt/certbot-dns-transip/logs" \
--mount type=bind,source="${PWD}"/letsencrypt,target="/etc/letsencrypt" \
--mount type=bind,source="${PWD}"/config,target="/opt/certbot-dns-transip/config" \
--mount type=bind,source="${PWD}"/logs,target="/opt/certbot-dns-transip/logs" \
rbongers/certbot-dns-transip \
certonly --manual --preferred-challenge=dns \
--manual-auth-hook=/opt/certbot-dns-transip/auth-hook \
Expand All @@ -68,11 +68,11 @@ certonly --manual --preferred-challenge=dns \
```

And to renew certificates:
```shell
```shell script
docker run -ti \
-v "${PWD}/letsencrypt:/etc/letsencrypt" \
-v "${PWD}/config:/opt/certbot-dns-transip/config" \
-v "${PWD}/logs:/opt/certbot-dns-transip/logs" \
--mount type=bind,source="${PWD}"/letsencrypt,target="/etc/letsencrypt" \
--mount type=bind,source="${PWD}"/config,target="/opt/certbot-dns-transip/config" \
--mount type=bind,source="${PWD}"/logs,target="/opt/certbot-dns-transip/logs" \
rbongers/certbot-dns-transip \
renew
```
Expand Down
4 changes: 2 additions & 2 deletions src/CertbotTransIpDns01/Bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@ class Bootstrap implements LoggerAwareInterface

public function __construct(HookRequestInterface $request)
{
try {
$this->setUp();
$this->setUp();

try {
if ($request instanceof AuthHookRequest) {
$this->acme2->authHook($request);
} elseif ($request instanceof CleanupHookRequest) {
Expand Down
7 changes: 4 additions & 3 deletions src/CertbotTransIpDns01/ConfigLoader.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,10 @@ public function __construct()
$this->config = include(APP_ROOT . '/config/transip.php');
}

foreach ($this->requires as $required) {
if ($this->get($required) === null) {
throw new RuntimeException(sprintf("Config option '%s' not found", $required));
foreach ($this->requires as $requiredConfigKey) {
$requiredConfigKeyWithProvider = $this->get('provider') . '_' . $requiredConfigKey;
if ($this->get($requiredConfigKeyWithProvider, $this->get($requiredConfigKey)) === null) {
throw new RuntimeException(sprintf("Config option '%s' not found", $requiredConfigKey));
}
}
}
Expand Down

0 comments on commit a1031f7

Please sign in to comment.