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

Improve DNS SEC Public key information display #3676

Merged
merged 1 commit into from Jun 12, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
17 changes: 10 additions & 7 deletions bin/v-list-dnssec-public-key
Expand Up @@ -42,19 +42,21 @@ is_object_valid 'dns' 'DOMAIN' "$domain"
json_list() {
echo '{'
echo ' "'$DOMAIN'": {
"RECORD": "'$record'",
"FLAG": "'$flag'",
"ALGORITHM": "'$algorithm'",
"KEY": "'$key'",
"DS":"'$ds'"
"RECORD": "'$record'",
"KEYTAG": "'$keytag'",
"FLAG": "'$flag'",
"ALGORITHM": "'$algorithm'",
"KEY": "'$key'",
"DS":"'$ds'"
}'
echo '}'
}

# SHELL list function
shell_list() {
echo "RECORD: $record"
echo "DS: $DS"
echo "DS: $ds"
echo "KEYTAG: $keytag"
echo "FLAG: $flag"
echo "ALGORITHM: $algorithm"
echo "KEY: $key"
Expand All @@ -77,10 +79,11 @@ parse_object_kv_list $(grep "DOMAIN='$domain'" $USER_DATA/dns.conf)

if [ -n "$KEY" ]; then
record=$(cat "/var/cache/bind/K$domain_idn.+013+$KEY.key" | grep DNSKEY)
ds=$(dnssec-dsfromkey "/var/cache/bind/K$domain_idn.+013+$KEY.key")
keytag=$(echo "$ds" | cut -d' ' -f4)
flag=$(echo "$record" | cut -d' ' -f5)
algorithm=$(echo "$record" | cut -d' ' -f7)
key="$(echo "$record" | cut -d' ' -f8) $(echo "$record" | cut -d' ' -f9)"
ds=$(dnssec-dsfromkey "/var/cache/bind/K$domain_idn.+013+$KEY.key")
fi

case $format in
Expand Down
14 changes: 13 additions & 1 deletion web/templates/pages/list_dns_public.php
Expand Up @@ -89,10 +89,22 @@
</div>
<div class="l-unit animate__animated animate__fadeIn js-unit">
<div class="l-unit__col l-unit__col--right">
<div class="clearfix l-unit__stat-col--left u-text-center u-pt10"><b><?= _("Key Tag / Flag") ?></b></div>
<div class="clearfix l-unit__stat-col--left u-text-center u-pt10"><b><?= _("Key Type / Flag") ?></b></div>
<div class="clearfix l-unit__stat-col--left wide-3"><b><input type="text" class="form-control" value="<?php echo $flag; ?>"></b></div>
</div>
</div>
<div class="l-unit animate__animated animate__fadeIn js-unit">
<div class="l-unit__col l-unit__col--right">
<div class="clearfix l-unit__stat-col--left u-text-center u-pt10"><b><?= _("Key Tag") ?></b></div>
<div class="clearfix l-unit__stat-col--left wide-3"><b><input type="text" class="form-control" value="<?php echo $data[$domain]["KEYTAG"]; ?>"></b></div>
</div>
</div>
<div class="l-unit animate__animated animate__fadeIn js-unit">
<div class="l-unit__col l-unit__col--right">
<div class="clearfix l-unit__stat-col--left u-text-center u-pt10"><b><?= _("Flag") ?></b></div>
<div class="clearfix l-unit__stat-col--left wide-3"><b><input type="text" class="form-control" value="<?php echo $data[$domain]["FLAG"]; ?>"></b></div>
</div>
</div>
<div class="l-unit animate__animated animate__fadeIn js-unit">
<div class="l-unit__col l-unit__col--right">
<div class="clearfix l-unit__stat-col--left u-text-center u-pt10"><b><?= _("Algorithm") ?></b></div>
Expand Down