Giter Club home page Giter Club logo

bacon's People

Contributors

jungaretti avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

bacon's Issues

Fix deploy logic

Deploy should read records from a config, diff them with existing records, create new records, and delete old records

Ignore records based on type or name

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.

Nightly integration test for Porkbun

I'd like to add an end-to-end test for Porkbun that uses bacon ping, bacon deploy, and bacon deploy -c -d to deploy some DNS records. This test would ensure that those scenarios are working properly. It would also verify that Porkbun's API is behaving as-expected.

The test should be idempotent. It can run every night with a cron-triggered action.

Common types and interfaces for client

Client code should use common types and interfaces to enable more DNS providers in the future

Clients

Bacon clients are responsible for communicating with their DNS provider.

  • Ping checks authentication config
  • GetRecords(domain) gets all records
  • CreateRecord(domain, record)
  • DeleteRecord(domain, record)

Records

Bacon records describe a DNS record in a provider-agnostic manner. All clients understand Bacon records.

  • Type
  • Host (e.g., www.borkbork.buzz)
  • Content
  • TTL
  • Priority

Question: Print from domains not in porkbun account

Any plans to support the print option from generic DNS API providers so that this could be used as a DNS migration tool?

Something like:

GET: https://networkcalc.com/api/dns/lookup/example.com

and print out the entries in the YAML format. Then that YAML could be used to deploy those DNS entries into Porkbun and this would be a great DNS migration tool!

Ignore TTL/priority of 0

It makes sense to store TTL and priority values as numbers in config files, but this means we unmarshal a value of 0 when they aren't specified. We should treat 0, "0", and "" the same way when comparing records. We should only include a numerical value for TTL and priority in requests to Porkbun if their value is above 0.

MX record priority error

๐Ÿ‘‹ I was using this script to migrate a domain but ran into this error mid-way:

Error: couldn't create record: unmarshaling JSON body: invalid character '<' looking for beginning of value Usage:

When checking in the Porkbun admin it seemed to be a faulty MX record that got created but had priority 0. After manually changing the priority from PB admin panel the script could proceed.

Here is a snippet from my yaml:

  - type: MX
    host: "x.domain.com"
    content: mxa.eu.mailgun.org.
    ttl: 600
    priority: 10

As an aside, for some reason Bacon can't seem to detect that this particular DNS entry is already created:

  - type: TXT
    host: "bun-verify.khromov.se"
    content: "127d8e80396db8b58b2f236991f5e715c5431df0763ccaef0d2edd516220308a"
    ttl: 300

Every time i re-run it it says:

./bacon deploy khromov.se.yaml --delete --create
Deleting 1 records...
- {344101976 bun-verify.khromov.se TXT 127d8e80396db8b58b2f236991f5e715c5431df0763ccaef0d2edd516220308a 600 0 }
Creating 1 records...
- {bun-verify.khromov.se TXT 0xc0000b9450 127d8e80396db8b58b2f236991f5e715c5431df0763ccaef0d2edd516220308a}
Deployment complete!

Thanks for a great tool!

Command to export existing records

It would be extremely useful if Bacon could also export records into the YAML format, making it possible to migrate records between porkbun domains! ๐Ÿท

New print command to export existing records

A new dump command would make it much easier to create config files for domains that already have many DNS records. The dump command should simply print existing records for a domain in YAML format.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.