diff --git a/docs/deployment.md b/docs/deployment.md index 046b17e..12c61ab 100644 --- a/docs/deployment.md +++ b/docs/deployment.md @@ -150,6 +150,8 @@ Run the three in order before the new services-system, gateway and mobile-api go | `openspec/changes/archive/2026-12-02-add-landing-pages/sql/03-company-branding.sql` | Adds `logo_image_id` and `accent_color` to `service-system`.`company`. DDL. | | `openspec/changes/archive/2026-12-02-add-landing-pages/sql/04-module.sql` | Adds the Pages back-office module (`BO_PAGES`) under Events. No role gets it; super admins grant it under Roles. | | `openspec/changes/archive/2026-12-02-add-landing-pages/sql/05-page-labels.sql` | Adds the landing-page labels in English and Chinese. Run it only where `add-zh-cn-messages/sql/03` already ran before this change; the regenerated 03 already includes them. | +| `openspec/changes/add-custom-html-block/sql/01-hide-header.sql` | Adds `hide_header` to `service-counter`.`cms_page`, the "Hide page header" option. DDL. | +| `openspec/changes/add-custom-html-block/sql/02-html-block-labels.sql` | Adds the Custom HTML block labels in English and Chinese. Same rule as `05-page-labels.sql`: only where `add-zh-cn-messages/sql/03` already ran. | Run them in order before the new services-counter, services-system and mobile-api go live: the new services read the new columns on every event lead and company query. `01` to `03` need a user that may alter tables. `99-rollback.sql` in the same folder removes the module and drops the two tables and the columns, which deletes every page, image, page address and campaign tag. @@ -309,6 +311,8 @@ QR registration pages (`/r/`) are served by the admin portal on the same h **Landing pages.** Published pages live at `/p//` on the admin portal, with their images at `/api/public/page-images/` and their form at `/api/public/pages/...`. They need no new route: serve them on the public-pages hostname above, so printed and shared page links survive a later move to the customer portal. +**Custom HTML frames.** A Custom HTML block loads in a sealed frame from `/p///frame/`, and staff preview a draft one at `/pages//preview/frame/`. Both are portal routes on the same hostname as the page. Their responses carry their own `Content-Security-Policy: sandbox allow-scripts allow-popups allow-popups-to-escape-sandbox; frame-ancestors 'self'`. The proxy (Traefik or any other layer) must not replace or strip that header, and must not add `X-Frame-Options: DENY` to these paths. Without the sandbox header, pasted scripts would run as the portal's own origin when the address is opened directly. After deploy, open a frame address and check the response header. + ## 9. Secret templates There is no template yet for `service-email` (its keys wait for the email provider) or `service-system` (its Jumio keys stay unset). Kubernetes Secrets hold base64 values. Encode each one with `printf '%s' 'value' | base64 -w0`. These are templates: replace every `<…>` and never commit the filled-in files. diff --git a/docs/superpowers/specs/2026-12-02-custom-html-block-design.md b/docs/superpowers/specs/2026-12-02-custom-html-block-design.md new file mode 100644 index 0000000..3520f82 --- /dev/null +++ b/docs/superpowers/specs/2026-12-02-custom-html-block-design.md @@ -0,0 +1,73 @@ +# Custom HTML block for landing pages — design + +Date: 2026-12-02. Status: draft for owner approval. + +## Intent + +Marketing staff want to generate page sections with an AI tool and paste the HTML into a landing page, so a page can look like a designed site rather than only the built-in blocks. The owner chose option 1 on 2026-12-02: a "Custom HTML" block shown in a sealed frame. + +## Goals + +- A new block type, **Custom HTML**, holding HTML pasted by staff with `BO_PAGES`. +- The pasted HTML renders as the AI designed it: its own styles, fonts, CDN libraries and scripts. +- The pasted HTML can never act as the visitor or as a staff member on the Co-Lite site: no access to cookies, the back-office APIs, the page around it, or top-level navigation. +- Leads still come only from the built-in Sign-up form block, with consent, interests and UTM tags. + +## Non-goals + +- Forms inside the pasted HTML do not submit. A pasted "contact us" form is decoration; staff add the Sign-up form block for real leads. +- No HTML editor, syntax highlighting or AI generation inside Co-Lite. Staff paste text. +- No search-engine indexing of the framed content. The page title, description and the other blocks still carry the page's search text. + +## Anti-goals + +- Any path where pasted HTML runs with the Co-Lite origin. This includes someone opening the frame's address directly in a browser tab. + +## Approaches + +1. **Sealed frame (chosen).** The HTML is served from its own address with a `sandbox` Content-Security-Policy and shown in an `