Share Page
Publish a standalone HTML file at https://share.ca7.ir/<random-hash> for
sharing with others. Invoke only on an explicit ask ("publish on share.ca7.ir",
"give me a share link on my domain", /share-page) — never proactively, and
never for the word "share" alone (sharing to Slack, sharing context, Claude
Artifacts, etc. are not this skill).
Setup facts
- Cloudflare Worker
share-pagesserves KV-backed pages on routeshare.ca7.ir/*(zoneca7.ir). Proxied AAAAshare→100::exists. - Pages live in Workers KV namespace
share-pages; key = hash, value = full HTML. - All credentials/IDs live in the 1Password item
op://Private/cloudflare-api-token: fieldscredential(API token, also scoped for zonescatalinirimie.comandviii.cm),account_id, andshare_pages_kv_namespace_id. Follow theone-passwordskill rules foropreads; never print the token. - The worker serves
text/htmlwithx-robots-tag: noindexand 404s every key not in KV (including/). Unlisted-URL security only — do not publish secrets or private data.
Publish
The page must be a complete self-contained document (<!doctype html> …
inline CSS/JS, no external assets required by CSP anywhere, just good
practice). Then:
HASH=$(openssl rand -hex 12)
TOKEN=$(op read "op://Private/cloudflare-api-token/credential")
ACCT=$(op read "op://Private/cloudflare-api-token/account_id")
NS=$(op read "op://Private/cloudflare-api-token/share_pages_kv_namespace_id")
curl -s -X PUT "https://api.cloudflare.com/client/v4/accounts/$ACCT/storage/kv/namespaces/$NS/values/$HASH" \
-H "Authorization: Bearer $TOKEN" --data-binary "@page.html"
curl -s -o /dev/null -w "%{http_code}\n" "https://share.ca7.ir/$HASH" # expect 200
Give the user the full URL. To update a page in place, re-PUT the same key. To unpublish, DELETE the same KV values endpoint.
List / cleanup
curl -s -H "Authorization: Bearer $TOKEN" \
"https://api.cloudflare.com/client/v4/accounts/$ACCT/storage/kv/namespaces/$NS/keys" | jq -r '.result[].name'
Guardrails
- Never touch the
ca7.irapex or its DNS record — it points at a legacy EC2 box that serves the old site. - One page = one KV write. Do not re-upload or modify the worker script for publishing; only change the worker if the serving behavior itself must change.
- Hashes are the only access control: always
openssl rand -hex 12, never guessable names.