ServerKit is a lightweight, modern server control panel for managing web applications, databases, and services on your VPS or dedicated server. Built with Python/Flask backend and React frontend.
Python astracloudflarecontrol-panelcyberpaneldnsfablehosting-control-panelhosting-panelkimi-k3server-managementserverkitubuntu-web-panelwebserver
feat(extensions): Phase 1 — seed marketplace (GPU + Workflow), module toggles
Juan Denis3e373511b78c
diff --git a/CHANGELOG.md b/CHANGELOG.mdindex f6923399..94267ed8 100644--- a/CHANGELOG.md+++ b/CHANGELOG.md@@ -20,6 +20,17 @@ awaiting a stable release:### Added+- **Extensions platform (Phase 1 — seed the marketplace)** — the Marketplace is+ now genuinely populated. **GPU Monitor** and **Workflow Builder** became bundled+ builtin extensions (`serverkit-gpu`, `serverkit-workflows`) — same route, but+ their nav/route/title/command-palette entries now come from the extension+ manifest. An upgraded panel auto-installs a converted builtin once so nothing+ disappears; fresh installs simply see it in the Marketplace. New **Module+ toggles** (Settings → Modules) let an admin hide the Email and WordPress+ verticals — nav, routes, and the module's API (`/api/v1/email`,+ `/api/v1/wordpress`) all switch off — for a smaller panel without uninstalling+ anything. The Marketplace gained a "by ServerKit" first-party badge, real+ category chips, and an extension detail view with icon + screenshots.- **Extensions platform (Phase 0 — hygiene)** — groundwork for the small-core +marketplace direction. A single **extension author guide**([`docs/EXTENSIONS.md`](docs/EXTENSIONS.md)) documents the manifest schema,diff --git a/backend/app/__init__.py b/backend/app/__init__.pyindex 0eb6d946..b66f9170 100644--- a/backend/app/__init__.py+++ b/backend/app/__init__.py@@ -147,6 +147,11 @@ def create_app(config_name=None):from app.api.wordpress_sites import wordpress_sites_bpfrom app.api.environment_pipeline import environment_pipeline_bpapp.register_blueprint(php_bp, url_prefix='/api/v1/php')+ # WordPress is a toggleable module (#14): 503 its API when disabled.+ from app.services.module_service import attach_module_guard+ attach_module_guard(wordpress_bp, 'wordpress')+ attach_module_guard(wordpress_sites_bp, 'wordpress')+ attach_module_guard(environment_pipeline_bp, 'wordpress')app.register_blueprint(wordpress_bp, url_prefix='/api/v1/wordpress')app.register_blueprint(wordpress_sites_bp, url_prefix='/api/v1/wordpress')app.register_blueprint(environment_pipeline_bp, url_prefix='/api/v1/wordpress/projects')@@ -262,6 +267,9 @@ def create_app(config_name=None):# Register blueprints - Email Serverfrom app.api.email import email_bp+ # Email is a toggleable module (#14): 503 its API when disabled.+ from app.services.module_service import attach_module_guard as _attach_module_guard_email+ _attach_module_guard_email(email_bp, 'email')app.register_blueprint(email_bp, url_prefix='/api/v1/email')# Register blueprints - Uptime Tracking@@ -411,6 +419,10 @@ def create_app(config_name=None):from app.api.plugins import plugins_bpapp.register_blueprint(plugins_bp, url_prefix='/api/v1/plugins')+ # Register blueprints - Modules (core-vertical toggles)+ from app.api.modules import modules_bp+ app.register_blueprint(modules_bp, url_prefix='/api/v1/modules')+# Register blueprints - Queue Busfrom app.api.queue_bus import queue_bus_bpapp.register_blueprint(queue_bus_bp, url_prefix='/api/v1/queue')@@ -498,6 +510,16 @@ def create_app(config_name=None):import logginglogging.getLogger(__name__).warning(f'Plugin loader: {e}')+ # One-shot: auto-install builtin extensions that used to be core pages+ # so an upgraded panel doesn't lose the feature (decision D3). Fresh+ # installs see them in the Marketplace instead. Best-effort.+ try:+ from app.services.extension_migration import run_auto_install+ run_auto_install()+ except Exception as e:+ import logging+ logging.getLogger(__name__).warning(f'Extension auto-install: {e}')+# Start metrics history collection in backgroundfrom app.services.metrics_history_service import MetricsHistoryServiceif not MetricsHistoryService.is_running():diff --git a/backend/app/api/modules.py b/backend/app/api/modules.pynew file mode 100644index 00000000..49e28611--- /dev/null+++ b/backend/app/api/modules.py@@ -0,0 +1,51 @@+"""Modules API — toggle heavy core verticals (Email, WordPress) on/off.++Read is available to any authenticated user (the frontend needs it to hide nav+and guard routes); flipping a toggle is admin-only.+"""+from flask import Blueprint, request, jsonify+from flask_jwt_extended import jwt_required++from app.services import module_service+from app.services.audit_service import AuditService+from app.models.audit_log import AuditLog++modules_bp = Blueprint('modules', __name__)+++def _current_user():+ from flask_jwt_extended import get_jwt_identity+ from app.models.user import User+ return User.query.get(get_jwt_identity())+++@modules_bp.route('', methods=['GET'])+@modules_bp.route('/', methods=['GET'])+@jwt_required()+def list_modules():+ return jsonify({'modules': module_service.list_modules()})+++@modules_bp.route('/<name>', methods=['PUT'])+@jwt_required()+def set_module(name):+ user = _current_user()+ if not user or not user.is_admin:+ return jsonify({'error': 'Admin access required'}), 403++ if name not in module_service.MODULES:+ return jsonify({'error': f'Unknown module: {name}'}), 404++ data = request.get_json() or {}+ if 'enabled' not in data:+ return jsonify({'error': 'enabled (boolean) required'}), 400++ enabled = module_service.set_module_enabled(name, bool(data['enabled']), user_id=user.id)+ AuditService.log(+ action=AuditLog.ACTION_RESOURCE_ENABLE if enabled else AuditLog.ACTION_RESOURCE_DISABLE,+ user_id=user.id,+ target_type='module',+ target_id=None,+ details={'module': name, 'enabled': enabled},+ )+ return jsonify({'name': name, 'enabled': enabled})diff --git a/backend/app/services/extension_migration.py b/backend/app/services/extension_migration.pynew file mode 100644index 00000000..c21d2ef8--- /dev/null+++ b/backend/app/services/extension_migration.py@@ -0,0 +1,106 @@+"""One-shot auto-install of converted builtin extensions (decision D3).++When a core page is converted into a builtin extension, an *upgraded* panel must+not lose the feature. On the first boot after such an upgrade we auto-install the+extension once, recording a per-slug marker so we never do it again — the user is+free to uninstall afterwards and it stays uninstalled.++Fresh installs are different: they never had the page as a core feature, so they+should discover the extension in the Marketplace rather than have it pre-installed+(flagships that ship installed-by-default per D4 are handled separately, not here).+We distinguish the two by whether any user exists yet — a brand-new panel has none+until the setup wizard creates the first admin.++The whole pass is best-effort: a failure to install (e.g. a Docker panel whose+frontend plugins dir isn't writable) is logged and retried on the next boot, and+never blocks startup. The builtin frontends are pre-bundled (D5) regardless, so+the marker only governs whether the contribution is switched on.+"""+import json+import logging++from app import db+from app.models.plugin import InstalledPlugin++logger = logging.getLogger(__name__)++# Builtin extensions that were previously shipped as core pages. Append a slug+# here when its page is converted; existing panels then auto-install it once.+CONVERTED_BUILTIN_SLUGS = [+ 'serverkit-gpu',+ 'serverkit-workflows',+]++_MARKER_KEY = 'extensions.auto_installed_slugs'+++def _processed_slugs():+ from app.services.settings_service import SettingsService+ raw = SettingsService.get(_MARKER_KEY, '')+ if not raw:+ return set()+ try:+ return set(json.loads(raw))+ except (ValueError, TypeError):+ # Tolerate a legacy comma-joined value.+ return {s.strip() for s in str(raw).split(',') if s.strip()}+++def _save_processed(slugs):+ from app.services.settings_service import SettingsService+ SettingsService.set(_MARKER_KEY, json.dumps(sorted(slugs)))+++def _looks_like_existing_install():+ """True if this panel has prior data (an upgrade), False if brand-new.++ A fresh install has no users yet — the setup wizard creates the first admin.+ """+ from app.models.user import User+ try:+ return db.session.query(User.id).first() is not None+ except Exception:+ return False+++def run_auto_install():+ """Install converted builtins once on an upgraded panel. Idempotent."""+ processed = _processed_slugs()+ existing = _looks_like_existing_install()++ try:+ from app.services.plugin_service import (+ install_builtin_extension,+ list_builtin_extensions,+ )+ available = {e['slug'] for e in list_builtin_extensions()}+ except Exception as e:+ logger.warning(f'Extension auto-install skipped (builtins unavailable): {e}')+ return++ changed = False+ for slug in CONVERTED_BUILTIN_SLUGS:+ if slug in processed:+ continue++ # Not yet shipped as a builtin folder — skip quietly, revisit next boot.+ if slug not in available:+ continue++ if existing:+ # Upgrade path: keep the feature alive unless it's already present.+ if not InstalledPlugin.query.filter_by(slug=slug).first():+ try:+ install_builtin_extension(slug)+ logger.info(f'Auto-installed converted builtin extension: {slug}')+ except Exception as e:+ logger.warning(+ f'Auto-install of {slug} failed (retry next boot): {e}'+ )+ continue # leave unmarked so we retry+ # Fresh install (marketplace-only) OR successfully installed: record it.+ processed.add(slug)+ changed = True++ if changed:+ _save_processed(processed)diff --git a/backend/app/services/module_service.py b/backend/app/services/module_service.pynew file mode 100644index 00000000..e8f8d695--- /dev/null+++ b/backend/app/services/module_service.py@@ -0,0 +1,96 @@+"""Core-module toggles.++Some heavy verticals (Email, WordPress) haven't been extracted into extensions+yet, but an operator who doesn't use them still wants a smaller panel. A module+toggle hides the vertical's nav + routes and 503s its API — the same "disabled"+mechanism the plugin status guard uses — without uninstalling anything. The+toggle state later becomes the auto-install signal when the vertical is actually+extracted (plan #34).++Flagships (WordPress) ship enabled; disabling is opt-in. Nothing here deletes+data — flipping the toggle back restores the module instantly.+"""+import logging++logger = logging.getLogger(__name__)++# name -> presentation metadata. The settings key is module_<name>_enabled.+MODULES = {+ 'email': {+ 'label': 'Email Server',+ 'description': 'Postfix/Dovecot mail stack, delivery logs, and the /api/v1/email API.',+ },+ 'wordpress': {+ 'label': 'WordPress',+ 'description': 'WordPress site management, plugin library, and the /api/v1/wordpress API.',+ },+}+++def _setting_key(name):+ return f'module_{name}_enabled'+++def is_module_enabled(name):+ """True unless an admin explicitly turned the module off. Fail open: any+ error reading settings leaves the module enabled (never silently hide a+ core feature because of a settings glitch)."""+ if name not in MODULES:+ return True+ try:+ from app.services.settings_service import SettingsService+ val = SettingsService.get(_setting_key(name), True)+ except Exception:+ return True+ if isinstance(val, bool):+ return val+ return str(val).strip().lower() not in ('0', 'false', 'no', 'off', '')+++def set_module_enabled(name, enabled, user_id=None):+ if name not in MODULES:+ raise ValueError(f'Unknown module: {name}')+ from app.services.settings_service import SettingsService+ SettingsService.set(_setting_key(name), bool(enabled), user_id=user_id)+ return is_module_enabled(name)+++def list_modules():+ return [+ {+ 'name': name,+ 'label': meta['label'],+ 'description': meta['description'],+ 'enabled': is_module_enabled(name),+ }+ for name, meta in MODULES.items()+ ]+++def attach_module_guard(bp, name):+ """Attach a before_request that 503s a blueprint when its module is off.++ Mirrors plugin_service._attach_status_guard so a disabled module's API+ behaves exactly like a disabled plugin's.++ Idempotent: core blueprints are module-level singletons reused across app+ instances (e.g. every test builds a fresh app), and Flask forbids calling+ the `before_request` setup method after a blueprint has been registered+ once. We attach the handler a single time — it lives on the blueprint and+ applies to every app it's registered on — and read the toggle fresh on each+ request, so re-creating the app never re-attaches.+ """+ if getattr(bp, '_module_guard_attached', False):+ return++ def _check():+ if not is_module_enabled(name):+ from flask import jsonify+ return jsonify({+ 'error': f"The {MODULES[name]['label']} module is disabled",+ 'module': name,+ }), 503+ return None++ bp.before_request(_check)+ bp._module_guard_attached = Truediff --git a/backend/app/services/settings_service.py b/backend/app/services/settings_service.pyindex 77f2c252..e4bd6b2a 100644--- a/backend/app/services/settings_service.py+++ b/backend/app/services/settings_service.py@@ -123,6 +123,12 @@ class SettingsService:'ai_pii_redaction': {'value': True, 'type': 'boolean', 'description': 'Redact PII from AI input and tool output'},'ai_injection_detection': {'value': True, 'type': 'boolean', 'description': 'Refuse prompts flagged as prompt-injection'},'ai_pending_action_ttl_s': {'value': 300, 'type': 'integer', 'description': 'Seconds a write-tool confirmation stays valid'},+ # Module toggles — hide heavy verticals that haven't been extracted into+ # extensions yet (Email, WordPress). Disabling hides the nav + routes and+ # 503s the module's API (same mechanism as the plugin status guard). The+ # toggle state later becomes the extraction auto-install signal (#34).+ 'module_email_enabled': {'value': True, 'type': 'boolean', 'description': 'Show the Email server module (nav, routes, and /api/v1/email).'},+ 'module_wordpress_enabled': {'value': True, 'type': 'boolean', 'description': 'Show the WordPress module (nav, routes, and /api/v1/wordpress).'},}# Settings that must never be returned through the API (only "is it set?").diff --git a/backend/tests/test_extension_migration.py b/backend/tests/test_extension_migration.pynew file mode 100644index 00000000..7ae4092c--- /dev/null+++ b/backend/tests/test_extension_migration.py@@ -0,0 +1,82 @@+"""Prove the one-shot auto-install of converted builtin extensions (D3).++An *upgraded* panel (has users) auto-installs a converted builtin once; a *fresh*+panel (no users yet) does not — it sees the extension in the Marketplace. Either+way the pass is idempotent and recorded so it never repeats.+"""+import json++import pytest+from werkzeug.security import generate_password_hash++from app import db+from app.models.plugin import InstalledPlugin+from app.models.user import User+from app.services import plugin_service, extension_migration+++def demo_builtin(tmp_path, monkeypatch):+ """Redirect plugin dirs to temp, ship one converted builtin ('serverkit-demo')."""+ backend = tmp_path / 'backend_plugins'+ frontend = tmp_path / 'frontend_plugins'+ builtin = tmp_path / 'builtin_extensions'+ for d in (backend, frontend, builtin):+ d.mkdir()+ monkeypatch.setattr(plugin_service, 'BACKEND_PLUGINS_DIR', str(backend))+ monkeypatch.setattr(plugin_service, 'FRONTEND_PLUGINS_DIR', str(frontend))+ monkeypatch.setattr(plugin_service, 'BUILTIN_EXTENSIONS_DIR', str(builtin))+ monkeypatch.setattr(extension_migration, 'CONVERTED_BUILTIN_SLUGS', ['serverkit-demo'])++ folder = builtin / 'serverkit-demo'+ (folder / 'frontend').mkdir(parents=True)+ manifest = {+ 'name': 'serverkit-demo', 'display_name': 'Demo', 'version': '1.0.0',+ 'category': 'utility',+ 'contributions': {'nav': [{'id': 'demo', 'label': 'Demo', 'route': '/demo'}]},+ }+ (folder / 'plugin.json').write_text(json.dumps(manifest), encoding='utf-8')+ (folder / 'frontend' / 'index.jsx').write_text('export function P(){return null;}\n')+ return builtin+++def _make_user():+ u = User(email='[email protected]', username='someuser',+ password_hash=generate_password_hash('x'),+ role=User.ROLE_ADMIN, is_active=True)+ db.session.add(u)+ db.session.commit()+++def test_upgrade_auto_installs_converted_builtin(app, demo_builtin):+ _make_user() # existing install+ extension_migration.run_auto_install()++ p = InstalledPlugin.query.filter_by(slug='serverkit-demo').first()+ assert p is not None+ assert p.status == InstalledPlugin.STATUS_ACTIVE++ # Marker recorded → second run is a no-op (no error, still one row).+ extension_migration.run_auto_install()+ assert InstalledPlugin.query.filter_by(slug='serverkit-demo').count() == 1+++def test_fresh_install_does_not_auto_install(app, demo_builtin):+ # No users → brand-new panel.+ extension_migration.run_auto_install()+ assert InstalledPlugin.query.filter_by(slug='serverkit-demo').first() is None+ # But it was marked processed, so a later boot (even once users exist) won't+ # retroactively install it.+ assert 'serverkit-demo' in extension_migration._processed_slugs()+++def test_user_uninstall_is_not_undone(app, demo_builtin):+ _make_user()+ extension_migration.run_auto_install()+ p = InstalledPlugin.query.filter_by(slug='serverkit-demo').first()+ plugin_service.uninstall_plugin(p.id)+ assert InstalledPlugin.query.filter_by(slug='serverkit-demo').first() is None++ # Re-running must NOT reinstall — the one-shot already happened.+ extension_migration.run_auto_install()+ assert InstalledPlugin.query.filter_by(slug='serverkit-demo').first() is Nonediff --git a/backend/tests/test_module_toggles.py b/backend/tests/test_module_toggles.pynew file mode 100644index 00000000..10988d60--- /dev/null+++ b/backend/tests/test_module_toggles.py@@ -0,0 +1,45 @@+"""Module toggles (#14): hide/503 heavy verticals (Email, WordPress) on demand."""+from app.services import module_service+++def test_modules_default_enabled(app, client, auth_headers):+ resp = client.get('/api/v1/modules', headers=auth_headers)+ assert resp.status_code == 200+ mods = {m['name']: m for m in resp.get_json()['modules']}+ assert mods['email']['enabled'] is True+ assert mods['wordpress']['enabled'] is True+++def test_toggle_requires_admin_body(app, client, auth_headers):+ resp = client.put('/api/v1/modules/email', headers=auth_headers, json={})+ assert resp.status_code == 400+++def test_unknown_module_404(app, client, auth_headers):+ resp = client.put('/api/v1/modules/nope', headers=auth_headers, json={'enabled': False})+ assert resp.status_code == 404+++def test_email_api_503s_when_module_disabled(app, client, auth_headers):+ # Enabled → the email status route is reachable (any 2xx/4xx that isn't 503).+ resp = client.get('/api/v1/email/status', headers=auth_headers)+ assert resp.status_code != 503++ # Disable via the API, then the same route is guarded with 503.+ toggle = client.put('/api/v1/modules/email', headers=auth_headers, json={'enabled': False})+ assert toggle.status_code == 200+ assert toggle.get_json()['enabled'] is False++ resp = client.get('/api/v1/email/status', headers=auth_headers)+ assert resp.status_code == 503+ assert resp.get_json()['module'] == 'email'++ # Re-enable restores it.+ client.put('/api/v1/modules/email', headers=auth_headers, json={'enabled': True})+ resp = client.get('/api/v1/email/status', headers=auth_headers)+ assert resp.status_code != 503+++def test_is_module_enabled_fails_open(app):+ # Unknown module name is treated as enabled (never hide a core feature).+ assert module_service.is_module_enabled('does-not-exist') is Truediff --git a/builtin-extensions/serverkit-gpu/frontend/index.jsx b/builtin-extensions/serverkit-gpu/frontend/index.jsxnew file mode 100644index 00000000..6c1499f7--- /dev/null+++ b/builtin-extensions/serverkit-gpu/frontend/index.jsx@@ -0,0 +1,11 @@+// GPU Monitor, contributed through the extension system. The page component and+// its /api/v1/gpu backend stay in core for now (two-speed extraction, D2); this+// extension owns the /gpu route + sidebar/palette entries via its manifest.+//+// After sync this file lives at frontend/src/plugins/serverkit-gpu/ so the+// relative import resolves against the host's pages directory.+import GpuMonitor from '../../pages/GpuMonitor';++export function GpuMonitorPage() {+ return <GpuMonitor />;+}diff --git a/builtin-extensions/serverkit-gpu/plugin.json b/builtin-extensions/serverkit-gpu/plugin.jsonnew file mode 100644index 00000000..4f13c3da--- /dev/null+++ b/builtin-extensions/serverkit-gpu/plugin.json@@ -0,0 +1,38 @@+{+ "name": "serverkit-gpu",+ "display_name": "GPU Monitor",+ "version": "1.0.0",+ "description": "Live NVIDIA GPU metrics — utilization, memory, temperature, power and fan — for servers with a GPU.",+ "author": "ServerKit",+ "license": "MIT",+ "category": "monitoring",+ "homepage": "https://github.com/jhd3197/ServerKit",+ "permissions": ["shell"],+ "icon": "<rect x=\"3\" y=\"6\" width=\"18\" height=\"12\" rx=\"2\"/><path d=\"M7 6v12\"/><circle cx=\"13\" cy=\"12\" r=\"2.5\"/><path d=\"M17 6v12\"/>",+ "contributions": {+ "nav": [+ {+ "id": "gpu",+ "label": "GPU Monitor",+ "route": "/gpu",+ "category": "system",+ "requiresCondition": "gpuAvailable",+ "icon": "<rect x=\"3\" y=\"6\" width=\"18\" height=\"12\" rx=\"2\"/><path d=\"M7 6v12\"/><circle cx=\"13\" cy=\"12\" r=\"2.5\"/><path d=\"M17 6v12\"/>"+ }+ ],+ "routes": [+ { "path": "gpu", "component": "GpuMonitorPage" }+ ],+ "page_titles": {+ "/gpu": "GPU Monitor"+ },+ "command_palette": [+ {+ "label": "GPU Monitor",+ "path": "/gpu",+ "category": "Pages",+ "keywords": "nvidia cuda metrics gpu"+ }+ ]+ }+}diff --git a/builtin-extensions/serverkit-workflows/frontend/index.jsx b/builtin-extensions/serverkit-workflows/frontend/index.jsxnew file mode 100644index 00000000..375441be--- /dev/null+++ b/builtin-extensions/serverkit-workflows/frontend/index.jsx@@ -0,0 +1,12 @@+// Workflow Builder, contributed through the extension system. The page component+// and its /api/v1/workflows backend stay in core for now (two-speed extraction,+// D2); this extension owns the /workflow route + sidebar/palette entries via its+// manifest. The route uses the "full" layout (no padding) to match the canvas.+//+// After sync this file lives at frontend/src/plugins/serverkit-workflows/ so the+// relative import resolves against the host's pages directory.+import WorkflowBuilder from '../../pages/WorkflowBuilder';++export function WorkflowBuilderPage() {+ return <WorkflowBuilder />;+}diff --git a/builtin-extensions/serverkit-workflows/plugin.json b/builtin-extensions/serverkit-workflows/plugin.jsonnew file mode 100644index 00000000..29ebeeac--- /dev/null+++ b/builtin-extensions/serverkit-workflows/plugin.json@@ -0,0 +1,37 @@+{+ "name": "serverkit-workflows",+ "display_name": "Workflow Builder",+ "version": "1.0.0",+ "description": "Visual automation builder — chain deploy, build, and notification steps into pipelines on a drag-and-drop canvas.",+ "author": "ServerKit",+ "license": "MIT",+ "category": "deployment",+ "homepage": "https://github.com/jhd3197/ServerKit",+ "permissions": ["docker", "shell"],+ "icon": "<circle cx=\"18\" cy=\"5\" r=\"3\"/><circle cx=\"6\" cy=\"12\" r=\"3\"/><circle cx=\"18\" cy=\"19\" r=\"3\"/><path d=\"M8.59 13.51l6.83 3.98\"/><path d=\"M15.41 6.51l-6.82 3.98\"/>",+ "contributions": {+ "nav": [+ {+ "id": "workflow",+ "label": "Workflow Builder",+ "route": "/workflow",+ "category": "infrastructure",+ "icon": "<circle cx=\"18\" cy=\"5\" r=\"3\"/><circle cx=\"6\" cy=\"12\" r=\"3\"/><circle cx=\"18\" cy=\"19\" r=\"3\"/><path d=\"M8.59 13.51l6.83 3.98\"/><path d=\"M15.41 6.51l-6.82 3.98\"/>"+ }+ ],+ "routes": [+ { "path": "workflow", "component": "WorkflowBuilderPage", "layout": "full" }+ ],+ "page_titles": {+ "/workflow": "Workflow Builder"+ },+ "command_palette": [+ {+ "label": "Workflow Builder",+ "path": "/workflow",+ "category": "Pages",+ "keywords": "automation pipeline workflow"+ }+ ]+ }+}diff --git a/frontend/src/App.jsx b/frontend/src/App.jsxindex a4a4eafd..f41569f2 100644--- a/frontend/src/App.jsx+++ b/frontend/src/App.jsx@@ -29,7 +29,6 @@ import Services from './pages/Services';import NewService from './pages/NewService';import ServiceDetail from './pages/ServiceDetail';import Templates from './pages/Templates';-import WorkflowBuilder from './pages/WorkflowBuilder';import Servers from './pages/Servers';import ServerDetail from './pages/ServerDetail';import AgentFleet from './pages/AgentFleet';@@ -75,7 +74,6 @@ import StyleGuide from './pages/StyleGuide';import AppMap from './pages/AppMap';import Documentation from './pages/Documentation';import Deployments from './pages/Deployments';-import GpuMonitor from './pages/GpuMonitor';import QueueOperations from './pages/QueueOperations';import QueueDetail from './pages/QueueDetail';import Notifications from './pages/Notifications';@@ -84,6 +82,7 @@ import Telemetry from './pages/Telemetry';import Jobs from './pages/Jobs';import useExtensionRoutes from './plugins/ExtensionRoutes';import { useContributions } from './plugins/contributions';+import ModuleRoute from './components/ModuleRoute';// Page title mappingconst PAGE_TITLES = {@@ -101,7 +100,6 @@ const PAGE_TITLES = {'/wordpress/pipelines': 'WordPress Pipelines','/templates': 'Templates','/deployments': 'Deployment Activity',- '/workflow': 'Workflow Builder','/domains': 'Domains','/databases': 'Databases','/ssl': 'SSL Certificates',@@ -143,7 +141,6 @@ const PAGE_TITLES = {'/style-guide': 'Style Guide','/app-map': 'App Map','/documentation': 'Documentation',- '/gpu': 'GPU Monitor','/dynamic-dns': 'Dynamic DNS','/queue': 'Queue Bus','/notifications': 'Notifications',@@ -341,23 +338,26 @@ function AppRoutes() {<Route path="apps" element={<Navigate to="/services" replace />} /><Route path="apps/:id" element={<LegacyAppRedirect />} /><Route path="apps/:id/:tab" element={<LegacyAppRedirect />} />+ {/* WordPress routes are gated by the WordPress module toggle+ (Settings → Modules); disabled ⇒ redirect to the dashboard. */}<Route element={<TabGroupLayout tabs={WORDPRESS_TABS} />}>- <Route path="wordpress" element={<WordPress />} />- <Route path="wordpress/plugins/library" element={<WordPressPluginLibrary />} />- <Route path="wordpress/pipelines" element={<WordPressProjects />} />+ <Route path="wordpress" element={<ModuleRoute name="wordpress"><WordPress /></ModuleRoute>} />+ <Route path="wordpress/plugins/library" element={<ModuleRoute name="wordpress"><WordPressPluginLibrary /></ModuleRoute>} />+ <Route path="wordpress/pipelines" element={<ModuleRoute name="wordpress"><WordPressProjects /></ModuleRoute>} /></Route>- <Route path="wordpress/pipelines/:id" element={<WordPressProject />} />- <Route path="wordpress/pipelines/:id/:tab" element={<WordPressProject />} />+ <Route path="wordpress/pipelines/:id" element={<ModuleRoute name="wordpress"><WordPressProject /></ModuleRoute>} />+ <Route path="wordpress/pipelines/:id/:tab" element={<ModuleRoute name="wordpress"><WordPressProject /></ModuleRoute>} />{/* Legacy "WordPress Projects" URLs → Pipelines (§2). */}<Route path="wordpress/projects" element={<Navigate to="/wordpress/pipelines" replace />} /><Route path="wordpress/projects/:id" element={<LegacyWpPipelineRedirect />} /><Route path="wordpress/projects/:id/:tab" element={<LegacyWpPipelineRedirect />} />- <Route path="wordpress/:id" element={<WordPressDetail />} />- <Route path="wordpress/:id/:tab" element={<WordPressDetail />} />+ <Route path="wordpress/:id" element={<ModuleRoute name="wordpress"><WordPressDetail /></ModuleRoute>} />+ <Route path="wordpress/:id/:tab" element={<ModuleRoute name="wordpress"><WordPressDetail /></ModuleRoute>} />{/* Settings sub-section in the URL (e.g. .../settings/git) so theSettings left-nav is shareable and survives a refresh. */}- <Route path="wordpress/:id/:tab/:section" element={<WordPressDetail />} />- <Route path="workflow" element={<WorkflowBuilder />} />+ <Route path="wordpress/:id/:tab/:section" element={<ModuleRoute name="wordpress"><WordPressDetail /></ModuleRoute>} />+ {/* /workflow is now the serverkit-workflows builtin extension+ (contributes the route via its manifest, full layout). */}<Route element={<TabGroupLayout tabs={DOMAIN_TABS} />}><Route path="domains" element={<Domains />} /><Route path="ssl" element={<SSLCertificates />} />@@ -426,7 +426,7 @@ function AppRoutes() {<Route path="status-pages" element={<StatusPages />} /></Route><Route path="observability" element={<Navigate to="/monitoring" replace />} />- <Route path="gpu" element={<GpuMonitor />} />+ {/* /gpu is now the serverkit-gpu builtin extension. */}<Route element={<TabGroupLayout tabs={BACKUP_TABS} />}><Route path="backups" element={<Backups />} /><Route path="backups/:tab" element={<Backups />} />@@ -436,8 +436,10 @@ function AppRoutes() {<Route path="security" element={<Security />} /><Route path="security/:tab" element={<Security />} /></Route>- <Route path="email" element={<Email />} />- <Route path="email/:tab" element={<Email />} />+ {/* Email routes are gated by the Email module toggle+ (Settings → Modules); disabled ⇒ redirect to the dashboard. */}+ <Route path="email" element={<ModuleRoute name="email"><Email /></ModuleRoute>} />+ <Route path="email/:tab" element={<ModuleRoute name="email"><Email /></ModuleRoute>} /><Route path="terminal" element={<Terminal />} /><Route path="terminal/terminal" element={<Navigate to="/terminal/shell" replace />} /><Route path="terminal/:tab" element={<Terminal />} />diff --git a/frontend/src/components/CommandPalette.jsx b/frontend/src/components/CommandPalette.jsxindex 56c4bf2e..2a27c1cb 100644--- a/frontend/src/components/CommandPalette.jsx+++ b/frontend/src/components/CommandPalette.jsx@@ -19,7 +19,6 @@ const STATIC_PAGES = [{ label: 'SSL Certificates', path: '/ssl', category: 'Pages', keywords: 'https tls' },{ label: 'Templates', path: '/templates', category: 'Pages', keywords: 'deploy one-click' },{ label: 'Deployments', path: '/deployments', category: 'Pages', keywords: 'deploy jobs status logs' },- { label: 'Workflow Builder', path: '/workflow', category: 'Pages', keywords: 'automation pipeline' },{ label: 'WordPress', path: '/wordpress', category: 'Pages', keywords: 'wp sites' },{ label: 'WordPress Pipelines', path: '/wordpress/pipelines', category: 'Pages', keywords: 'wp environments projects pipeline' },{ label: 'Files', path: '/files', category: 'Pages', keywords: 'file manager explorer' },@@ -39,7 +38,8 @@ const STATIC_PAGES = [{ label: 'Projects', path: '/projects', category: 'Pages', keywords: 'organization group' },{ label: 'Shared Variables', path: '/shared-variables', category: 'Pages', keywords: 'env secrets shared' },{ label: 'Workspaces', path: '/workspaces', category: 'Pages', keywords: 'organization team' },- { label: 'GPU Monitor', path: '/gpu', category: 'Pages', keywords: 'nvidia cuda metrics' },+ // GPU Monitor + Workflow Builder command-palette entries are contributed by+ // the serverkit-gpu / serverkit-workflows builtin extensions.{ label: 'Queue', path: '/queue', category: 'Pages', keywords: 'bus operations tasks' },{ label: 'Jobs', path: '/jobs', category: 'Pages', keywords: 'scheduler background work' },{ label: 'Events', path: '/telemetry', category: 'Pages', keywords: 'telemetry metrics observability system events' },diff --git a/frontend/src/components/ModuleRoute.jsx b/frontend/src/components/ModuleRoute.jsxnew file mode 100644index 00000000..9aec4d5b--- /dev/null+++ b/frontend/src/components/ModuleRoute.jsx@@ -0,0 +1,19 @@+import { Navigate } from 'react-router-dom';+import useModules from '../hooks/useModules';++// Route guard for the optional feature modules (Email, WordPress). When the+// named module has been disabled by an admin, its routes redirect to the+// dashboard instead of rendering a dead page. While module state is still+// loading it is treated as enabled, so a valid deep link never flashes a+// redirect before state arrives.+const ModuleRoute = ({ name, children }) => {+ const { isEnabled } = useModules();++ if (!isEnabled(name)) {+ return <Navigate to="/" replace />;+ }++ return children;+};++export default ModuleRoute;diff --git a/frontend/src/components/Sidebar.jsx b/frontend/src/components/Sidebar.jsxindex eae9fdf9..1d30970a 100644--- a/frontend/src/components/Sidebar.jsx+++ b/frontend/src/components/Sidebar.jsx@@ -10,6 +10,7 @@ import NotificationBell from './NotificationBell';import { SIDEBAR_CATEGORIES, CATEGORY_LABELS, SIDEBAR_PRESETS, getHiddenItemIds, getVisibleItems, applyWorkspaceNavPermissions } from './sidebarItems';import { useContributions } from '../plugins/contributions';import { sanitizeSvgInner } from '../utils/sanitizeSvg';+import useModules from '../hooks/useModules';const Sidebar = ({ mobileOpen = false, isMobile = false, onMobileClose = () => {} }) => {const { user, logout, updateUser } = useAuth();@@ -111,7 +112,13 @@ const Sidebar = ({ mobileOpen = false, isMobile = false, onMobileClose = () => {.catch(() => setGpuAvailable(false));}, []);- const conditions = { wpInstalled, gpuAvailable };+ // Feature-module toggles (Email + WordPress). Default to enabled until the+ // shared module state loads so items never flicker/hide prematurely.+ const { isEnabled: isModuleEnabled } = useModules();+ const emailEnabled = isModuleEnabled('email');+ const wordpressEnabled = isModuleEnabled('wordpress');++ const conditions = { wpInstalled, gpuAvailable, emailEnabled, wordpressEnabled };const currentPreset = user?.sidebar_config?.preset || 'recommended';const [manualExpanded, setManualExpanded] = useState({});const [autoExpanded, setAutoExpanded] = useState(null);@@ -150,8 +157,9 @@ const Sidebar = ({ mobileOpen = false, isMobile = false, onMobileClose = () => {category: item.category || 'system',}));// Top-level items can gate on a runtime condition (e.g. GPU Monitor- // only when a GPU is present), mirroring sub-item requiresCondition.- const conds = { wpInstalled, gpuAvailable };+ // only when a GPU is present, or the Email/WordPress modules being+ // enabled), mirroring sub-item requiresCondition.+ const conds = { wpInstalled, gpuAvailable, emailEnabled, wordpressEnabled };const items = [...core, ...fromPlugins].filter((item) => !item.requiresCondition || conds[item.requiresCondition]);@@ -168,7 +176,7 @@ const Sidebar = ({ mobileOpen = false, isMobile = false, onMobileClose = () => {}}return applyWorkspaceNavPermissions(items, activeWorkspace, user);- }, [user?.sidebar_config, pluginNav, wpInstalled, gpuAvailable, user]);+ }, [user?.sidebar_config, pluginNav, wpInstalled, gpuAvailable, emailEnabled, wordpressEnabled, user]);// Group visible items by categoryconst groupedItems = useMemo(() => {diff --git a/frontend/src/components/settings/ModulesTab.jsx b/frontend/src/components/settings/ModulesTab.jsxnew file mode 100644index 00000000..dc51e1d4--- /dev/null+++ b/frontend/src/components/settings/ModulesTab.jsx@@ -0,0 +1,76 @@+import { useState } from 'react';+import { Layers, CheckCircle, XCircle } from 'lucide-react';+import { useAuth } from '../../contexts/AuthContext';+import useModules from '../../hooks/useModules';+import api from '../../services/api';+import { Label } from '@/components/ui/label';+import { Switch } from '@/components/ui/switch';+import EmptyState from '../EmptyState';++// Admin-only card to enable/disable the optional feature verticals (Email,+// WordPress). Toggling writes through the /modules API and then refreshes the+// shared module state so the sidebar + route guards update immediately.+const ModulesTab = () => {+ const { isAdmin } = useAuth();+ const { modules, refresh } = useModules();+ const [saving, setSaving] = useState({});+ const [message, setMessage] = useState(null);++ async function handleToggle(name, enabled) {+ setSaving((prev) => ({ ...prev, [name]: true }));+ setMessage(null);+ try {+ await api.setModule(name, enabled);+ // Re-fetch shared state so the sidebar / guards reflect the change.+ await refresh();+ setMessage({ type: 'success', text: `Module ${enabled ? 'enabled' : 'disabled'}` });+ } catch (err) {+ setMessage({ type: 'error', text: err.message || 'Failed to update module' });+ } finally {+ setSaving((prev) => ({ ...prev, [name]: false }));+ setTimeout(() => setMessage(null), 5000);+ }+ }++ return (+ <div className="settings-section">+ <div className="section-header">+ <h2><Layers size={20} /> Modules</h2>+ <p>Enable or disable optional feature areas. Disabled modules are hidden from the sidebar and their pages become unreachable.</p>+ </div>++ {message && (+ <div className={`alert alert--${message.type}`}>+ {message.type === 'success' ? <CheckCircle size={16} /> : <XCircle size={16} />}+ {message.text}+ </div>+ )}++ {!modules ? (+ <EmptyState loading title="Loading modules..." />+ ) : (+ <div className="settings-card">+ {modules.map((mod) => (+ <div className="settings-row" key={mod.name}>+ <div className="settings-label">+ <Label>{mod.label || mod.name}</Label>+ {mod.description && (+ <span className="settings-hint">{mod.description}</span>+ )}+ </div>+ <div className="settings-control">+ <Switch+ checked={!!mod.enabled}+ onCheckedChange={(checked) => handleToggle(mod.name, checked)}+ disabled={!isAdmin || !!saving[mod.name]}+ />+ </div>+ </div>+ ))}+ </div>+ )}+ </div>+ );+};++export default ModulesTab;diff --git a/frontend/src/components/sidebarItems.js b/frontend/src/components/sidebarItems.jsindex 6c2a0280..f5582b28 100644--- a/frontend/src/components/sidebarItems.js+++ b/frontend/src/components/sidebarItems.js@@ -95,15 +95,12 @@ export const SIDEBAR_ITEMS = [label: 'WordPress',route: '/wordpress',category: 'infrastructure',+ // Hidden when an admin disables the WordPress module (Settings → Modules).+ requiresCondition: 'wordpressEnabled',icon: '<circle cx="12" cy="12" r="10"/><path d="M12 2a15.3 15.3 0 0 1 4 10 15.3 15.3 0 0 1-4 10 15.3 15.3 0 0 1-4-10 15.3 15.3 0 0 1 4-10z"/><path d="M3.5 9h17M3.5 15h17"/>'},- {- id: 'workflow',- label: 'Workflow Builder',- route: '/workflow',- category: 'infrastructure',- icon: '<circle cx="18" cy="5" r="3"/><circle cx="6" cy="12" r="3"/><circle cx="18" cy="19" r="3"/><path d="M8.59 13.51l6.83 3.98"/><path d="M15.41 6.51l-6.82 3.98"/>'- },+ // Workflow Builder is now the serverkit-workflows builtin extension; its+ // sidebar item is contributed by the extension manifest.{id: 'databases',label: 'Databases',@@ -173,6 +170,8 @@ export const SIDEBAR_ITEMS = [label: 'Email Server',route: '/email',category: 'operations',+ // Hidden when an admin disables the Email module (Settings → Modules).+ requiresCondition: 'emailEnabled',icon: '<path d="M4 4h16c1.1 0 2 .9 2 2v12c0 1.1-.9 2-2 2H4c-1.1 0-2-.9-2-2V6c0-1.1.9-2 2-2z"/><polyline points="22,6 12,13 2,6"/>'},{@@ -196,16 +195,9 @@ export const SIDEBAR_ITEMS = [category: 'system',icon: '<path d="m12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83Z"/><path d="m22 17.65-9.17 4.16a2 2 0 0 1-1.66 0L2 17.65"/><path d="m22 12.65-9.17 4.16a2 2 0 0 1-1.66 0L2 12.65"/>'},- {- id: 'gpu',- label: 'GPU Monitor',- route: '/gpu',- // Hidden unless the panel host reports a GPU (Sidebar sets gpuAvailable- // from api.getGpuInfo) — no point showing an empty monitor.- requiresCondition: 'gpuAvailable',- category: 'system',- icon: '<rect x="3" y="6" width="18" height="12" rx="2"/><path d="M7 6v12"/><circle cx="13" cy="12" r="2.5"/><path d="M17 6v12"/>'- },+ // GPU Monitor is now the serverkit-gpu builtin extension; its sidebar item+ // (still gated on gpuAvailable via requiresCondition) is contributed by the+ // extension manifest.{// Inbound webhook console. Secret storage ("Vaults") that used to share// this page now lives under the Organization tab group (/vaults); onlydiff --git a/frontend/src/hooks/useModules.js b/frontend/src/hooks/useModules.jsnew file mode 100644index 00000000..17cb7bc7--- /dev/null+++ b/frontend/src/hooks/useModules.js@@ -0,0 +1,60 @@+import { useState, useEffect, useCallback } from 'react';+import api from '../services/api';++// Shared, app-wide state for the optional feature modules (Email + WordPress).+// The module list is fetched once and cached at module scope so the sidebar,+// route guards, and the Settings "Modules" card all read the same source and+// stay in sync. Toggling a module (Settings) calls refresh(), which re-fetches+// and notifies every mounted consumer so the sidebar updates immediately.++let cache = null; // last-fetched array of module objects+let inflight = null; // de-dupes concurrent initial fetches+const listeners = new Set();++function notify() {+ for (const listener of listeners) listener(cache);+}++async function fetchModules(force = false) {+ if (cache && !force) return cache;+ if (inflight && !force) return inflight;+ inflight = api.getModules()+ .then((data) => {+ cache = data?.modules || [];+ notify();+ return cache;+ })+ .catch(() => {+ // Keep the last-known state (or empty) on a transient error.+ cache = cache || [];+ return cache;+ })+ .finally(() => { inflight = null; });+ return inflight;+}++export function useModules() {+ const [modules, setModules] = useState(cache);++ useEffect(() => {+ const listener = (m) => setModules(m);+ listeners.add(listener);+ fetchModules();+ return () => { listeners.delete(listener); };+ }, []);++ // Re-fetch and broadcast to all consumers (call after a toggle).+ const refresh = useCallback(() => fetchModules(true), []);++ // Whether a named module is enabled. Unknown / still-loading state is+ // treated as enabled so nothing flickers or hides before state loads.+ const isEnabled = useCallback((name) => {+ if (!modules) return true;+ const mod = modules.find((m) => m.name === name);+ return mod ? !!mod.enabled : true;+ }, [modules]);++ return { modules, isEnabled, refresh };+}++export default useModules;diff --git a/frontend/src/layouts/DashboardLayout.jsx b/frontend/src/layouts/DashboardLayout.jsxindex da20fe6a..1bcde535 100644--- a/frontend/src/layouts/DashboardLayout.jsx+++ b/frontend/src/layouts/DashboardLayout.jsx@@ -15,7 +15,9 @@ import { useLockBodyScroll } from '../hooks/useLockBodyScroll';import api from '../services/api';import SystemNotices from '../components/SystemNotices';-const FULL_PAGE_ROUTES = ['/workflow', '/files', '/docker'];+// /workflow is contributed by the serverkit-workflows extension with+// layout:'full', so it's picked up dynamically via fullPagePaths below.+const FULL_PAGE_ROUTES = ['/files', '/docker'];const DashboardLayout = () => {const location = useLocation();diff --git a/frontend/src/pages/Marketplace.jsx b/frontend/src/pages/Marketplace.jsxindex 50200ba2..f6f5779f 100644--- a/frontend/src/pages/Marketplace.jsx+++ b/frontend/src/pages/Marketplace.jsx@@ -22,6 +22,8 @@ import {} from 'lucide-react';import api from '../services/api';import { useToast } from '../contexts/ToastContext';+import { sanitizeSvgInner } from '../utils/sanitizeSvg';+import Modal from '@/components/Modal';import PageLoader from '../components/PageLoader';import EmptyState from '../components/EmptyState';import { StatStrip, Stat } from '../components/StatCard';@@ -64,6 +66,22 @@ const titleCase = (value = '') => {const getCategoryIcon = (category) => CATEGORY_ICONS[category] || Package;+// A first-party ("by ServerKit") entry is one authored by ServerKit or one whose+// manifest explicitly opts in via `first_party`. Case-insensitive on author.+const isFirstParty = (author, source = {}) => {+ if (source && source.first_party) return true;+ return String(author || '').trim().toLowerCase() === 'serverkit';+};++// Union of categories actually present across the merged catalog, ordered by the+// canonical CATEGORIES list first, then any extras alphabetically (stable, deduped).+const deriveCatalogCategories = (entries) => {+ const present = new Set(entries.map((entry) => entry.category || 'utility'));+ const known = CATEGORIES.filter((item) => present.has(item));+ const extra = [...present].filter((item) => !CATEGORIES.includes(item)).sort();+ return [...known, ...extra];+};+const getPublishedCatalogEntry = (extension, installed) => ({key: `published:${extension.id}`,source: 'published',@@ -75,6 +93,9 @@ const getPublishedCatalogEntry = (extension, installed) => ({category: extension.category || 'utility',version: extension.version || '0.0.0',author: extension.author,+ firstParty: isFirstParty(extension.author, extension),+ icon: extension.icon || null,+ screenshots: Array.isArray(extension.screenshots) ? extension.screenshots : [],extensionType: extension.extension_type,installed,rating: extension.rating,@@ -105,6 +126,9 @@ const getLocalCatalogEntry = (builtin) => {category: manifest.category || 'utility',version: manifest.version || '0.0.0',author: manifest.author,+ firstParty: isFirstParty(manifest.author, manifest),+ icon: manifest.icon || null,+ screenshots: Array.isArray(manifest.screenshots) ? manifest.screenshots : [],extensionType: 'built-in',installed: Boolean(builtin.installed),status: builtin.status,@@ -141,6 +165,7 @@ const Marketplace = () => {const [pluginFile, setPluginFile] = useState(null);const [installSource, setInstallSource] = useState('url');const [installing, setInstalling] = useState(false);+ const [detailEntry, setDetailEntry] = useState(null);const loadExtensions = useCallback(async () => {try {@@ -192,6 +217,14 @@ const Marketplace = () => {}};+ const installEntry = (entry) => {+ if (entry.source === 'local') {+ handleBuiltinInstall(entry.installKey);+ } else {+ handleInstall(entry.installKey);+ }+ };+const handlePluginInstall = async () => {let action;if (installSource === 'url') {@@ -286,7 +319,9 @@ const Marketplace = () => {const totalDownloads = extensions.reduce((total, extension) => total + (Number(extension.download_count) || 0), 0);const availableCount = extensions.length + builtins.length;const installedCatalogCount = installedCatalogEntries.length;- const catalogEntries = [...localCatalogEntries, ...publishedCatalogEntries]+ const mergedCatalogEntries = [...localCatalogEntries, ...publishedCatalogEntries];+ const catalogCategories = deriveCatalogCategories(mergedCatalogEntries);+ const catalogEntries = mergedCatalogEntries.filter((entry) => catalogEntryMatches(entry, search, category));const hasFilters = Boolean(search.trim() || category);@@ -337,7 +372,7 @@ const Marketplace = () => {aria-label="Filter by category"><option value="">All Categories</option>- {CATEGORIES.map((item) => (+ {catalogCategories.map((item) => (<option key={item} value={item}>{titleCase(item)}</option>))}</select>@@ -357,7 +392,7 @@ const Marketplace = () => {>All</button>- {CATEGORIES.map((item) => (+ {catalogCategories.map((item) => (<buttonkey={item}type="button"@@ -390,6 +425,7 @@ const Marketplace = () => {? handleBuiltinInstall: handleInstall}+ onOpenDetail={setDetailEntry}statusVariant={pluginStatusVariant}/>))}@@ -418,7 +454,7 @@ const Marketplace = () => {>All</button>- {CATEGORIES.map((item) => {+ {catalogCategories.map((item) => {const Icon = getCategoryIcon(item);return (<button@@ -606,6 +642,18 @@ const Marketplace = () => {</TabsContent></Tabs>+ {detailEntry && (+ <ExtensionDetailModal+ entry={detailEntry}+ installing={installing}+ statusVariant={pluginStatusVariant}+ onClose={() => setDetailEntry(null)}+ onInstall={() => {+ installEntry(detailEntry);+ setDetailEntry(null);+ }}+ />+ )}</div>);};@@ -620,7 +668,7 @@ const SectionHeader = ({ kicker, title, meta }) => (</div>);-const CatalogExtensionCard = ({ entry, installing, onInstall, statusVariant }) => {+const CatalogExtensionCard = ({ entry, installing, onInstall, onOpenDetail, statusVariant }) => {const category = entry.category || 'utility';const Icon = getCategoryIcon(category);const isLocal = entry.source === 'local';@@ -628,13 +676,30 @@ const CatalogExtensionCard = ({ entry, installing, onInstall, statusVariant }) =? titleCase(entry.status): 'Installed';+ const openDetail = () => onOpenDetail(entry);+ const handleKeyDown = (event) => {+ if (event.key === 'Enter' || event.key === ' ') {+ event.preventDefault();+ openDetail();+ }+ };+return (- <article className={`extension-card extension-card--${entry.source} extension-card--${category} card`}>+ <article+ className={`extension-card extension-card--${entry.source} extension-card--${category} extension-card--clickable card`}+ role="button"+ tabIndex={0}+ onClick={openDetail}+ onKeyDown={handleKeyDown}+ ><div className="extension-card__topline"><div className={`extension-card__icon extension-card__icon--${category}`}><Icon aria-hidden="true" /></div><div className="extension-card__badges">+ {entry.firstParty && (+ <Badge variant="secondary" className="extension-firstparty">by ServerKit</Badge>+ )}<Badge variant={isLocal ? 'warning' : 'outline'}>{entry.sourceLabel}</Badge><Badge variant="outline">{titleCase(category)}</Badge></div>@@ -681,7 +746,10 @@ const CatalogExtensionCard = ({ entry, installing, onInstall, statusVariant }) =<Buttonsize="sm"disabled={isLocal && installing}- onClick={() => onInstall(entry.installKey)}+ onClick={(event) => {+ event.stopPropagation();+ onInstall(entry.installKey);+ }}><DownloadCloud aria-hidden="true" />{isLocal && installing ? 'Installing...' : 'Install'}@@ -693,6 +761,84 @@ const CatalogExtensionCard = ({ entry, installing, onInstall, statusVariant }) =);};+const ExtensionDetailModal = ({ entry, installing, statusVariant, onClose, onInstall }) => {+ const category = entry.category || 'utility';+ const Icon = getCategoryIcon(category);+ const isLocal = entry.source === 'local';+ const iconSvg = entry.icon ? sanitizeSvgInner(entry.icon) : '';+ const screenshots = entry.screenshots || [];+ const installedLabel = isLocal && entry.status && entry.status !== 'active'+ ? titleCase(entry.status)+ : 'Installed';++ return (+ <Modal open onClose={onClose} title={entry.displayName} size="lg">+ <div className="extension-detail">+ <div className="extension-detail__header">+ <div className={`extension-detail__icon extension-detail__icon--${category}`}>+ {iconSvg ? (+ <svg+ viewBox="0 0 24 24"+ fill="none"+ stroke="currentColor"+ aria-hidden="true"+ focusable="false"+ dangerouslySetInnerHTML={{ __html: iconSvg }}+ />+ ) : (+ <Icon aria-hidden="true" />+ )}+ </div>+ <div className="extension-detail__heading">+ <div className="extension-detail__badges">+ {entry.firstParty && (+ <Badge variant="secondary" className="extension-firstparty">by ServerKit</Badge>+ )}+ <Badge variant={isLocal ? 'warning' : 'outline'}>{entry.sourceLabel}</Badge>+ <Badge variant="outline">{titleCase(category)}</Badge>+ </div>+ <div className="extension-detail__meta">+ <span>v{entry.version}</span>+ {entry.author && <span>by {entry.author}</span>}+ <span>{isLocal ? 'built-in' : entry.extensionType}</span>+ </div>+ </div>+ </div>++ <p className="extension-detail__desc">{entry.description}</p>++ {screenshots.length > 0 && (+ <div className="extension-detail__gallery" aria-label="Screenshots">+ {screenshots.map((src, index) => (+ <img+ key={src}+ src={src}+ alt={`${entry.displayName} screenshot ${index + 1}`}+ className="extension-detail__shot"+ loading="lazy"+ />+ ))}+ </div>+ )}++ <div className="extension-detail__actions">+ {entry.installed ? (+ <Badge variant={isLocal ? statusVariant(entry.status) : 'success'}>+ <CheckCircle2 aria-hidden="true" />+ {installedLabel}+ </Badge>+ ) : (+ <Button disabled={isLocal && installing} onClick={onInstall}>+ <DownloadCloud aria-hidden="true" />+ {isLocal && installing ? 'Installing...' : 'Install'}+ </Button>+ )}+ </div>+ </div>+ </Modal>+ );+};+const InstalledCatalogRow = ({ entry, onUninstall }) => {const isLocal = entry.source === 'local';const Icon = isLocal ? Archive : PackageCheck;diff --git a/frontend/src/pages/Settings.jsx b/frontend/src/pages/Settings.jsxindex 1a3aaab8..716ef9e9 100644--- a/frontend/src/pages/Settings.jsx+++ b/frontend/src/pages/Settings.jsx@@ -18,18 +18,19 @@ import ApiSettingsTab from '../components/settings/ApiSettingsTab';import MigrationHistoryTab from '../components/settings/MigrationHistoryTab';import IconReferenceTab from '../components/settings/IconReferenceTab';import AISettingsTab from '../components/settings/AISettingsTab';+import ModulesTab from '../components/settings/ModulesTab';import AboutTab from '../components/settings/AboutTab';import { Activity, Code, Database, Layers, Link2, PaintBucket, Sparkles, Settings as SettingsIcon } from 'lucide-react';import { Button } from '@/components/ui/button';import { PageTopbar, SegControl } from '@/components/ds';import { useNavigate } from 'react-router-dom';-const VALID_TABS = ['profile', 'security', 'connections', 'appearance', 'sidebar', 'whitelabel', 'notifications', 'system', 'users', 'activity', 'site', 'sso', 'api', 'ai', 'migrations', 'developer', 'about'];+const VALID_TABS = ['profile', 'security', 'connections', 'appearance', 'sidebar', 'whitelabel', 'notifications', 'system', 'users', 'activity', 'site', 'sso', 'api', 'ai', 'modules', 'migrations', 'developer', 'about'];// Tabs that belong to the server-wide "Administration" group (admin-only); the// rest are personal "My Account" settings. Drives the two-way section switch so// personal prefs aren't interleaved with destructive system controls.-const ADMIN_TABS = ['users', 'activity', 'site', 'connections', 'sso', 'api', 'ai', 'migrations', 'system', 'developer'];+const ADMIN_TABS = ['users', 'activity', 'site', 'connections', 'sso', 'api', 'ai', 'modules', 'migrations', 'system', 'developer'];const Settings = () => {const [activeTab, setActiveTab] = useTabParam('/settings', VALID_TABS);@@ -239,6 +240,14 @@ const Settings = () => {<Sparkles size={18} />AI Assistant</Button>+ <Button+ variant="ghost"+ className={`settings-nav-item ${activeTab === 'modules' ? 'active' : ''}`}+ onClick={() => setActiveTab('modules')}+ >+ <Layers size={18} />+ Modules+ </Button><Buttonvariant="ghost"className={`settings-nav-item ${activeTab === 'migrations' ? 'active' : ''}`}@@ -300,6 +309,7 @@ const Settings = () => {{activeTab === 'sso' && isAdmin && <SSOConfigTab />}{activeTab === 'api' && isAdmin && <ApiSettingsTab />}{activeTab === 'ai' && isAdmin && <AISettingsTab />}+ {activeTab === 'modules' && isAdmin && <ModulesTab />}{activeTab === 'migrations' && isAdmin && <MigrationHistoryTab />}{activeTab === 'system' && isAdmin && <SystemTab />}{activeTab === 'developer' && devMode && isAdmin && <IconReferenceTab />}diff --git a/frontend/src/plugins/serverkit-gpu/index.jsx b/frontend/src/plugins/serverkit-gpu/index.jsxnew file mode 100644index 00000000..6c1499f7--- /dev/null+++ b/frontend/src/plugins/serverkit-gpu/index.jsx@@ -0,0 +1,11 @@+// GPU Monitor, contributed through the extension system. The page component and+// its /api/v1/gpu backend stay in core for now (two-speed extraction, D2); this+// extension owns the /gpu route + sidebar/palette entries via its manifest.+//+// After sync this file lives at frontend/src/plugins/serverkit-gpu/ so the+// relative import resolves against the host's pages directory.+import GpuMonitor from '../../pages/GpuMonitor';++export function GpuMonitorPage() {+ return <GpuMonitor />;+}diff --git a/frontend/src/plugins/serverkit-gpu/plugin.json b/frontend/src/plugins/serverkit-gpu/plugin.jsonnew file mode 100644index 00000000..78463e23--- /dev/null+++ b/frontend/src/plugins/serverkit-gpu/plugin.json@@ -0,0 +1,43 @@+{+ "name": "serverkit-gpu",+ "display_name": "GPU Monitor",+ "version": "1.0.0",+ "description": "Live NVIDIA GPU metrics — utilization, memory, temperature, power and fan — for servers with a GPU.",+ "author": "ServerKit",+ "license": "MIT",+ "category": "monitoring",+ "homepage": "https://github.com/jhd3197/ServerKit",+ "permissions": [+ "shell"+ ],+ "icon": "<rect x=\"3\" y=\"6\" width=\"18\" height=\"12\" rx=\"2\"/><path d=\"M7 6v12\"/><circle cx=\"13\" cy=\"12\" r=\"2.5\"/><path d=\"M17 6v12\"/>",+ "contributions": {+ "nav": [+ {+ "id": "gpu",+ "label": "GPU Monitor",+ "route": "/gpu",+ "category": "system",+ "requiresCondition": "gpuAvailable",+ "icon": "<rect x=\"3\" y=\"6\" width=\"18\" height=\"12\" rx=\"2\"/><path d=\"M7 6v12\"/><circle cx=\"13\" cy=\"12\" r=\"2.5\"/><path d=\"M17 6v12\"/>"+ }+ ],+ "routes": [+ {+ "path": "gpu",+ "component": "GpuMonitorPage"+ }+ ],+ "page_titles": {+ "/gpu": "GPU Monitor"+ },+ "command_palette": [+ {+ "label": "GPU Monitor",+ "path": "/gpu",+ "category": "Pages",+ "keywords": "nvidia cuda metrics gpu"+ }+ ]+ }+}diff --git a/frontend/src/plugins/serverkit-workflows/index.jsx b/frontend/src/plugins/serverkit-workflows/index.jsxnew file mode 100644index 00000000..375441be--- /dev/null+++ b/frontend/src/plugins/serverkit-workflows/index.jsx@@ -0,0 +1,12 @@+// Workflow Builder, contributed through the extension system. The page component+// and its /api/v1/workflows backend stay in core for now (two-speed extraction,+// D2); this extension owns the /workflow route + sidebar/palette entries via its+// manifest. The route uses the "full" layout (no padding) to match the canvas.+//+// After sync this file lives at frontend/src/plugins/serverkit-workflows/ so the+// relative import resolves against the host's pages directory.+import WorkflowBuilder from '../../pages/WorkflowBuilder';++export function WorkflowBuilderPage() {+ return <WorkflowBuilder />;+}diff --git a/frontend/src/plugins/serverkit-workflows/plugin.json b/frontend/src/plugins/serverkit-workflows/plugin.jsonnew file mode 100644index 00000000..62c0846b--- /dev/null+++ b/frontend/src/plugins/serverkit-workflows/plugin.json@@ -0,0 +1,44 @@+{+ "name": "serverkit-workflows",+ "display_name": "Workflow Builder",+ "version": "1.0.0",+ "description": "Visual automation builder — chain deploy, build, and notification steps into pipelines on a drag-and-drop canvas.",+ "author": "ServerKit",+ "license": "MIT",+ "category": "deployment",+ "homepage": "https://github.com/jhd3197/ServerKit",+ "permissions": [+ "docker",+ "shell"+ ],+ "icon": "<circle cx=\"18\" cy=\"5\" r=\"3\"/><circle cx=\"6\" cy=\"12\" r=\"3\"/><circle cx=\"18\" cy=\"19\" r=\"3\"/><path d=\"M8.59 13.51l6.83 3.98\"/><path d=\"M15.41 6.51l-6.82 3.98\"/>",+ "contributions": {+ "nav": [+ {+ "id": "workflow",+ "label": "Workflow Builder",+ "route": "/workflow",+ "category": "infrastructure",+ "icon": "<circle cx=\"18\" cy=\"5\" r=\"3\"/><circle cx=\"6\" cy=\"12\" r=\"3\"/><circle cx=\"18\" cy=\"19\" r=\"3\"/><path d=\"M8.59 13.51l6.83 3.98\"/><path d=\"M15.41 6.51l-6.82 3.98\"/>"+ }+ ],+ "routes": [+ {+ "path": "workflow",+ "component": "WorkflowBuilderPage",+ "layout": "full"+ }+ ],+ "page_titles": {+ "/workflow": "Workflow Builder"+ },+ "command_palette": [+ {+ "label": "Workflow Builder",+ "path": "/workflow",+ "category": "Pages",+ "keywords": "automation pipeline workflow"+ }+ ]+ }+}diff --git a/frontend/src/services/api/system.js b/frontend/src/services/api/system.jsindex 82b965ff..f197b2c4 100644--- a/frontend/src/services/api/system.js+++ b/frontend/src/services/api/system.js@@ -929,3 +929,15 @@ export async function rateExtension(extId, rating) {method: 'POST', body: { rating }});}++// Feature module toggles (Email + WordPress verticals). getModules() is+// available to any authenticated user; setModule() is admin-only.+export async function getModules() {+ return this.request('/modules');+}++export async function setModule(name, enabled) {+ return this.request(`/modules/${name}`, {+ method: 'PUT', body: { enabled }+ });+}diff --git a/frontend/src/styles/pages/_marketplace.scss b/frontend/src/styles/pages/_marketplace.scssindex ddd431f4..a3e9f780 100644--- a/frontend/src/styles/pages/_marketplace.scss+++ b/frontend/src/styles/pages/_marketplace.scss@@ -211,6 +211,15 @@}}+ .extension-card--clickable {+ cursor: pointer;++ &:focus-visible {+ outline: 2px solid $accent-primary;+ outline-offset: 2px;+ }+ }+.extension-card__topline,.extension-card__footer,.extension-card__info,@@ -759,3 +768,97 @@}}}++// First-party "by ServerKit" badge. Rendered both inside .marketplace-page+// (cards) and inside the detail Modal (a Radix portal outside the page tree),+// so it lives at the root. Matches the `secondary` variant selector specificity+// and wins on source order to apply the accent tint.+[data-slot='badge'].extension-firstparty {+ gap: 4px;+ border-color: var(--accent-dim);+ background: var(--accent-bg);+ color: var(--accent-bright);+ font-weight: $font-weight-semibold;+}++// Extension detail modal (rendered in a Radix Dialog portal).+.extension-detail {+ display: flex;+ flex-direction: column;+ gap: $space-4;++ &__header {+ display: flex;+ align-items: flex-start;+ gap: $space-4;+ }++ &__icon {+ display: inline-flex;+ align-items: center;+ justify-content: center;+ width: 52px;+ height: 52px;+ flex: 0 0 52px;+ border-radius: $radius-lg;+ color: $accent-primary;+ background: fade($accent-primary-raw, 12%);++ svg {+ width: 26px;+ height: 26px;+ }+ }++ &__heading {+ display: flex;+ flex-direction: column;+ gap: $space-2;+ min-width: 0;+ }++ &__badges {+ display: flex;+ align-items: center;+ flex-wrap: wrap;+ gap: $space-2;+ }++ &__meta {+ display: flex;+ align-items: center;+ flex-wrap: wrap;+ gap: $space-3;+ color: $text-tertiary;+ font-size: $font-size-sm;+ }++ &__desc {+ margin: 0;+ color: $text-secondary;+ font-size: $font-size-base;+ line-height: $line-height-normal;+ }++ &__gallery {+ display: grid;+ grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));+ gap: $space-3;+ }++ &__shot {+ width: 100%;+ height: auto;+ border: 1px solid $border-subtle;+ border-radius: $radius-md;+ background: $bg-elevated;+ object-fit: cover;+ }++ &__actions {+ display: flex;+ justify-content: flex-end;+ padding-top: $space-4;+ border-top: 1px solid $border-subtle;+ }+}