Commit Graph
92 Commits
Author SHA1 Message Date
Juan Denis 4cdcff598d Remove compare_server_metrics endpoint
Deleted the /metrics/compare API endpoint and its handler from servers.py. This endpoint allowed comparison of metrics across multiple servers but is no longer needed.
2026-01-22 19:55:22 -05:00
Juan Denis bca7e29b57 Implement security features: key rotation, IP allowlist, anomaly detection
Adds API key rotation, IP allowlisting, anomaly detection, and replay protection to the ServerKit agent system. Backend changes include new endpoints, models, and services for security alerts, nonce tracking, and anomaly detection, as well as updates to the server model and agent authentication logic. The agent now supports credential rotation and replay protection via nonces. Frontend updates add UI and API methods for managing allowed IPs, viewing security alerts, and rotating API keys. Documentation and environment setup instructions are included.
2026-01-22 18:11:22 -05:00
Juan Denis fd90e2eead Add full-stack remote terminal/PTY support
Implements remote terminal functionality across agent, backend, and frontend. Adds PTY session management in the agent using creack/pty, new protocol actions, and terminal manager. Backend exposes terminal session APIs and session tracking via TerminalService. Frontend introduces a RemoteTerminal component using xterm.js and related APIs for interactive remote shell access.
2026-01-22 16:44:06 -05:00
Juan Denis 78fee0ada0 Add server historical metrics API and service
Implements backend API endpoints and a new ServerMetricsService for historical metrics, retention policies, aggregation, and multi-server comparison. Updates frontend ApiService with methods for metrics history, aggregation, comparison, retention stats, and cleanup. Updates integration plan to mark monitoring & metrics as complete.
2026-01-22 08:51:31 -05:00
Juan Denis 4a34349ed4 Add remote Docker Compose management support
Implements full remote Docker Compose project management, including listing, starting, stopping, restarting, pulling images, and viewing logs for compose projects. Updates the agent, backend API, service layer, frontend UI, and API client to support these operations for both local and remote servers.
2026-01-22 08:31:27 -05:00
Juan Denis 35deeb8882 Add remote Docker container logs streaming support
Implements backend and frontend support for streaming Docker container logs from remote servers. Adds new API endpoints, agent handler, and UI controls for selecting log line count. Updates documentation to reflect the completed feature.
2026-01-21 23:23:29 -05:00
Juan Denis 4e9767a6ca Add agent auto-update mechanism and backend endpoints
Implemented agent auto-update functionality, including periodic update checks, manual update command, and configuration options. Added backend API endpoints for agent version checking, update triggering, and download redirection. Updated documentation to reflect completion of the auto-update system.
2026-01-21 23:07:20 -05:00
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 c79e8458c6 Add Flask Hello World debug template
Introduced a new 'Flask - Hello World' template for testing and debugging connectivity, including a sample Flask app with health, debug, and headers endpoints. Updated index.json to register the new template and added 'testing' to the global categories.
2026-01-19 18:07:41 -05:00
Juan Denis 679ccf9f62 Enhance app cleanup and listing with Docker resource management
Expanded the cleanup and factory reset commands to remove orphaned Docker containers, networks, and volumes while preserving ServerKit infrastructure. Improved the list-apps command to optionally display all Docker containers with a new --all flag, and updated documentation and CLI help to reflect these changes.
2026-01-19 17:16:25 -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 Denis 236d040458 Add migrate_db CLI command for database migrations
Introduces a new 'migrate_db' command to the CLI that checks for and adds missing columns to the 'applications' table. This helps keep the database schema up to date without requiring manual intervention or full migrations.
2026-01-19 16:30:14 -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 ad20feff86 feat(11): Register WordPress External DB template in index
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>
2026-01-19 10:19:46 -05:00
Juan DenisandClaude Opus 4.5 733705d205 feat(11): Create WordPress External Database template
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>
2026-01-19 10:19:19 -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