- GET /workflows - List all workflows for user
- GET /workflows/<id> - Get single workflow
- POST /workflows - Create new workflow
- PUT /workflows/<id> - Update workflow
- DELETE /workflows/<id> - Delete workflow
- JWT authentication and access control
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- SQLAlchemy model with name, description, nodes, edges, viewport
- JSON string storage for React Flow state
- to_dict() method with node/edge counts
- User relationship and timestamps
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
POST /templates/test-db-connection - validates MySQL connection
- Required: host, user, password, database
- Optional: port (default 3306)
- Returns success/error with detailed message
- Includes warning if pymysql not available
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add validate_mysql_connection() method to TemplateService
- Check port connectivity first, then full MySQL connection if pymysql available
- Falls back to port-only check if pymysql not installed
- Integrate validation into install_template() for wordpress-external-db
- Return clear error messages if database is unreachable
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Add wordpress-external-db to templates registry with:
- Categories: cms, blog, website, development
- Description highlighting dev/prod support
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
New template for WordPress with external database support:
- No bundled MySQL container
- Configurable DB_HOST, DB_PORT, DB_NAME, DB_USER, DB_PASSWORD
- TABLE_PREFIX for multiple WordPress instances on same database
- Ideal for dev/prod environment sharing
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Backend:
- Add /system/check-update endpoint
- Fetch latest release from GitHub API
- Compare versions and return update_available flag
- Cache results for 1 hour to respect rate limits
Frontend:
- Add checkUpdate() API method
- Add "Check for Updates" button in About section
- Show update available notification with release link
- Show "You're up to date" when current
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add get_all_disk_mounts() using psutil for multi-mount support
- Add analyze_directory_sizes() for directory size analysis
- Add get_file_type_breakdown() for file categorization by type
- Add recursive helpers with depth limits for performance
- New endpoints: /files/disk-mounts, /files/analyze, /files/type-breakdown
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Create metrics API blueprint with history, stats, and collection
control endpoints
- Register blueprint at /api/v1/metrics
- Auto-start background metrics collection on app startup
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
The compose_ps function now handles:
- NDJSON: One JSON object per line (newer docker versions)
- JSON Array: Single line with array of objects
- Warning messages: Skip lines starting with 'time=' or 'WARN'
- Both dict and list parsed results
This fixes 'str' object has no attribute 'get' error when
docker compose outputs warnings before JSON.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
CLI commands failed with "unable to open database file" because
environment variables weren't loaded from .env before create_app().
Now checks multiple .env locations:
- Same directory as cli.py
- Parent directory
- /opt/serverkit/.env (production)
- /opt/serverkit/backend/.env
Add --debug flag to show which env file was loaded.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
docker compose ps --format json outputs NDJSON (one JSON object per
line), not a JSON array. Parse each line separately to correctly
detect running containers.
This fixes container detection in app status and diagnostics.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
GET /api/v1/apps/{id}/status now returns:
- port: The configured port number
- port_accessible: Boolean indicating if the port is reachable
Helps frontend display real-time routing health status.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Wait for containers to start after docker compose up
- Check if configured port is accessible
- Include port status in installation response
- Log warning if port not accessible (may need more startup time)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Require Docker apps to have a port configured before adding domains
- Check port accessibility and include warning if port not reachable
- Provides actionable error messages with hints for resolution
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
New endpoints for debugging domain/container routing:
- GET /api/v1/domains/debug/diagnose/{app_id}: Full diagnostic report
with app config, domains, nginx status, docker containers, health
assessment and actionable recommendations
- POST /api/v1/domains/debug/test-routing/{app_id}: Active routing
tests to verify traffic flow
Both endpoints require admin access.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Add diagnostic methods to NginxService:
- get_site_config(): Get config content, enabled status, parsed info
- diagnose_site(): Full diagnostic with health check and recommendations
- check_site_routing(): Test the complete routing chain
Includes automatic health assessment and actionable recommendations.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Add diagnostic methods to DockerService:
- check_port_accessible(): Test if a port has something listening
- get_container_port_bindings(): Get port mappings for a container
- get_container_network_info(): Get full network settings including IPs
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Added '/var/serverkit' to ALLOWED_ROOTS for file browsing. Enhanced error handling for owner/group resolution to support missing pwd/grp modules and additional exception types. Improved get_disk_usage to check for path existence, handle permission errors, and avoid division by zero.
Updated log fetching logic in LogsTab to handle both array and string formats for Docker and regular app logs, ensuring logs are displayed correctly regardless of backend response structure.
Introduces a new /system/version API endpoint in the backend to provide the current ServerKit version, reading from possible VERSION files. Updates the frontend About section to fetch and display the version dynamically instead of hardcoding it.
App deletion now performs Docker cleanup, removes app folders, and cleans up Nginx configs, returning detailed cleanup results. TemplateService port variable generation now avoids ports in use by Docker containers and system processes, improving reliability for dynamic port assignment.
Implements endpoints for managing and querying MySQL/PostgreSQL databases running in Docker containers, including listing containers, databases, tables, and executing queries. Adds endpoints for retrieving app logs and real-time status for Docker apps. Updates template variable processing to flag auto-generated and hidden variables. Extends DatabaseService with Docker MySQL/PostgreSQL discovery and query utilities.
Automatically create, update, and delete nginx configs for Docker applications when domains are added or removed. Adds an endpoint to manually regenerate nginx configs for Docker apps. Updates TemplateService to detect port from multiple possible variable names (PORT, HTTP_PORT, WEB_PORT) when creating Docker app records.
Same bug as before - the validate_installation function was using
.items() on variables expecting a dict, but templates now use
list format.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
The validate_template function was failing because it expected
variables in dict format but templates now use list format.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Convert variables to list format
- Use ${APP_NAME} for container names
- Standardize service names and port variables
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add APP_NAME as automatic variable for all template installs
- Handle both list and dict formats for template variables
- Update uptime-kuma, portainer, node-app templates with proper format
- Use ${APP_NAME} for container names instead of hardcoded values
- Standardize port variable names to HTTP_PORT
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- get_app_logs now checks for docker-compose.yml first
- Uses 'docker compose logs' for containerized apps
- Falls back to nginx logs for host-based apps
- Added /var/serverkit and /var/www to allowed log directories
Fixes 'Failed to load logs' error for Docker-deployed apps.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Removed duplicate root templates/ folder
- Added PHP, Python, Node.js templates to marketplace (YAML format)
- Templates now installable via web UI Templates page
- CLI create-app now points users to web UI
- All 63 templates in one place: backend/templates/
New templates:
- php-app: Custom PHP 8.0-8.3 with Apache
- python-app: Custom Python 3.9-3.12 (Flask/FastAPI/Django)
- node-app: Custom Node.js 18-21 (Express/Next.js)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Create /app/instance directory in Dockerfile with proper permissions
- Update DATABASE_URL default to use absolute path (/app/instance/serverkit.db)
- Ensures the non-root appuser can write to the database location
- Fixes "unable to open database file" error on fresh installs
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Introduces backend endpoints and models for admin features including user management, system settings, and audit logging. Adds RBAC middleware, audit log and system settings models, and services for audit and settings. Updates authentication to support setup flow and registration control. On the frontend, adds settings tabs for users and audit logs, a setup page, and updates routing and context to support setup and registration state. Styles and API service are updated to support new features.
Replaced all uses of app.path with app.root_path in backend API and service layers for consistency and correctness. Renamed the 'metadata' field to 'extra_data' in the Deployment model to avoid SQLAlchemy reserved word conflicts and updated related methods. Also updated frontend to import Toast context from the correct location and added new border and font size variables in styles.