---
name: etamong-pages
description: Use the Pages dashboard / CLI / API to deploy static sites and host containerized apps; manage tokens, env, traffic split, and the admin console.
---

Pages — etamong-lab static-site + container-app hosting.

## Quickstart

Use the Pages MCP tools when connected: create a private site, publish supplied files as a preview, then explicitly publish production when authorized.
For local build directories, install the CLI with `curl -fsSL https://pages.onul.me/install.sh | sh`, run `pages login`, then `pages deploy <slug> --dir dist`.
OAuth login requests offline access; refresh credentials stay on the CLI computer and do not enter this chat.
A remote CLI needs a reachable loopback callback or explicit SSH port forwarding before browser approval.
Use a deploy-scoped PAT from a trusted secret binding for unattended CI; never ask the user to paste a credential into chat.

## MCP and native OAuth

The opt-in Streamable HTTP endpoint is `https://pages.onul.me/mcp`.
Native clients use authorization code with PKCE S256 and request `openid email profile pages:read pages:write offline_access`.
The dedicated provider must enable these scopes and refresh grants, issue access tokens for the canonical Pages origin, and preserve the client audience for OIDC.
Clients own refresh tokens; Pages accepts only verified access tokens and retains existing site permissions.
Ordinary OAuth grants user authority without inheriting platform-admin privileges; token and saved-credential management require a browser session.
Existing PATs and site-scoped CI tokens remain supported.

Configure `PAGES_MACHINE_ISSUER` and comma-separated `PAGES_MACHINE_CLIENT_IDS` separately from the dashboard's confidential OIDC client.
The Authentik access-token contract requires `azp`, `uid`, verified email, subject, expiry and Pages scopes; do not add access-token-only claims to ID-token scope mappings.
Qualify callback matching, resource binding, token-type separation and refresh against the deployed provider before activation.
Enable the endpoint with `PAGES_MCP_ENABLED=true`; disabled MCP returns 503.
`PAGES_MCP_MAX_BYTES` defaults to 5 MiB and `PAGES_MCP_MAX_FILES` to 100, within the existing deployment limit.
The encoded HTTP limit allows six times the decoded content plus bounded metadata overhead for JSON escaping.
`PAGES_MCP_MAX_CONCURRENT_REQUESTS` defaults to 4 (range 1–64); excess concurrent MCP requests return 503 before reading their bodies.
`PAGES_MCP_READ_TIMEOUT` defaults to 30s (positive, at most 5m); stalled body reads terminate and release capacity.
Untrusted HTTP Origin headers are rejected; native requests without Origin are supported.

Public discovery endpoints are `/.well-known/oauth-protected-resource` for the resource and operation scopes, and `/.well-known/pages-client` for native-client bootstrap metadata including refresh scope.

Remote administrator access requires the separately configured `PAGES_DEVICE_ISSUER` and `PAGES_DEVICE_CLIENT_ID`, a provider-approved `pages:admin` scope, and the issuer-signed `pages_admin=true` entitlement.
The device issuer/client pair is independent of ordinary native-client discovery and is exposed through `/.well-known/pages-device-client`.
The provider must cap access tokens at five minutes and re-evaluate administrator group membership on refresh.
Pages enforces a seven-day maximum from the signed `auth_time`, including access tokens issued just before that deadline.
Qualify that the device grant sets `auth_time` at initial token issuance and preserves it on refresh.
After this provider configuration is active, authorize from a browser on any device:

```sh
unset PAGES_TOKEN
pages login --device --admin
pages whoami
pages mcp proxy
```

`pages login --device` requests ordinary site access without administrator scope.
The CLI prints the verification URL, user code, requested authority, and expiry, and preserves existing credentials if approval fails or grants insufficient authority.
Device credentials use the existing private origin-bound store, locked refresh rotation, and logout revocation; the CLI stops refreshing after seven days.
`offline_access` supplies the refresh token used by CLI and MCP when the browser is closed; refresh rotation does not extend the server-enforced deadline.
Administrator device access does not enable browser-session-only credential or token management.
For a registered public client named `pages-native`:

```sh
codex mcp add pages --url https://pages.onul.me/mcp \
  --oauth-client-id pages-native --oauth-resource https://pages.onul.me
codex mcp login pages --scopes pages:read,pages:write,offline_access
```

Register only qualified server-bound loopback callback URIs, preserving their exact host/path and supported variable ports.
Direct Claude Code HTTP OAuth and manual callback URL recovery are unsupported because its generic callback does not bind the authorization server.
Do not register that generic callback; Claude Code connects through the CLI's OAuth-only stdio proxy.
Install or update the public CLI, check `pages help mcp`, and finish `pages login` before enabling the connection:

```sh
curl -fsSL https://pages.onul.me/install.sh | sh
unset PAGES_TOKEN
PAGES_URL=https://pages.onul.me pages login
```

Use this MCP configuration for the local command:

```json
{"mcpServers":{"pages":{"type":"stdio","command":"pages","args":["mcp","proxy"],"env":{"PAGES_URL":"https://pages.onul.me"}}}}
```

`pages mcp proxy` reads the CLI's private per-origin OAuth store and serializes refresh rotation with other CLI commands.
It rejects a nonempty `PAGES_TOKEN`, saved PATs and legacy PAT fallback; ordinary CLI commands retain their existing PAT behavior.
Run login separately: the MCP process never opens a browser, and stdout contains only protocol messages.
Tool schemas, annotations and results come from the authenticated remote endpoint; redirects and automatic mutation replay are disabled.
The stdio frame and HTTP response body limits are each 32 MiB, allowing the remote default 5 MiB decoded upload limit plus JSON escaping and bounded metadata.
Oversized responses fail without retrying the request.
Startup discovery accepts at most 16 pages, 128 tools and 32 MiB of total tool metadata.
If a publish response is lost, inspect deployment history before retrying.
Remote clients need a reachable callback or explicit tunnel; a browser on another computer cannot reach the remote CLI's loopback directly.
Never paste access or refresh credentials into chat, tool arguments or checked-in configuration.

The tools are `get_account`, `list_sites`, `create_site`, `list_deploys`, `publish_static`, `get_site_source` and `cancel_site_source_sync`.
Site listings include the caller's effective `role`: `owner`, `editor` or `viewer`.
Create a private site and publish supplied files as a preview:

```json
{"name":"create_site","arguments":{"slug":"research-notes","name":"Research notes"}}
{"name":"publish_static","arguments":{"slug":"research-notes","files":[{"path":"index.html","content":"<h1>Private research notes</h1>"}]}}
```

Site visibility defaults to private; `visibility: "public"` must be explicit.
Publishing defaults to preview alias `mcp`; `mode: "production"` explicitly replaces the live version and cannot have a preview alias.
Binary files use `encoding: "base64"` with standard base64 content.
Absolute paths, traversal, duplicate normalized names, unknown encodings and oversized artifacts are rejected before a deployment starts.
Use the CLI for large local directories.
Inspect `list_deploys` after uncertain publish failures before retrying; mutations are not automatically replayed.
To stop a site sync, inspect `get_site_source` and pass its `recovery_token` with the site slug to `cancel_site_source_sync`.
The dashboard Stop sync control and `pages github cancel <slug>` use the same attempt-bound cancellation API.
Cancellation pauses automatic sync and preserves the live site; inspect the separate executor termination state before assuming the build has exited.
Workers observe cancellation during clone, build and upload; cleanup retries deletion of the exact retained build Job with a UID precondition.
Termination remains pending when worker completion or build identity is unconfirmed, even after connection edits or disconnect.

## Install the CLI
- One-liner (macOS/Linux): `curl -fsSL https://pages.onul.me/install.sh | sh`.
- One-liner (Windows PowerShell): `irm https://pages.onul.me/install.ps1 | iex`.
- Direct binary: download `https://pages.onul.me/cli/pages-<os>-<arch>` (e.g. `pages-darwin-arm64`, `pages-linux-amd64`; Windows is `pages-windows-amd64.exe`), `chmod +x` (macOS/Linux), put it on PATH.
- The app self-hosts the CLI — no login, no private-repo access, no nix needed to obtain it.
- Build from source (repo checkout): `cd cli && go build -o ~/bin/pages .`.

## Auth

`pages login` uses OAuth authorization code with PKCE S256 and requests `offline_access`.
It prints the approval URL and stores credentials privately per Pages origin under `~/.config/pages/credentials/` after checking access with Pages.
The CLI refreshes before API operations and serializes rotation across processes.
`pages logout` removes local credentials and revokes a stored OAuth refresh grant where supported.
It does not revoke PATs or remove an externally configured `PAGES_TOKEN`.

For remote use, run `pages login --no-browser --callback-port 43807` and forward that loopback port from the browser computer to the CLI host before approving.
Do not launch a desktop browser on a headless server.
Login times out with an error if the callback is unavailable; it does not report a successful login without credentials.

`PAGES_TOKEN` takes precedence over saved credentials.
A PAT supplied through trusted local stdin with `pages login` replaces this origin's stored OAuth credentials.
Legacy `~/.config/pages/token` is read only for the default Pages origin.
Use a site-bound deploy PAT for unattended publishing; broader PATs require an explicit user/admin purpose.
Ordinary OAuth access does not inherit platform-admin privileges, and token or saved-credential management requires a browser session.

## No shell? (browser-only agents)
If MCP is connected, use its tools without installing the CLI.
Otherwise, a browser-only agent uses the dashboard:
- Connect a public GitHub repo + "지금 동기화" — zero CLI, shallow clone, no in-cluster build.
- Or drag/drop your built folder (e.g. `dist/`) into the dashboard — its *contents*
  become the site root, so make sure `index.html` sits at the folder's top level
  (not nested in a further sub-folder).
- For any direct API use, a human must mint a token for you (tokens can't be minted headlessly).

## Surfaces
- Web dashboard: pages.onul.me (OIDC SSO).
- CLI `pages` (Go): `pages sites …`, `pages apps …`, `pages deploy <slug> --dir dist`. Auth via `pages login` or API token (Tokens tab → "user"/"deploy"/"admin" scope).
- HTTP API at /api/* — same surface the dashboard uses; tokens go in `Authorization: Bearer <token>`.

## Sites (static hosting)
- Create: `pages sites create <slug>` or dashboard "새 사이트".
- Deploy: `pages deploy <slug> --dir dist` (or drag/drop). `--dir` uploads that directory's *contents*, so `dist/index.html` becomes the site root `/` — point `--dir` at the folder that holds `index.html`, not its parent. >100MB uses the chunked path automatically (server-side compose; no CDN re-transit).
- Visibility: private (oauth2-proxy gated) or public (anonymous). Private + unauth shows a small interstitial naming the site with a login button; toggle "주소를 알아도 존재 숨기기" (`hide_when_private`) on a private site to return a plain 404 instead — same response a nonexistent slug gets, no name leaked.
- Link preview: the site overview reads metadata from the deployed homepage, preferring Open Graph text and falling back to the standard HTML title and description; edit HTML and redeploy to change it. Viewer-authorized `GET /api/v1/sites/{slug}/og-preview` returns the same metadata without modifying it.
- GitHub: connect a public repo + sync-now → shallow clone, no in-cluster build. Private repos need a stored credential (XChaCha20-Poly1305 at rest).
- Caps: 5 GiB site soft cap; 1 GiB per deploy (chunked); single file <100MB CDN limit, chunked compose internally.

## Static deployment security review

When security warnings are enabled, a new static deployment remains unpublished until its analysis is terminal and its exact report is acknowledged.
Production and preview URLs retain their last eligible content while review is pending, including uploads and source syncs.
Existing deployments retain their eligibility; this static analysis does not qualify container applications or external handlers.

```sh
pages deploy example --dir dist
pages security report example DEPLOY_ID
pages security acknowledge example DEPLOY_ID --report REPORT_ID --digest ARTIFACT_DIGEST --accept-warnings
```

Read the findings and coverage before every acknowledgement.
Obtain informed approval for that report, or reuse explicit approval for subsequent deployments within the same agent session, Pages origin, site and user-approved publication scope.
Session approval may cover the disclosed scan limitations and accepted findings; a general request to deploy is not acceptance of scan warnings.
For example: "For this session, redeploy this site with these scan limitations without asking again; ask if there are new findings or worse coverage limitations."
Remember the approved scope, findings and limitations in the current session context; do not persist this as a standing approval or reuse it in another session.
Ask again for new or worsened findings, new or worsened coverage limitations (including analysis failure), a different origin or site, or publication outside the approved scope.
Honor a narrower approval or its revocation immediately.
Use the report's top-level `id` and `artifact_digest`, not its canonical content digest.
Pending or running analysis cannot be acknowledged; failed or incomplete analysis requires acceptance of its coverage warning, either for that report or under the matching session approval.
A newer deployment, report or digest requires reading its report and checking it against the approval scope, but does not by itself require another user prompt.
Keep each acknowledgement bound to its exact report and artifact; after a conflict, re-read the current report and recheck approval before using its identifiers.
The CLI prints the pending deployment ID and report command rather than claiming publication succeeded.

MCP clients read `get_deployment_security` with `slug` and `deploy_id`, then call `acknowledge_deployment_security` with the same identifiers, `report_id`, `artifact_digest` and `acknowledge=true` after approval.
Upload and promotion tools do not imply acknowledgement.
In the dashboard, open **Review security report**, read the report, select the initially unchecked acceptance box, and confirm publication.

## Apps (container hosting)
- Allowlisted creators only (admin-managed in Console → "앱 생성 권한"). The "앱 만들기" button hides for non-creators.
- Create: bring-your-own image OR buildpacks-from-Dockerfile (auto runtime detect, non-root synth).
- Revisions are immutable (Cloud Run-style); the Versions tab lists every build, marks active, supports rollback + canary traffic split (max 2 canaries, IP-sticky weight).
- Env tab: stage changes (`apply=false` → pending_restart banner) or apply now. Secret values are masked in responses; the underlying store is AEAD-encrypted.
- GitHub source: poller auto-syncs on new commits; broken SHAs are auto-skipped after one failed build (`last_failed_sha`) until a new commit or "지금 동기화" clears it.
- Resources tab: edit revision template (CPU / memory / replicas).
- Restart button = re-pull image (BYO-image case) + new revision.
- Lite DB: opt into one Postgres per app with `--db` (within your per-account quota). Connection info is injected as `DATABASE_URL` (platform-managed — shown masked as `(platform-managed)`, never returned by any API/CLI/screen); "Regenerate credential" rotates it (rolling restart). 256 MiB cap — over it the DB goes read-only (reads/deletes still work) until you free space. `pages apps db status <slug>` shows size/limit/read-only.

## Tokens
- `user` scope: act as you; `deploy` scope: only `pages deploy`; `admin` scope: app-create + app-manage (admin gate enforced server-side).
- Mint from the Tokens tab; copied once at creation (never shown again).

## Logging + observability
- Errors land in the etamong-lab Errors dashboard (Loki+Grafana, `ref` join key); reference impl for the `httperr` convention.
- Custom-app logs surface via Promtail relabel (`pages_app=<slug>`) inside the host `pages-apps-vc` namespace.

## Console (admin only)
- "앱 생성 권한" allowlist (email-based, case-insensitive). Removing an entry instantly disables the creator's "앱 만들기" button.
- "DB 할당량": set each user's DB-app allowance (default from config; `0` disables). Shows per-user used/quota + per-DB size/read-only. Credentials are never shown here — usage only.

## Access requests (request-to-join flow)
- When an authenticated user hits a private site/app they don't have a role on, the proxy redirects them to `pages.m/dashboard/#/request-access?kind=<site|app>&slug=<slug>` instead of returning a hard 403. They post a short message; the owner sees it in the "권한 요청함" (Inbox) tab.
- Owners (`owner_email`, or owner/editor membership) see pending requests in their Inbox with a red badge on the sidebar/tab. Admins see every pending request.
- Approve grants a viewer membership; deny just closes the request (the requester may re-request). One pending request per (resource, requester) — a duplicate POST returns the existing row.
- API: `POST /api/access-requests` (kind+slug+message), `GET /api/access-requests/inbox`, `GET /api/access-requests/inbox/count`, `POST /api/access-requests/{id}/approve|deny`.

## Skill usage notes
- Confirm destructive ops before running (delete site / token / app / member).
- Prefer the CLI for batch operations; the dashboard for one-offs.
- Never paste a user's API token into a public log or chat.

## Application analytics

Owners and administrators can read `/api/v1/apps/{slug}/analytics` for traffic summaries and `/analytics/visits` for request details, with literal `path`, `match=exact|prefix` and explicit RFC3339 `start`/`end` filters.
Keep the response time range and filters when using a visitor `next_cursor`; aggregates retain 30 days and details 7 days.
Traffic is origin-observed HTTP requests, not page views or distinct people; unavailable attribution is explicit.
Visitor details expose only authenticated/anonymous status, never visitor email or IP.
Collection and trusted geographic attribution require the deployment and privacy prerequisites documented in the README.
