coredns-powerdns-api-wrapper deployment
This commit is contained in:
1 parent
e44eb6844a
commit
8959cabd67
4 files changed
+92
No files matched your search
@@ -1 +1,30 @@
|
||||
# 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](https://git.bjphoster.com/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>records` table. The application never creates or alters it. `CPAW_TABLE_PREFIX` must match the plugin's `table_prefix`.
|
||||
- A dedicated database user limited to the statements the service runs (`SELECT`, plus `DELETE` and `INSERT` inside one transaction per PATCH):
|
||||
```sql
|
||||
CREATE USER 'corednsapi'@'%' IDENTIFIED BY '<password>';
|
||||
GRANT SELECT, INSERT, DELETE ON `coredns`.`coredns_records` TO 'corednsapi'@'%';
|
||||
```
|
||||
|
||||
## Usage
|
||||
```sh
|
||||
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:
|
||||
```sh
|
||||
docker compose pull
|
||||
docker compose up -d
|
||||
```
|
||||
Reference in new issue
Block a user