Skip to content

Commit 0f70291

Browse files
committed
docs: resolve PR feedback on deployment and snippet correctness
1 parent 6ccc428 commit 0f70291

8 files changed

Lines changed: 61 additions & 49 deletions

File tree

examples/deployment/docker-compose.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,7 @@ services:
22
html2rss-web:
33
image: html2rss/web:latest
44
restart: unless-stopped
5-
env_file:
6-
- path: .env
7-
required: false
5+
env_file: .env
86
environment:
97
PORT: 4000
108

src/components/docs/DockerComposeSnippet.astro

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,7 @@ const snippets: Record<Props["variant"], string> = {
1515
restart: unless-stopped
1616
ports:
1717
- "127.0.0.1:4000:4000"
18-
env_file:
19-
- path: .env
20-
required: false
18+
env_file: .env
2119
environment:
2220
RACK_ENV: production
2321
PORT: 4000
@@ -58,9 +56,7 @@ const snippets: Record<Props["variant"], string> = {
5856
html2rss-web:
5957
image: ${webImage}
6058
restart: unless-stopped
61-
env_file:
62-
- path: .env
63-
required: false
59+
env_file: .env
6460
environment:
6561
RACK_ENV: production
6662
PORT: 4000
@@ -86,9 +82,7 @@ volumes:
8682
html2rss-web:
8783
image: ${webImage}
8884
restart: unless-stopped
89-
env_file:
90-
- path: .env
91-
required: false
85+
env_file: .env
9286
environment:
9387
RACK_ENV: production
9488
PORT: 4000
@@ -115,7 +109,7 @@ volumes:
115109
- /var/run/docker.sock:/var/run/docker.sock:ro
116110
# Optional for private registries only:
117111
# - "\${HOME}/.docker/config.json:/config.json:ro"
118-
command: --cleanup --interval 7200`,
112+
command: --cleanup --interval 7200 html2rss-web browserless caddy`,
119113
resourceGuardrails: `services:
120114
html2rss-web:
121115
image: ${webImage}

src/content/docs/ruby-gem/how-to/advanced-features.mdx

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,9 +85,15 @@ Optimize requests with appropriate headers:
8585

8686
### Web Application Health Checks
8787

88-
Use the health check endpoint to monitor feed generation:
88+
Use the authenticated health endpoint to monitor the web application, or use liveness/readiness endpoints when you do not use an auth token:
8989

90-
<Code code={`curl -u username:password http://localhost:4000/health_check.txt`} lang="bash" />
90+
<Code
91+
code={`
92+
curl -H "Authorization: Bearer YOUR_HEALTH_CHECK_TOKEN" \
93+
http://localhost:4000/api/v1/health
94+
`}
95+
lang="bash"
96+
/>
9197

9298
## Article Validation
9399

src/content/docs/ruby-gem/how-to/custom-http-requests.mdx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,8 @@ Test your configuration to ensure headers work correctly:
204204

205205
<Code
206206
code={`
207-
curl -H "Authorization: Bearer YOUR_TOKEN" https://api.example.com/posts && \
207+
curl -H "Authorization: Bearer YOUR_TOKEN" \
208+
https://api.example.com/posts && \
208209
html2rss feed your-config.yml
209210
`}
210211
lang="bash"

src/content/docs/ruby-gem/how-to/scraping-json.mdx

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ is converted to this XML structure:
2929

3030
<Code
3131
code={`
32-
<object>
32+
<object>
3333
<data>
3434
<array>
3535
<object>
@@ -38,7 +38,7 @@ is converted to this XML structure:
3838
</object>
3939
</array>
4040
</data>
41-
</object>
41+
</object>
4242
`}
4343
lang="xml"
4444
/>
@@ -55,12 +55,12 @@ is converted to this XML structure:
5555

5656
<Code
5757
code={`
58-
<array>
58+
<array>
5959
<object>
6060
<title>Headline</title>
6161
<url>https://example.com</url>
6262
</object>
63-
</array>
63+
</array>
6464
`}
6565
lang="xml"
6666
/>
@@ -73,7 +73,7 @@ You would use `array > object` as your `items` selector.
7373

7474
<Code
7575
code={`
76-
Html2rss.feed(
76+
Html2rss.feed(
7777
headers: {
7878
Accept: 'application/json'
7979
},
@@ -85,7 +85,7 @@ You would use `array > object` as your `items` selector.
8585
title: { selector: 'title' },
8686
url: { selector: 'url' }
8787
}
88-
)
88+
)
8989
`}
9090
lang="ruby"
9191
/>
@@ -94,17 +94,17 @@ You would use `array > object` as your `items` selector.
9494

9595
<Code
9696
code={`
97-
headers:
97+
headers:
9898
Accept: application/json
99-
channel:
99+
channel:
100100
url: "https://domainname.tld/whatever.json"
101-
selectors:
101+
selectors:
102102
items:
103103
selector: "array > object"
104104
title:
105-
selector: ".title"
105+
selector: "title"
106106
url:
107107
selector: "url"
108-
`}
108+
`}
109109
lang="yml"
110110
/>

src/content/docs/ruby-gem/reference/cli-reference.mdx

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -69,12 +69,24 @@ Known anti-bot interstitial responses (for example Cloudflare challenge pages) a
6969

7070
<Code
7171
code={`
72-
docker run --rm -p 3000:3000 -e "CONCURRENT=10" -e "TOKEN=6R0W53R135510" ghcr.io/browserless/chromium && \
73-
BROWSERLESS_IO_WEBSOCKET_URL="ws://127.0.0.1:3000" \
74-
BROWSERLESS_IO_API_TOKEN="6R0W53R135510" \
75-
html2rss auto https://example.com/updates --strategy browserless
72+
# 1) Start Browserless in the background
73+
docker run -d --rm --name html2rss-browserless \
74+
-p 3000:3000 \
75+
-e "CONCURRENT=10" \
76+
-e "TOKEN=6R0W53R135510" \
77+
ghcr.io/browserless/chromium
78+
79+
# 2) Run html2rss against Browserless
80+
81+
BROWSERLESS_IO_WEBSOCKET_URL="ws://127.0.0.1:3000" \
82+
BROWSERLESS_IO_API_TOKEN="6R0W53R135510" \
83+
html2rss auto https://example.com/updates --strategy browserless
84+
85+
# 3) Stop Browserless when done
86+
87+
docker stop html2rss-browserless
7688
`}
77-
lang="bash"
89+
lang="bash"
7890
/>
7991

8092
If you see `Browserless connection failed`, check:

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

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ Before exposing html2rss-web, ensure:
3030
- Inbound TCP ports 80 and 443 reach the host (check firewalls and cloud security groups)
3131
- You are ready to watch the first deployment logs for certificate issuance
3232
- You have a value ready for `HTML2RSS_SECRET_KEY`
33-
- You have a value ready for `HEALTH_CHECK_TOKEN` (required by the documented Compose stack)
33+
- You have a value ready for `HEALTH_CHECK_TOKEN` if you plan to monitor authenticated `GET /api/v1/health` (the documented Compose stack uses it; `/api/v1/health/live` and `/api/v1/health/ready` do not require it)
3434

3535
If you plan to enable automatic feed generation, also prepare:
3636

@@ -82,7 +82,7 @@ Caddy handles certificates and redirects with almost no configuration.
8282
- Update your `.env` before starting the stack:
8383
- Set `CADDY_HOST` for your domain.
8484
- Generate a production secret (`openssl rand -hex 32`) and assign it to `HTML2RSS_SECRET_KEY`.
85-
- Set a strong `HEALTH_CHECK_TOKEN` (required by the documented Compose stack).
85+
- Set a strong `HEALTH_CHECK_TOKEN` when you use authenticated `GET /api/v1/health`; liveness/readiness probes can use `/api/v1/health/live` and `/api/v1/health/ready` without it.
8686
- Set `BUILD_TAG` and `GIT_SHA` to real release metadata for production.
8787
- 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.
8888
- After `docker compose up -d`, run `docker compose logs caddy --tail 20`; look for `certificate obtained`.
@@ -94,6 +94,7 @@ Caddy handles certificates and redirects with almost no configuration.
9494
Harden the application before inviting other users:
9595

9696
- Set a strong `HEALTH_CHECK_TOKEN` for authenticated `GET /api/v1/health`, and strong credentials for any protected feeds
97+
- Set a strong `HEALTH_CHECK_TOKEN` for authenticated `GET /api/v1/health`, and separate strong bearer tokens for any protected feeds
9798
- Prefer environment files (`.env`) stored outside version control for secrets
9899
- Keep any operator-only token distribution flow outside public docs and outside version control
99100

@@ -114,7 +115,7 @@ Keep the instance healthy once it is in production:
114115

115116
<DockerComposeSnippet variant="watchtower" />
116117

117-
This Watchtower shape updates all containers in the Docker host by default (not only `html2rss-web`).
118+
This Watchtower shape scopes updates to `html2rss-web`, `browserless`, and `caddy`; replace service names if your stack differs.
118119

119120
Check `docker compose logs watchtower` occasionally to confirm updates are applied.
120121

src/content/docs/web-application/reference/env-variables.mdx

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -5,19 +5,19 @@ description: "Configuration reference for html2rss-web environment variables."
55

66
## Supported ENV variables
77

8-
| Name | Description |
9-
| --------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
10-
| `HTML2RSS_SECRET_KEY` | required in production; development/test gets a temporary default |
11-
| `HEALTH_CHECK_TOKEN` | bearer token for authenticated `GET /api/v1/health`; required by the documented Compose stack, but custom stacks that probe only `/api/v1/health/live` and `/api/v1/health/ready` can omit it |
12-
| `BUILD_TAG` | defaults to `local` in the Compose stack; set release metadata explicitly in production |
13-
| `GIT_SHA` | defaults to `local` in the Compose stack; set deployed commit SHA explicitly in production |
14-
| `SENTRY_DSN` | optional; enables Sentry errors/logs when set |
15-
| `BROWSERLESS_IO_WEBSOCKET_URL` | optional; Browserless websocket endpoint for `browserless` strategy |
16-
| `BROWSERLESS_IO_API_TOKEN` | required by this site's Compose stack and by custom websocket endpoints; standalone `html2rss` local defaults can omit it |
17-
| `AUTO_SOURCE_ENABLED` | `true` by default in development/test, `false` otherwise |
18-
| `ASYNC_FEED_REFRESH_ENABLED` | optional boolean; default `false` |
19-
| `ASYNC_FEED_REFRESH_STALE_FACTOR` | optional integer `>= 1`; default `3` |
20-
| `PORT` | app listen port; compose uses `4000` |
21-
| `RACK_ENV` | Rack environment; compose uses `production` |
8+
| Name | Description |
9+
| --------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
10+
| `HTML2RSS_SECRET_KEY` | required in production; development/test gets a temporary default |
11+
| `HEALTH_CHECK_TOKEN` | bearer token for authenticated `GET /api/v1/health`; optional unless you use that endpoint (the documented Compose stack includes it); `/api/v1/health/live` and `/api/v1/health/ready` do not require it |
12+
| `BUILD_TAG` | defaults to `local` in the Compose stack; set release metadata explicitly in production |
13+
| `GIT_SHA` | defaults to `local` in the Compose stack; set deployed commit SHA explicitly in production |
14+
| `SENTRY_DSN` | optional; enables Sentry errors/logs when set |
15+
| `BROWSERLESS_IO_WEBSOCKET_URL` | optional; Browserless websocket endpoint for `browserless` strategy |
16+
| `BROWSERLESS_IO_API_TOKEN` | required by this site's Compose stack and by custom websocket endpoints; standalone `html2rss` local defaults can omit it |
17+
| `AUTO_SOURCE_ENABLED` | `true` by default in development/test, `false` otherwise |
18+
| `ASYNC_FEED_REFRESH_ENABLED` | optional boolean; default `false` |
19+
| `ASYNC_FEED_REFRESH_STALE_FACTOR` | optional integer `>= 1`; default `3` |
20+
| `PORT` | app listen port; compose uses `4000` |
21+
| `RACK_ENV` | Rack environment; compose uses `production` |
2222

2323
Older environment-variable examples from previous docs revisions are obsolete. Use only the supported table above and the `Environment & Runtime Flags` table in [`html2rss-web/docs/README.md`](https://github.com/html2rss/html2rss-web/blob/main/docs/README.md).

0 commit comments

Comments
 (0)