Skip to content

Conversation

@fallsjo
Copy link

@fallsjo fallsjo commented Dec 26, 2024

  • Now supports individual keys for different NS servers.
  • Updates will only be sent to known NS servers.

Linked Items

Fixes #

Description

Refactor the existing nsupdate code so that it supports different sig keys for different servers.
Updates will only be attempted if the name server is know (in the configuration settings)

Behaviour changes

Old: The code assumes you use the same tsig-key for all name servers, and it will send updates to any server using the same key.

New: The update allows (force) you to configure tsig-keys for each name server that you want to be able to send updates to.

Category

This is related to a:

  • Bugfix
  • Feature
  • Packaging
  • Docs
  • Code Quality
  • Refactoring
  • Miscellaneous

Tests

  • Unit-Tests were created
  • System-Tests were created
  • Code is already covered by Unit-Tests
  • Code is already covered by System-Tests
  • No tests required

* Now supports individual keys for different NS servers.
* Updates will only be sent to known NS servers.
@fallsjo
Copy link
Author

fallsjo commented Dec 29, 2024

I'm unsure how to handle the migration/schema update that this pull-request contain.

If it needs to be handled differently please let me know how, or if there is any developer references available.

@SchoolGuy
Copy link
Member

Thanks for your contribution! This is not a small change, so I'd like to have an issue that describes the issue/feature request that you are trying to fix.

In regard to your question: The library we are using for schema validation is schema. There is no dedicated developer guide sadly. What I can tell you is that all migrations need to be done inside the method migrate and that it migrates from version x-1 to version x.

Furthermore, these are changes that need to be tested, so if you have the resources I'd love if you could add a test case that shows that the code works as written.

@fallsjo
Copy link
Author

fallsjo commented Jan 29, 2025 via email

@SchoolGuy
Copy link
Member

SchoolGuy commented Jan 29, 2025

Thanks for you efforts also on this PR. Setting up a mock DNS server is possible via a supervisord unit, for your unit-tests this shouldn't be needed though. Just try to validate that the configuration file contains a piece of text that you expect. What you are attempting to do is part of the much more complicated integration testsuite.

An example of a migration of optional parameters is not found because optional parameters are not present per default in the settings. Since in your case there is no migration to be done due to a missing relationship of zone and currently assigned key (if I understand correctly), you can just drop the old key inside the method migrate:

helper.key_delete("example", settings)

Starting with version 3.4.0 we have no default values present in the settings file anymore, as such there is no need to add new keys.

@SchoolGuy SchoolGuy moved this from Todo to Pull Requests in Cobbler Server Aug 18, 2025
@SchoolGuy SchoolGuy added this to the v3.3.8 milestone Aug 18, 2025
@SchoolGuy SchoolGuy self-requested a review August 18, 2025 11:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Pull Requests

Development

Successfully merging this pull request may close these issues.

2 participants