Commit Graph

19 Commits

Author SHA1 Message Date
SaelixCode 79fde6e2bd fix(editor): bundle Monaco locally to fix stuck Loading state and CSP block
- Add monaco-editor to frontend deps and configure @monaco-editor/react
  to use the local bundle via loader.config({ monaco }) instead of
  fetching from cdn.jsdelivr.net (blocked by CSP scriptSrc: self)
- Wire editorWorker via Vite ?worker syntax — blob: URLs already
  permitted by existing workerSrc CSP directive, no CSP changes needed
- fix(ci): use DOCS_REPO_TOKEN in release-please so tag creation
  cascades to docker-publish.yml (GITHUB_TOKEN cannot trigger workflows)
- fix(ci): auto-merge screenshots PR via gh pr merge --auto --squash
2026-03-24 19:43:55 -04:00
SaelixCode c294def7cc feat(ci): add release-please automated versioning workflow 2026-03-24 19:01:09 -04:00
SaelixCode 6c911fd67f fix(ci): trigger docker-publish on v* tag push instead of GitHub Release event 2026-03-24 18:48:21 -04:00
Anso 278f7f18d9 fix(ci): add linux/arm64 Docker build support with QEMU optimization (#76)
- Add docker/setup-qemu-action@v3 to docker-publish.yml (was missing,
  causing multi-platform builds to hang indefinitely)
- Add platforms: linux/amd64,linux/arm64 to build-push-action step
- Optimize Dockerfile with --platform=$BUILDPLATFORM on builder stages
  so TypeScript compilation runs at native amd64 speed; only the lean
  npm ci --omit=dev step runs under QEMU in the final stage, compiling
  the three native modules (bcrypt, better-sqlite3, node-pty) for the
  correct target architecture — reduces arm64 build time from 6+ hours
  to ~15-30 minutes
2026-03-24 07:50:33 -04:00
Anso 12467c3fc1 fix: add linux/arm64 platform to Docker build for ARM server support 2026-03-23 16:58:25 -04:00
SaelixCode 8902f6fb4c fix(ci): exclude .git from rsync --delete in sync-docs
rsync --delete removes everything in the destination that is absent from
the source. sencho/docs/ has no .git directory, so rsync was deleting
sencho-docs/.git/ on every run. The commit step then had no git repo to
work with, giving 'fatal: not in a git directory'.

Fix: add --exclude='.git' to the rsync invocation.
2026-03-23 08:02:42 -04:00
SaelixCode b24863db66 fix(ci): fix update-screenshots token and sync-docs empty-repo handling
update-screenshots:
- Add pull-requests: write to job permissions (required by
  peter-evans/create-pull-request to open a PR)
- Switch checkout and create-pull-request from GITHUB_TOKEN to
  DOCS_REPO_TOKEN (classic PAT with repo scope); GITHUB_TOKEN is
  blocked from creating PRs against protected branches

sync-docs:
- Replace actions/checkout + init fallback with a single bash step that
  runs git clone and falls back to git init on failure; actions/checkout
  on an empty repo creates a .git in a broken state (no HEAD/branch),
  which the previous [ ! -d .git ] guard never caught, leaving the
  commit step with no valid working tree
- Drop --global safe.directory config (no longer needed once we own
  the git setup ourselves)
2026-03-23 00:28:47 -04:00
SaelixCode 9505132aaf fix(ci): fix sync-docs empty-repo crash and update-screenshots protected-branch push
update-screenshots: replace direct git push to develop (blocked by branch
protection) with peter-evans/create-pull-request@v6, which opens or
updates a chore/refresh-screenshots PR instead.

sync-docs: add continue-on-error on the sencho-docs checkout so an empty
repo doesn't abort the job. A new init step runs git init -b main and
re-adds the remote when .git is missing. Final push uses
git push origin HEAD:main to work on both first-run (empty repo) and
subsequent runs (existing branch).
2026-03-23 00:09:31 -04:00
SaelixCode 353fd253e9 fix(ci): add load: true to buildx so Trivy can find the built image 2026-03-22 22:07:32 -04:00
SaelixCode f5c5eda30a fix(ci): use double-quoted string for if condition to fix YAML parse error 2026-03-22 22:04:49 -04:00
SaelixCode dc79683b01 fix(ci): YAML syntax error in if condition and safe.directory for sync-docs 2026-03-22 22:00:57 -04:00
SaelixCode ed8b8e33b6 feat: add update-screenshots CI job and screenshot capture spec 2026-03-22 21:28:20 -04:00
SaelixCode 7d1b996bb7 fix: trigger docs sync on develop instead of main 2026-03-22 21:17:45 -04:00
SaelixCode 9496b14f72 feat: add automated docs pipeline and scaffold /docs folder
- Add sync-docs CI job: runs on push to main, copies /docs into sencho-docs repo via DOCS_REPO_TOKEN
- Scaffold /docs with mint.json, getting-started/introduction.mdx, getting-started/quickstart.mdx, features/overview.mdx
- Update CHANGELOG
2026-03-22 21:08:16 -04:00
SaelixCode fbd6b8933d ci: restructure pipeline into parallel jobs with E2E, Docker validation, and auditing
- Split serial build-and-test job into parallel backend, frontend, docker-validate, and e2e jobs
- backend job: build → test → lint (new ESLint) → npm audit --audit-level=high
- frontend job: build → lint → npm audit --audit-level=high
- docker-validate job: builds image on every PR without pushing; Trivy scans for CRITICAL/HIGH CVEs (informational)
- e2e job: runs full Playwright suite against live dev servers after backend+frontend pass
- Add backend/eslint.config.mjs and lint script to backend/package.json
2026-03-22 00:48:49 -04:00
SaelixCode ce50db0fde security: pre-release hardening, automated testing, and production readiness
SECURITY (critical fixes):
- Add authMiddleware to /api/system/console-token (was publicly accessible)
- Validate api_url on node create/update to prevent SSRF (rejects localhost/loopback)
- Add rate limiting (5 req/15 min/IP) to /api/auth/login and /api/auth/setup
- Fix path traversal in env_file resolution — absolute/escaping paths rejected
- Add stack name validation to GET routes (was only on PUT/POST)
- Add helmet security headers middleware
- Restrict CORS to FRONTEND_URL in production

PRODUCTION READINESS:
- Add GET /api/health public endpoint + HEALTHCHECK in Dockerfile
- Add SIGTERM/SIGINT graceful shutdown handler (drains connections, closes DB)
- Run container as non-root sencho user in Dockerfile

QUALITY:
- Fix 4 silent empty catch{} blocks in EditorLayout (now show toast.error)
- Connect ErrorBoundary to root App in main.tsx
- Replace WebSocket.Server with named WebSocketServer import (ESM compat)

TESTING (new automated test suite):
- Install Vitest; 38 backend tests across 4 suites covering validation utilities,
  health endpoint, auth middleware, login flows, SSRF protection, and path traversal
- Extract isValidStackName/isValidRemoteUrl/isPathWithinBase to utils/validation.ts
- Playwright E2E scaffolding: auth, stacks, nodes specs + shared login helper
- CI: run Vitest + ESLint on every PR
2026-03-21 21:59:44 -04:00
SaelixCode 243802eaa7 ci: fix npm cache dependency path for monorepo 2026-03-04 16:09:30 -05:00
SaelixCode 35b444d528 chore: add workflow_dispatch to docker publish to trigger UI registration 2026-03-04 16:06:06 -05:00
SaelixCode 3889d4914e chore: initialize git flow, ci pipeline, and changelog 2026-03-04 13:06:29 -05:00