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

feat: faster and simpler DNS checks, better ip-address determination #346

Merged
merged 20 commits into from
Jul 8, 2024

Conversation

hpk42
Copy link
Contributor

@hpk42 hpk42 commented Jul 7, 2024

shrinks and streamlines the DNS-checking code to use 'execnet' which allows to execute python functions remotely.

  • DNS-checking is much faster as the ssh-connection is re-used, and there are much fewer roundtrips.

  • Instead of parsing the output of the "ip" command this PR uses a standard python "socket" pattern to determine IPV4 and IPV6 addresses. This is likely less dependent on the target enviroment, so could also work better with non-debian systems.

  • DNS checking now gives progress indicators (use -v|--verbose to see commands executed remotely)

@link2xt
Copy link
Contributor

link2xt commented Jul 8, 2024

Instead of parsing the output of the "ip" command this PR uses a standard python "socket" pattern to determine IPV4 and IPV6 addresses. This is likely less dependent on the target enviroment, so could also work better with non-debian systems.

Can we remove checking PTR records completely? See #336
Then there is no need to determine IP address which is not reliable anyway even with the new method: the host may not know its external IP address, this address may change in the future etc.

@hpk42
Copy link
Contributor Author

hpk42 commented Jul 8, 2024

Can we remove checking PTR records completely? See #336 Then there is no need to determine IP address which is not reliable anyway even with the new method: the host may not know its external IP address, this address may change in the future etc.

we could probably remove the ip-address detection but
it's useful to at least check that the IP addresses A/AAAA records have reverse PTR records.
I'd suggest to do this in a separate PR though.

cmdeploy/src/cmdeploy/sshexec.py Outdated Show resolved Hide resolved
@hpk42 hpk42 merged commit 85bb301 into main Jul 8, 2024
5 checks passed
@hpk42 hpk42 deleted the hpk/fast-ssh branch July 8, 2024 18:10
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.

None yet

2 participants