Skip to content

Commit cc1bce5

Browse files
authored
docs(web): align deployment and operator guidance (#1115)
* docs(web): align deployment and operator guidance * docs: align naming * docs: align heavy-usage auto quality guidance and web retry semantics * docs: relax compose startup env requirements * docs: reconcile deployment env guidance * docs: env + strategy adjustment * chore(deps): update ruby deps * docs: migrate code blocks to Starlight Code and fix YAML indentation * docs: resolve PR feedback on deployment and snippet correctness * docs: standardize compose env_file object syntax * .
1 parent 30be9bd commit cc1bce5

41 files changed

Lines changed: 1551 additions & 925 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ pnpm-debug.log*
1616
# environment variables
1717
.env
1818
.env.production
19+
!examples/deployment/.env
1920

2021
# macOS-specific files
2122
.DS_Store

AGENTS.md

Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
# Repository Guidelines
2+
3+
## Scope and Ownership
4+
5+
This repository (`html2rss.github.io/`) is the public docs and feed-directory site built with Astro/Starlight.
6+
Classify most work here as `docs`.
7+
8+
What this repo owns:
9+
10+
- docs content and navigation under `src/content/docs/`
11+
- docs-specific components and styling under `src/components/`
12+
- feed-directory presentation and client behavior
13+
- generated docs data consumed by the site (`src/data/configs.json`)
14+
15+
What this repo does not own:
16+
17+
- runtime extractor behavior and CLI semantics (`html2rss/`)
18+
- web API behavior and OpenAPI generation (`html2rss-web/`)
19+
- feed YAML catalog definitions (`html2rss-configs/`)
20+
21+
When docs describe behavior from other repos, treat those repos as source-of-truth and update docs to match them.
22+
23+
## Cross-Repo Contracts
24+
25+
Before substantial edits, state cross-repo context in your notes:
26+
27+
- Source-of-truth repo
28+
- Downstream consumer repo(s)
29+
- Whether this change needs coordinated follow-up outside `html2rss.github.io/`
30+
31+
Common contracts:
32+
33+
- Feed directory data comes from `html2rss-configs` via `bin/data-update`.
34+
- Ruby gem docs should match `html2rss` behavior and CLI output.
35+
- Web application docs should match `html2rss-web` behavior and published OpenAPI.
36+
37+
If a cross-repo behavior changed but upstream is not updated yet, document the gap clearly instead of inventing new behavior.
38+
39+
## Generated Artifacts
40+
41+
Treat `src/data/configs.json` as generated.
42+
43+
- Do not hand-edit it.
44+
- Regenerate with repo-native commands:
45+
- `make update`
46+
- or `bin/data-update` (after dependencies are installed)
47+
- `bin/data-update` reads packaged configs (from `html2rss-configs`) and writes `src/data/configs.json`.
48+
49+
If a change only affects generated data, include the source change rationale in the PR description.
50+
51+
## Build, Test, and Dev Commands
52+
53+
Run commands from `html2rss.github.io/`:
54+
55+
- `make setup` installs dependencies and refreshes generated data
56+
- `make dev` runs Astro locally
57+
- `make build` builds production output
58+
- `make lint` checks formatting
59+
- `make lintfix` applies formatting fixes
60+
- `make update` refreshes feed-directory data from packaged configs
61+
62+
Preferred verification flow for docs/content changes:
63+
64+
1. Run targeted check(s) first (`make lint` or `make build`).
65+
2. Run the broader check set before PR (`make lint` and `make build`).
66+
3. If feed directory or config references changed, run `make update` and verify resulting diffs.
67+
68+
## Docs Authoring Rules
69+
70+
### Code Snippets
71+
72+
In docs content (`src/content/docs/**`) and docs-supporting components:
73+
74+
- Do not use triple-backtick fenced code blocks.
75+
- Always render snippets with the `<Code>` component.
76+
- Use this import:
77+
`import { Code } from '@astrojs/starlight/components';`
78+
- Do not use:
79+
`import Code from "astro/components/Code.astro";`
80+
81+
### Accuracy Rules
82+
83+
- Prefer concrete, verifiable statements over aspirational wording.
84+
- Keep repo and path references explicit when guidance is cross-repo.
85+
- When referencing commands that belong to another repo, include that repo directory in the command example.
86+
87+
## Commit and PR Expectations
88+
89+
- Keep each commit scoped to one logical docs change.
90+
- Do not mix unrelated changes or unrelated generated diffs.
91+
- In PRs, call out:
92+
- cross-repo assumptions
93+
- generated files updated
94+
- verification commands run

Gemfile.lock

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,11 +178,12 @@ GEM
178178

179179
PLATFORMS
180180
arm64-darwin-24
181+
arm64-darwin-25
181182
x86_64-linux
182183

183184
DEPENDENCIES
184185
html2rss!
185186
html2rss-configs!
186187

187188
BUNDLED WITH
188-
2.7.1
189+
4.0.9

README.md

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,21 +13,24 @@ website.
1313
### Quick Setup
1414

1515
```bash
16-
# Install dependencies and start development server
16+
# Install dependencies and refresh generated feed data
1717
make setup
18+
19+
# Start the local Astro development server
20+
make dev
1821
```
1922

2023
### 💻 Try in Browser
2124

2225
You can develop html2rss directly in your browser using GitHub Codespaces:
2326

24-
[Open in GitHub Codespaces](https://github.com/codespaces/new?repo=html2rss/html2rss)
27+
[Open in GitHub Codespaces](https://github.com/codespaces/new?repo=html2rss/html2rss.github.io)
2528

2629
The Codespace provides a cloud development environment with Node.js and Ruby pre-installed. Run `make setup` to install dependencies and get started!
2730

2831
### Available Commands
2932

30-
- `make setup` - Install dependencies and start dev server
33+
- `make setup` - Install dependencies and refresh generated feed data
3134
- `make dev` - Start Astro development server
3235
- `make build` - Build for production
3336
- `make preview` - Preview production build

examples/deployment/.env

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# Domain & routing
2+
CADDY_HOST=example.com
3+
4+
# Core runtime
5+
RACK_ENV=production
6+
7+
# Security
8+
# Generate with: openssl rand -hex 32
9+
HTML2RSS_SECRET_KEY=replace-with-64-hex-characters-generated-by-openssl-rand-hex-32
10+
11+
# Authenticated health endpoint token
12+
# Required by the documented Compose stack.
13+
# If you build a custom stack and probe only /api/v1/health/live and /api/v1/health/ready,
14+
# you can omit this value.
15+
HEALTH_CHECK_TOKEN=replace-with-strong-health-token
16+
17+
# Auto source (optional; keep false unless you need automatic feed generation)
18+
AUTO_SOURCE_ENABLED=false
19+
20+
# Observability (optional)
21+
#SENTRY_DSN=
22+
23+
# Performance tuning (override defaults only when needed)
24+
WEB_CONCURRENCY=2
25+
WEB_MAX_THREADS=5
26+
RACK_TIMEOUT_SERVICE_TIMEOUT=15

examples/deployment/docker-compose.yml

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,24 @@
11
services:
2-
html2rss:
2+
html2rss-web:
33
image: html2rss/web:latest
4-
env_file: .env
4+
restart: unless-stopped
5+
env_file:
6+
- path: .env
7+
required: false
8+
environment:
9+
PORT: 4000
510

611
caddy:
712
image: caddy:2-alpine
813
depends_on:
9-
- html2rss
14+
- html2rss-web
1015
command:
1116
- caddy
1217
- reverse-proxy
1318
- --from
1419
- ${CADDY_HOST}
1520
- --to
16-
- html2rss:3000
21+
- html2rss-web:4000
1722
ports:
1823
- "80:80"
1924
- "443:443"
@@ -23,14 +28,12 @@ services:
2328
watchtower:
2429
image: containrrr/watchtower
2530
depends_on:
26-
- html2rss
31+
- html2rss-web
2732
- caddy
2833
command:
2934
- --cleanup
3035
- --interval
31-
- "300"
32-
- html2rss
33-
- caddy
36+
- "7200"
3437
volumes:
3538
- /var/run/docker.sock:/var/run/docker.sock:ro
3639
restart: unless-stopped

src/components/docs/DockerComposeSnippet.astro

Lines changed: 63 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
import Code from "astro/components/Code.astro";
2+
import { Code } from "@astrojs/starlight/components";
33
import { browserlessImage, caddyImage, watchtowerImage, webImage } from "../../data/docker";
44
55
interface Props {
@@ -15,13 +15,19 @@ 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
1821
environment:
1922
RACK_ENV: production
2023
PORT: 4000
21-
HTML2RSS_SECRET_KEY: your-generated-secret-key
22-
HEALTH_CHECK_TOKEN: your-health-check-token
24+
BUILD_TAG: \${BUILD_TAG:-local}
25+
GIT_SHA: \${GIT_SHA:-local}
26+
HTML2RSS_SECRET_KEY: \${HTML2RSS_SECRET_KEY:?set HTML2RSS_SECRET_KEY}
27+
HEALTH_CHECK_TOKEN: \${HEALTH_CHECK_TOKEN:?set HEALTH_CHECK_TOKEN}
28+
SENTRY_DSN: \${SENTRY_DSN:-}
2329
BROWSERLESS_IO_WEBSOCKET_URL: ws://browserless:4002
24-
BROWSERLESS_IO_API_TOKEN: your-browserless-token
30+
BROWSERLESS_IO_API_TOKEN: \${BROWSERLESS_IO_API_TOKEN:?set BROWSERLESS_IO_API_TOKEN}
2531
2632
browserless:
2733
image: "${browserlessImage}"
@@ -31,10 +37,11 @@ const snippets: Record<Props["variant"], string> = {
3137
environment:
3238
PORT: 4002
3339
CONCURRENT: 10
34-
TOKEN: your-browserless-token`,
40+
TOKEN: \${BROWSERLESS_IO_API_TOKEN:?set BROWSERLESS_IO_API_TOKEN}`,
3541
productionCaddy: `services:
3642
caddy:
3743
image: ${caddyImage}
44+
restart: unless-stopped
3845
ports:
3946
- "80:80"
4047
- "443:443"
@@ -46,39 +53,71 @@ const snippets: Record<Props["variant"], string> = {
4653
- --from
4754
- \${CADDY_HOST}
4855
- --to
49-
- html2rss:3000
50-
html2rss:
56+
- html2rss-web:4000
57+
58+
html2rss-web:
5159
image: ${webImage}
52-
env_file: .env
60+
restart: unless-stopped
61+
env_file:
62+
- path: .env
63+
required: false
64+
environment:
65+
RACK_ENV: production
66+
PORT: 4000
67+
BUILD_TAG: \${BUILD_TAG:-local}
68+
GIT_SHA: \${GIT_SHA:-local}
69+
HTML2RSS_SECRET_KEY: \${HTML2RSS_SECRET_KEY:?set HTML2RSS_SECRET_KEY}
70+
HEALTH_CHECK_TOKEN: \${HEALTH_CHECK_TOKEN:?set HEALTH_CHECK_TOKEN}
71+
SENTRY_DSN: \${SENTRY_DSN:-}
72+
BROWSERLESS_IO_WEBSOCKET_URL: ws://browserless:4002
73+
BROWSERLESS_IO_API_TOKEN: \${BROWSERLESS_IO_API_TOKEN:?set BROWSERLESS_IO_API_TOKEN}
74+
75+
browserless:
76+
image: "${browserlessImage}"
77+
restart: unless-stopped
78+
environment:
79+
PORT: 4002
80+
CONCURRENT: 10
81+
TOKEN: \${BROWSERLESS_IO_API_TOKEN:?set BROWSERLESS_IO_API_TOKEN}
5382
5483
volumes:
5584
caddy_data:`,
5685
secure: `services:
57-
html2rss:
86+
html2rss-web:
5887
image: ${webImage}
88+
restart: unless-stopped
89+
env_file:
90+
- path: .env
91+
required: false
5992
environment:
6093
RACK_ENV: production
61-
LOG_LEVEL: warn
62-
HEALTH_CHECK_USERNAME: your-secure-username
63-
HEALTH_CHECK_PASSWORD: your-very-secure-password
64-
BASE_URL: https://yourdomain.com`,
94+
PORT: 4000
95+
BUILD_TAG: \${BUILD_TAG:-local}
96+
GIT_SHA: \${GIT_SHA:-local}
97+
HTML2RSS_SECRET_KEY: \${HTML2RSS_SECRET_KEY:?set HTML2RSS_SECRET_KEY}
98+
HEALTH_CHECK_TOKEN: \${HEALTH_CHECK_TOKEN:?set HEALTH_CHECK_TOKEN}
99+
SENTRY_DSN: \${SENTRY_DSN:-}
100+
BROWSERLESS_IO_WEBSOCKET_URL: ws://browserless:4002
101+
BROWSERLESS_IO_API_TOKEN: \${BROWSERLESS_IO_API_TOKEN:?set BROWSERLESS_IO_API_TOKEN}
102+
103+
browserless:
104+
image: "${browserlessImage}"
105+
restart: unless-stopped
106+
environment:
107+
PORT: 4002
108+
CONCURRENT: 10
109+
TOKEN: \${BROWSERLESS_IO_API_TOKEN:?set BROWSERLESS_IO_API_TOKEN}`,
65110
watchtower: `services:
66111
watchtower:
67112
image: ${watchtowerImage}
68-
depends_on:
69-
- html2rss
70-
- caddy
71-
command:
72-
- --cleanup
73-
- --interval
74-
- "300"
75-
- html2rss
76-
- caddy
113+
restart: unless-stopped
77114
volumes:
78115
- /var/run/docker.sock:/var/run/docker.sock:ro
79-
restart: unless-stopped`,
116+
# Optional for private registries only:
117+
# - "\${HOME}/.docker/config.json:/config.json:ro"
118+
command: --cleanup --interval 7200 html2rss-web browserless caddy`,
80119
resourceGuardrails: `services:
81-
html2rss:
120+
html2rss-web:
82121
image: ${webImage}
83122
deploy:
84123
resources:

0 commit comments

Comments
 (0)