From 7ef303cb93a909271111da2ccfb7f061291fad60 Mon Sep 17 00:00:00 2001 From: kochetkov-ma Date: Mon, 8 Jun 2026 22:17:45 +0100 Subject: [PATCH] docs(publish): document site republish (PUT, same URL) across skill variants --- brewdoc/skills/publish/SKILL.md | 13 ++++++++----- openclaw/brewpage-publish/SKILL.md | 4 +++- skills/brewpage-publish/SKILL.md | 4 +++- .../src/content/docs/brewdoc/skills/publish.mdx | 10 ++++++++++ 4 files changed, 24 insertions(+), 7 deletions(-) diff --git a/brewdoc/skills/publish/SKILL.md b/brewdoc/skills/publish/SKILL.md index aece405..3daedad 100644 --- a/brewdoc/skills/publish/SKILL.md +++ b/brewdoc/skills/publish/SKILL.md @@ -116,7 +116,7 @@ if [ ! -f "$HISTORY_FILE" ]; then cat > "$HISTORY_FILE" <<'HEADER' # brewpage.app — Published Pages -> Owner tokens allow delete (no in-place PUT for sites; html/json/kv support PUT). Keep this file private. +> Owner tokens allow delete and in-place republish (html/json/kv/sites all support PUT). Keep this file private. > Delete: `curl -s -X DELETE "https://brewpage.app/api/{ns}/{id}" -H "X-Owner-Token: TOKEN"` | Date | URL | Owner Token | TTL | Type | @@ -155,7 +155,7 @@ if [ ! -f "$HISTORY_FILE" ]; then cat > "$HISTORY_FILE" <<'HEADER' # brewpage.app — Published Pages -> Owner tokens allow delete (no in-place PUT for sites; html/json/kv support PUT). Keep this file private. +> Owner tokens allow delete and in-place republish (html/json/kv/sites all support PUT). Keep this file private. > Delete: `curl -s -X DELETE "https://brewpage.app/api/{ns}/{id}" -H "X-Owner-Token: TOKEN"` | Date | URL | Owner Token | TTL | Type | @@ -189,7 +189,7 @@ if [ ! -f "$HISTORY_FILE" ]; then cat > "$HISTORY_FILE" <<'HEADER' # brewpage.app — Published Pages -> Owner tokens allow delete (no in-place PUT for sites; html/json/kv support PUT). Keep this file private. +> Owner tokens allow delete and in-place republish (html/json/kv/sites all support PUT). Keep this file private. > Delete: `curl -s -X DELETE "https://brewpage.app/api/{ns}/{id}" -H "X-Owner-Token: TOKEN"` | Date | URL | Owner Token | TTL | Type | @@ -222,8 +222,9 @@ if [ ! -f "$HISTORY_FILE" ]; then cat > "$HISTORY_FILE" <<'HEADER' # brewpage.app — Published Pages -> Owner tokens allow delete (no in-place PUT for sites; html/json/kv support PUT). Keep this file private. +> Owner tokens allow delete and in-place republish (html/json/kv/sites all support PUT). Keep this file private. > Delete: `curl -s -X DELETE "https://brewpage.app/api/sites/{ns}/{id}" -H "X-Owner-Token: TOKEN"` +> Update site (keep same URL): `PUT /api/sites/{ns}/{id}` with `X-Owner-Token: TOKEN` + the new bundle — fully replaces the file set (adds new, removes absent, overwrites matching). The link never changes. | Date | URL | Owner Token | TTL | Type | |------|-----|-------------|-----|------| @@ -261,8 +262,9 @@ if [ ! -f "$HISTORY_FILE" ]; then cat > "$HISTORY_FILE" <<'HEADER' # brewpage.app — Published Pages -> Owner tokens allow delete (no in-place PUT for sites; html/json/kv support PUT). Keep this file private. +> Owner tokens allow delete and in-place republish (html/json/kv/sites all support PUT). Keep this file private. > Delete: `curl -s -X DELETE "https://brewpage.app/api/sites/{ns}/{id}" -H "X-Owner-Token: TOKEN"` +> Update site (keep same URL): `PUT /api/sites/{ns}/{id}` with `X-Owner-Token: TOKEN` + the new bundle — fully replaces the file set (adds new, removes absent, overwrites matching). The link never changes. | Date | URL | Owner Token | TTL | Type | |------|-----|-------------|-----|------| @@ -320,6 +322,7 @@ Publish failed. - Use `jq -n --arg c "$CONTENT" '{content: $c}'` to safely encode text content. **`format` is a query param**, not a body field — `/api/html` ignores any `format` key inside the JSON body and reads only `?format=` from the URL. Wrong location = server applies default `html` and stores your markdown as raw text. - TTL default is `15` days. Namespace must be alphanumeric (3-32 chars), default: suggested (private) namespace. - To **delete** a published page, find the owner token in `.claude/brewpage-history.md` and use the delete command shown in that file's header. +- To **update a published site**, `PUT` the new bundle to the same site URL (`PUT /api/sites/{ns}/{id}`) with your `X-Owner-Token` — the uploaded bundle fully replaces the file set (adds new files, removes absent ones, overwrites matching) and the link never changes. No DELETE-then-POST needed. - Entry file detection: `--entry` override > `index.html` > first `.html` alphabetically. - **SITE URL — NO trailing slash.** API returns `.link = "https://brewpage.app/public/"` without trailing `/`. Appending `/` routes to brewpage.app's own landing page; the JS redirect that rescues the no-slash form does NOT fire for the slash-dir form → site becomes inaccessible. - **SITE verification cannot be done via `curl`.** The no-slash URL serves the BrewPage landing HTML with an inline JS redirect that only executes in a real browser. To verify: use Playwright / `browser_navigate`, or fetch `/index.html` explicitly. diff --git a/openclaw/brewpage-publish/SKILL.md b/openclaw/brewpage-publish/SKILL.md index 7a48012..64e02a1 100644 --- a/openclaw/brewpage-publish/SKILL.md +++ b/openclaw/brewpage-publish/SKILL.md @@ -116,9 +116,10 @@ if [ ! -f "$HISTORY_FILE" ]; then # brewpage.app — Published Pages > PRIVATE FILE — keep this out of version control and never share it. -> Owner tokens allow delete (no in-place PUT for sites; html/json/kv support PUT). +> Owner tokens allow delete and in-place republish (html/json/kv/sites all support PUT). > Delete html/json/kv: `curl -s -X DELETE "https://brewpage.app/api/{ns}/{id}" -H "X-Owner-Token: TOKEN"` > Delete site: `curl -s -X DELETE "https://brewpage.app/api/sites/{ns}/{id}" -H "X-Owner-Token: TOKEN"` +> Update site (keep same URL): `PUT /api/sites/{ns}/{id}` with `X-Owner-Token: TOKEN` + the new bundle — the uploaded bundle fully replaces the file set (adds new files, removes absent ones, overwrites matching). The link never changes. | Date | URL | Owner Token | TTL | Type | |------|-----|-------------|-----|------| @@ -256,6 +257,7 @@ Publish failed. - Use `jq -n --arg c "$CONTENT" '{content: $c}'` to safely encode text content. **`format` is a query param**, not a body field — `/api/html` ignores any `format` key inside the JSON body and reads only `?format=` from the URL. Wrong location = server applies default `html` and stores your markdown as raw text. - TTL default is `15` days. Namespace must be alphanumeric (3-32 chars), default `public`. - To **delete** a published page, find the owner token in `./brewpage-history.md` and use the delete command shown in that file's header. +- To **update a published site**, `PUT` the new bundle to the same site URL (`PUT /api/sites/{ns}/{id}`) with your `X-Owner-Token` — the uploaded bundle fully replaces the file set (adds new files, removes absent ones, overwrites matching) and the link never changes. No DELETE-then-POST needed. - **Sites: directory is the primary input** — it is auto-zipped (the only thing `POST /api/sites` accepts), which seals relative paths. A pre-built `.zip` is the alternative input, uploaded as-is. Always publish BUILT output (`dist/`, `build/`, `out/`, `_site/`, `public/`), never project sources. - The auto-zip excludes `.git/`, `.env`/`.env.*`, `node_modules/`, editor/OS junk, sourcemaps and logs — a deliberate secret-leak safeguard so credentials and VCS history never reach the public archive. - Entry file detection: `--entry` override > `index.html` > first `.html` alphabetically. diff --git a/skills/brewpage-publish/SKILL.md b/skills/brewpage-publish/SKILL.md index 53b10f4..82ce6de 100644 --- a/skills/brewpage-publish/SKILL.md +++ b/skills/brewpage-publish/SKILL.md @@ -120,9 +120,10 @@ if [ ! -f "$HISTORY_FILE" ]; then # brewpage.app — Published Pages > PRIVATE FILE — keep this out of version control and never share it. -> Owner tokens allow delete (no in-place PUT for sites; html/json/kv support PUT). +> Owner tokens allow delete and in-place republish (html/json/kv/sites all support PUT). > Delete html/json/kv: `curl -s -X DELETE "https://brewpage.app/api/{ns}/{id}" -H "X-Owner-Token: TOKEN"` > Delete site: `curl -s -X DELETE "https://brewpage.app/api/sites/{ns}/{id}" -H "X-Owner-Token: TOKEN"` +> Update site (keep same URL): `PUT /api/sites/{ns}/{id}` with `X-Owner-Token: TOKEN` + the new bundle — the uploaded bundle fully replaces the file set (adds new files, removes absent ones, overwrites matching). The link never changes. | Date | URL | Owner Token | TTL | Type | |------|-----|-------------|-----|------| @@ -283,6 +284,7 @@ Publish failed. - Use `jq -n --arg c "$CONTENT" '{content: $c}'` to safely encode text content. **`format` is a query param**, not a body field — `/api/html` ignores any `format` key inside the JSON body and reads only `?format=` from the URL. Wrong location = server applies default `html` and stores your markdown as raw text. - TTL default is `15` days. Namespace must be alphanumeric (3-32 chars), default: suggested (private) namespace. - To **delete** a published page, find the owner token in `.claude/brewpage-history.md` and use the delete command shown in that file's header. +- To **update a published site**, `PUT` the new bundle to the same site URL (`PUT /api/sites/{ns}/{id}`) with your `X-Owner-Token` — the uploaded bundle fully replaces the file set (adds new files, removes absent ones, overwrites matching) and the link never changes. No DELETE-then-POST needed. - **Sites: directory is the primary input** — it is auto-zipped (the only thing `POST /api/sites` accepts), which seals relative paths. A pre-built `.zip` is the alternative input, uploaded as-is. Always publish BUILT output (`dist/`, `build/`, `out/`, `_site/`, `public/`), never project sources. - The auto-zip excludes `.git/`, `.env`/`.env.*`, `node_modules/`, editor/OS junk, sourcemaps and logs — a deliberate secret-leak safeguard so credentials and VCS history never reach the public archive. - Entry file detection: `--entry` override > `index.html` > first `.html` alphabetically. diff --git a/web/docs/src/content/docs/brewdoc/skills/publish.mdx b/web/docs/src/content/docs/brewdoc/skills/publish.mdx index ef6cfe2..82e20bf 100644 --- a/web/docs/src/content/docs/brewdoc/skills/publish.mdx +++ b/web/docs/src/content/docs/brewdoc/skills/publish.mdx @@ -146,6 +146,16 @@ curl -s -X DELETE "https://brewpage.app/api/{ns}/{id}" \ For sites use `/api/sites/{ns}/{id}`. +**Update a published site (keep the same URL):** + +```bash +curl -s -X PUT "https://brewpage.app/api/sites/{ns}/{id}" \ + -H "X-Owner-Token: TOKEN" \ + -F "archive=@/absolute/path/to/new-bundle.zip" +``` + +To update a published site, `PUT` the new bundle to the same site URL with your owner token — the uploaded bundle fully replaces the file set (adds new files, removes absent ones, overwrites matching). The link never changes; no DELETE-then-POST needed. + **Namespace rules:** lowercase alphanumeric + hyphens, 3–32 chars. Auto-suggestion is content-derived (`api-docs`, `report-q2`) — never a random string or truncated filename. **Site uploads:** directory → zipped to `mktemp /tmp/brewpage-site-XXXXXX.zip` → POSTed as `archive=@$TMPZIP` → temp file removed. `User-Agent: ClaudeCode/1.0` header included.