diff --git a/src/html.ts b/src/html.ts index 465c42e..e9b1b6c 100644 --- a/src/html.ts +++ b/src/html.ts @@ -17,6 +17,9 @@ const COINPAY = 'https://coinpayportal.com' /** crawlproof analytics: one async script on every page. CRAWLPROOF_SITE_ID overrides; 'off' drops it. */ const TRACKER_SITE = process.env.CRAWLPROOF_SITE_ID ?? '' +// WebMCP (@profullstack/webmcp): site_info/open_page plus the annotated forms below as tools for +// the AI agent in the visitor's browser. Forms never auto-submit: they spend or change the account. +const WEBMCP = `` const TRACKER = TRACKER_SITE && TRACKER_SITE !== 'off' ? `` : '' const asset = (name: string) => { @@ -60,6 +63,7 @@ ${o.noindex ? '' : `` : ''} ${TRACKER} +${WEBMCP} ${RING_PLACEHOLDER} @@ -187,7 +191,7 @@ function adRow(c: Campaign): string { } function fundForm(ctx: Ctx, values: { amount?: string } = {}): string { - return `
${csrfField(ctx)} + return `${csrfField(ctx)}
` } @@ -202,7 +206,7 @@ export function advertisePage(ctx: Ctx, o: { balanceCents: number; campaigns: Ca path: '/advertise', body: `

Advertise

${ctx.free ? 'Free while we launch. Your ads run with no balance. ' : ''}Balance ${usd(Math.max(0, o.balanceCents))}${!ctx.free && o.balanceCents <= 0 ? ' ยท add budget to start your ads' : ''}

${flashNote(o.flash)}${flashNote(o.error, true)} -
${csrfField(ctx)} +${csrfField(ctx)}

New ad

@@ -289,7 +293,7 @@ export function publishPage(ctx: Ctx, o: { sites: Site[]; withdrawals: Withdrawa path: '/publish', body: `

Publish

${o.sites.length ? `Your sites have earned ${usd(earned)}.` : 'Put ads on your site and get paid in USDC.'}

${flashNote(o.flash)}${flashNote(o.error, true)} -${csrfField(ctx)} +${csrfField(ctx)}

Add a site

diff --git a/src/server.ts b/src/server.ts index b2b2796..71ec2b2 100644 --- a/src/server.ts +++ b/src/server.ts @@ -31,7 +31,7 @@ const SECURITY_HEADERS: Record = { // https://pit.world: the footer's newsletter form posts to pit.world/api/subscribe // (connect-src) and falls back to a plain POST to pit.world/subscribe (form-action). // script-src also gets the footer's inline-script hashes, added per response below. - 'content-security-policy': "default-src 'none'; style-src 'self' 'unsafe-inline'; script-src 'self' https://crawlproof.com; img-src 'self' data: https://built.indie.pit.world https://pwamart.com; connect-src 'self' https://crawlproof.com https://pit.world; frame-src https://crawlproof.com; form-action 'self' https://coinpayportal.com https://pit.world; base-uri 'none'; frame-ancestors 'none'", + 'content-security-policy': "default-src 'none'; style-src 'self' 'unsafe-inline'; script-src 'self' https://crawlproof.com https://cdn.jsdelivr.net; img-src 'self' data: https://built.indie.pit.world https://pwamart.com; connect-src 'self' https://crawlproof.com https://pit.world; frame-src https://crawlproof.com; form-action 'self' https://coinpayportal.com https://pit.world; base-uri 'none'; frame-ancestors 'none'", 'referrer-policy': 'strict-origin-when-cross-origin', 'x-content-type-options': 'nosniff', 'permissions-policy': 'interest-cohort=(), browsing-topics=(), camera=(), microphone=(), geolocation=()',