Skip to content

Commit 0d4e207

Browse files
committed
fix(docs/openapi): quickstart README and deterministic openapi generation
1 parent ef57f1a commit 0d4e207

3 files changed

Lines changed: 23 additions & 17 deletions

File tree

README.md

Lines changed: 17 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -47,16 +47,23 @@ This trial run is intentionally minimal. Use Docker Compose for Browserless, aut
4747

4848
## Deploy (Docker Compose)
4949

50-
1. Generate a key: `openssl rand -hex 32`.
51-
2. Export `HTML2RSS_SECRET_KEY`, `HEALTH_CHECK_TOKEN`, and `BROWSERLESS_IO_API_TOKEN` in your shell or `.env`.
52-
3. Export build metadata required by `docker-compose.yml`:
53-
```bash
54-
export BUILD_TAG=local
55-
export GIT_SHA="$(git rev-parse --short HEAD 2>/dev/null || echo dev)"
56-
```
57-
4. Optionally export `SENTRY_DSN` to send application errors to Sentry.
58-
5. Optionally export `SENTRY_ENABLE_LOGS=true` to forward structured application logs to Sentry.
59-
6. Start: `docker-compose up`.
50+
Quick start:
51+
52+
```bash
53+
export HTML2RSS_SECRET_KEY="$(openssl rand -hex 32)"
54+
export HEALTH_CHECK_TOKEN="replace-with-a-strong-token"
55+
export BROWSERLESS_IO_API_TOKEN="replace-with-your-browserless-token"
56+
export BUILD_TAG="local"
57+
export GIT_SHA="$(git rev-parse --short HEAD 2>/dev/null || echo dev)"
58+
docker-compose up
59+
```
60+
61+
Optional:
62+
63+
```bash
64+
export SENTRY_DSN="https://examplePublicKey@o0.ingest.sentry.io/0"
65+
export SENTRY_ENABLE_LOGS=true
66+
```
6067

6168
UI + API run on `http://localhost:4000`. The app exits if the secret key is missing.
6269

public/openapi.yaml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -277,8 +277,7 @@ paths:
277277
<rss version="2.0"><channel><title>Error</title><description>Internal Server Error</description></channel></rss>
278278
schema:
279279
type: string
280-
description: returns non-cacheable json feed errors when service generation
281-
fails
280+
description: returns non-cacheable feed errors when service generation fails
282281
security: []
283282
summary: Render feed by token
284283
tags:
@@ -331,7 +330,7 @@ paths:
331330
- success
332331
- data
333332
type: object
334-
description: returns current health status when a valid bearer token is provided
333+
description: returns health status when token is valid
335334
'401':
336335
content:
337336
application/json:

spec/html2rss/web/api/v1_spec.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ def expected_featured_feeds
214214
expect(json.dig('data', 'health', 'status')).to eq('healthy')
215215
end
216216

217-
it 'returns health status when the configured environment token is valid', :aggregate_failures do
217+
it 'returns health status when the configured environment token is valid', :aggregate_failures, openapi: false do
218218
ClimateControl.modify(HEALTH_CHECK_TOKEN: 'rotated-health-token') do
219219
allow(Html2rss::Web::Auth).to receive(:authenticate).and_call_original
220220

@@ -227,7 +227,7 @@ def expected_featured_feeds
227227
end
228228
end
229229

230-
it 'returns health status after production-style env scrubbing', :aggregate_failures do
230+
it 'returns health status after production-style env scrubbing', :aggregate_failures, openapi: false do
231231
capture_scrubbed_runtime_env(
232232
'RACK_ENV' => 'production',
233233
'HEALTH_CHECK_TOKEN' => 'scrubbed-health-token'
@@ -410,7 +410,7 @@ def expected_featured_feeds
410410
)
411411
end
412412

413-
it 'returns non-cacheable xml feed errors when service generation fails', :aggregate_failures do
413+
it 'returns non-cacheable feed errors when service generation fails', :aggregate_failures do
414414
unique_url = "#{feed_url}/service-error-xml"
415415
token = Html2rss::Web::Auth.generate_feed_token('admin', unique_url, strategy: 'faraday')
416416

@@ -424,7 +424,7 @@ def expected_featured_feeds
424424
expect(last_response.body).to include('Internal Server Error')
425425
end
426426

427-
it 'returns non-cacheable json feed errors when service generation fails', :aggregate_failures do
427+
it 'returns non-cacheable json feed errors when service generation fails', :aggregate_failures, openapi: false do
428428
unique_url = "#{feed_url}/service-error-json"
429429
token = Html2rss::Web::Auth.generate_feed_token('admin', unique_url, strategy: 'faraday')
430430

0 commit comments

Comments
 (0)