-
-
Notifications
You must be signed in to change notification settings - Fork 174
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow injecting root certificate validity via env and also validity f…
…or new certs, when using USE_LOCAL_CA=1
- Loading branch information
Hreniuc Cristian-Alexandru
committed
Feb 19, 2024
1 parent
c799f6c
commit 1d2891c
Showing
4 changed files
with
29 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -80,6 +80,9 @@ instructions, from `@staticfloat`'s image, can be found | |
- `CERTBOT_DNS_PROPAGATION_SECONDS`: The number of seconds to wait for the DNS challenge to [propagate](.docs/certbot_authenticators.md#troubleshooting-tips) (default: certbot's default) | ||
- `DEBUG`: Set to `1` to enable debug messages and use the [`nginx-debug`][10] binary (default: `0`) | ||
- `USE_LOCAL_CA`: Set to `1` to enable the use of a [local certificate authority](./docs/advanced_usage.md#local-ca) (default: `0`) | ||
- `LOCAL_CA_DIR`: Set to a path to use as the [local CA directory](./docs/advanced_usage.md#local-ca) (default: `/etc/local_ca`) | ||
- `ROOT_CERT_LOCAL_CA_VALIDITY`: The number of days the [root certificate](./docs/advanced_usage.md#local-ca) should be valid (default: `30` days) | ||
- `NEW_CERT_LOCAL_CA_VALIDITY`: The number of days the [issued certificates](./docs/advanced_usage.md#local-ca) should be valid (default: `30` days) | ||
|
||
|
||
## Volumes | ||
|
@@ -115,6 +118,21 @@ the scripts and Nginx to reload everything. | |
docker kill --signal=HUP <container_name> | ||
``` | ||
|
||
Example of how to start the container with a local CA(advanced usage): | ||
|
||
```bash | ||
docker run -it -p 80:80 -p 443:443 \ | ||
--env [email protected] \ | ||
-v $(pwd)/nginx_secrets:/etc/letsencrypt \ | ||
-v $(pwd)/user_conf.d:/etc/nginx/user_conf.d:ro \ | ||
-v $(pwd)/local_ca:/etc/local_ca_custom:rw \ | ||
--env USE_LOCAL_CA=1 \ | ||
--env LOCAL_CA_DIR=/etc/local_ca_custom \ | ||
--env ROOT_CERT_LOCAL_CA_VALIDITY=3650 \ | ||
--env NEW_CERT_LOCAL_CA_VALIDITY=365 \ | ||
--name nginx-certbot jonasal/nginx-certbot:latest | ||
``` | ||
|
||
|
||
## Run with `docker-compose` | ||
An example of a [`docker-compose.yaml`](./examples/docker-compose.yml) file can | ||
|
@@ -211,4 +229,4 @@ a look and see if one of these helps or inspires you to do something similar: | |
[13]: https://portforward.com/router.htm | ||
[14]: https://github.com/JonasAlfredsson/docker-nginx-certbot/issues/28 | ||
[15]: https://security.stackexchange.com/a/104991 | ||
[16]: https://github.com/bats-core/bats-core | ||
[16]: https://github.com/bats-core/bats-core |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters