Skip to content

Commit 01ec082

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 01ec082

3 files changed

Lines changed: 86 additions & 47 deletions

File tree

src/components/docs/DockerComposeSnippet.astro

Lines changed: 76 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,85 @@
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
16+
depends_on:
17+
- html2rss-web
1518
ports:
1619
- "127.0.0.1:4000:4000"
20+
volumes:
21+
- caddy_data:/data
22+
- caddy_config:/config
23+
command:
24+
- sh
25+
- -c
26+
- |
27+
caddy run --config - --adapter caddyfile <<EOF
28+
{
29+
admin off
30+
\${CADDY_GLOBAL_OPTIONS:-}
31+
}
32+
https://localhost:4000 {
33+
reverse_proxy html2rss-web:4000 {
34+
header_up X-Forwarded-For {client_ip}
35+
header_up X-Real-IP {client_ip}
36+
header_down -Via
37+
}
38+
}
39+
EOF
40+
41+
html2rss-web:
42+
image: ${webImage}
1743
environment:
1844
RACK_ENV: development
1945
HTML2RSS_ACCESS_TOKEN: CHANGE_ME_ADMIN_TOKEN
2046
BOTASAURUS_SCRAPER_URL: http://botasaurus:4010
2147
2248
botasaurus:
23-
image: ${botasaurusImage}`,
49+
image: ${botasaurusImage}
50+
51+
volumes:
52+
caddy_data:
53+
caddy_config:`,
2454
productionCaddy: `services:
2555
caddy:
2656
image: ${caddyImage}
2757
restart: unless-stopped
58+
depends_on:
59+
- html2rss-web
2860
ports:
2961
- "80:80"
3062
- "443:443"
3163
volumes:
3264
- caddy_data:/data
65+
- caddy_config:/config
3366
command:
34-
- caddy
35-
- reverse-proxy
36-
- --from
37-
- \${CADDY_HOST}
38-
- --to
39-
- html2rss-web:4000
67+
- sh
68+
- -c
69+
- |
70+
caddy run --config - --adapter caddyfile <<EOF
71+
{
72+
admin off
73+
\${CADDY_GLOBAL_OPTIONS:-}
74+
}
75+
https://\${CADDY_HOST:-localhost} {
76+
reverse_proxy html2rss-web:4000 {
77+
header_up X-Forwarded-For {client_ip}
78+
header_up X-Real-IP {client_ip}
79+
header_down -Via
80+
}
81+
}
82+
EOF
4083
4184
html2rss-web:
4285
image: ${webImage}
@@ -48,36 +91,35 @@ const snippets: Record<Props["variant"], string> = {
4891
RACK_ENV: production
4992
PORT: 4000
5093
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"
94+
HEALTH_CHECK_TOKEN: \${HEALTH_CHECK_TOKEN:?set HEALTH_CHECK_TOKEN}
5395
SENTRY_DSN: \${SENTRY_DSN:-}
54-
BOTASAURUS_SCRAPER_URL: http://botasaurus:4010
96+
SENTRY_ENABLE_LOGS: \${SENTRY_ENABLE_LOGS:-false}
97+
HTML2RSS_TOTAL_TIMEOUT_SECONDS: 25
98+
RACK_TIMEOUT_SERVICE_TIMEOUT: 30
99+
BROWSERLESS_IO_WEBSOCKET_URL: ws://browserless:4002
100+
BROWSERLESS_IO_API_TOKEN: \${BROWSERLESS_IO_API_TOKEN:?set BROWSERLESS_IO_API_TOKEN}
55101
56-
botasaurus:
57-
image: ${botasaurusImage}
102+
watchtower:
103+
image: ${watchtowerImage}
58104
restart: unless-stopped
105+
volumes:
106+
- /var/run/docker.sock:/var/run/docker.sock
107+
- "\${HOME}/.docker/config.json:/config.json"
108+
command: --cleanup --interval 7200
59109
60-
volumes:
61-
caddy_data:`,
62-
secure: `services:
63-
html2rss-web:
64-
image: ${webImage}
110+
browserless:
111+
image: ${browserlessImage}
65112
restart: unless-stopped
66-
env_file:
67-
- path: .env
68-
required: false
113+
ports:
114+
- "127.0.0.1:4002:4002"
69115
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
116+
PORT: 4002
117+
CONCURRENT: 10
118+
TOKEN: \${BROWSERLESS_IO_API_TOKEN:?set BROWSERLESS_IO_API_TOKEN}
77119
78-
botasaurus:
79-
image: ${botasaurusImage}
80-
restart: unless-stopped`,
120+
volumes:
121+
caddy_data:
122+
caddy_config:`,
81123
watchtower: `services:
82124
watchtower:
83125
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)