mirror of
https://github.com/kochetkov-ma/claude-brewcode.git
synced 2026-09-14 20:16:41 +08:00
docs(publish): document site republish (PUT, same URL) across skill variants
This commit is contained in:
@@ -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/<id>"` 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 `<url>/index.html` explicitly.
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user