Commit Graph
73 Commits
Author SHA1 Message Date
Juan Denis 528c86d640 Add agent install scripts and release automation
Introduced Linux (install.sh) and Windows (install.ps1) installation scripts for ServerKit agent, and exposed new backend endpoints to serve these scripts and installation instructions. Added a GitHub Actions workflow (agent-release.yml) for automated agent builds and releases. Updated ROADMAP.md and SERVERS_INTEGRATION_PLAN.md to reflect progress on installation and distribution features.
2026-01-21 22:57:40 -05:00
Juan Denis 009fb12435 Add multi-server management and agent gateway
Introduces backend models, API endpoints, and services for remote server and agent management, including WebSocket agent gateway, server CRUD, metrics, command history, and remote Docker operations. Updates frontend to support server listing, detail pages, and related UI components and styles.
2026-01-21 22:47:42 -05:00
Juan Denis 39aac19f59 Add advanced security management features
Implemented backend and frontend support for Fail2ban management, SSH key management, IP allowlist/blocklist, security audit reports, Lynis vulnerability scanning, and automatic security updates. Added new API endpoints and service methods for these features in the backend, and introduced corresponding tabs and UI components in the frontend Security page for comprehensive server security administration.
2026-01-21 21:58:59 -05:00
Juan Denis d4b44b582f Integrate firewall management into Security page
Moved firewall management UI from its own page into a new tab within the Security page for unified security management. Updated backend firewall service to improve detection of installed firewalls. Adjusted sidebar navigation and routing to remove the standalone Firewall page. Added new styles for the integrated firewall tab and updated roadmap to reflect these changes.
2026-01-21 21:44:07 -05:00
Juan Denis 5597521148 Add git webhook and deployment management APIs
Introduces models and services for managing Git webhooks, deployment history, and Gitea repository interactions. Adds comprehensive API endpoints for webhook CRUD, repository browsing, deployment triggering, rollback, and log retrieval. Updates ROADMAP.md to remove version targets from planned features.
2026-01-21 21:31:57 -05:00
Juan Denis 5139fac360 Add Nginx /gitea path support for Gitea and update UI
Introduces Nginx configuration for serving Gitea at the /gitea path, including creation and removal logic in NginxService. GitService now manages and reports the slug-based URL path, and the frontend Git page uses and displays the new /gitea path if available, falling back to port-based URLs for backward compatibility.
2026-01-21 20:56:13 -05:00
Juan Denis 39fc113eb7 Add integrated Git server (Gitea) management UI and API
Introduces backend API endpoints and service logic for installing, managing, and uninstalling a Gitea-based Git server. Adds a new frontend page for Git server management, updates the sidebar and routing, and includes supporting API methods and styles for the new feature.
2026-01-21 18:25:50 -05:00
Juan Denis 3b59478b7c Enhance dashboard and workflow with real app support
Added system info API for admin, improved system metrics with cached memory and network I/O stats, and updated frontend dashboard with refresh controls and live/polling status. Workflow builder now supports loading full server infrastructure, adding real apps, and improved node palette. Docker app nodes and config panels display more details for real apps, and styles updated for new UI elements.
2026-01-19 20:57:42 -05:00
Juan Denis 5fe76cd811 Add support for template file creation and bind mounts
Introduces handling of a 'files' section in templates, allowing creation of files and automatic updating of docker-compose.yml to use bind mounts for these files instead of named volumes. Also updates nginx config generation to avoid using 'default_server' for private URL servers, delegating that responsibility to serverkit.conf.
2026-01-19 19:49:12 -05:00
Juan Denis f05d056678 Improve port variable handling and add app cleanup CLI
Port variables in templates are now hidden and always auto-generated, never using user-supplied values. The TemplateService's port assignment checks both database and Docker for used ports, and removes obsolete Docker Compose version fields. Adds new CLI commands for cleaning up all applications, performing a factory reset, and listing applications. Minor update to AuthContext to mark setup as complete after registration.
2026-01-19 16:56:57 -05:00
Juan DenisandClaude Opus 4.5 4a5c474e4b fix(workflow): Start containers and pass DB credentials on deploy
- Add compose_up() call to start containers after creating docker files
- Update app status to 'running' on successful container start
- Pass database password (DB_PASSWORD) to app environment variables
- Store credentials in created_resources for proper propagation
- Return warning if containers fail to start (app still created)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-19 15:27:02 -05:00
Juan DenisandClaude Opus 4.5 f55e399021 feat(22-3): Add WebSocket container log streaming
- Add subscribe_container_logs event for real-time log streaming
- Add unsubscribe_container_logs event to stop streaming
- Stream logs via docker logs --follow subprocess
- Parse log lines with timestamp and level detection
- Emit container_log events to room logs_{app_id}
- Handle container_log_ended when container stops
- Clean up processes on disconnect or unsubscribe
- Support service selection for compose apps

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-19 14:45:50 -05:00
Juan DenisandClaude Opus 4.5 744c626edb feat(22-2): Add container-logs REST API endpoint
- Add GET /apps/{id}/container-logs with tail, since, timestamps, format params
- Add GET /apps/{id}/containers to list containers for compose apps
- Support 'raw' and 'json' output formats
- Include container state and available services in response
- Cap log lines at 10000 for performance
- Handle service selection for multi-container compose apps

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-19 14:44:51 -05:00
Juan DenisandClaude Opus 4.5 f3010d9983 feat(22-1): Add streaming logs and container resolution to DockerService
- Add stream_container_logs() for real-time log streaming via subprocess
- Add get_app_container_id() to resolve container ID from app model
- Add get_all_app_containers() for compose apps with multiple containers
- Add parse_log_line() to extract timestamp and detect log level
- Add parse_logs_to_lines() for batch parsing
- Add get_container_state() to check if container is running

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-19 14:44:05 -05:00
Juan Denis 46b6d5e7ad Add server time and timezone management features
Introduces backend API endpoints and service methods for retrieving and setting server time and timezone (admin only). Updates the dashboard to display current server time and timezone, and adds a timezone selector to the settings page for admins. Includes supporting API methods and frontend styles for the new UI components.
2026-01-19 14:06:44 -05:00
Juan Denis 85831b9b54 Add metric filter toggles and improve validation UX
Introduces clickable filter buttons to toggle CPU, memory, and disk metrics in MetricsGraph, replacing the static legend. Refines app name validation in both backend and frontend for template installation, allowing 2+ character names and improving error handling. WorkflowBuilder now handles missing workflow data gracefully and supports a fullscreen layout. Updates related styles for new filter legend and fullscreen workflow view.
2026-01-19 13:43:46 -05:00
Juan Denis 83ba62bb08 feat(21-2): Add workflow deploy API endpoint 2026-01-19 12:38:12 -05:00
Juan Denis bead238379 feat(21-1): Create workflow deployment service 2026-01-19 12:37:48 -05:00
Juan Denis 9c4c5dd886 feat(20-3): Register workflow blueprint 2026-01-19 12:26:26 -05:00
Juan DenisandClaude Opus 4.5 5f48bb1a37 feat(20-2): Create workflow API endpoints
- 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>
2026-01-19 12:25:21 -05:00
Juan DenisandClaude Opus 4.5 ee9826ff1f feat(20-1): Create Workflow model
- 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>
2026-01-19 12:24:51 -05:00
Juan Denis 65d1fbef77 feat(12): Update app list response to include environment info and filtering 2026-01-19 10:32:23 -05:00
Juan Denis 748577149c feat(12): Add database credential propagation for linked apps 2026-01-19 10:31:16 -05:00
Juan Denis 3e4ba7007e feat(12): Add app linking API endpoints (link, unlink, get linked, update environment) 2026-01-19 10:30:15 -05:00
Juan Denis 34bee0e87b feat(12): Add environment linking fields to Application model 2026-01-19 10:29:35 -05:00
Juan DenisandClaude Opus 4.5 b5269e88b8 feat(11): Add test-db-connection API endpoint
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>
2026-01-19 10:21:38 -05:00
Juan DenisandClaude Opus 4.5 b3187c35e5 feat(11): Add MySQL connection validation for external DB templates
- 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>
2026-01-19 10:20:53 -05:00
Juan DenisandClaude Opus 4.5 4f5da492cc feat(14): Add version update check via GitHub releases API
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>
2026-01-19 10:09:59 -05:00
Juan DenisandClaude Opus 4.5 4c7f551936 feat(9): Add backend directory analysis and disk mount endpoints
- 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>
2026-01-19 09:42:24 -05:00
Juan DenisandClaude Opus 4.5 189dead603 Add metrics API endpoints and auto-start collection
- 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>
2026-01-19 02:51:58 -05:00
Juan Denis d6f0ee9b8f feat(phase6): add MetricsHistoryService for data collection
Service provides metrics recording, querying by period, automatic
aggregation (minute to hour/day), and retention-based cleanup.
2026-01-19 02:50:17 -05:00
Juan Denis 8a54630124 feat(phase6): add MetricsHistory model for historical metrics
SQLite model with aggregation levels (minute/hour/day) for storing
CPU, memory, disk metrics with composite indexes for efficient queries.
2026-01-19 02:49:15 -05:00
Juan Denis 48534dc5ea feat(phase5): register private URLs API blueprint
Register private_urls_bp for /api/v1/apps/* private URL endpoints.
2026-01-19 02:37:10 -05:00
Juan Denis 9a16753ed8 feat(phase5): add Nginx private URL configuration
Adds methods to generate and manage Nginx configs for private URL
routing via /p/{slug}/ paths with automatic config regeneration.
2026-01-19 02:36:40 -05:00
Juan Denis 85cb72c685 feat(phase5): add private URL API endpoints
Endpoints for enabling, updating, disabling, and regenerating
private URLs. Includes public resolver endpoint for slug lookup.
2026-01-19 02:35:55 -05:00
Juan Denis 5b0af3b27e feat(phase5): add PrivateURLService for slug generation
Provides cryptographically secure slug generation and validation
with support for custom slugs and uniqueness checking.
2026-01-19 02:35:18 -05:00
Juan Denis d40f82ed27 feat(phase5): add private URL fields to Application model
Add private_slug and private_url_enabled fields to support
shareable private URLs for applications.
2026-01-19 02:34:53 -05:00
Juan DenisandClaude Opus 4.5 4d9ad82400 fix(3): handle all docker compose ps output formats
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>
2026-01-19 02:22:50 -05:00
Juan DenisandClaude Opus 4.5 3f9884c055 fix(2): parse NDJSON output from docker compose ps
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>
2026-01-19 01:56:43 -05:00
Juan DenisandClaude Opus 4.5 47acb0914c feat(1-1): add port accessibility to app status endpoint
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>
2026-01-19 01:06:37 -05:00
Juan DenisandClaude Opus 4.5 5ac5a85e90 feat(1-1): verify port accessibility after template installation
- 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>
2026-01-19 01:06:11 -05:00
Juan DenisandClaude Opus 4.5 1a2c39065c fix(1-1): validate port configuration on domain creation
- 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>
2026-01-19 01:05:33 -05:00
Juan DenisandClaude Opus 4.5 cb809ee4dd feat(1-1): add routing diagnostic API endpoints
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>
2026-01-19 01:05:05 -05:00
Juan DenisandClaude Opus 4.5 f14af7107e feat(1-1): add Nginx config diagnostics and routing checks
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>
2026-01-19 01:04:29 -05:00
Juan DenisandClaude Opus 4.5 5182d2326c feat(1-1): add port accessibility and container network diagnostics
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>
2026-01-19 01:03:51 -05:00
Juan Denis 6ea84d1482 Improve file service error handling and add root dir
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.
2026-01-19 00:38:20 -05:00
Juan Denis 122f099167 Fix log display for array and string formats
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.
2026-01-19 00:34:39 -05:00
Juan Denis b619779059 Add dynamic ServerKit version endpoint and UI
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.
2026-01-19 00:11:49 -05:00
Juan Denis c7eaafab6a Enhance app deletion and improve port allocation logic
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.
2026-01-19 00:01:33 -05:00
Juan Denis bf237c698d Add Docker database and app management endpoints
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.
2026-01-18 23:55:12 -05:00