Skip to content

Commit a25aada

Browse files
Update documentation
With the addtion of the local CA I had to do a large refactoring of all the documentation. This looks like a large change, but basically the only new stuff is about the "Local CA".
1 parent 1a3c470 commit a25aada

File tree

4 files changed

+333
-186
lines changed

4 files changed

+333
-186
lines changed

README.md

Lines changed: 58 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -8,19 +8,19 @@ used during the initial handshake of some ciphers.
88

99
> :information_source: The very first time this container is started it might
1010
take a long time before before it is ready to respond to requests. Read more
11-
about this in the [Diffie-Hellman parameters][diffie-hellman-parameters]
11+
about this in the
12+
[Diffie-Hellman parameters](./docs/good_to_know.md#diffie-hellman-parameters)
1213
section.
1314

1415
### Noteworthy Features
15-
- Handles multiple server names when [requesting certificates][how-the-script-add-domain-names-to-certificate-requests] (i.e. both `example.com` and `www.example.com`).
16-
- Can request both [RSA and ECDSA][15] keys ([at the same time][ecdsa-and-rsa-certificates]).
17-
- Will create [Diffie-Hellman parameters][diffie-hellman-parameters] if they are defined.
16+
- Handles multiple server names when [requesting certificates](./docs/good_to_know.md#how-the-script-add-domain-names-to-certificate-requests) (i.e. both `example.com` and `www.example.com`).
17+
- Can request both [RSA and ECDSA](./docs/good_to_know.md#ecdsa-and-rsa-certificates) certificates ([at the same time](./docs/advanced_usage.md#multi-certificate-setup)).
18+
- Will create [Diffie-Hellman parameters](./docs/good_to_know.md#diffie-hellman-parameters) if they are defined.
1819
- Uses the [parent container][9]'s [`/docker-entrypoint.d/`][7] folder.
1920
- Will report correct [exit code][6] when stopped/killed/failed.
20-
- You can do a live reload of configs by [sending in a `SIGHUP`][manualforce-renewal] signal (no container restart needed).
21-
- Easy to [force renewal][manualforce-renewal] of certificates if necessary.
22-
- You can tune your own [renewal interval][renewal-check-interval].
23-
- Both [Debian and Alpine][dockerhub_tags] images built for [multiple architectures][14].
21+
- You can do a live reload of configs by [sending in a `SIGHUP`](./docs/advanced_usage.md#manualforce-renewal) signal (no container restart needed).
22+
- Possibility to use this image **offline** with the help of a [local CA](./docs/advanced_usage.md#local-ca).
23+
- Both [Debian and Alpine](./docs/dockerhub_tags.md) images built for [multiple architectures][14].
2424

2525

2626

@@ -35,23 +35,23 @@ This repository was originally forked from [`@henridwyer`][4] by
3535
the code has since become so significant that this has now been detached as its
3636
own independent repository (while still retaining all the history). Migration
3737
instructions, from `@staticfloat`'s image, can be found
38-
[here][help-migrating-from-staticfloats-image].
38+
[here](./docs/good_to_know.md#help-migrating-from-staticfloats-image).
3939

4040

4141

4242
# Usage
4343

4444
## Before You Start
4545
1. This guide expects you to already own a domain which points at the correct
46-
IP address, and that you have both port `80` and `443` correctly forwarded if
47-
you are behind NAT. Otherwise I recommend [DuckDNS][12] as a Dynamic DNS
46+
IP address, and that you have both port `80` and `443` correctly forwarded
47+
if you are behind NAT. Otherwise I recommend [DuckDNS][12] as a Dynamic DNS
4848
provider, and then either search on how to port forward on your router or
4949
maybe find it [here][13].
5050

5151
2. I suggest you read at least the first two sections in the
52-
[Good to Know][good-to-know] documentation, since this will give you some
53-
important tips on how to create a basic server config, and how to use
54-
the Let's Encrypt staging servers in order to not get rate limited.
52+
[Good to Know](./docs/good_to_know.md) documentation, since this will give
53+
you some important tips on how to create a basic server config, and how to
54+
use the Let's Encrypt staging servers in order to not get rate limited.
5555

5656
3. I don't think it is necessary to mention if you managed to find this
5757
repository, but you will need to have [Docker][11] installed for this to
@@ -64,23 +64,27 @@ instructions, from `@staticfloat`'s image, can be found
6464
- `CERTBOT_EMAIL`: Your e-mail address. Used by Let's Encrypt to contact you in case of security issues.
6565

6666
### Optional
67-
- `STAGING`: Set to `1` to use Let's Encrypt's [staging servers][initial-testing] (default: `0`)
68-
- `DHPARAM_SIZE`: The size of the [Diffie-Hellman parameters][diffie-hellman-parameters] (default: `2048`)
67+
- `STAGING`: Set to `1` to use Let's Encrypt's [staging servers](./docs/good_to_know.md#initial-testing) (default: `0`)
68+
- `DHPARAM_SIZE`: The size of the [Diffie-Hellman parameters](./docs/good_to_know.md#diffie-hellman-parameters) (default: `2048`)
6969
- `RSA_KEY_SIZE`: The size of the RSA encryption keys (default: `2048`)
70-
- `ELLIPTIC_CURVE`: The size/[curve][16] of the ECDSA keys (default: `secp256r1`)
71-
- `USE_ECDSA`: Set to `1` to have certbot use [ECDSA keys instead of RSA][ecdsa-and-rsa-certificates] (default: `0`)
72-
- `RENEWAL_INTERVAL`: Time interval between certbot's [renewal checks][renewal-check-interval] (default: `8d`)
70+
- `ELLIPTIC_CURVE`: The size/[curve][15] of the ECDSA keys (default: `secp256r1`)
71+
- `USE_ECDSA`: Set to `1` to have certbot use [ECDSA instead of RSA](./docs/good_to_know.md#ecdsa-and-rsa-certificates) (default: `0`)
72+
- `RENEWAL_INTERVAL`: Time interval between certbot's [renewal checks](./docs/good_to_know.md#renewal-check-interval) (default: `8d`)
73+
74+
### Advanced
7375
- `DEBUG`: Set to `1` to enable debug messages and use the [`nginx-debug`][10] binary (default: `0`)
76+
- `USE_LOCAL_CA`: Set to `1` to enable the use of a [local certificate authority](./docs/advanced_usage.md#local-ca) (default: `0`)
7477

7578

7679
## Volumes
7780
- `/etc/letsencrypt`: Stores the obtained certificates and the Diffie-Hellman parameters
7881

7982

8083
## Run with `docker run`
81-
Create your own [`user_conf.d/`][the-user_conf.d-folder] folder and place all
82-
of you custom server config files in there. When done you can just start the
83-
container with the following command ([available tags][dockerhub_tags]):
84+
Create your own [`user_conf.d/`](./docs/good_to_know.md#the-user_confd-folder)
85+
folder and place all of you custom server config files in there. When done you
86+
can just start the container with the following command
87+
([available tags](./docs/dockerhub_tags.md)):
8488

8589
```bash
8690
docker run -it -p 80:80 -p 443:443 \
@@ -95,25 +99,27 @@ docker run -it -p 80:80 -p 443:443 \
9599

96100
As was mentioned in the introduction; the very first time this container is
97101
started it might take a long time before before it is ready to
98-
[respond to requests][diffie-hellman-parameters], please be a little bit
99-
patient. If you change any of the config files after the container is ready,
100-
you can just [send in a `SIGHUP`][manualforce-renewal] to tell my scripts and
101-
Nginx to reload everything.
102+
[respond to requests](./docs/good_to_know.md#diffie-hellman-parameters), please
103+
be a little bit patient. If you change any of the config files after the
104+
container is ready, you can just
105+
[send in a `SIGHUP`](./docs/advanced_usage.md#manualforce-renewal) to tell
106+
the scripts and Nginx to reload everything.
102107

103108
```bash
104109
docker kill --signal=HUP <container_name>
105110
```
106111

107112

108113
## Run with `docker-compose`
109-
An example of a `docker-compose.yaml` file can be found in the
110-
[`examples/`](./examples) folder. The default parameters that are found inside
111-
the `nginx-certbot.env` file will be overwritten by any environment variables
112-
you set inside the `.yaml` file.
114+
An example of a [`docker-compose.yaml`](./examples/docker-compose.yml) file can
115+
be found in the [`examples/`](./examples) folder. The default parameters that
116+
are found inside the [`nginx-certbot.env`](./examples/nginx-certbot.env) file
117+
will be overwritten by any environment variables you set inside the `.yaml`
118+
file.
113119

114120
Like in the example above, you just need to place your custom server configs
115-
inside your [`user_conf.d/`][the-user_conf.d-folder] folder beforehand. Then
116-
you start it all with the following command.
121+
inside your [`user_conf.d/`](./docs/good_to_know.md#the-user_confd-folder)
122+
folder beforehand. Then you start it all with the following command.
117123

118124
```bash
119125
docker-compose up
@@ -122,15 +128,15 @@ docker-compose up
122128

123129
## Build It Yourself
124130
This option is for if you make your own `Dockerfile`. Check out which tags that
125-
are available in [this document][dockerhub_tags], or on [Docker Hub][8], and
126-
then choose how specific you want to be.
131+
are available in [this document](./docs/dockerhub_tags.md), or on
132+
[Docker Hub][8], and then choose how specific you want to be.
127133

128134
In this case it is possible to completely skip the
129-
[`user_conf.d/`][the-user_conf.d-folder] folder and just write your files
130-
directly into Nginx's `conf.d/` folder. This way you can replace the files I
131-
have built [into the image](./src/nginx_conf.d) with your own. However, if you
132-
do that please take a moment to understand what they do, and what you need to
133-
include in order for certbot to continue working.
135+
[`user_conf.d/`](./docs/good_to_know.md#the-user_confd-folder) folder and just
136+
write your files directly into Nginx's `conf.d/` folder. This way you can
137+
replace the files I have built [into the image](./src/nginx_conf.d) with your
138+
own. However, if you do that please take a moment to understand what they do,
139+
and what you need to include in order for certbot to continue working.
134140

135141
```Dockerfile
136142
FROM jonasal/nginx-certbot:latest
@@ -143,33 +149,26 @@ COPY conf.d/* /etc/nginx/conf.d/
143149
Here is a collection of links to other resources that provide useful
144150
information.
145151

146-
### Good to Know
147-
[Document][good-to-know] with a lot of good to know stuff about this image and
148-
the features it provides.
152+
#### Good to Know
153+
[Document](./docs/good_to_know.md) with a lot of good to know stuff about this
154+
image and the features it provides.
149155

150-
### Changelog
151-
[Document][changelog] with all the tagged versions of this repository, as well
152-
as bullet points to what has changed between the releases.
156+
#### Changelog
157+
[Document](./docs/changelog.md) with all the tagged versions of this repository,
158+
as well as bullet points to what has changed between the releases.
153159

154-
### DockerHub Tags
155-
[Document][dockerhub_tags] with all the tags available from Docker Hub.
160+
#### DockerHub Tags
161+
[Document](./docs/dockerhub_tags.md) with all the tags available from Docker
162+
Hub.
156163

164+
#### Advanced Usage
165+
[Document](./docs/advanced_usage.md) with information about the more advanced
166+
features this image provides.
157167

158168

159169

160170

161171

162-
[good-to-know]: https://github.com/JonasAlfredsson/docker-nginx-certbot/tree/master/docs/good_to_know.md
163-
[diffie-hellman-parameters]: https://github.com/JonasAlfredsson/docker-nginx-certbot/tree/master/docs/good_to_know.md#diffie-hellman-parameters
164-
[help-migrating-from-staticfloats-image]: https://github.com/JonasAlfredsson/docker-nginx-certbot/tree/master/docs/good_to_know.md#help-migrating-from-staticfloats-image
165-
[how-the-script-add-domain-names-to-certificate-requests]: https://github.com/JonasAlfredsson/docker-nginx-certbot/tree/master/docs/good_to_know.md#how-the-script-add-domain-names-to-certificate-requests
166-
[manualforce-renewal]: https://github.com/JonasAlfredsson/docker-nginx-certbot/tree/master/docs/good_to_know.md#manualforce-renewal
167-
[renewal-check-interval]: https://github.com/JonasAlfredsson/docker-nginx-certbot/tree/master/docs/good_to_know.md#renewal-check-interval
168-
[initial-testing]: https://github.com/JonasAlfredsson/docker-nginx-certbot/tree/master/docs/good_to_know.md#initial-testing
169-
[the-user_conf.d-folder]: https://github.com/JonasAlfredsson/docker-nginx-certbot/tree/master/docs/good_to_know.md#the-user_confd-folder
170-
[changelog]: https://github.com/JonasAlfredsson/docker-nginx-certbot/tree/master/docs/changelog.md
171-
[dockerhub_tags]: https://github.com/JonasAlfredsson/docker-nginx-certbot/blob/master/docs/dockerhub_tags.md
172-
[ecdsa-and-rsa-certificates]: https://github.com/JonasAlfredsson/docker-nginx-certbot/tree/master/docs/good_to_know.md#ecdsa-and-rsa-certificates
173172

174173
[1]: https://letsencrypt.org/
175174
[2]: https://github.com/certbot/certbot
@@ -185,5 +184,4 @@ as bullet points to what has changed between the releases.
185184
[12]: https://www.duckdns.org/
186185
[13]: https://portforward.com/router.htm
187186
[14]: https://github.com/JonasAlfredsson/docker-nginx-certbot/issues/28
188-
[15]: https://sectigostore.com/blog/ecdsa-vs-rsa-everything-you-need-to-know/
189-
[16]: https://security.stackexchange.com/a/104991
187+
[15]: https://security.stackexchange.com/a/104991

0 commit comments

Comments
 (0)