{"id":29297995,"url":"https://github.com/persys-dev/persys-agent","last_synced_at":"2026-05-06T18:32:41.217Z","repository":{"id":301545726,"uuid":"993314238","full_name":"persys-dev/persys-agent","owner":"persys-dev","description":"Persys Agent is a lightweight, CPP-based system agent for managing Docker containers, Docker Compose services, Docker Swarm clusters, and cron jobs on a node. It provides secure, API-driven orchestration, resource monitoring, and heartbeat reporting.","archived":false,"fork":false,"pushed_at":"2025-06-27T11:42:50.000Z","size":14,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-06-27T12:37:11.320Z","etag":null,"topics":["agent","automation","cpp","devops","distributed-systems","docker","docker-compose","docker-swarm","edge-computing","hmac-authentication","infrastructure","monitoring","orchestration","systemd"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/persys-dev.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-05-30T15:18:49.000Z","updated_at":"2025-06-27T12:14:55.000Z","dependencies_parsed_at":"2025-06-27T12:49:07.156Z","dependency_job_id":null,"html_url":"https://github.com/persys-dev/persys-agent","commit_stats":null,"previous_names":["persys-dev/persys-agent"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/persys-dev/persys-agent","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/persys-dev%2Fpersys-agent","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/persys-dev%2Fpersys-agent/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/persys-dev%2Fpersys-agent/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/persys-dev%2Fpersys-agent/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/persys-dev","download_url":"https://codeload.github.com/persys-dev/persys-agent/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/persys-dev%2Fpersys-agent/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":263943796,"owners_count":23533643,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["agent","automation","cpp","devops","distributed-systems","docker","docker-compose","docker-swarm","edge-computing","hmac-authentication","infrastructure","monitoring","orchestration","systemd"],"created_at":"2025-07-06T17:38:30.640Z","updated_at":"2026-05-06T18:32:41.189Z","avatar_url":"https://github.com/persys-dev.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Persys Agent\n\nPersys Agent is a C++-based system agent that manages Docker containers, Docker Compose services, Docker Swarm clusters, and cron jobs on a node. It communicates with a central server to report its status and receive commands.\n\n## Features\n\n- **Node Management**: Registration and health monitoring of nodes in the system\n- **Docker Management**: Container lifecycle management (create, start, stop, remove)\n- **Docker Compose**: Service management using Docker Compose\n- **Docker Swarm**: Swarm cluster management and operations\n- **Cron Job Management**: Schedule and manage cron jobs\n- **System Resource Monitoring**: CPU and memory usage tracking\n- **Heartbeat Mechanism**: Regular status updates to the central server\n- **Secure Communication**: Request signature verification middleware\n\n## Prerequisites\n\n- C++17 or later\n- libcurl\n- jsoncpp\n- Crow (C++ web framework)\n- Docker\n- Docker Compose\n- Docker Swarm (optional)\n\n## Environment Variables\n\n- `CENTRAL_URL`: URL of the central server (required)\n- `AGENT_PORT`: Port for the agent's HTTP server (default: 8080)\n\n## API Endpoints\n\n### Health Check\n- `GET /api/v1/health`: Returns node health status and resource usage\n\n### Docker Operations\n- Container management endpoints for create, start, stop, and remove operations\n- Container inspection and status checking\n\n### Docker Compose\n- Service deployment and management\n- Service status monitoring\n- Service scaling\n\n### Docker Swarm\n- Swarm cluster management\n- Node management within the swarm\n- Service deployment in swarm mode\n\n### Cron Jobs\n- Schedule management\n- Job execution monitoring\n- Job status reporting\n\n## Architecture\n\nThe agent is built with a modular architecture:\n\n### Controllers\n- `NodeController`: Manages node registration and status\n- `SystemController`: Monitors system resources\n- `DockerController`: Handles Docker container operations\n- `ComposeController`: Manages Docker Compose services\n- `SwarmController`: Handles Docker Swarm operations\n- `CronController`: Manages scheduled tasks\n\n### Routes\n- Handshake routes for node registration\n- Docker operation routes\n- Compose service routes\n- Swarm management routes\n- Cron job routes\n\n### Middleware\n- Signature verification for secure communication\n- Request validation and authentication\n\n## Building\n\n```bash\nmkdir build\ncd build\ncmake ..\nmake\n```\n\n## Running\n\n### With Environment Variables\n```bash\nexport CENTRAL_URL=\"http://your-central-server:8084\"\nexport AGENT_PORT=8080\n./persys-agent\n```\n\n### With Docker Compose\nA sample docker-compose file is provided in `docker/docker-compose.yml`:\n\n```bash\ncd docker\n# Build and run the agent in the background\nsudo docker-compose up --build -d\n```\n\n- The agent will be available on port 8080 by default.\n- The Docker socket is mounted for container management.\n- You can configure `CENTRAL_URL` and `AGENT_PORT` in the compose file.\n\n### As a systemd Service\nYou can install and manage Persys Agent as a systemd service:\n\n1. Install the agent and service:\n   ```bash\n   sudo make install\n   ```\n2. The service will be installed as `persys-agent.service` and enabled to start on boot.\n3. Configuration is managed via `/etc/persys-agent.env`.\n4. Control the service with:\n   ```bash\n   sudo systemctl status persys-agent\n   sudo systemctl restart persys-agent\n   sudo systemctl stop persys-agent\n   ```\n\n### Uninstall\nTo remove the agent and service:\n```bash\nsudo make uninstall\n```\n\n## Security\n\nThe agent implements request signature verification to ensure secure communication with the central server. All API requests must be properly signed and authenticated.\n\n## Error Handling\n\nThe agent implements robust error handling and retry mechanisms for:\n- Node registration\n- Heartbeat communication\n- Docker operations\n- Service management\n\n## Monitoring\n\nThe agent provides:\n- Regular heartbeat updates to the central server\n- System resource monitoring\n- Container and service status tracking\n- Error logging and reporting\n\n## License\n\nGNU GENERAL PUBLIC LICENSE","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpersys-dev%2Fpersys-agent","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpersys-dev%2Fpersys-agent","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpersys-dev%2Fpersys-agent/lists"}