fix local mode being enabled when no keys in ~/.dnsvi/default #9

Merged
heiko merged 3 commits from fix-local into master 2025-11-26 13:26:31 +01:00
Member

If no key files are found in ~/.dnsvi/default/, dnsvi forcibly enabled local mode, but this is undesirable when a key is specified via the -k option.

Instead enable local mode only if no keys were found, and no key is specified.

If no key files are found in `~/.dnsvi/default/`, dnsvi forcibly enabled local mode, but this is undesirable when a key is specified via the `-k` option. Instead enable local mode only if no keys were found, **and** no key is specified.
heiko requested review from heiko 2025-11-25 15:15:25 +01:00
heiko requested changes 2025-11-25 16:17:49 +01:00
Dismissed
bin/dnsvi Outdated
@ -24,3 +24,2 @@
local => undef,
key => (grep { -f } glob "$ENV{HOME}/.dnsvi/default/*key")[0]
// (undef, local => 1),
key => (grep { -f } glob "$ENV{HOME}/.dnsvi/default/*key")[0] // undef,
Owner

We should implement a way to specify the key location directly. E.g.:

  • implict in .dnsvi/... if used w/o / in the key file name
  • explicit in the filesystem, if the key file name contains /
We should implement a way to specify the key location *directly*. E.g.: - implict in `.dnsvi/...` if used w/o `/` in the key file name - explicit in the filesystem, if the key file name contains `/`
Author
Member

@heiko wrote in #9 (comment):

We should implement a way to specify the key location directly. E.g.:

* implict in `.dnsvi/...` if used w/o `/` in the key file name

* explicit in the filesystem, if the key file name contains `/`

The value passed to -k is a normal, cwd-relative path. So I'm not sure what you mean? The grep { -f } ... construct tries to find a default key to use if no -k flag is used.

@heiko wrote in https://forgejo.schlittermann.de/IUS/dnsvi/pulls/9#issuecomment-2806: > We should implement a way to specify the key location _directly_. E.g.: > > * implict in `.dnsvi/...` if used w/o `/` in the key file name > > * explicit in the filesystem, if the key file name contains `/` The value passed to `-k` is a normal, cwd-relative path. So I'm not sure what you mean? The `grep { -f } ...` construct tries to find a *default* key to use if no `-k` flag is used.
Owner

You're right. Never we had an "implicit" key directory.

You're right. Never we had an "implicit" key directory.
heiko marked this conversation as resolved
Owner

bekommen wir da bis donnerstag eine neue version hin? hab herrn lumme gesagt das wir möglicherweise bis donnerstag den fehler behoben haben könnten

bekommen wir da bis donnerstag eine neue version hin? hab herrn lumme gesagt das wir möglicherweise bis donnerstag den fehler behoben haben könnten
heiko requested review from sf 2025-11-26 13:01:42 +01:00
heiko approved these changes 2025-11-26 13:02:29 +01:00
heiko merged commit 4207ed7483 into master 2025-11-26 13:26:31 +01:00
heiko deleted branch fix-local 2025-11-26 13:26:41 +01:00
heiko referenced this pull request from a commit 2025-11-26 16:18:54 +01:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
3 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
IUS/dnsvi!9
No description provided.