You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
refactor(validator): serve the page and its endpoint from one origin
validator.opentechevents.org replaces tools.opentechevents.org/validator/
as the canonical URL, and workers/validator (renamed from fetch-url)
serves both the page — through an assets binding — and /fetch.
Two reasons, one of them structural:
The validator is the only tool with no `?repo=` context. The others read
an organizer's fork from the query string, which is what the shared
tools host expresses; this one serves anyone holding a JSON document,
kit user or not, so a path under that host misfiled it.
Sharing an origin deletes a class of configuration rather than managing
it. The page issues a relative /fetch, so no cross-origin request
happens, its CSP tightens to `connect-src 'self'`, and ALLOWED_ORIGINS
shrinks to callers that genuinely are elsewhere (the dev server, the
legacy path). The endpoint URL is no longer baked into the bundle and
the CSP, where the two could drift apart.
GitHub Pages keeps /validator/ as a redirect so links already shared
survive and permalinks have one canonical form. Deployment moves to
deploy-validator.yml, which builds the page, deploys the Worker and then
re-runs the SSRF probes against the live endpoint — a deploy that stopped
refusing file:// or the metadata address is worse than one that failed.
Needs a CLOUDFLARE_API_TOKEN repository secret.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Copy file name to clipboardExpand all lines: README.md
+19-13Lines changed: 19 additions & 13 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -40,26 +40,32 @@ improvements can be traced package by package.
40
40
|[`preview`](apps/preview/)| Static feed previewer for OTE organizer forks. |
41
41
|[`publish`](apps/publish/)| "Broadcast" console: one event → every channel it can be published to. schema.org snippet, widget and subscribe links work today; directories, newsletters and social posts are declared and unbuilt. |
42
42
|[`embed`](apps/embed/)| Embeddable `<ote-events>` web component: drop an OTE feed into any website. |
43
-
|[`validator`](apps/validator/)| Is this document a valid OTE feed or event? Three input modes (URL, file, paste), linkable results, errors pointed at the exact line. |
43
+
|[`validator`](apps/validator/)| Is this document a valid OTE feed or event? Three input modes (URL, file, paste), linkable results, errors pointed at the exact line. Served at `validator.opentechevents.org` by `workers/validator`, not from Pages. |
`editor`, `preview`, `publish`, `validator` and `embed` are built and deployed
47
-
together by `deploy-tools.yml`; `dashboard-checks.js` is served as a
48
-
standalone file. Once the `tools.opentechevents.org` custom domain is
49
-
configured (see `.github/workflows/deploy-tools.yml`), they're reachable at
50
-
`tools.opentechevents.org/editor`, `/preview`, `/validator` and `/embed`.
46
+
`editor`, `preview`, `publish` and `embed` are built and deployed together by
47
+
`deploy-tools.yml` to `tools.opentechevents.org/<tool>/`;
48
+
`dashboard-checks.js` is served as a standalone file. Those four take a
49
+
`?repo=owner/name` context from an organizer's fork, which is what the shared
50
+
host expresses.
51
+
52
+
The `validator` does not: it serves anyone with a JSON document, so it gets
53
+
its own hostname, `validator.opentechevents.org`, deployed with the Worker
54
+
that its URL mode needs anyway (`deploy-validator.yml`). The Pages path
55
+
`/validator/` remains as a redirect.
51
56
52
57
## Workers
53
58
54
59
| Worker | What it does |
55
60
| --- | --- |
56
-
|[`fetch-url`](workers/fetch-url/)| Cloudflare Worker, the **only** component with network access: given a URL, return the bytes, under SSRF and size limits. Deployed to Cloudflare, not to the tools site. |
57
-
58
-
It exists for one mode of one tool: the validator cannot fetch a third-party
59
-
feed from the browser, because community feeds send no CORS headers. This is
60
-
not the "CORS proxy for reading platforms" that DESIGN.md rules out — it
61
-
fetches a document the user already has the URL of, in order to validate it,
62
-
and stores nothing.
61
+
|[`validator`](workers/validator/)| Serves `validator.opentechevents.org`: the validator page **and** its fetch endpoint on one origin. The **only** component with network access. |
62
+
63
+
The endpoint exists for one mode of one tool: the validator cannot fetch a
64
+
third-party feed from the browser, because community feeds send no CORS
65
+
headers. This is not the "CORS proxy for reading platforms" that DESIGN.md
66
+
rules out — it fetches a document the user already has the URL of, in order to
67
+
validate it, and stores nothing. Serving the page from the same Worker means
68
+
the page never makes a cross-origin request at all.
0 commit comments