{"id":29100621,"url":"https://github.com/dimo414/porkbun-cert-fetch","last_synced_at":"2025-08-19T23:09:12.823Z","repository":{"id":297890024,"uuid":"998215747","full_name":"dimo414/porkbun-cert-fetch","owner":"dimo414","description":"Fetcher for LetsEncrypt SSL certs from Porkbun","archived":false,"fork":false,"pushed_at":"2025-07-16T07:53:48.000Z","size":8,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-07-25T03:48:42.450Z","etag":null,"topics":["bash","docker","docker-compose","letsencrypt","letsencrypt-certificates","letsencrypt-utils","porkbun","porkbun-api","ssl","ssl-certificates"],"latest_commit_sha":null,"homepage":"","language":"Shell","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/dimo414.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-06-08T05:42:26.000Z","updated_at":"2025-07-16T07:53:52.000Z","dependencies_parsed_at":null,"dependency_job_id":"f3826051-441c-40db-8344-d2bd63d4ae77","html_url":"https://github.com/dimo414/porkbun-cert-fetch","commit_stats":null,"previous_names":["dimo414/porkbun-cert-fetch"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/dimo414/porkbun-cert-fetch","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dimo414%2Fporkbun-cert-fetch","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dimo414%2Fporkbun-cert-fetch/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dimo414%2Fporkbun-cert-fetch/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dimo414%2Fporkbun-cert-fetch/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dimo414","download_url":"https://codeload.github.com/dimo414/porkbun-cert-fetch/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dimo414%2Fporkbun-cert-fetch/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":271236280,"owners_count":24723978,"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","status":"online","status_checked_at":"2025-08-19T02:00:09.176Z","response_time":63,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["bash","docker","docker-compose","letsencrypt","letsencrypt-certificates","letsencrypt-utils","porkbun","porkbun-api","ssl","ssl-certificates"],"created_at":"2025-06-28T18:37:17.702Z","updated_at":"2025-08-19T23:09:12.808Z","avatar_url":"https://github.com/dimo414.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Porkbun SSL Certificate Fetcher\n\nUtility to fetch\n[wildcard LetsEncrypt SSL certificates from Porkbun-registered domains](https://porkbun.com/products/ssl)\nusing their API.\n\nIf the certificates already exist on disk they are not overwritten, enabling downstream tools to check the file modtime\nto determine when to reload.\n\n## Usage\n\n```\nporkbun-cert-fetch [--destination DIR] [--force] [--node_exporter_textfile_dir DIR] domain ...\n```\n\nYou will need to enable Porkbun API access for the domain(s) you intend to query, and then provide the API and secret\nkeys via the environment variables `API_KEY` and `SECRET_API_KEY`, respectively.\n\n* `--destination`                 Specify the directory to write the certificates to, defaults to ~/.ssl\n* `--force`                       Overwrite local files even if the contents have not changed\n* `--node_exporter_textfile_dir`  Specify a directory to write Prometheus metrics to, for publishing via node_exporter\n\n## Docker Compose\n\nAlthough the utility can be run directly and has minimal dependencies (`curl`, `jq`), it can be convenient to run inside\na container or with Docker Compose.\nA [container is provided with this repository](http://ghcr.io/dimo414/porkbun-cert-fetch), but it's particularly\nconvenient to use Docker Compose to specify the configuration you'd like to run. For example:\n\n```\nservices:\n  porkbun-cert-fetch:\n    image: ghcr.io/dimo414/porkbun-cert-fetch:main\n    container_name: porkbun-cert-fetch\n    user: 1000:1000  # set this to write the files as a non-root owner\n    environment:\n      API_KEY: [API KEY]\n      SECRET_API_KEY: [SECRET API KEY]\n      NODE_EXPORTER_TEXTFILE_DIR: /var/lib/node_exporter/textfile_collector\n    command:\n      - '--destination'\n      - '/ssl'\n      - 'yourdomain.com'\n      - 'anotherdomain.dev'\n    volumes:\n      - '~/.ssl:/ssl'\n      - '/var/lib/node_exporter/textfile_collector:/var/lib/node_exporter/textfile_collector'\n```\n\nThis writes the certificate files to `~/.ssl` on the host (mounted as `/ssl` in the container) as the specified user.\nUse `id -u` and `id -g` to see your UID/GID assuming that is the user you'd like to run as.\n\nThe `NODE_EXPORTER_TEXTFILE_DIR` variable and `/var/lib/node_exporter/textfile_collector` mount are optional, and only\nneeded if you want to monitor this script with Prometheus.\n\nThis is intended to be executed with [`docker compose run`](https://docs.docker.com/reference/cli/docker/compose/run/)\nvia `cron`. There are other ways to schedule Docker tasks, such as [Ofelia](https://hub.docker.com/r/mcuadros/ofelia),\nhowever for simple tasks like this cron is likely sufficient.\n\n```\n# Fetch LetsEncrypt SSL certs from Porkbun\n2 30 1,15 * * docker compose --project-directory /path/to run --rm porkbun-cert-fetch\n```\n\nYou can also use [`task-mon`](https://github.com/dimo414/task-mon) to monitor the run with healthchecks.io:\n\n```\n# Fetch LetsEncrypt SSL certs from Porkbun\n2 30 1,15 * * /usr/local/bin/task-mon --uuid [...] --detailed -- docker compose --project-directory /path/to run --rm porkbun-cert-fetch\n```\n\n# Credits\n\nThanks to https://github.com/corey-braun/porkbun-api-bash for the idea / inspiration. All code in this repository is my\nown, but it was a helpful reference.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdimo414%2Fporkbun-cert-fetch","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdimo414%2Fporkbun-cert-fetch","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdimo414%2Fporkbun-cert-fetch/lists"}