Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Brings DNSControl up to date along with some new features #118

Open
wants to merge 13 commits into
base: main
Choose a base branch
from

Conversation

plttn
Copy link

@plttn plttn commented Nov 9, 2024

Few things here:

  • Updates DNSControl to the latest version (as 3.31.4 came out quite a while ago)
  • Improves the output of the preview to remove color codes, resulting in there not being color codes in the preview comment (without disabling color for the action logs)
  • switches it to use concurrent as that's about to be the default.

Personal bugbear that isn't a huge deal:

With concurrent mode on, the preview looks like this:

CONCURRENTLY gathering 1 zone(s)
SERIALLY gathering 2 zone(s)
Serially Gathering: "example.org"
Serially Gathering: "example.net"
Waiting for concurrent gathering(s) to complete...DONE
******************** Domain: example.com
******************** Domain: example.net
******************** Domain: example.org
2 corrections (porkbun)
#1: + CREATE example.org A 1.1.1.1 ttl=600
#2: + CREATE demo.example.org A 1.1.1.1 ttl=600
Done. 2 corrections.

With concurrent off, it looks like this:

******************** Domain: example.com
******************** Domain: example.net
******************** Domain: example.org
2 corrections (porkbun)
#1: + CREATE example.org A 1.1.1.1 ttl=600
#2: + CREATE demo.example.org A 1.1.1.1 ttl=600
Done. 2 corrections.

I couldn't quite figure out how to get grep to drop those first few lines, but feel free to amend the PR if you can get it sorted.

Comment on lines 6 to +9
grep -v -e '\.\.\. (skipping)' |\
grep -v -e '^----- DNS Provider: ' |\
grep -v -e '^----- Registrar: ' |\
grep -v -e '^----- Getting nameservers from:'
grep -v -e '^----- Getting nameservers from:' | \

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The grep -v statements can be removed. Those are only output if the --full flag is used, which it isn't.

@@ -6,4 +6,6 @@ grep -v -e '^\.\.\.0 corrections$' |\
grep -v -e '\.\.\. (skipping)' |\
grep -v -e '^----- DNS Provider: ' |\
grep -v -e '^----- Registrar: ' |\
grep -v -e '^----- Getting nameservers from:'
grep -v -e '^----- Getting nameservers from:' | \
sed -r "s/\x1B\[([0-9]{1,3}(;[0-9]{1,2};?)?)?[mGK]//g" # remove ANSI color codes

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of the sed, you can use ``--no-color` (it goes before the "preview" or "push" verb).

I would also add:

  • --reportmax=0 -- be less verbose

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The reason I implemented it like this was so that colors still worked in the action log, but weren't commented in the PR.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah! makes sense.

(it's a shame that whoever added the -p flag to col didn't also strip escape sequences)

@SukkaW
Copy link

SukkaW commented Jan 15, 2025

@plttn It seems that the dnscontrol-action is no longer maintained. Would you like to take over and maintain it? I am more than happy to use your fork instead!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants