27 Commits

Author SHA1 Message Date
space a3d5a9c95c Merge pull request 'fix: open preview security groups by default' (#5) from fix/open-preview-security-groups into main
Deploy / Build (push) Successful in 34s
Deploy / Build and Push Docker Image (push) Successful in 1m12s
Reviewed-on: #5
2026-07-26 19:12:24 +02:00
space 90906a3c78 fix: open preview security groups by default
Deploy / Build (pull_request) Successful in 37s
Deploy / Build and Push Docker Image (pull_request) Has been skipped
Co-Authored-By: Codex <codex@openai.com>
2026-07-26 19:11:41 +02:00
space 21a80f025f feat(ui): enhance RepoConfig with new sections and improved state management
Deploy / Build (pull_request) Successful in 32s
Deploy / Build and Push Docker Image (pull_request) Has been skipped
Deploy / Build (push) Successful in 34s
Deploy / Build and Push Docker Image (push) Successful in 1m8s
2026-07-26 18:32:28 +02:00
space 5d8791a117 Merge pull request 'fix(ui): use app icon in header' (#3) from fix/use-real-app-icon into main
Deploy / Build (push) Successful in 31s
Deploy / Build and Push Docker Image (push) Successful in 1m34s
Reviewed-on: #3
2026-07-26 17:11:36 +02:00
space a1c7ad7120 feat(setup): add ability to skip setup wizard and update user model
Deploy / Build (pull_request) Successful in 33s
Deploy / Build and Push Docker Image (pull_request) Has been skipped
2026-07-26 17:06:05 +02:00
space d86b35f231 feat(deploy, ec2, ssh): add timeout parameters for SSH and Git commands, improve AWS credentials logging
Deploy / Build (push) Successful in 35s
Deploy / Build and Push Docker Image (push) Successful in 1m10s
2026-07-26 15:14:16 +02:00
space 8fa9aa516e fix(ui): use app icon in header
Deploy / Build (pull_request) Successful in 36s
Deploy / Build and Push Docker Image (pull_request) Has been skipped
Co-Authored-By: Codex <codex@openai.com>
2026-07-26 15:00:08 +02:00
space accbd0d2c6 refactor(TODO.md): clean up completed tasks and update remaining todos [skip ci] 2026-07-26 14:28:02 +02:00
space 3a09d392bb Merge pull request 'feat(v2): full spec implementation — root SSH, bootstrap sentinel, HMAC webhook, all parametric routes fixed' (#1) from v2/full-spec-implementation into main
Deploy / Build (push) Successful in 30s
Deploy / Build and Push Docker Image (push) Successful in 1m11s
Reviewed-on: #1
2026-07-26 14:26:39 +02:00
space 8b53698f29 Really huge mass update; Getting everything up-to-spec and implementing a wide range of features
Deploy / Build (pull_request) Successful in 40s
Deploy / Build and Push Docker Image (pull_request) Has been skipped
2026-07-26 14:24:18 +02:00
luna 2c563685bd fix(v2): deploy through Ubuntu cloud user 2026-07-25 14:36:58 +00:00
luna 714090c0ec fix(v2): authenticate Gitea clones without URL credentials 2026-07-25 14:02:59 +00:00
luna 151a69fb0b fix(v2): use root SSH as bootstrap readiness signal 2026-07-25 13:39:10 +00:00
luna 24c0fa1e7c fix(v2): make EC2 bootstrap readiness deterministic 2026-07-25 13:32:20 +00:00
luna 2fb966542b fix(v2): deterministic Docker build — pin pnpm, fix supply-chain policy, workspace-level install
- Add workspace-level pnpm install in Dockerfile so pnpm-workspace.yaml
  supply-chain settings (onlyBuiltDependencies, allowBuilds) apply uniformly
- Pin pnpm@11.5.2 via corepack with sha1 hash to prevent future policy drift
- Downgrade postcss to ^8.5.22 (8.5.23 was <24h old, violated minimumReleaseAge)
- Regenerate frontend/pnpm-lock.yaml and add root pnpm-lock.yaml for full workspace
- Add binaryTargets to Prisma schema for linux-musl (Alpine) + debian compatibility
- Run pnpm approve-builds to set allowBuilds for esbuild, ssh2, prisma, @prisma/*
- Fix docker-compose.yml: postgres:18-alpine volume at /var/lib/postgresql (not /data)
- Add .env.docker.example; ignore .env.docker in .gitignore

Integration tests (Docker Compose against real Gitea 1.26.2):
 Docker image builds cleanly (pnpm frozen-lockfile, no policy violations)
 postgres:18-alpine starts healthy
 Prisma migrations run on startup
 Founder registration and session auth
 Gitea connection validated (PAT scope check)
 Webhook registered on test repo (Hook ID 11)
 PR opened → HMAC verified → preview created → DEPLOY job queued
 Gitea PR comment posted (write:issue scope confirmed working)
 Deploy fails correctly at AWS step: "Region is missing" (no creds in test env)
 PR closed → STOP job created and completed (status DONE)
 HMAC rejection: wrong signature → 401
 /pp stop via issue_comment webhook → accepted

Blocked (expected): EC2 provisioning requires AWS credentials not present in CI/test env.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-07-25 12:31:46 +00:00
luna 16fea6b952 fix(v2): use rjweb-server {param} syntax for URL path parameters
rjweb-server 9.x uses {param} not :param for dynamic route segments.
All parametric routes (/webhook/{userId}, /api/previews/{id}, etc.)
were returning 404 because the server never matched them.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-07-25 08:49:11 +00:00
luna 787a695fbe fix(v2): UX polish, spec compliance, type safety, race-condition fixes
- Auto-create WebhookToken for new users (first-user and admin-created),
  so setup wizard step 3 immediately has a valid secret to display
- Setup wizard: load webhook secret on step 3 entry (not only on AWS save),
  so skipping AWS setup still shows correct webhook info
- Admin panel: add Edit modal with username and password change for any user
  (spec: 'Edit username or password of any user')
- Webhook handler: only post 'no config' comment on opened/reopened actions,
  not on synchronize or closed — prevents spam on sync events
- deploy.ts: clear stale abort signal at start of runDeploy so a signal meant
  to cancel the previous job cannot accidentally abort the new one
- routes/auth.ts: fix sameSite cookie case to lowercase 'lax' per TypeScript
- Add node-cron type declaration to silence TS7016 for that import
- SPEC.md: fix ec2:ImportKeyPair → ec2:CreateKeyPair (code uses CreateKeyPair)
- example.env: improve comments, add NODE_ENV, add key generation hints

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-07-25 08:39:36 +00:00
luna 25f3612561 fix(v2): critical bug fixes — root SSH, bootstrap wait, SG deletion order, PAT masking
- EC2 bootstrap now enables root SSH (copies authorized_keys to root, sets
  PermitRootLogin without-password, reloads sshd) so all commands run as
  root and NVM at /root/.nvm is accessible
- Added /var/lib/pp-bootstrap-done sentinel; deploy waits for it before
  running any user commands — prevents race between SSH availability and
  user-data completion (docker/nvm install can take 3-5+ min)
- Fixed stopPreview: terminate instance first, delete key pair next, then
  delete security group with 30s delay — SG deletion was previously
  attempted before termination causing it to fail
- Fixed redeploy to always fetch fresh instanceIp/sshPrivateKey from DB
  rather than using potentially-stale preview parameter
- Fixed .env writing to use base64 encoding via echo|base64-d to safely
  handle values with special characters, single quotes, and newlines
- PAT and git clone URL now masked in preview logs (shows **** for password)
- Fixed inactivity cron: removed dead inactivityMs variable, use join on
  repoConfig to avoid N+1, deduplicate pending INACTIVITY_STOP jobs
- Fixed IAM policy UI: ec2:CreateKeyPair (backend uses CreateKeyPair, not
  ImportKeyPair which is a different AWS operation)
- Admin panel: added Edit button with username/password form for users
- Privacy page: fetch and display admin contactEmail from settings
- pnpm-workspace.yaml: fix allowBuilds→onlyBuiltDependencies for pnpm 9

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-07-25 08:34:50 +00:00
space f974840868 fix: update Prisma schema path and upgrade PostgreSQL image to 18-alpine 2026-07-25 09:19:53 +02:00
space f9a2253742 docs: add comprehensive README with setup instructions and pnpm workspace config
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-07-25 00:32:12 +02:00
space 8da5d6eef3 fix: correct route registration - use full paths in rjweb-server path.http() calls
rjweb-server path.http() second argument is the FULL path, not relative to prefix.
Changed all routes from server.path('/prefix', path => path.http(method, '/suffix', ...))
to server.path('/', path => path.http(method, '/prefix/suffix', ...)).

Also fixed:
- Duplicate createContext import in useAuth.ts
- notFound handler now excludes /webhook paths from SPA fallback

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-07-25 00:28:14 +02:00
space 1fd41420c7 fix: improve SSH command execution in deploy service
- Prefix all nvm-dependent commands with NVM source via withNvm() helper
- Fix .env file writing using printf instead of heredoc (which does not work over SSH exec)
- Fix git clone URL encoding using URL class for proper credential encoding
- Add DEBIAN_FRONTEND=noninteractive to apt-get for non-interactive installs

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-07-25 00:25:07 +02:00
space 4a1dc78714 fix: use CreateKeyPair instead of ImportKeyPair for simpler SSH key management
AWS CreateKeyPair generates the RSA key pair server-side and returns the private key,
avoiding the need to manually format RSA public keys in OpenSSH wire format.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-07-25 00:23:59 +02:00
space b975f8e9b9 chore: add .gitignore, remove dist from tracking
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-07-25 00:20:48 +02:00
space 6434be8bed feat: add orphan EC2 cleanup on startup, fix SetupWizard routing, fix SSH key gen
- On startup, scan for EC2 instances with pp:managed=true and terminate any orphans
- SetupWizard now renders as full-page (no Layout wrapper)
- Fixed SSH RSA key generation (generateKeyPairSync with spki format)
- Removed unused import in orphanCleanup.ts
- Frontend rebuild with App.tsx routing fix

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-07-25 00:20:36 +02:00
space 40d484bede feat: initial scaffold - backend, frontend, Prisma schema, Docker
- Prisma schema: User, Session, RepoConfig, Preview, Job, WebhookToken, NoConfigComment, AdminSettings
- Backend: auth (login/logout/me/first-user setup), webhook handler with HMAC verification, EC2 service, SSH service, deploy pipeline, job queue worker, cron workers
- Frontend: Login with first-user detection, Dashboard, PreviewDetail with live log streaming, Settings, Repos config, Admin panel, SetupWizard, Privacy page
- Docker Compose and Dockerfile for self-hosted deployment
- Uses bcryptjs for Node 24 compatibility

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-07-25 00:18:08 +02:00
space ca2efdadea init 2026-07-24 23:41:59 +02:00