{"id":27525621,"url":"https://github.com/hivecom/docker-control","last_synced_at":"2026-03-03T16:35:33.725Z","repository":{"id":287988109,"uuid":"965756294","full_name":"hivecom/docker-control","owner":"hivecom","description":"Secure API providing remote Docker control and container metrics using Hono on Deno","archived":false,"fork":false,"pushed_at":"2025-05-04T00:48:39.000Z","size":59,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-05-04T01:21:16.823Z","etag":null,"topics":["api","deno","docker","hono"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"agpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/hivecom.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-04-13T20:49:05.000Z","updated_at":"2025-05-04T00:48:42.000Z","dependencies_parsed_at":"2025-05-04T01:29:41.161Z","dependency_job_id":null,"html_url":"https://github.com/hivecom/docker-control","commit_stats":null,"previous_names":["hivecom/docker-control"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/hivecom/docker-control","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hivecom%2Fdocker-control","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hivecom%2Fdocker-control/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hivecom%2Fdocker-control/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hivecom%2Fdocker-control/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hivecom","download_url":"https://codeload.github.com/hivecom/docker-control/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hivecom%2Fdocker-control/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30051956,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-03T15:26:47.567Z","status":"ssl_error","status_checked_at":"2026-03-03T15:26:17.132Z","response_time":61,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["api","deno","docker","hono"],"created_at":"2025-04-18T14:27:20.988Z","updated_at":"2026-03-03T16:35:33.718Z","avatar_url":"https://github.com/hivecom.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# docker-control\n\nHivecom network wide Docker container orchestration and metrics API using Hono and Deno.\n\n## Using Docker Control\n\n```plaintext\n\u003e $ deno task start --help\nUsage:   docker-control\nVersion: [Version]\n\nDescription:\n\n  Hivecom Docker container orchestration and metrics API\n\nOptions:\n\n  -h, --help              - Show this help.                            \n  -V, --version           - Show the version number for this program.  \n  -s, --silent            - Run in silent mode (no console output)     \n  -l, --log-file  \u003cpath\u003e  - Log output to the specified file           \n\nCommands:\n\n  serve  - Start the Docker control API server\n```\n\nStart it in development with `deno task dev` (essentially `deno run --watch main.ts`), you can access the API at `http://localhost:${DOCKER_CONTROL_PORT}` (default: `54320`).\n\nMake sure you set the appropriate `DOCKER_CONTROL_KEY` in your environment variables. This is the key that will be used to authenticate requests to the API.\n\n## API Endpoints\n\nAll API requests require the `Authorization` header containing the token matching the `DOCKER_CONTROL_TOKEN` environment variable.\n\n| Method | Endpoint | Description |\n|--------|----------|-------------|\n| GET | `/containers` | Returns information about all Docker containers |\n| GET | `/names` | Returns a list of all container names |\n| GET | `/status` | Returns status information for all containers |\n| POST | `/control/:association/:value/start` | Start a container |\n| POST | `/control/:association/:value/stop` | Stop a container |\n| POST | `/control/:association/:value/restart` | Restart a container |\n| GET | `/control/:association/:value/logs` | Get container logs* |\n| GET | `/control/:association/:value/status` | Get status for a specific container |\n\nSpecify `:association` as `id` or `name` and `:value` to perform an action on a given container ID or name.  \n\nThe `logs` endpoint will return logs from the container and supports the following query parameters:\n\n- `tail=\u003cnumber\u003e` - Limit the output to the specified number of lines from the end (e.g., `?tail=50`)\n- `since=\u003cduration\u003e` - Get logs since the specified duration from now. Formats:\n  - `\u003cnumber\u003ed` - days (e.g., `?since=2d` for logs from the last 2 days)\n  - `\u003cnumber\u003eh` - hours (e.g., `?since=6h` for logs from the last 6 hours)\n  - `\u003cnumber\u003em` - minutes (e.g., `?since=30m` for logs from the last 30 minutes)\n  - `\u003cnumber\u003es` - seconds (e.g., `?since=90s` for logs from the last 90 seconds)\n- `from=\u003ctimestamp\u003e` - Get logs from the specified Unix timestamp in seconds (e.g., `?from=1714842000`)\n- `to=\u003ctimestamp\u003e` - Get logs until the specified Unix timestamp in seconds (requires `from` to be provided) (e.g., `?from=1714842000\u0026to=1714845600`)\n\nNote that if both `since` and `from` parameters are provided, the `from` parameter takes precedence.\n\n## Development Setup\n\nMake sure Deno is installed on your machine. You can follow the instructions [here](https://deno.land/manual/getting_started/installation) to install Deno.\n\nOnce Deno is installed, you can clone this repository and install the dependencies.\n\n```bash\ndeno install\n```\n\n## Compiling\n\nIf you want to compile the API to a single executable file, you can use the following command:\n\n```bash\ndeno task compile\n```\n\nThis will create a single executable file `docker-control` in the `./bin` directory. You can then run this file to start the API.\n\nThe compiled binary includes all the CLI features:\n\n```bash\n# Show help\n./bin/docker-control --help\n\n# Display version\n./bin/docker-control --version\n\n# Run in silent mode with log output\n./bin/docker-control --silent --log-file /var/log/docker-control.log\n```\n\n### Version Information\n\nYou can override this by setting the `DOCKER_CONTROL_VERSION` environment variable before building:\n\n```bash\nDOCKER_CONTROL_VERSION=1.2.3 deno task compile\n```\n\n## Deployment\n\n### With Systemd\n\nThe repository includes systemd configuration files for running docker-control as a service.\n\n1. First, compile the API to a single executable file:\n\n    ```bash\n    deno task compile\n    ```\n\n2. Run the provided setup script as root:\n\n    ```bash\n    sudo ./system/systemd/docker-control-setup.sh\n    ```\n\n3. Edit the environment file to set your secure token:\n\n    ```bash\n    sudo nano /etc/docker-control/environment\n    ```\n\n4. Start and enable the service:\n\n    ```bash\n    sudo systemctl enable --now docker-control\n    ```\n\n5. Check the service status:\n\n    ```bash\n    sudo systemctl status docker-control\n    ```\n\n\u003e **Note:** When running as a service, Docker Control runs in silent mode with log output directed to `/var/log/docker-control/app.log`.\n\n### With NGINX\n\n\u003e[!NOTE]\n\u003e We're using `control.[host].hivecom.net` as an example for a server in the Hivecom network. You should replace this with your own domain name.\n\nTo expose the API through NGINX with HTTPS, you can use the provided NGINX configuration file.\n\n1. Copy the NGINX configuration file to your NGINX sites directory:\n\n    ```bash\n    sudo cp ./system/nginx/control.host.hivecom.net.conf /etc/nginx/sites-available/\n    ```\n\n2. Create a symbolic link to enable the site:\n\n    ```bash\n    sudo ln -s /etc/nginx/sites-available/control.host.hivecom.net.conf /etc/nginx/sites-enabled/\n    ```\n\n3. Edit the configuration file to adjust paths and SSL settings for your environment:\n\n    ```bash\n    sudo nano /etc/nginx/sites-available/control.host.hivecom.net.conf\n    ```\n\n4. Test the NGINX configuration:\n\n    ```bash\n    sudo nginx -t\n    ```\n\n5. Reload NGINX:\n\n    ```bash\n    sudo systemctl reload nginx\n    ```\n\nNow your Docker Control API should be accessible at `https://control.host.hivecom.net` with proper SSL encryption.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhivecom%2Fdocker-control","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhivecom%2Fdocker-control","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhivecom%2Fdocker-control/lists"}