Skip to content

Commit 477fed1

Browse files
Add documentation for self-signed cert healthchecks (#7397)
* Add documentation for self-signed cert healthchecks Adds instruction to set NODE_EXTRA_CA_CERTS in docker-compose healthcheck commands so Node.js can trust the certificate. * [autofix.ci] apply automated fixes * fixup! Add documentation for self-signed cert healthchecks * [autofix.ci] apply automated fixes * Update Docker health checks with self-signed certs If using self signed certs, comment the first test line and uncomment the second test line. * fixup! Update Docker health checks with self-signed certs * fixup! Add documentation for self-signed cert healthchecks * fixup! Update Docker health checks with self-signed certs * [autofix.ci] apply automated fixes * fixup! Add documentation for self-signed cert healthchecks * fixup! Update Docker health checks with self-signed certs --------- Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
1 parent 64b2d9b commit 477fed1

3 files changed

Lines changed: 17 additions & 0 deletions

File tree

packages/docs/docs/config/https.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,15 @@ Use a self-signed certificate. This is the easiest way to get HTTPS working, but
1414

1515
- A command line tool like [mkcert](https://github.com/FiloSottile/mkcert) can automate this process.
1616
- Alternately, you can manually generate the certificates. Install OpenSSL for your operating system, then run `openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout selfhost.key -out selfhost.crt` in a terminal to generate the certificate and private key. You'll need to enter a two-letter country code to get the `.crt` file to be generated, but you can leave the rest of the fields blank (just hit enter at each prompt). Move the `selfhost.key` and `selfhost.crt` files to a location accessible to the Actual server.
17+
- When using a self-signed certificate, you may need to update the health check test command in your docker-compose.yml file to ensure it trusts the certificate. Add the `NODE_EXTRA_CA_CERTS=/data/selfhost.crt` environment variable to the health check command:
18+
19+
```yaml
20+
test:
21+
[
22+
'CMD-SHELL',
23+
'NODE_EXTRA_CA_CERTS=/data/selfhost.crt node src/scripts/health-check.js',
24+
]
25+
```
1726
1827
### Obtain a certificate without exposing to the internet
1928

packages/sync-server/docker-compose.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ services:
2222
healthcheck:
2323
# Enable health check for the instance
2424
test: ['CMD-SHELL', 'node src/scripts/health-check.js']
25+
# health check using self signed certs
26+
# test: ['CMD-SHELL', 'NODE_EXTRA_CA_CERTS=/data/selfhost.crt node src/scripts/health-check.js']
2527
interval: 60s
2628
timeout: 10s
2729
retries: 3

upcoming-release-notes/7397.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
category: Maintenance
3+
authors: [Kennedy242]
4+
---
5+
6+
Add documentation for configuring Docker health checks with self-signed certificates using `NODE_EXTRA_CA_CERTS`.

0 commit comments

Comments
 (0)