Skip to content

Commit 1d63c98

Browse files
committed
docs: update for built-in Caddy SSL termination
- Update getting-started.mdx: localhost URL → https://localhost:4000, add browser self-signed cert bypass note - Update deployment.mdx: remove 'Why a Reverse Proxy?' and separate Option A/B sections; document Caddy as the default built-in entry point with CADDY_HOST and CADDY_GLOBAL_OPTIONS env vars - Update DockerComposeSnippet.astro: align minimal and productionCaddy snippets with new compose files; remove stale 'secure' variant; import browserlessImage Part of html2rss/html2rss-web#1012
1 parent 688e82a commit 1d63c98

3 files changed

Lines changed: 76 additions & 47 deletions

File tree

src/components/docs/DockerComposeSnippet.astro

Lines changed: 66 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,51 @@
11
---
22
import { Code } from "@astrojs/starlight/components";
3-
import { botasaurusImage, caddyImage, watchtowerImage, webImage } from "../../data/docker";
3+
import { botasaurusImage, browserlessImage, caddyImage, watchtowerImage, webImage } from "../../data/docker";
44
55
interface Props {
6-
variant: "minimal" | "productionCaddy" | "secure" | "watchtower" | "resourceGuardrails";
6+
variant: "minimal" | "productionCaddy" | "watchtower" | "resourceGuardrails";
77
}
88
99
const { variant } = Astro.props;
1010
1111
const snippets: Record<Props["variant"], string> = {
1212
minimal: `services:
13-
html2rss-web:
14-
image: ${webImage}
13+
caddy:
14+
image: ${caddyImage}
15+
restart: unless-stopped
1516
ports:
1617
- "127.0.0.1:4000:4000"
18+
volumes:
19+
- caddy_data:/data
20+
- caddy_config:/config
21+
command:
22+
- sh
23+
- -c
24+
- |
25+
echo "{
26+
admin off
27+
\${CADDY_GLOBAL_OPTIONS:-}
28+
}
29+
https://localhost:4000 {
30+
reverse_proxy html2rss-web:4000 {
31+
header_up X-Forwarded-For {client_ip}
32+
header_up X-Real-IP {client_ip}
33+
}
34+
}" | caddy run --config - --adapter caddyfile
35+
36+
html2rss-web:
37+
image: ${webImage}
1738
environment:
1839
RACK_ENV: development
1940
HTML2RSS_ACCESS_TOKEN: CHANGE_ME_ADMIN_TOKEN
2041
BOTASAURUS_SCRAPER_URL: http://botasaurus:4010
2142
2243
botasaurus:
23-
image: ${botasaurusImage}`,
44+
image: ${botasaurusImage}
45+
46+
volumes:
47+
caddy_data:
48+
caddy_config:`,
2449
productionCaddy: `services:
2550
caddy:
2651
image: ${caddyImage}
@@ -30,13 +55,21 @@ const snippets: Record<Props["variant"], string> = {
3055
- "443:443"
3156
volumes:
3257
- caddy_data:/data
58+
- caddy_config:/config
3359
command:
34-
- caddy
35-
- reverse-proxy
36-
- --from
37-
- \${CADDY_HOST}
38-
- --to
39-
- html2rss-web:4000
60+
- sh
61+
- -c
62+
- |
63+
echo "{
64+
admin off
65+
\${CADDY_GLOBAL_OPTIONS:-}
66+
}
67+
https://\${CADDY_HOST:-localhost} {
68+
reverse_proxy html2rss-web:4000 {
69+
header_up X-Forwarded-For {client_ip}
70+
header_up X-Real-IP {client_ip}
71+
}
72+
}" | caddy run --config - --adapter caddyfile
4073
4174
html2rss-web:
4275
image: ${webImage}
@@ -48,36 +81,35 @@ const snippets: Record<Props["variant"], string> = {
4881
RACK_ENV: production
4982
PORT: 4000
5083
HTML2RSS_SECRET_KEY: \${HTML2RSS_SECRET_KEY:?set HTML2RSS_SECRET_KEY}
51-
HTML2RSS_ACCESS_TOKEN: \${HTML2RSS_ACCESS_TOKEN:?set HTML2RSS_ACCESS_TOKEN}
52-
AUTO_SOURCE_ENABLED: "true"
84+
HEALTH_CHECK_TOKEN: \${HEALTH_CHECK_TOKEN:?set HEALTH_CHECK_TOKEN}
5385
SENTRY_DSN: \${SENTRY_DSN:-}
54-
BOTASAURUS_SCRAPER_URL: http://botasaurus:4010
86+
SENTRY_ENABLE_LOGS: \${SENTRY_ENABLE_LOGS:-false}
87+
HTML2RSS_TOTAL_TIMEOUT_SECONDS: 25
88+
RACK_TIMEOUT_SERVICE_TIMEOUT: 30
89+
BROWSERLESS_IO_WEBSOCKET_URL: ws://browserless:4002
90+
BROWSERLESS_IO_API_TOKEN: \${BROWSERLESS_IO_API_TOKEN:?set BROWSERLESS_IO_API_TOKEN}
5591
56-
botasaurus:
57-
image: ${botasaurusImage}
92+
watchtower:
93+
image: ${watchtowerImage}
5894
restart: unless-stopped
95+
volumes:
96+
- /var/run/docker.sock:/var/run/docker.sock
97+
- "\${HOME}/.docker/config.json:/config.json"
98+
command: --cleanup --interval 7200
5999
60-
volumes:
61-
caddy_data:`,
62-
secure: `services:
63-
html2rss-web:
64-
image: ${webImage}
100+
browserless:
101+
image: ${browserlessImage}
65102
restart: unless-stopped
66-
env_file:
67-
- path: .env
68-
required: false
103+
ports:
104+
- "127.0.0.1:4002:4002"
69105
environment:
70-
RACK_ENV: production
71-
PORT: 4000
72-
HTML2RSS_SECRET_KEY: \${HTML2RSS_SECRET_KEY:?set HTML2RSS_SECRET_KEY}
73-
HTML2RSS_ACCESS_TOKEN: \${HTML2RSS_ACCESS_TOKEN:?set HTML2RSS_ACCESS_TOKEN}
74-
AUTO_SOURCE_ENABLED: "true"
75-
SENTRY_DSN: \${SENTRY_DSN:-}
76-
BOTASAURUS_SCRAPER_URL: http://botasaurus:4010
106+
PORT: 4002
107+
CONCURRENT: 10
108+
TOKEN: \${BROWSERLESS_IO_API_TOKEN:?set BROWSERLESS_IO_API_TOKEN}
77109
78-
botasaurus:
79-
image: ${botasaurusImage}
80-
restart: unless-stopped`,
110+
volumes:
111+
caddy_data:
112+
caddy_config:`,
81113
watchtower: `services:
82114
watchtower:
83115
image: ${watchtowerImage}

src/content/docs/web-application/deployment.mdx

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -37,15 +37,9 @@ If you plan to enable automatic feed generation, also prepare:
3737
- a clear way to give users the same `HTML2RSS_ACCESS_TOKEN` your instance expects
3838
- optional advanced-rendering infrastructure only if harder sites later prove they need it
3939

40-
### Why a Reverse Proxy?
40+
### Configure Caddy & SSL (Automatic HTTPS)
4141

42-
A reverse proxy terminates public HTTPS traffic and forwards requests to html2rss-web on your private Docker network.
43-
44-
### Option A: Caddy (Automatic HTTPS)
45-
46-
Caddy handles certificates and redirects.
47-
48-
<DockerComposeSnippet variant="productionCaddy" />
42+
The default `docker-compose.yml` includes Caddy out-of-the-box as the entry point. Caddy automatically terminates public HTTPS traffic, manages SSL/TLS certificates (via Let's Encrypt / ZeroSSL), redirects HTTP to HTTPS, and sanitizes headers to mitigate IP spoofing rate-limit bypasses.
4943

5044
Create a `.env` file beside your compose file:
5145

@@ -56,16 +50,19 @@ Create a `.env` file beside your compose file:
5650
HTML2RSS_ACCESS_TOKEN=<strong access token>
5751
# Optional only if you want authenticated GET /api/v1/health
5852
# HEALTH_CHECK_TOKEN=<strong health token>
53+
# Optional CDN/Load-balancer trusted proxies configuration
54+
# CADDY_GLOBAL_OPTIONS="servers { trusted_proxies static 172.16.0.0/12 }"
5955
`}
6056
lang="dotenv"
6157
/>
6258

6359
Before starting the stack:
6460

65-
- Set `CADDY_HOST` for your domain.
61+
- Set `CADDY_HOST` for your domain. If unset or left as `localhost`, Caddy will run with a local self-signed certificate.
6662
- Generate `HTML2RSS_SECRET_KEY` with `openssl rand -hex 32`.
6763
- Set a strong `HTML2RSS_ACCESS_TOKEN`. This is the token users paste into the web UI.
6864
- Leave `HEALTH_CHECK_TOKEN` unset unless you intentionally use authenticated `GET /api/v1/health`.
65+
- If you run behind a CDN (like Cloudflare), define `CADDY_GLOBAL_OPTIONS` in your `.env` with your trusted proxy configurations.
6966
- Leave `BUILD_TAG` and `GIT_SHA` unset unless you intentionally override image metadata in logs.
7067
- Adjust optional knobs such as `AUTO_SOURCE_ENABLED` and `SENTRY_DSN` as needed; refer to the [environment reference](/web-application/reference/env-variables/) for details.
7168

@@ -83,8 +80,6 @@ Harden the application before inviting other users:
8380
- Give trusted users the same current `HTML2RSS_ACCESS_TOKEN` through your normal operator channel
8481
- If you use authenticated `GET /api/v1/health`, set a strong `HEALTH_CHECK_TOKEN`; do not leave `CHANGE_ME_HEALTH_CHECK_TOKEN` anywhere in production
8582

86-
<DockerComposeSnippet variant="secure" />
87-
8883
Store these variables in a `.env` file and reference it with `env_file:` as demonstrated in the Caddy example.
8984

9085
## Operate & Monitor

src/content/docs/web-application/getting-started.mdx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ Run `html2rss-web` locally with Docker, confirm one generated feed works, then m
1515

1616
After this guide, you should have:
1717

18-
- `html2rss-web` running at `http://localhost:4000`
18+
- `html2rss-web` running at `https://localhost:4000`
1919
- successful feed generated from your own page URL
2020
- a clear handoff from the demo stack to the real deployment setup
2121
- a generated feed URL from your own page URL
@@ -59,7 +59,9 @@ This first-run stack keeps the path narrow:
5959

6060
## First Success Check
6161

62-
1. Open `http://localhost:4000`
62+
1. Open `https://localhost:4000`
63+
> [!NOTE]
64+
> Because the local stack runs securely over HTTPS using Caddy's internal certificate authority, your browser will show a warning about an untrusted or self-signed certificate. You can safely bypass/accept the warning to access the interface.
6365
2. Paste your own page URL into `Page URL`
6466
3. Start with a listing, newsroom, changelog, releases, or updates page instead of a homepage
6567
4. Enter `CHANGE_ME_ADMIN_TOKEN` when prompted

0 commit comments

Comments
 (0)