Technical Specifications (pages.astrophysics.fans)
pages.astrophysics.fans (in development). For a non-technical overview and step-by-step guide, see the pages.astrophysics.fans Guide. Specifications are subject to change.Infrastructure & Architecture
pages.astrophysics.fans runs inside an Incus container on a dedicated KVM VPS (Los Angeles / Debian / 1 Core, 1 GB RAM, 30 GB SSD), isolated from other laboratory services and development environments. AI client access is unified through LabPortal (on a separate host), while public pages run on open-compute (a self-hosted Workers / D1 / R2 compatible runtime). This VPS cannot connect to the on-campus network.
Server Specs & Network Isolation
| Item | Configuration |
|---|---|
| Host | Dedicated KVM VPS for pages (Los Angeles, US) |
| OS / Specs | Debian / 1 Core / 1 GB RAM / 30 GB SSD |
| Container Isolation | Isolated Incus container running the pages stack |
| On-Campus Network | No access (does not join the lab VPN; no outbound connections to campus machines or LabPortal) |
- Point-to-Point WireGuard + Per-Request Signatures: AI tool calls enter via LabPortal and are relayed over a dedicated two-host WireGuard link to
pages-mcp-gateway. LabPortal never forwards its own user tokens; instead, every request carries a short-lived Ed25519-signed assertion with body hash and replay protection. - Worker Egress Blocking: Outbound connections and DNS from page Workers are blocked via
nftablesto prevent SSRF and data exfiltration. Only TLS certificate issuance is permitted via an authenticated dedicated relay (acme-proxy) restricted to Let’s Encrypt. - Credential Isolation: open-compute management credentials stay strictly within the gateway and administrator CLI and are never exposed to page code or AI clients.
MCP Connector & Authorization Flow
LabPortal acts as the OAuth 2.1 (PKCE S256) authorization server and Streamable HTTP MCP endpoint (/mcp).
sequenceDiagram
actor User as Lab Member (AI Client)
participant LP as LabPortal (OAuth 2.1 / MCP)
participant GW as pages-mcp-gateway
participant OC as open-compute
User->>LP: OAuth 2.1 Consent (pages / pages_write)
LP-->>User: Issue Access Token
User->>LP: Call MCP Tool (Manual Approval for Writes)
LP->>LP: Verify Token, Scope, Rate Limit (60 / 10 min)
LP->>GW: Relay over WireGuard (Ed25519-Signed Assertion)
GW->>GW: Verify Signature, TTL, Body Hash, Nonce & Ownership
GW->>OC: Manage Worker / D1 / Files via Management API
OC-->>GW: Result
GW-->>LP: MCP JSON Response
LP-->>User: Return Tool Output
- Supported Clients: Primarily targeting
claude.aicustom connectors (LabPortal’s OAuth connector supports bothclaude.aiandchatgpt.comby default). - Explicit OAuth Scopes:
pages: Read-only access to page lists, source code, response data, and edit historypages_write: Read/write access including deploying, updating, deleting pages, and editing/undoing response data
- Ownership Isolation: MCP operations are strictly restricted to pages owned by the authenticated member.
MCP Tools (9 Tools)
Read Tools (pages scope)
| Tool | Inputs | Description |
|---|---|---|
list_pages | None | List your pages, statuses, current usage, and quota limits |
get_page | slug | Fetch metadata and current Worker source code |
read_page_data | slug, sql, params?, limit? | Execute read-only single SELECT / WITH queries against your page DB (up to 200 rows) |
list_page_data_edits | slug | List undoable response data edits (values omitted) |
get_template | kind (poll / rsvp / form) | Retrieve reference Worker templates to customize |
Write Tools (pages_write scope)
| Tool | Inputs | Description |
|---|---|---|
deploy_page | slug, module_code, with_database, with_storage?, ttl_days? | Create or update a page. Omitting ttl_days or with_storage on update preserves current settings (ttl_days: null removes expiration) |
delete_page | slug | Delete a page along with its DB and stored files (unavailable while suspended) |
edit_page_data | slug, table, action, row_ids, values? | Update or delete up to 20 rows without raw SQL; keeps original rows for 7 days |
undo_page_data_edit | slug, edit_id | Revert a prior edit within 7 days (rejected if subsequent changes conflict) |
Runtime & Brokered File Storage
Pages run as single ES module Workers (export default required) with no build step. Only two bindings are provided: DB (D1-compatible per-page SQLite) and FILES (scoped file storage API). Custom bindings, environment variables/secrets, outbound fetch, Cron triggers, and multi-file/npm builds are disabled.
Brokered File Storage (FILES Binding)
Because exposing R2 directly to page code would bypass quota enforcement, file access is routed through a private internal broker Worker (storage--broker) exposed via the FILES service binding. Owner and page identifiers are pinned in binding props and cannot be altered by page code.
flowchart LR
Worker["Page Worker"] -->|"env.FILES (Pinned Owner & Page)"| Broker["storage--broker (Private Broker Worker)"]
Broker -->|"1. Atomic Quota Reservation & Metadata"| Ledger[("Ledger D1")]
Broker -->|"2. Store / Fetch Object"| R2[("R2 Bucket")]
GW["pages-mcp-gateway (Delete, Usage, Cleanup)"] --> Ledger
GW --> R2
- Provided API:
env.FILES.put(name, data, { contentType })/get(name)/list({ after })/delete(name)/usage()(custom API, not raw R2 API). - Deleting a page or reaching its expiration removes all files associated with that page.
Planned Quotas & Defaults
| Item | Default |
|---|---|
slug Pattern | ^[a-z0-9][a-z0-9-]{1,38}[a-z0-9]$ (no consecutive hyphens or reserved words) |
| Pages / Member | 10 |
| Page DBs (D1) / Global | 32 |
| Module Size | 256 KiB |
| Storage / Member (across all pages) | 512 MiB |
| Max File Size | 10 MiB |
| Files / Member | 5,000 |
| Storage / Global | 5 GiB |
read_page_data Row Limit | 200 rows (max 256 KiB response) |
Auto-Expiration (ttl_days) | 1–3,650 days (no expiration if omitted on creation) |
| MCP Rate Limit | 60 calls per 10 minutes per member |
Comparison with Cloudflare Workers
Despite a similar Worker syntax, pages does not run on Cloudflare—it runs on self-hosted open-compute with a distinct operating model.
| Aspect | pages.astrophysics.fans | Cloudflare Workers |
|---|---|---|
| Interface | AI clients via MCP (9 tools) | Wrangler CLI, dashboard, REST API |
| Infrastructure | Incus container on a dedicated KVM VPS (Los Angeles / Debian / 1 Core, 1 GB RAM, 30 GB SSD; open-compute) | Cloudflare global edge network |
| Code | Single ES module (up to 256 KiB, no build step) | Multi-module, npm, TypeScript build |
| Bindings | DB and FILES only | D1, R2, KV, Durable Objects, Queues, etc. |
| Outbound Network / Secrets / Cron | Disabled | Supported |
| Auto-Expiration | Built-in (ttl_days) | Not built-in |
| Availability & DDoS Protection | Single server, no SLA | Distributed network & built-in protection |
| Best For | Quickly publishing polls/RSVP pages via AI without CLI or billing | Production apps, external integrations, high availability |
Security & Operational Notes
- Poll and RSVP templates rely on
HttpOnly(__Host-on HTTPS) cookies and do not perform strict identity verification. - Visitor uploads count against the page owner’s file storage quota.
- Backups and service continuity are not guaranteed; keep local copies of important data.
- Administrators may suspend (
503) or delete problematic pages. Report abuse via the Abuse Contact (abuse [at] astrophysics.fans).