Commit Graph
483 Commits
Author SHA1 Message Date
Juan DenisandClaude Opus 4.8 cdcfba5980 feat(extensions): Phase 3 — platform primitives (models, jobs, sockets, perms)
Backend:
- Plugin data models (manifest `models` → ext_<slug>_ tables; upgrade hook;
  purge on uninstall) via extension_lifecycle.py
- Declarative jobs/schedules wired into the Jobs SDK; pause on disable,
  resume on enable, removed on uninstall
- Socket.IO extension point (plugins_sdk.sockets → status-guarded /ext/<slug>)
- Permission capability gate (plugins_sdk.permissions.require_permission)
- Version compat gates enforced at every install source + panel_version() SDK;
  app/utils/version.py
- Keep-data vs purge on uninstall (lifecycle.uninstall(plugin, purge=))
- Plugin-asset serving route (delivery foundation, ADR 0001); manifest-spec
  documents all new fields

Frontend:
- Generic PluginSlot; mounted dashboard.top / service.detail.tab /
  domain.drawer.panel
- Uninstall keep/purge dialog; permission consent list + config_schema preview
  on the extension detail modal

Docs: ADR 0001 (frontend delivery), ADR 0002 (sandboxing note), EXTENSIONS.md
updates; scripts/new-extension.mjs scaffolder (#40).
Tests: test_extension_platform.py (11). Full backend suite: 1197 passed.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-01 22:11:09 -04:00
Juan DenisandClaude Opus 4.8 00b22decd1 feat(marketplace): Phase 2 frontend — registry source + update badges
- Registry as a Browse source (getRegistryExtensions, "Registry" label,
  checksum-verified install via installRegistryExtension)
- Update badges + one-click Update on the ServerKit Plugins tab
  (getPluginUpdates / updatePlugin), disabled when panel too old
- API methods for registry + updates

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-01 21:44:34 -04:00
Juan DenisandClaude Opus 4.8 3e373511b7 feat(extensions): Phase 1 — seed marketplace (GPU + Workflow), module toggles
- One-shot auto-install migration (extension_migration.py): converted builtins
  auto-install on upgrade, marketplace-only on fresh install, user uninstall
  respected
- Convert GPU Monitor → serverkit-gpu and Workflow Builder → serverkit-workflows
  (manifest-driven nav/route/title/palette; pages + backend stay core, D2)
- Module toggles (#14): module_service + /api/v1/modules + 503 guards on
  email/wordpress; frontend useModules hook, sidebar gating, ModuleRoute guard,
  Settings → Modules card
- Marketplace curation polish (#15): by-ServerKit badge, real category chips,
  detail modal with icon + screenshots
- Tests: test_extension_migration.py, test_module_toggles.py (backend suite green)

Tab-grouped conversions (#8/#9/#10/#12/#13) deferred to after the Phase 3
tab-slot primitive (#27) to avoid a grouped-UX regression — see plan doc.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-01 21:34:54 -04:00
Juan DenisandClaude Opus 4.8 74c5e0a885 feat(extensions): Phase 0 hygiene — author guide, sync gate, truth pass, tests
- docs/EXTENSIONS.md: honest author guide (manifest, contributions, SDK,
  lifecycle, install sources, production frontend constraint, conversion recipe)
- Retire the serverkit-git compat shim in contributions.js (manifest is canonical)
- scripts/sync-builtin-frontends.mjs + extensions-ci.yml: builtin-frontend
  drift gate (single source of truth per D5)
- Marketplace UI truth pass: relabel bundled entries "Built-in"
- backend/tests/test_plugins_pipeline.py: first coverage for the install
  pipeline (builtin install, contributions envelope, disable 503, reinstall
  refresh, zip-slip)

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-01 21:13:04 -04:00
Juan DenisandClaude Fable 5 7b45504568 docs: adopt numbered filenames for docs/plans and update references
Plan docs in docs/plans/ (git-ignored) now carry a NN_ prefix in
creation order so new plans sort last. Updated the tracked references
(test docstrings, AGENTS.md, serverkit_installer, _utilities.scss) and
dropped two stale per-file .gitignore lines already covered by the
/docs/plans rule.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-01 20:49:41 -04:00
Juan DenisandClaude Opus 4.8 58e80b2e18 feat(databases): track managed databases as first-class resources
Persist the databases ServerKit provisions (and let you adopt existing ones) so
backups, connection strings, and the UI have durable state -- beside, not
replacing, the live-introspection explorer. Not a DBaaS (no pooling/replicas).

- ManagedDatabase model (engine/name/host/port/origin/owner; admin secret
  Fernet-encrypted, unique per engine+host+name) + migration 044.
- managed_database_service: record_provisioned (additive on the create routes),
  adopt (idempotent), build_connection_uri (real URI, masked by default),
  sync_state (drift detection), delete (optional drop), protect.
- Backup FK fix (the headline): a managed-DB BackupPolicy uses
  target_id = managed_databases.id plus a `managed` marker, and _resolve_target
  resolves the descriptor (incl. decrypted secret) from the row. Legacy
  JSON-descriptor policies keep resolving unchanged (backward compatible).
- API under /api/v1/databases/managed (list/create/get+sync/delete?drop=/adopt/
  connection-uri/protect); the connection-uri reveal is admin-only and audited.
- Frontend: a "Managed" panel on the Database Explorer (connection-string
  reveal/copy, one-click Protect, Untrack/Drop).
- Tests: provisioning persists a row, adopt idempotent, connection URI per
  engine + masking, sync_state drift, protect resolves via the real FK, legacy
  policy still resolves, API masking/admin-gating/audited reveal.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-01 09:44:48 -04:00
Juan DenisandClaude Opus 4.8 cbbd410bc8 feat(services): first-class managed volumes for apps
Give a service tracked, named persistent storage that survives redeploys,
replacing fragile relative bind mounts (./mysql-data:/var/lib/mysql).

- AppVolume model (namespaced serverkit-app-{id}-{slug}, unique per mount path)
  + migration 043.
- volume_service: create (docker volume + row, dup-path refusal), list_for_app
  (rows + live inspect), delete (row-only by default; wipe only when the app is
  stopped and no running container uses it), measure, convert_bind_mount,
  run_args, compose_fragment, host_paths_for_app.
- Wired into the single-container deploy (_deploy_docker passes -v specs to
  docker run) and new compose stacks (create_docker_app gains named_volumes ->
  top-level volumes: block).
- API under /api/v1/apps/<id>/volumes (list/attach/detach?wipe=/convert), ACL
  via ResourceGrantService.
- Frontend: Storage panel in Service detail Settings (attach/detach with an
  off-by-default "also delete data" checkbox, disabled while running).
- Tests: create + namespaced volume, dup-path refusal, wipe safety, single-
  container -v proving test, compose top-level named-volume generation, convert,
  API CRUD.

Scoping: volumes are backup-addressable (mountpoints exposed; protect via the
files target) rather than force-folded into the app's single-parent incremental
tar chain, which would break restore. Live compose files (esp. the WP multidev
stack) are not rewritten -- convert_bind_mount is the opt-in migration.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-01 01:57:07 -04:00
Juan DenisandClaude Opus 4.8 298c556ec7 feat(connections): authenticate private container registry pulls
Store per-registry credentials (Fernet-encrypted) and run `docker login`
before pulling a private image — GHCR, Docker Hub, GitLab, ECR, or any
generic registry. Public/anonymous pulls are unchanged.

- ContainerRegistry model (secret encrypted at rest; to_dict never returns it)
  + nullable applications.registry_id; migration 042.
- container_registry_service: CRUD + login/logout/test_connection (secret piped
  via stdin, never on argv) + lazy ECR token exchange.
- DockerService.pull_image gains a registry= arg (login -> pull -> logout in a
  try/finally). Wired into the deploy path (_deploy_docker) and the compose
  path (start_app / apply_image_update): a docker login authenticates both
  `docker pull` and `docker compose pull`.
- API under /api/v1/connections/registries (list=auth, writes=admin); registries
  join the unified /connections list.
- Frontend: Connections hub "Container registry" card (add/test/remove with a
  provider selector) + a per-app registry picker in Container Ops.
- Tests: encrypt/decrypt, stdin-not-argv, login->pull->logout ordering incl.
  finally-on-failure, deploy + compose auth-before-pull, API CRUD/masking/admin.

Deviation from the plan's "single injection point": docker apps run via compose,
so login was wired into both the compose and run_container paths; remote-agent
compose is a follow-up.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-01 01:35:44 -04:00
Juan DenisandClaude Opus 4.8 6b35bb996d feat(wordpress): global plugin library for operator-owned plugins
Register WordPress plugins from GitHub repos or local paths in a global
library, then install or update them across any managed WP site from one
place. The per-site Plugins tab gains a "managed" badge and an
"update from library" action.

- models: WordPressCustomPlugin (library) + WordPressSitePlugin (installs)
- service: WordPressPluginLibraryService - sync, install, update, scan,
  with a per-slug cache dir under paths.SERVERKIT_CACHE_DIR
- api: /plugins/library CRUD + sync/install/bulk-update on wordpress_bp
- migration 041_wordpress_plugin_library
- frontend: WordPressPluginLibrary page + "Plugin Library" tab; managed
  badges and library-update action in PluginsTab
- tests: test_wp_plugin_library

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-01 01:08:42 -04:00
Juan DenisandClaude Opus 4.8 432e65179b feat(services): pick a base domain when giving an app a subdomain
Bring the multi-base picker to the generic app/service publish flow, matching
the WordPress create flow. The service Settings → "Give it a subdomain" modal
now loads the registered base domains and, when more than one exists, shows a
"Base domain" dropdown (default marked, HTTPS flagged); the live suffix and the
wildcard/per-site hint follow the selection, and the choice is passed through to
give-subdomain so the app publishes at <label>.<chosen-base>. A single-base
install is unchanged (no dropdown).

api.suggestSubdomain / giveSubdomain take an optional base; new
api.getSiteBaseDomains() reads GET /domains/base-domains.

Proven: suggest-subdomain honours ?base (test_site_base_domains.py); frontend
lints clean (0 errors) and builds.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-01 00:31:22 -04:00
Juan DenisandClaude Opus 4.8 2f11f450d9 feat(settings): manage the base-domain registry from Settings → Site
Turn the single-base "Managed Sites Domain & HTTPS" card into a registry
manager. Operators can now register several base domains, mark a default,
remove one, flip each between wildcard/per-site DNS, and set up per-base
wildcard HTTPS with a chosen DNS provider — all from the UI.

- Each registered base renders as a row with Default / HTTPS badges, a DNS-mode
  select, a "Set up / Renew HTTPS" action (using the selected provider, base
  passed through), plus Make default / Remove.
- Back-compat: an install with no registry rows shows its single legacy base as
  an editable in-place row (saves sites_base_domain); adding a second domain
  seeds that legacy value into a real row server-side, and the table takes over.
  A fresh install with no base shows an empty state + the Add form.
- Server public IP and DNS provider are shared across bases.
- New admin PATCH /admin/sites-https/base-domains/<domain> for DNS-mode edits;
  api service gains add/remove/setDefault/update helpers and setupSitesHttps now
  takes a base.

Proven: test_site_base_domains.py adds a PATCH-dns-mode API test (13 pass);
frontend lints clean (0 errors) and builds.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-01 00:27:30 -04:00
Juan DenisandClaude Opus 4.8 bc70bdb97d feat(wordpress): pick a base domain in the create flow
With several base domains registered, the create modal now lets you choose
which one the site publishes under. A "Publish under" dropdown lists the
available bases (default first, marked, showing which have HTTPS) and previews
the exact live host — <slug>.<base> — as you type the name. The choice rides
through as baseDomain in the existing createSite payload. When no base domain
is configured the field explains the site will stay on localhost until one is
set. The Custom Domain field is clarified as an override of the base choice.

wordpressApi.listBaseDomains() reads GET /api/v1/domains/base-domains; the base
list loads when the modal opens and preselects the returned default.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-01 00:13:27 -04:00
Juan DenisandClaude Opus 4.8 45ba40a7ad feat(wordpress): surface the live site URL on create (closes roadmap #21)
After creating a WordPress site the post-create banner showed only the admin
credentials, so users had no signal that the site was already reachable at
<slug>.<base> — the exact "preview URL before DNS" gap roadmap #21 tracked,
now unblocked by the base-domain + Phase-5 wildcard-cert stack.

The banner now surfaces the live link on every successful create: a clickable
<slug>.<base> (noting HTTPS when the wildcard cert is set up), or, when the
site only came up on localhost, a nudge to set a managed-sites base domain in
Settings to publish it publicly. Shown even when the automated install did not
finalize (no captured credentials).

Mark #21 done in the roadmap: the wildcard base subdomain is the working,
TLS-valid preview a user relies on while pointing a custom domain, so the
separate *.preview.<panel-domain> scheme is unnecessary.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-30 23:35:25 -04:00
Juan DenisandClaude Opus 4.8 31330a09be fix(deploy): make docker-compose.yml frontend-only (backend runs on host)
ServerKit's backend manages the host it runs on -- it creates app dirs under
/var/serverkit/apps, drives the host Docker daemon (one container per app),
and reloads nginx. The default compose containerized the backend, so it ran
as a non-root user into a root-owned /var/serverkit/apps with no host
docker.sock: WordPress/app creation failed with
`Permission denied: /var/serverkit/apps/...`. It also contradicted install.sh,
which runs the backend on the host via systemd and expects compose to bring
up only the frontend.

- docker-compose.yml: frontend-only; the frontend reaches the host backend via
  extra_hosts ["backend:host-gateway"].
- backend/Dockerfile: chown /var/serverkit to appuser (latent EACCES on the
  apps dir for dev/demo container use) + header noting it cannot manage host.
- frontend/nginx.conf: document the backend:host-gateway upstream.
- docs/DEPLOYMENT.md: add a Deployment model note; fix build/start + data paths.
- scripts/test/test_install.sh: T12 guards against re-adding a backend service.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-25 16:20:32 -04:00
Juan DenisandClaude Opus 4.8 e1088aff71 feat(frontend): skeleton loaders, branded AppLoader, favicon refresh
Replace spinners with skeleton placeholders across page/section loaders
(EmptyState, DataTable, and ~page surfaces), add a reusable Skeleton
component + _skeleton.scss, rework AppLoader into a branded "server
powering on" loader, and refresh the favicon set (incl. SVG icon link).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-24 21:44:40 -04:00
Juan DenisandClaude Opus 4.8 b00fff7759 refactor(unify): §4 — one Observability namespace + tab group
Backend:
- The monitoring / metrics / telemetry(events) / uptime / fleet / status-page
  read surfaces are re-mounted under /api/v1/observability/<domain> as true
  aliases (same blueprints, distinct names). Original prefixes stay; the public
  status page route /api/v1/status/public/<slug> is untouched.

Frontend:
- The Monitoring tab group becomes "Observability": Monitoring · Events
  (the SystemEvent stream, formerly the standalone "Telemetry" page) · Status
  Pages, sharing one PageTopbar. /observability lands on Monitoring.
- The standalone Telemetry route + sidebar item are folded into the group
  (sidebar "Monitoring" → "Observability"; Events covered by matchPrefixes;
  removed from ADVANCED_ITEM_IDS). Command palette updated.
- Fleet Monitor stays under Servers (server-scoped) and GPU stays its own
  hardware page — intentional, per the plan.

Deferred (plan §4 deep merge, documented): the unified events/metrics/checks/
alerts/thresholds tables + collector migration into the job system. The
read-surface namespace + IA consolidation ship now; the schema merge is a large
data migration best done against a live metrics store.

Verified: 3 backend namespace tests + telemetry suite pass (22); frontend build
+ eslint clean.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-24 14:58:55 -04:00
Juan DenisandClaude Opus 4.8 15fce59543 refactor(unify): §5 — single SSL surface (basic + advanced)
Unifies "SSL Certificates" and "Advanced SSL" into one lifecycle surface.

Backend:
- The advanced cert operations (wildcard DNS-01, SAN, custom upload, TLS
  profiles, health, expiry alerts) now mount under /api/v1/ssl alongside the
  basic certbot routes — no path collisions. /api/v1/ssl/advanced kept as a
  deprecated alias (same blueprint, second registration).

Frontend:
- api client advanced methods repointed to the unified /ssl/* paths.
- SSLCertificates.jsx (already the single SSL page) gains the two cert-creation
  paths that were previously UI-inaccessible: a "Wildcard (DNS-01)" mode in the
  New Certificate modal (Cloudflare token / Route 53 keys) and an "Upload"
  action + modal for bring-your-own PEM cert/key/chain.

Deferred (documented follow-up): a unified Certificate registry model + disk
scan, and surfacing health/profiles panels — the API is unified and the client
methods exist; these are read-side enhancements.

Verified: 3 backend route-unification tests + existing SSL suites pass (19);
frontend build + eslint clean.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-24 14:40:08 -04:00
Juan DenisandClaude Opus 4.8 d87e69b44f refactor(unify): §8 Phase B4 — surface DeploymentSnapshot as "Config Checkpoint"
Recorded §8 decision: a deployment config snapshot is shown as a "Config
Checkpoint" in the UI to end the overloaded "snapshot" wording. Distinct from
data-protection backups and from WordPress DB snapshots, which are untouched.

Backend:
- snapshots blueprint serves every route under /apps/:id/config-checkpoints
  in addition to /apps/:id/snapshots (dual @route — both resolve to one view).

Frontend:
- DeployTab section "Deployment Timeline" → "Config Checkpoints" with reworded
  hint; ConfigDiffModal + DeploymentTimeline empty/peer copy use "checkpoint".
- api/snapshots.js gains getConfigCheckpoint(s)/Diff/restore aliases.
- ProtectionStatusCard: "Snapshots run on the configured schedule" → "Backups"
  (that card describes backups, not config checkpoints).

Verified: 2 alias tests + existing config-snapshot suite pass; frontend build clean.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-24 14:24:13 -04:00
Juan DenisandClaude Opus 4.8 8c57636455 refactor(unify): §2 — rename WordPress "Projects" → "Pipelines"
Feature-unification plan §2. Ends the naming collision between generic
/projects (workspace organization) and WordPress "Projects" (environment
pipelines). Label + URL change only; deeper WP/app unification is §7.

Frontend:
- Pipeline list moves to /wordpress/pipelines; detail to
  /wordpress/pipelines/:id[/:tab]. WORDPRESS_TABS, command palette, page
  titles, breadcrumbs, empty-state copy, and the WordPressProject tab base
  all updated to "Pipelines".
- Legacy /wordpress/projects[...] URLs redirect to the pipelines space via
  LegacyWpPipelineRedirect (deep links preserved).
- wordpressApi.getPipelines() added; getProjects() kept as back-compat alias.

Backend:
- environment_pipeline_bp mounted a second time under
  /api/v1/wordpress/pipelines as a true alias of /wordpress/projects.
- Test: /pipelines resolves identically to /projects.

Verified: frontend build clean, 5 alias tests pass.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-24 14:09:35 -04:00
Juan DenisandClaude Opus 4.8 3f18a0ebd3 refactor(unify): §1 — single Services detail surface; /apps→/services
Feature-unification plan §1 (Services UI = Applications backend). Ends the
"Applications vs Services" terminology split by collapsing the two detail
pages into one canonical surface and aliasing the backend.

Frontend:
- Merge ApplicationDetail's exclusive tabs (Container Ops, WAF, Build, Deploy,
  Previews) into the canonical ServiceDetail (PageTopbar chrome). Type-gating
  preserved exactly: ops=Docker, waf=Docker+Python, build/deploy/previews=all.
- serviceTypes.js tab lists extended for the merged tabs.
- /apps/:id and /apps/:id/:tab now redirect to /services/:id[/:tab] via
  LegacyAppRedirect (deep links preserved); ApplicationDetail.jsx deleted.
- Drop the /apps page-title entry and "Application Details" dynamic title.
- api.getServices()/getService() aliases over getApps()/getApp().

Backend:
- Mount apps_bp a second time under /api/v1/services as a true alias of
  /api/v1/apps (Flask blueprint re-registration with name='services').
- Test: /api/v1/services resolves identically to /api/v1/apps.

Verified: frontend build clean, eslint 0 errors, 3 alias tests pass.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-24 14:06:05 -04:00
Juan Denis a283df0cf1 Split Secrets & Webhooks into Vaults and Webhooks
Refactor UI to split the legacy "Secrets & Webhooks" page into two focused pages: Vaults (organization tab) and Webhooks (standalone page). Added new pages frontend/src/pages/Vaults.jsx and frontend/src/pages/Webhooks.jsx, removed frontend/src/pages/SecretsWebhooks.jsx, and updated routes in App.jsx to register /vaults and /webhooks while redirecting legacy /secrets routes to the new locations. Updated CommandPalette, organization tabs, and sidebar items to reflect Vaults/Webhooks and adjusted ADVANCED_ITEM_IDS. UI comments explain intent and migration. This keeps secret storage under Organization and makes webhooks a dedicated console.
2026-06-24 13:56:01 -04:00
Juan DenisandClaude Opus 4.8 a4135de92d fix(frontend): Phase 5 §8.5 — narrow the legacy-.card lint rule to stop false positives
The no-restricted-syntax `.card` selector used `\bcard\b`, which flagged any
className containing "card" as a word — including unrelated compound classes like
`settings-card`, `sk-spec-card`, `auth-card`, and `wp-site-card-skeleton`, none of
which are the legacy `.card` class the rule's message targets. Narrowed it to the
legacy card family as a LEADING token (`card`, `card-header`, `card-body`, …),
removing ~220 false-positive warnings while still flagging real `.card` usage
(225 remain). Frontend ESLint warnings: 1616 (plan baseline) → 1190; 0 errors.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-24 10:50:30 -04:00
Juan DenisandClaude Opus 4.8 bdffd91361 chore(frontend): Phase 5 §8.5 — add pre-commit ESLint guard
Adds a shared git hook (.githooks/pre-commit) that lints staged frontend JS/JSX
and blocks the commit on ESLint ERRORS only (warnings allowed). It exits early
for commits with no frontend JS/JSX (backend, SCSS, docs), so it never disrupts
those. Enable once per clone: `git config core.hooksPath .githooks` (or
`sh frontend/setup-hooks.sh`).

Chose a committed .githooks script over husky/lint-staged: this is a monorepo
(git root has the Python backend; only frontend/ is a node package with no root
package.json), so a dependency-free hook avoids an npm-install-time git-config
mutation and keeps backend committers unaffected. Documented in AGENTS.md.

Tested: blocks a staged file with a parse error (exit 123), passes when clean.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-24 10:46:28 -04:00
Juan DenisandClaude Opus 4.8 b70277ef67 fix(frontend): Phase 5 §8.2 A3 — add type="button" to raw action buttons
Raw <button> elements default to type="submit" inside a form, causing accidental
submits. Added an explicit type="button" to the 234 raw buttons (across 60
files) that have an onClick and no type — i.e. action buttons, which are never
the intended default-submit. Default-submit buttons (no onClick) and the shadcn
ui/* wrappers were left untouched. Applied via a brace/quote-aware scan so
multi-line tags and style={{...}} attrs are handled correctly.

Verified: npm run build passes; dashboard/services/settings screenshots render
unchanged.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-24 10:42:47 -04:00
Juan DenisandClaude Opus 4.8 fd2a3cadd6 refactor(frontend): Phase 3 §6.4/§6.2 — migrate WordPress list to ResourceListPage
Second ResourceListPage consumer (the page Services' chrome was copied from).
Replaced WordPress.jsx's duplicated .wp-list toolbar/bulk-bar + inline sk-dtable
table with ResourceListPage; the table is now DataTable columns. Added a `header`
slot to ResourceListPage for the one-time credentials banner; the tag-filter
chips go through `toolbarExtra`. Kept the custom loading skeleton and lite-tier
ResourceGate as early returns, and the Import/Create modals as children. All
behavior preserved (filter chips, search, tag filter, select-all + per-row
checkboxes, bulk ops, open/wp-admin links, row-click routing).

Verified: npm run build passes, 0 lint errors; WordPress list screenshot (mock
data) renders identically to before.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-24 10:33:56 -04:00
Juan DenisandClaude Opus 4.8 972849dc6c refactor(frontend): Phase 3 §6.4/§6.2 — ResourceListPage + migrate Services to DataTable
Per docs/plans/FRONTEND_UX_TAILWIND_CLEANUP_PLAN.md §6.4 (ResourceListPage) and
§6.2 (table → DataTable).

- Add components/layouts/ResourceListPage.jsx: the shared list-page chrome —
  status-filter SegControl + search toolbar, bulk-actions bar, the DataTable, and
  the loading / empty / filtered-empty states. Markup mirrors the existing
  .wp-list design so SCSS applies unchanged.
- Services.jsx: replaced its hand-rolled .wp-list chrome + inline sk-dtable table
  with ResourceListPage. The table is now DataTable columns; interactive cells
  (checkbox, row actions) stop click propagation so they don't trigger the row
  navigate. All behavior preserved (filter chips with counts, search, select-all
  + per-row checkboxes, bulk bar, source/status/env cells, row-click routing).

Verified: npm run build passes, 0 lint errors; Services screenshot (mock data)
renders identically to before (also fixed the section's stale wait-selector).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-24 10:28:51 -04:00
Juan DenisandClaude Opus 4.8 ecde757115 refactor(frontend): Phase 4 §7.3 — split ServerDetail/ApplicationDetail/WordPressDetail monoliths
Per docs/plans/FRONTEND_UX_TAILWIND_CLEANUP_PLAN.md §7.3, following the Docker
split. Pure move-plus-imports refactors (no logic/JSX/state changes); the tabs
were already top-level + prop-driven, so the build validates every import.

- ServerDetail.jsx  2459 → 390 lines → components/serverdetail/ (serverDetailShared
  + ServerOverviewTab/AlertsTab/ServerDockerTab/CronTab/CloudflaredTab/
  ServerMetricsTab/ServerSettingsTab; Server* prefixes avoid collisions with the
  folder's existing PackagesTab/ServicesTab/SystemStatusCard).
- ApplicationDetail.jsx  1737 → 275 lines → new components/appdetail/ (appDetailShared
  + Overview/Packages/Gunicorn/Commands/Build/Logs/Settings/DeployTab).
- WordPressDetail.jsx  3992 → 464 lines → new components/wordpress/detail/
  (wpDetailShared + 15 tab files; cross-tab modals re-exported, e.g. OverviewTab
  imports CreateEnvironmentModal/SearchReplaceModal from their owning tabs).

Verified: combined npm run build passes, 0 lint errors; rendered all three detail
shells under Playwright (mock data) — header, full tab nav, and Overview content
render correctly (no pageerror/error-boundary). Combined with the build (which
resolves every tab import) this confirms the shell→tab wiring.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-24 10:09:43 -04:00
Juan DenisandClaude Opus 4.8 019fdb2cfe refactor(frontend): Phase 4 §7.3 — split Docker.jsx monolith into per-tab files
Per docs/plans/FRONTEND_UX_TAILWIND_CLEANUP_PLAN.md §7.3. Pure refactor (move +
imports only, no logic change). Docker.jsx goes from 2521 → 334 lines (a thin
shell: status/server/stats/tab state + layout). Extracted to components/docker/:
- dockerHelpers.js  — ServerContext/useServer + the pure container helpers/constants
- dockerShared.jsx  — IconAction, TrashIcon, ContainerResourceBars, DownloadIcon
- ContainersTab.jsx — ContainersTab + ContainerInspector + Run button/modal + logs/exec modals
- ComposeTab.jsx, ImagesTab.jsx, NetworksTab.jsx, VolumesTab.jsx, PruneButton.jsx
The tabs were already decoupled (shared ServerContext + onStatsChange prop, no
closures over the shell), so the split is mechanical.

Verified: npm run build passes, 0 lint errors, and drove ALL FIVE tabs
(Containers/Compose/Images/Networks/Volumes) open under Playwright with mock data
— each renders correctly (tables, status/port pills, resource bars, row actions,
toolbar buttons) identical to pre-split.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-24 09:39:22 -04:00
Juan DenisandClaude Opus 4.8 bf21504358 refactor(frontend): Phase 3 §6.1 — migrate the large-page modals to shared Modal
Converts the remaining hand-rolled .modal-overlay modals in the big pages to the
shared <Modal>: Docker (6: compose logs, run, exec, pull, create network/volume),
WordPressDetail (5: clone, search-replace, delete, create env, snapshot),
Domains (2: add domain, enable SSL), Servers (1: manage groups),
ApplicationDetail (2: build config, deploy config), WordPressProject (1: create
env). Same pattern: forms+actions in the body, sizes mapped, close-animation
null-guards where the body derefs open-state.

Only 2 .modal-overlay remain, both intentionally left — they are custom
right-side slide-in DRAWERS (Servers AddServerModal/.server-setup-modal and the
Templates detail panel) that need the Drawer primitive, not a centered Modal.

Verified: npm run build passes (each agent built independently + final combined
build).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-24 03:16:53 -04:00
Juan DenisandClaude Opus 4.8 f3fd9c5e76 refactor(frontend): Phase 3 §6.1 — migrate ~37 hand-rolled modals to shared Modal
Per docs/plans/FRONTEND_UX_TAILWIND_CLEANUP_PLAN.md §6.1. Converted the
.modal-overlay/.modal boilerplate to the shared Radix-backed <Modal> (focus
trap, Escape, backdrop, built-in close) across 20 files: AttachDomainModal,
ChangeUrlModal, ConfigDiffModal (xl), SettingsTab, Templates, WordPress (lg),
Workspaces, WorkspaceDetail, StatusPages, ServerTemplates, CloudProvision,
CronJobs, SSLCertificates, FTPServer, Email, FileManager, Git (lg/xl), Backups,
QueueDetail, QueueOperations. Forms keep their submit button + .modal-actions in
the Modal body; bodies that deref open-state objects are guarded for the close
animation; sizes mapped from old .modal-lg/.modal-xl.

Also hoisted .status-modal/.status-modal-grid out of .status-pages-page in
_status-pages.scss — the shared Modal portals to <body>, so page-scoped rules
would not have reached it.

Left intentionally: the Templates detail panel (custom slide-in drawer) and
ProjectDetail (already uses the Radix Dialog primitive directly).

Verified: npm run build passes; databases-modal pilot confirmed rendering via
Playwright; eslint adds no new errors.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-24 03:12:26 -04:00
Juan DenisandClaude Opus 4.8 a877e49585 refactor(frontend): Phase 3 §6.1 — migrate databases modals to shared Modal
Per docs/plans/FRONTEND_UX_TAILWIND_CLEANUP_PLAN.md §6.1 (priority #1 cluster).
Converted the 5 hand-rolled .modal-overlay modals in databases/modals.jsx
(CredentialsResult + Create MySQL/PostgreSQL Database/User) to the shared
components/Modal.jsx (Radix-backed: focus trap, Escape, backdrop). The form +
.modal-actions stay in the Modal body so the type=submit button remains inside
<form>. Logic unchanged.

Verified: npm run build passes; drove the Create MySQL database modal open under
Playwright (mock data) — renders correctly via .sk-modal.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-24 03:00:51 -04:00
Juan DenisandClaude Opus 4.8 9c0109b880 refactor(frontend): Phase 5 §8.4 — Settings account/admin switch uses SegControl
Per docs/plans/FRONTEND_UX_TAILWIND_CLEANUP_PLAN.md §8.4. Replaced the hand-rolled
two-<button> role=tablist 'My Account / Admin' switch in Settings.jsx with the
shared components/ds/SegControl, so settings uses the same segmented-control
primitive as the rest of the app.

Verified: npm run build passes; settings screenshot confirms the segmented
control renders correctly.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-24 02:54:29 -04:00
Juan DenisandClaude Opus 4.8 3e1ca209fe fix(frontend): sanitize sidebar icon SVG in SidebarSettings too
Follow-up to the Sidebar XSS fix (c3eb51f) — the Sidebar customization preview
in SidebarSettings.jsx injected item.icon via dangerouslySetInnerHTML without
sanitizing. Routed it through sanitizeSvgInner like the main Sidebar. (The
SqlEditor and file-preview highlighters were checked and already escape-first,
so A5/A6 need no change.)

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-24 02:52:31 -04:00
Juan DenisandClaude Opus 4.8 3fcb128cb3 refactor(frontend): Phase 3 §6.6 — remove the useConfirm-driven local ConfirmDialogs
Follows the ConfirmProvider checkpoint. Removed the now-inert per-page
<ConfirmDialog> instances that were driven by useConfirm's confirmState across
18 files (ApplicationDetail, Docker, ServerDetail, Terminal, WordPressDetail,
Backups, CronJobs, Databases, Queue*, SSLCertificates, ServiceDetail,
ContainerOpsPanel, ProtectionPanel, BackupsTab, PreviewList, PackagesTab,
MigrationHistoryTab); simplified each useConfirm() destructure to { confirm } and
dropped the unused ConfirmDialog imports. confirm() now renders only via the
app-level provider.

~20 other files keep their own local-useState-controlled ConfirmDialogs (not
useConfirm-driven) — intentionally left; migrating those is a separate behavior
change.

Verified: npm run build passes; no dangling confirmState refs; Docker page
renders.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-24 02:50:59 -04:00
Juan DenisandClaude Opus 4.8 6a0d57587a refactor(frontend): Phase 3 §6.6 — add ConfirmProvider (app-level confirm dialog)
Per docs/plans/FRONTEND_UX_TAILWIND_CLEANUP_PLAN.md §6.6. Adds a single
app-level <ConfirmDialog> via ConfirmProvider (wraps the dashboard). useConfirm
is now context-aware: with the provider present, confirm() routes to the one
dialog and the legacy confirmState/handleConfirm/handleCancel become inert
no-ops (so the 39 pages' own <ConfirmDialog> render closed/harmless until
removed). Falls back to local state outside a provider so nothing breaks.

Backward-compatible checkpoint; the per-page dialog removal follows.

Verified: npm run build passes; 0 lint errors.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-24 02:46:33 -04:00
Juan DenisandClaude Opus 4.8 ad9acb89e3 refactor(frontend): Phase 5 §8.5 — drop 142 unused React imports (JSX transform)
Per docs/plans/FRONTEND_UX_TAILWIND_CLEANUP_PLAN.md §8.5. React 18's automatic
JSX runtime makes 'import React' unnecessary; removed it from the 142 files
eslint flagged as 'React defined but never used' (named imports like useState
preserved). Driven by an eslint --format json pass so only flagged files were
touched.

Lint warnings: 1603 -> 1461 (0 errors). Verified: npm run build passes.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-24 02:44:16 -04:00
Juan DenisandClaude Opus 4.8 c3eb51f3d2 refactor(frontend): Phase 5 §8.2 — sanitize sidebar SVG icons + AI shortcut a11y
Per docs/plans/FRONTEND_UX_TAILWIND_CLEANUP_PLAN.md §8.2 (A1/A8, A2).
- Sidebar icons were injected via dangerouslySetInnerHTML. Core icons are
  trusted constants, but plugin-contributed nav items flow through the same path
  and could supply arbitrary SVG. Added utils/sanitizeSvg.js: an allowlist
  sanitizer (DOMParser-based, caches results) that keeps only safe SVG shape
  elements/attributes and drops scripts/event handlers/external refs. Wired both
  Sidebar icon sites through it — zero visual change (verified via screenshot).
- AI Alt+A shortcut: added a visible title tooltip + aria-keyshortcuts on the
  chat bubble (discoverable), and made the global handler skippable via
  localStorage 'sk_ai_shortcut' = 'off'.

Verified: npm run build passes; 0 lint errors; dashboard screenshot confirms
sidebar icons still render.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-24 02:40:43 -04:00
Juan DenisandClaude Opus 4.8 d6b631ec34 refactor(frontend): Phase 4 §7.2 — disambiguate the two WafPanel components
Per docs/plans/FRONTEND_UX_TAILWIND_CLEANUP_PLAN.md. Two different components
were both named WafPanel.jsx (app-level vs Cloudflare-zone WAF), a real source
of confusion. Renamed:
- components/apps/WafPanel.jsx -> AppWafPanel.jsx
- components/cloudflare/WafPanel.jsx -> CloudflareWafPanel.jsx
Updated the single importer of each (ApplicationDetail, CloudflareZoneSettings).

Verified: npm run build passes; no stray WafPanel references remain.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-24 02:32:27 -04:00
Juan DenisandClaude Opus 4.8 360d268fe5 refactor(frontend): Phase 3 §6.5 — replace ad-hoc loading divs with EmptyState
Per docs/plans/FRONTEND_UX_TAILWIND_CLEANUP_PLAN.md (acceptance: no
<div className="loading"> remains). Replaced all 14 ad-hoc loading divs across
13 files with the shared <EmptyState loading title="..." /> (centered spinner +
label), preserving each message verbatim. EmptyState was already imported in
Docker/Services; added the default import elsewhere.

Verified: npm run build passes; grep for className="loading" returns nothing;
eslint adds no new errors.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-24 02:30:24 -04:00
Juan DenisandClaude Opus 4.8 b872b9def0 refactor(frontend): Phase 4 §7.4 — sync command palette routes
Per docs/plans/FRONTEND_UX_TAILWIND_CLEANUP_PLAN.md. STATIC_PAGES had drifted
from the real route table:
- Drop the 'DNS Zones' /dns entry (it redirects to /domains); fold its
  dns/records/nameserver/zones keywords into the Domains entry.
- Add the missing pages: Projects, Shared Variables, Workspaces, GPU Monitor,
  Queue, Jobs, Telemetry, Secrets (all verified present in App.jsx).

Verified: npm run build passes.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-24 02:26:26 -04:00
Juan DenisandClaude Opus 4.8 9bd6d18f2c refactor(frontend): Phase 5 §8.3/§8.2 — useLockBodyScroll hook + markdown link hardening
Per docs/plans/FRONTEND_UX_TAILWIND_CLEANUP_PLAN.md Phase 5.
- Add hooks/useLockBodyScroll.js: a ref-counted body-scroll lock that composes
  nested locks correctly (a modal over an already-locked drawer no longer
  restores scroll prematurely). Replaces the duplicated
  document.body.style.overflow toggles in DashboardLayout (mobile nav drawer),
  PreviewDrawer (file preview), and ChatDrawer (mobile AI sheet).
- lib/ai/markdown.js: escape quotes in link URLs. The renderer already
  HTML-escapes all input and only emits allowlisted tags, but `"`/`'` in a
  crafted URL could break out of the href attribute — now percent-encoded.

Verified: npm run build passes; eslint adds no new errors.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-24 02:24:27 -04:00
Juan DenisandClaude Opus 4.8 dcf9365ff3 refactor(frontend): Phase 4 §7.1 — delete dead redirected pages
Per docs/plans/FRONTEND_UX_TAILWIND_CLEANUP_PLAN.md Phase 4.
- pages/Applications.jsx: orphaned. /apps already redirects to /services and
  /apps/:id renders ApplicationDetail; nothing imported this 481-line page.
- pages/Firewall.jsx: orphaned. /firewall already redirects to
  /security/firewall; the live UI is components/security/FirewallTab.jsx.
- components/status/ContainerStatusPill.jsx: only consumed by dead Applications.

Kept _applications.scss and _firewall.scss — verified both are shared by live
components (ApplicationDetail/ServiceDetail/ContainerOpsPanel and FirewallTab),
so not orphaned. App.jsx route redirects retained so bookmarks don't 404.

Verified: npm run build passes; no remaining references to deleted files.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-24 02:20:53 -04:00
Juan DenisandClaude Opus 4.8 064e00c7f0 refactor(frontend): Phase 3 §6.3 — consolidate byte/relative-time formatters
Per docs/plans/FRONTEND_UX_TAILWIND_CLEANUP_PLAN.md Phase 3 utility consolidation.
Replaces the scattered, drifted-apart local helpers with the canonical utils
added in Phase 1.

formatBytes (was 14 local copies):
- utils/formatBytes.js realigned to the codebase convention (1024 divisor +
  KB/MB/GB labels; `iec` opt switches labels to KiB/MiB). It was unused until
  now, so displayed values are preserved.
- Removed local formatBytes/formatSize/formatMemory from ApplicationDetail,
  Backups, Databases, Monitoring, Terminal, ServerDetail (x2), BackupsTab,
  QuarantineTab, SystemTab, DiskUsageBar, SnapshotTable. Decimals matched per
  call site (e.g. BackupsTab keeps 2 decimals); empty/falsy fallbacks preserved
  via defaultValue. fileTypes.js and logHelpers.js now re-export the canonical
  (their named exports are consumed elsewhere).

formatRelativeTime (was 6 local copies):
- ActivityFeed, PipelineView (x2), Dashboard migrated to utils/time.js.
- serviceTypes.js and logHelpers.js re-export the canonical.
- EnvironmentCard left as-is (intentionally distinct "Today/Yesterday/X days
  ago" vocabulary, not the "Xm ago" format).

Behavioral deltas are cosmetic only: trailing-zero trim ("1.0 GB"->"1 GB"), the
date-fallback threshold normalized to 30d, and sub-hour times now show precise
"Xm ago". Units and numeric values are unchanged.

Verified: npm run build passes; eslint adds no new errors.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-24 02:17:44 -04:00
Juan DenisandClaude Opus 4.8 e24f834ada refactor(frontend): Phase 2 — remove Tailwind, standardize on the SCSS design system
Per docs/plans/FRONTEND_UX_TAILWIND_CLEANUP_PLAN.md Phase 2. Removes the Tailwind
CSS v4 dependency entirely; the internal SCSS design system is now the single
styling source (aligns with AGENTS.md / project policy).

Build wiring:
- Remove @tailwindcss/vite plugin from vite.config.js.
- Drop tailwindcss, @tailwindcss/vite, tailwind-merge, tailwindcss-animate from
  package.json (+ lockfile).
- Delete src/globals.css and its import in main.jsx. --radius was already
  redefined in _theme-variables.scss (loaded after globals), so nothing breaks;
  repointed the 3 var(--color-primary) refs in _wordpress-pipeline.scss to
  var(--accent-primary). Font stack now resolves to IBM Plex (SCSS) — the
  Inter/JetBrains globals.css vars were unused.
- lib/utils.js: cn() now uses clsx only (no tailwind-merge).

Primitives (components/ui/*) converted to SCSS-only classes (.ui-*):
- dropdown-menu.jsx, command.jsx → new .ui-dropdown-* / .ui-command-* classes.
- skeleton.jsx → .ui-skeleton; popover.jsx → .ui-popover-panel.
- dialog/alert-dialog/select/sheet → dropped the tailwindcss-animate veneer;
  enter/exit animation now handled by SCSS [data-state] keyframes in _ui.scss.
- alert-dialog AlertDialogAction gained a `variant` prop so non-danger confirms
  keep their primary (not destructive) button.
- Modal.jsx → .sk-modal*; ConfirmDialog.jsx → .sk-confirm* (icon containers,
  colors via theme tokens, layout) — the two heaviest raw-Tailwind components.

SCSS:
- _utilities.scss: extended the existing shim with a "Tailwind-removal
  compatibility" layer covering every remaining utility class still referenced
  in pages/components (positioning, sizing, spacing, semantic colors mapped to
  theme tokens, sr-only, the handful of sm:/lg:/hover: variants actually used).
- _ui.scss: .ui-dropdown-*, .ui-command-*, .ui-skeleton, .ui-popover-panel,
  .sk-modal*, .sk-confirm*, and [data-state] enter/exit animations.

Verified:
- npm run build passes; CSS shrank ~16kB (Tailwind utility layer gone).
- Completeness audit (scratchpad script): 0 un-styled Tailwind tokens remain
  (only SCSS-nested BEM false positives).
- Visual smoke test (screenshots skill, mock data): dashboard / docker / servers
  render correctly with full theming.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-24 02:08:03 -04:00
Juan DenisandClaude Opus 4.8 128a5333d7 refactor(frontend): Phase 1 foundation — styling policy, ScheduleCard hooks fix, shared utils
Per docs/plans/FRONTEND_UX_TAILWIND_CLEANUP_PLAN.md Phase 1:
- AGENTS.md: document the SCSS-only styling standard (forbid Tailwind/CSS-in-JS),
  canonical primitives/utilities, and the in-progress Tailwind removal.
- ScheduleCard.jsx: fix Rules-of-Hooks violation (early return before
  useState/useEffect/useMemo); hooks now run unconditionally before the loading
  branch. Clears the 10 ESLint errors.
- Add canonical shared utilities to replace scattered duplicates:
  utils/formatBytes.js, utils/time.js (timeAgo + formatRelativeTime),
  utils/clipboard.js + hooks/useClipboard.js. timeAgo.js now re-exports time.js.

Verified: npm run build passes; eslint reports 0 errors in touched files.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-24 01:46:29 -04:00
Juan Denis ed2c9c3426 Protect ServerKit containers from lifecycle actions
Block stopping/restarting/removing ServerKit's own Docker containers and surface that in the UI. Backend: add DockerService helpers (is_protected_name / is_protected_container), route guard (_reject_if_protected) to reject destructive actions, annotate list_containers with a protected flag, and update cleanup logic. Add tests (backend/tests/test_docker_protection.py). Frontend: hide/replace lifecycle controls for protected containers (lock badge + styles), add Organization tab group (ORG_TABS) and migrate Projects/Shared Variables/Workspaces into a TabGroupLayout with topbar action hooks; update related styles and sidebar item matching.
2026-06-24 01:43:29 -04:00
Juan DenisandClaude Opus 4.8 807ca7b05e feat: per-service targeting for the compose env overlay
A variable can now land on one compose service instead of all of them. Both
EnvironmentVariable and SharedVariable gain an optional target_service
(NULL = all services), threaded through the shared resolver as an inclusion
filter (a var applies to a service when it targets all OR that service).

EnvService.get_effective_env_for_services(app, services) computes each service's
merged env (all-services vars + that-service vars, local overriding shared), and
ComposeEnvService builds the override's per-service environment from it — so a
var targeted at "db" only appears under the db service, untargeted vars appear
everywhere. The single-container docker-run path is unchanged (one container
gets the full effective env regardless of target).

API: env-var create/update and shared-variable create/update accept
target_service; GET /apps/<id>/compose-services lists a compose app's services.
UI: the Environment tab shows an "Applies to" selector (gated to compose apps via
the service list) with a per-row target chip; the shared variable editor gains a
target-service field.

Migration 036 adds the two columns; single Alembic head; chain applies from
empty. Proving tests cover per-service distribution + the resolver helper. Full
backend suite: 949 passed, 14 skipped; frontend builds clean.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-23 23:19:41 -04:00
Juan DenisandClaude Opus 4.8 f015ecb7f8 feat: inject shared variables into the deploy env (under local precedence)
Shared variable groups were resolved/displayed but never reached the container.
EnvService.get_effective_env(app) now merges them in: shared groups
(workspace < project < environment < direct) form the base layer and the app's
own local env vars override them, so a key set in both yields the local value —
matching the "Set locally — local value applies" UI hint. Secrets are decrypted
for injection; shared resolution is best-effort and never blocks a deploy.

The docker deploy path (_deploy_docker) now injects this merged env via
run_container, which also fixes a latent bug there (it called .get('success')
on get_env_vars()'s list result, so env was effectively never applied). Updated
the shared-variables panel note to say shared vars now apply at deploy with
local taking precedence.

Proving test test_effective_env.py (6 cases) covers the merge precedence, the
best-effort fallback, and that _deploy_docker hands run_container the merged env.
Full backend suite: 941 passed, 14 skipped; frontend builds clean.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-23 21:33:53 -04:00
Juan DenisandClaude Opus 4.8 e2438db9d1 feat: UX hardening for the new organization/proxy/snapshot surfaces
Tightens the seams the recent features introduced:

- Secret precedence/conflict: the embedded shared-variables panel now resolves
  via the hierarchical endpoint, shows a per-variable source-scope badge +
  precedence legend, and flags keys that are also set locally with a
  "Set locally — local value applies" badge (shared groups are a facade and are
  not injected into the container; the app's own env var is authoritative).
- Split inventory: apps now expose project_name/environment_name; the Services
  list shows a project/environment badge (or "Unassigned") and a "Move to
  project" bulk action (POST /apps/move-to-project, workspace-validated,
  null-unassigns).
- Fleet proxy actionability: fleet_overview rows carry a {level,text}
  recommendation (mismatch warning / idle stack / empty host / aligned),
  rendered as a per-row pill.
- Onboarding wizard: "Step X of 5" + progress bar + rough ETA, and a
  collapsible step-history trail so returning users get a clean summary.
- Config diff: a plain-language summary ("3 environment variables and the image
  tag (app:1.2.1 -> app:1.1.9) changed") above the technical diff and echoed in
  the restore confirmation.
- Container status: an always-visible "N issues" / "healthy/total" badge so a
  degraded sub-container isn't hidden behind hover.
- Sidebar: Projects, Shared Variables and Workspaces collapse under a single
  "Organization" group.

No schema change (project/environment names are derived). Backend suite: 935
passed, 14 skipped; frontend builds clean.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-23 21:15:16 -04:00
Juan DenisandClaude Opus 4.8 0e71ab346a feat: make the ingress-plane boundary explicit (host Nginx vs proxy stack)
Both reverse proxies bind 80/443, so pointing the same domain at host Nginx and
a Dockerized proxy stack is an operational footgun. This tags each app with the
plane it expects and surfaces disagreements instead of leaving them implicit.

- Each app carries an `ingress_plane` ('nginx' | 'proxy_stack'); NULL reads as
  the host-Nginx default. New pure helpers in app/utils/ingress.py: only
  container-based services are proxy-stack eligible, and a requested proxy_stack
  is forced back to nginx for PHP/WordPress/static/Python apps. to_dict() also
  exposes `ingress_proxy_eligible`.
- ProxyStackService.ingress_audit(server) reports which of a server's apps
  disagree with its active proxy mode; fleet_overview now includes per-server
  app_count + mismatch_count. New GET /servers/<id>/proxy/ingress-audit.
- Create wizard offers the proxy stack only for Docker/Compose services and
  keeps the default on Nginx; app detail shows an Ingress badge; the fleet proxy
  dashboard flags mismatch counts; the server proxy panel warns and lists the
  specific mismatched apps with reasons.

Migration 035 adds applications.ingress_plane. Backend suite green (incl. 8 new
ingress tests); frontend builds clean.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-23 20:57:40 -04:00