Skip to content

Commit d6de75d

Browse files
committed
Docs: fix style and typos and add testing instructions.
1 parent 6fe4d93 commit d6de75d

File tree

1 file changed

+39
-14
lines changed

1 file changed

+39
-14
lines changed

README.md

Lines changed: 39 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ certificate management ([ACMEv2]) protocol.
1616

1717
### Requirements
1818

19-
- Regular NGINX build dependencies: C compliler, make, PCRE2, Zlib
19+
- Regular NGINX build dependencies: C compiler, make, PCRE2, Zlib
2020
- System-wide installation of OpenSSL 1.1.1 or later
2121
- Rust toolchain (1.81.0 or later)
2222
- [libclang] for rust-bindgen
@@ -25,11 +25,11 @@ certificate management ([ACMEv2]) protocol.
2525

2626
### Building
2727

28-
One way to build the module is to export a path to a pre-built nginx source
28+
One way to build the module is to export a path to a pre-built NGINX source
2929
tree and run `cargo`.
3030

3131
```sh
32-
# checkout, configure and build nginx at ../nginx
32+
# checkout, configure and build NGINX at ../nginx
3333
cd nginx-acme
3434
export NGINX_BUILD_DIR=$(realpath ../nginx/objs)
3535
cargo build --release
@@ -40,7 +40,7 @@ The result will be located at `target/release/libnginx_acme.so`.
4040
Another way is to use the provided config script:
4141

4242
```sh
43-
# in the nginx source directory
43+
# in the NGINX source directory
4444
auto/configure \
4545
--with-compat \
4646
--with-http_ssl_module \
@@ -52,9 +52,29 @@ The result will be located at `objs/ngx_http_acme_module.so`.
5252
Currently this method produces a slightly larger library, as we don't instruct
5353
the linker to perform LTO and remove unused code.
5454

55+
### Testing
56+
57+
The repository contains an integration test suite based on the [nginx-tests].
58+
The following command will build the module and run the tests:
59+
60+
```sh
61+
# Path to the nginx source checkout, defaults to ../nginx if not specified.
62+
export NGINX_SOURCE_DIR=$(realpath ../nginx)
63+
# Path to the nginx-tests checkout; defaults to ../nginx/tests if not specified.
64+
export NGINX_TESTS_DIR=$(realpath ../nginx-tests)
65+
66+
make test
67+
```
68+
69+
Most of the tests require [pebble] test server binary in the path, or in a
70+
location specified via `TEST_NGINX_PEBBLE_BINARY` environment variable.
71+
72+
[nginx-tests]: https://github.com/nginx/nginx-tests
73+
[pebble]: https://github.com/letsencrypt/pebble
74+
5575
## How to Use
5676

57-
Add the module to the nginx configuration and configure as described below.
77+
Add the module to the NGINX configuration and configure as described below.
5878
Note that this module requires a [resolver] configuration in the `http` block.
5979

6080
[resolver]: https://nginx.org/en/docs/http/ngx_http_core_module.html#resolver
@@ -66,12 +86,12 @@ resolver 127.0.0.1:53;
6686
6787
acme_issuer example {
6888
uri https://acme.example.com/directory;
69-
70-
state_path /var/lib/nginx/acme-example;
89+
# contact [email protected];
90+
state_path /var/cache/nginx/acme-example;
7191
accept_terms_of_service;
7292
}
7393
74-
acme_shared_zone zone=acme_shared:1M;
94+
acme_shared_zone zone=ngx_acme_shared:1M;
7595
7696
server {
7797
listen 443 ssl;
@@ -82,6 +102,7 @@ server {
82102
ssl_certificate $acme_certificate;
83103
ssl_certificate_key $acme_certificate_key;
84104
105+
# do not parse the certificate on each request
85106
ssl_certificate_cache max=2;
86107
}
87108
@@ -130,12 +151,13 @@ of the ACME server. This is the only mandatory parameter in the
130151
The account's private key used for request authentication.
131152
Accepted values:
132153

133-
- `ecdsa:256/384/521` for `ES256` / `ES384` / `ES512` JSON Web Signature algorithms
134-
- `rsa:2048..4096` for `RS256` .
154+
- `ecdsa:256/384/521` for `ES256`, `ES384` or `ES512` JSON Web Signature
155+
algorithms
156+
- `rsa:2048..4096` for `RS256`.
135157
- File path for an existing key, using one of the algorithms above.
136158

137159
The generated account keys are preserved across reloads, but will be lost on
138-
restart unless [](#state_path) is configured.
160+
restart unless [state_path](#state_path) is configured.
139161

140162
### contact
141163

@@ -171,7 +193,7 @@ the certificate of the ACME server.
171193

172194
**Context:** acme_issuer
173195

174-
Enables or disables verification of the ACME servier certificate.
196+
Enables or disables verification of the ACME server certificate.
175197

176198
### state_path
177199

@@ -215,6 +237,9 @@ the module.
215237
The shared memory zone will be used to store the issued certificates, keys and
216238
challenge data for all the configured certificate issuers.
217239

240+
The default zone size is sufficient to hold ~50 ECDSA prime256v1 keys or
241+
~35 RSA 2048 keys.
242+
218243
### acme_certificate
219244

220245
**Syntax:** acme_certificate `issuer` [`identifier` ...] [ `key` = `alg[:size]` ]
@@ -245,12 +270,12 @@ The `ngx_http_acme_module` module defines following embedded
245270
variables, valid in the `server` block with the
246271
[acme_certificate](#acme_certificate) directive:
247272

248-
### ``$acme_certificate``
273+
### `$acme_certificate`
249274

250275
SSL certificate that can be passed to the
251276
[ssl_certificate](https://nginx.org/en/docs/http/ngx_http_ssl_module.html#ssl_certificate).
252277

253-
### ``$acme_certificate_key``
278+
### `$acme_certificate_key`
254279

255280
SSL certificate private key that can be passed to the
256281
[ssl_certificate_key](https://nginx.org/en/docs/http/ngx_http_ssl_module.html#ssl_certificate_key).

0 commit comments

Comments
 (0)