{"id":41329496,"url":"https://github.com/karrots/mikrotik-certbot","last_synced_at":"2026-01-23T06:13:12.341Z","repository":{"id":319776463,"uuid":"1069453481","full_name":"karrots/mikrotik-certbot","owner":"karrots","description":"Deploy hook for use with certbot allowing deployment of certificates to RouterOS devices.","archived":false,"fork":false,"pushed_at":"2025-10-20T04:14:47.000Z","size":77,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-12-01T16:27:08.453Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/karrots.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,"notice":null,"maintainers":null,"copyright":null,"agents":"AGENTS.md","dco":null,"cla":null}},"created_at":"2025-10-04T01:06:14.000Z","updated_at":"2025-10-26T17:31:25.000Z","dependencies_parsed_at":null,"dependency_job_id":"3f919249-2fc5-4a07-ab2f-de209c55bc91","html_url":"https://github.com/karrots/mikrotik-certbot","commit_stats":null,"previous_names":["karrots/mikrotik-certbot"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/karrots/mikrotik-certbot","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/karrots%2Fmikrotik-certbot","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/karrots%2Fmikrotik-certbot/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/karrots%2Fmikrotik-certbot/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/karrots%2Fmikrotik-certbot/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/karrots","download_url":"https://codeload.github.com/karrots/mikrotik-certbot/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/karrots%2Fmikrotik-certbot/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28682090,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-23T05:48:07.525Z","status":"ssl_error","status_checked_at":"2026-01-23T05:48:07.129Z","response_time":59,"last_error":"SSL_read: 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":[],"created_at":"2026-01-23T06:13:11.751Z","updated_at":"2026-01-23T06:13:12.337Z","avatar_url":"https://github.com/karrots.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# mikrotik-certbot\n\nA Certbot deploy-hook tool that uploads renewed Let’s Encrypt certificates to MikroTik RouterOS devices and applies them to services. It is idempotent and non‑destructive: imports under a versioned name, applies to targets, then prunes older unreferenced certificates.\n\nWhy not just use the built in ACME support?\n- EAB authentication is broken in ROS 7.20 and lower.\n- Router may not have access to the Internet\n- Renewal of services like hotspot not supported by the built in ACME service. \n\n## Contents\n- [mikrotik-certbot](#mikrotik-certbot)\n  - [Contents](#contents)\n  - [Highlights](#highlights)\n  - [Prerequisites](#prerequisites)\n  - [Initial Setup (Certbot deploy hook)](#initial-setup-certbot-deploy-hook)\n  - [Application Flow](#application-flow)\n  - [More Documentation](#more-documentation)\n  - [Developer Workflows](#developer-workflows)\n  - [License \\\u0026 Authors](#license--authors)\n\n## Highlights\n- Versioned, collision‑safe certificate naming (UTC `YYYYMMDDThhmm`, `_SEQ` suffix when needed)\n- REST upload on RouterOS ≥ 7.17; SFTP fallback otherwise, then REST import\n- Applies to `www-ssl`, `api-ssl`, and optional Hotspot profiles\n- Strict gating (`MIKROTIK_DOMAIN` must be in `RENEWED_DOMAINS`), `DRY_RUN` support\n\n## Prerequisites\n- Python `3.11+` and `uv` installed\n- Certbot on the host that renews the certificate\n- MikroTik RouterOS reachable over HTTPS (REST); SFTP enabled only if supporting fallback\n- A RouterOS user with access to files/certificates/services\n\n## Initial Setup (Certbot deploy hook)\n1) Install `uv` if needed: `curl -LsSf https://astral.sh/uv/install.sh | sh`\n2) Download the hook directly (no repository clone required). Replace the example URL with the raw file URL for this repo:\n```sh\nsudo curl -fsSL \"https://raw.githubusercontent.com/karrots/mikrotik-certbot/refs/heads/main/deploy-hook.sh\" -o /etc/letsencrypt/renewal-hooks/deploy/mikrotik-certbot.sh\n```\n3) Edit the following variables in the downloaded `/etc/letsencrypt/renewal-hooks/deploy/mikrotik-certbot.sh` file:\n    - `MIKROTIK_DOMAIN`: your FQDN (must appear in `RENEWED_DOMAINS`)\n    - `ROUTER_HOST`: e.g., `router.example.net:8443`\n    - `ROUTER_USER` / `ROUTER_PASS`: least‑privilege credentials for RouterOS access\n4) Verify with a dry‑run: `sudo certbot renew --dry-run --deploy-hook /etc/letsencrypt/renewal-hooks/deploy/mikrotik-certbot.sh`\n5) If multiple hosts need certificates duplicate the `deploy-hook.sh` as needed.\n\nSee `docs/config.md` for all configuration options and behavior toggles.\n\n## Application Flow\nThe hook exits early unless `MIKROTIK_DOMAIN` is present in `RENEWED_DOMAINS`. It derives a versioned, collision‑safe certificate name and detects RouterOS capabilities to pick REST upload or SFTP fallback. The combined PEM (privkey + fullchain) is uploaded, then imported without removing any existing same‑name certificate first. The new certificate is applied to `www-ssl`, `api-ssl`, and any configured Hotspot profiles. After a real import completes, older unreferenced certificates are pruned, keeping the newest two.\n\n## More Documentation\n- Configuration: `docs/config.md`\n- Usage: `docs/usage.md`\n- RouterOS Permissions: `docs/permissions.md`\n\n## Developer Workflows\n- Sync dev deps: `uv sync --group dev`\n- Run: `uv run mikrotik-certbot`\n- Lint: `uv run --group dev ruff check .`\n- Types: `uv run --group dev mypy .`\n- Tests: `uv run --group dev pytest`\n- Build: `uv build`\n\n## License \u0026 Authors\n- License: MIT (see `LICENSE`)\n- Author: Jonathan Karras\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkarrots%2Fmikrotik-certbot","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkarrots%2Fmikrotik-certbot","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkarrots%2Fmikrotik-certbot/lists"}