1.5 KiB
1.5 KiB
coredns-powerdns-api-wrapper Deployment
PowerDNS Authoritative API subset used by acme.sh dns_pdns, backed by the records table of the CoreDNS mysql plugin: source/coredns-powerdns-api-wrapper.
Every /api/v1 call requires X-API-Key. /healthz is an unauthenticated check that pings MySQL; /version reports the running version. The binary starts as root and drops to PUID/PGID itself, so the compose sets no user:. It keeps no local state and needs no volume.
Requirements
- MySQL or MariaDB holding the plugin's
<prefix>recordstable. The application never creates or alters it.CPAW_TABLE_PREFIXmust match the plugin'stable_prefix. - A dedicated database user limited to the statements the service runs (
SELECT, plusDELETEandINSERTinside one transaction per PATCH):
CREATE USER 'corednsapi'@'%' IDENTIFIED BY '<password>';
GRANT SELECT, INSERT, DELETE ON `coredns`.`coredns_records` TO 'corednsapi'@'%';
Usage
cp env.example .env
# edit .env
docker compose up -d
MYSQL_DSN is built from the CPAW_DB_* variables. Wrap CPAW_DB_PASSWORD in single quotes in .env if it contains $, otherwise Compose interpolates it.
acme.sh connects with PDNS_Url=https://pdnsapi.example.com, PDNS_ServerId set to CPAW_PDNS_SERVER_ID and PDNS_Token set to CPAW_PDNS_API_KEY.
Update
Set CPAW_VERSION in .env, then:
docker compose pull
docker compose up -d