Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
90d51df
ci: Add PR previews via Codespaces
backspace Jun 17, 2026
614fa3a
ci: trigger Codespaces preview on push instead of dispatch
backspace Jun 17, 2026
511c0f0
ci: fix Codespace build on Debian trixie base image
backspace Jun 17, 2026
8e99cbf
ci: run Codespace start-services detached so postStart returns
backspace Jun 17, 2026
d5f19d7
ci: install mise globally and grant Codespace access to content repos
backspace Jun 17, 2026
4420036
ci: record Codespace preview target
codespace Jun 17, 2026
f81ed70
ci: clone Codespace content repos over HTTPS, not SSH
backspace Jun 17, 2026
bf0fea1
ci: set GRAFANA_SECRET for the Codespace realm server
backspace Jun 17, 2026
745145e
ci: fix docker-in-docker install (drop moby:false, skip buildx)
backspace Jun 17, 2026
e2a6cf4
ci: record Codespace preview target
codespace Jun 17, 2026
3b9e494
ci: run a local host app so the Codespace realm server boots and card…
backspace Jun 17, 2026
fb2bb2d
ci: detach Codespace start-services with setsid so it isn't reaped
backspace Jun 17, 2026
85b29f3
ci: record Codespace preview target
codespace Jun 17, 2026
a42c7f3
ci: serve the Codespace host and realm over HTTPS to match the prerender
backspace Jun 17, 2026
08243f8
ci: record Codespace preview target
codespace Jun 17, 2026
cf9b17f
ci: prebuild a static host instead of vite dev for the Codespace preview
backspace Jun 17, 2026
3333b04
ci: add sshd feature so the Codespace is reachable over gh codespace ssh
backspace Jun 17, 2026
cfcf980
ci: reuse the CI/S3 host build instead of building in the Codespace
backspace Jun 18, 2026
a658cb9
ci: give the Codespace realm server its public serverURL
backspace Jun 18, 2026
2b2b03f
ci: rebase before pushing the Codespace target so it isn't silently d…
backspace Jun 18, 2026
fc3099a
ci: log into the Codespace's own Synapse via realm-injected config
backspace Jun 18, 2026
0460129
ci: build the Codespace preview host generically (drop per-Codespace …
backspace Jun 18, 2026
5a5dc38
ci: serve the Codespace realm over plain HTTP (GitHub edge does TLS)
backspace Jun 18, 2026
142c502
ci: proxy host assets same-origin in Codespace previews (fix CORS)
backspace Jun 18, 2026
5d6f095
fix(codespaces): document that forwarded ports must be set public ext…
backspace Jun 18, 2026
6a5f752
fix(codespaces): register realm_server Matrix users so login doesn't 500
backspace Jun 18, 2026
967b015
fix(codespaces): assert https so realm content resolves (fixes 404s)
backspace Jun 18, 2026
b38286f
fix(codespaces): tear down prior services on (re)start
backspace Jun 18, 2026
d080a9f
fix(codespaces): pin Host too, not just proto, for realm URL matching
backspace Jun 18, 2026
555e929
fix(codespaces): rewrite seeded realm permissions to the hosted URL
backspace Jun 18, 2026
b281ebd
fix(codespaces): index bootstrap realms so card instances resolve
backspace Jun 18, 2026
8e75da6
fix(codespaces): point worker/prerender REALM_BASE_URL at the forward…
backspace Jun 19, 2026
348348c
fix(codespaces): teardown must match real ts-node process names
backspace Jun 19, 2026
8ddebad
feat(codespaces): proxy Matrix + icons through the realm (single origin)
backspace Jun 19, 2026
d403e8c
feat(codespaces): local TLS shim so indexing needs no public port
backspace Jun 19, 2026
f958758
Revert "feat(codespaces): local TLS shim so indexing needs no public …
backspace Jun 19, 2026
d379c80
fix(codespaces): wait for Docker so postStart auto-start is reliable
backspace Jun 20, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Node major here only needs to be close enough to bootstrap mise; the exact
# toolchain (node + pnpm) is pinned in /.mise.toml and installed by setup.sh.
# Pinned to bookworm: the floating `:24` tag now resolves to Debian trixie,
# which several devcontainer features (notably docker-in-docker's Moby
# packages) don't yet support.
FROM mcr.microsoft.com/devcontainers/javascript-node:24-bookworm

# mise manages the Node and pnpm versions pinned in the repo's .mise.toml.
# `mise install` is run by .devcontainer/setup.sh once the repo is checked out.
# Install to a global path: this RUN executes as root, so the default
# ~/.local/bin/mise would land under /root and be invisible to the 'node' user
# that Codespaces runs lifecycle commands as. A global binary is on PATH for
# every user; per-user mise data still lives under each user's home.
RUN curl https://mise.run | MISE_INSTALL_PATH=/usr/local/bin/mise sh && \
echo 'eval "$(mise activate bash)"' >> /etc/bash.bashrc

# build-essential for node-gyp; the rest are the shared libraries Chromium
# needs so puppeteer's bundled Chrome can launch for card prerendering
# (the prerender service fails with "libatk-1.0.so.0: cannot open shared
# object file" without them). Postgres, Matrix/Synapse and SMTP run as
# Docker containers via the docker-in-docker feature, so they need nothing here.
RUN apt-get update && apt-get install -y --no-install-recommends \
build-essential \
libnss3 libnspr4 libatk1.0-0 libatk-bridge2.0-0 libcups2 libdrm2 \
libxkbcommon0 libxcomposite1 libxdamage1 libxfixes3 libxrandr2 \
libgbm1 libpango-1.0-0 libcairo2 libasound2 libatspi2.0-0 \
libgtk-3-0 libx11-xcb1 libxcb1 libxss1 fonts-liberation \
&& rm -rf /var/lib/apt/lists/*
56 changes: 56 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
{
"name": "Boxel PR Review",
"build": {
"dockerfile": "Dockerfile",
"context": ".."
},
"workspaceFolder": "/workspaces/boxel",

"features": {
"ghcr.io/devcontainers/features/docker-in-docker:2": {
"dockerDashComposeVersion": "v2",
"installDockerBuildx": false
},
"ghcr.io/devcontainers/features/python:1": {
"version": "3.11"
},
"ghcr.io/devcontainers/features/github-cli:1": {},
"ghcr.io/devcontainers/features/sshd:1": {}
},

"forwardPorts": [4201, 4206, 8008],
"portsAttributes": {
"4201": { "label": "Realm Server", "onAutoForward": "silent" },
"4206": { "label": "Icons Server", "onAutoForward": "silent" },
"8008": { "label": "Matrix/Synapse", "onAutoForward": "silent" }
},

"postCreateCommand": "bash .devcontainer/setup.sh",
"postStartCommand": "nohup setsid bash .devcontainer/start-services.sh > /workspaces/.boxel-start-services.log 2>&1 < /dev/null &",

"customizations": {
"codespaces": {
"repositories": {
"cardstack/boxel-catalog": { "permissions": { "contents": "read" } },
"cardstack/boxel-skills": { "permissions": { "contents": "read" } }
}
},
"vscode": {
"extensions": [
"cardstack.boxel-tools",
"dbaeumer.vscode-eslint",
"esbenp.prettier-vscode",
"typed-ember.glint-vscode"
],
"settings": {
"terminal.integrated.defaultProfile.linux": "bash"
}
}
},

"hostRequirements": {
"cpus": 4,
"memory": "16gb",
"storage": "64gb"
}
}
55 changes: 55 additions & 0 deletions .devcontainer/setup.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
#!/bin/bash
# One-time setup after the container is created.
# Runs during Codespace build (or prebuild) — keep it idempotent.
# The host app is NOT built here; it's deployed via GitHub Actions
# (.github/workflows/codespaces-preview.yml) pointed back at this Codespace.
set -euo pipefail

cd /workspaces/boxel

# mise installs the exact Node + pnpm versions pinned in .mise.toml. `mise
# trust` is required because the repo's .mise.toml has not been trusted in a
# fresh container. Activate mise for this shell so the pinned tools are on PATH.
echo "==> Installing pinned toolchain via mise..."
mise trust
mise install
eval "$(mise activate bash)"

echo "==> Installing dependencies..."
mise exec -- pnpm install --frozen-lockfile

# Source-realm content lives in separate repos that are cloned on first setup.
# The catalog/skills :setup scripts try an SSH clone (git@github.com:) first,
# which blocks on an interactive host-key prompt in this non-interactive
# context. A Codespace has an HTTPS token credential helper but no SSH key,
# so rewrite SSH GitHub URLs to HTTPS — the clones then authenticate with the
# token (the repos are granted in devcontainer.json customizations.codespaces).
# These are also re-run idempotently when the realm server starts; doing them
# here moves the clone cost into setup.
git config --global url."https://github.com/".insteadOf "git@github.com:"

echo "==> Setting up skills realm..."
mise exec -- pnpm --dir=packages/skills-realm skills:setup

echo "==> Setting up catalog realm..."
mise exec -- pnpm --dir=packages/catalog catalog:setup
mise exec -- pnpm --dir=packages/catalog catalog:update

# No local TLS cert: the realm server serves plain HTTP, and GitHub's port
# forwarding terminates TLS at its edge (it forwards plain HTTP to the
# backend). If the realm served HTTPS it would 308-redirect the edge's
# plain-HTTP request to https://localhost:4201 — bouncing the browser to
# localhost. The prerender uses the public S3 host (already HTTPS), so
# nothing here needs a local cert.

# The host app is NOT built here. The realm server requires a reachable host
# (it fetches distURL at startup) and the prerenderer renders cards against
# it, but rather than build a second copy in the Codespace, start-services.sh
# points both at the host the codespaces-preview workflow already builds and
# deploys to S3 (a production, CloudFront-served bundle that loads far faster
# than a local dev build).

# Database schema is created on demand: infra:ensure-pg starts the boxel-pg
# container and creates the databases, and the realm server runs with
# --migrateDB to apply migrations. Both happen in start-services.sh.
echo "==> Setup complete. Backend services will start automatically."
Loading
Loading