jungaretti / bacon

Deploy your DNS records from YAML config files to Porkbun
GNU General Public License v3.0
12 stars 1 forks source link

Ignore records based on type or name #17

Open jungaretti opened 1 year ago

jungaretti commented 1 year ago

Bacon needs to offer the option to ignore records based on their type or name. Porkbun recently updated their API to return NS nameserver records. Furthermore, they rotate _acme-challenge.example.com records regularly.

Output of bacon deploy

Would delete 6 records:
- {263350200 jungaretti.com NS curitiba.porkbun.com 86400  }
- {263350203 jungaretti.com NS fortaleza.porkbun.com 86400  }
- {263350205 jungaretti.com NS maceio.porkbun.com 86400  }
- {263350206 jungaretti.com NS salvador.porkbun.com 86400  }
- {263350208 _acme-challenge.jungaretti.com TXT nStUIY7ccq-47CEgzHa8rBnfirueLxVRaLjpXcdinSg 600  }
- {263350209 _acme-challenge.jungaretti.com TXT XN05LMcknvIkobS1q3GF4m11zL2dtVT7T043K_zxAyc 600  }
Would create 2 records:
- { _acme-challenge.jungaretti.com TXT Kb6-nJirHoqvIqzbzKklBaXrbmqxbLav77qO0o1BFPY 600  }
- { _acme-challenge.jungaretti.com TXT J4Qs_IAv-pH5RMFZ64pI50SL-t21Tq6WHkycp6BExjc 600  }
Mock deployment complete

This is bad. Bacon wants to delete the 4 NS records and revert the _acme-challenge.jungaretti.com records.

jungaretti commented 1 year ago

This is fixed in v1.1. It's not a generic fix, but it unblocks Bacon: https://github.com/jungaretti/bacon/blob/v1.1/pkg/providers/porkbun/api/api.go#L91-L113