Sunil Mohan Adapa a1070bf319
names: Show systemd-resolved status in the names page
This improves the user experience in many ways:

- Help user understand if DNSSEC is being used on the current DNS server in case
'allow-fallback' is supported.

- Nudges the user to explore enabling DNS-over-TLS and DNSSEC.

- Help user understand how global vs. link specific configuration works. Help
user understand if a global DNS is being used.

- Show the list of fallback DNS servers being used (as this poses privacy
concerns).

Also helps with debugging in problematic situations:

- Find out which DNS server is being used (and leading to problems) and show the
cycling mechanism.

Tests:

- Enable/disable fallback DNS server in privacy app. See that fallback servers
line is only shown when enabled.

- Set various global values of DNS-over-TLS and DNSSEC and see the status
changes.

- Set various values of DNS-over-TLS in the network connection settings and see
the changes in status.

- Set DNSSEC to allow-fallback. Perform a query and see that the value of
supported/unsupported changes.

- Set DNS servers with special configuration file in
/etc/systemd/resolved.conf.d/test.conf and restart systemd-resolved. See change
in status page. Notice that if connection specific DNS server is set to an
invalid server, global section has a current DNS server.

- Set SNI domain name and port for the an IPv4 DNS and an IPv6 DNS. See that the
display is as expected.

- Raise an exception in get_status() and notice that an error alert is show
properly.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewd-by: Veiko Aasa <veiko17@disroot.org>
2024-09-07 22:58:48 +03:00

117 lines
3.4 KiB
HTML

{% extends "app.html" %}
{% comment %}
# SPDX-License-Identifier: AGPL-3.0-or-later
{% endcomment %}
{% load bootstrap %}
{% load i18n %}
{% block status %}
{{ block.super }}
<h3>{% trans "Domains" %}</h3>
<div class="table-responsive">
<table class="table names-table">
<thead>
<tr>
<th>{% trans "Type" %}</th>
<th class="names-domain-column">{% trans "Domain Name" %}</th>
<th>{% trans "Services" %}</th>
<th></th>
</tr>
</thead>
<tbody>
{% for domain in status.domains|dictsort:"domain_type.display_name" %}
<tr>
<td>{{ domain.domain_type.display_name }}</td>
<td class="names-domain-column">{{ domain.name }}</td>
<td>{{ domain.get_readable_services|join:', ' }}</td>
<td>
<a href="{% url domain.domain_type.configuration_url %}"
role="button" class="btn btn-md btn-default">
{% trans "Configure" %}
</a>
</td>
</tr>
{% endfor %}
{% for domain_type in status.unused_domain_types %}
<tr>
<td>{{ domain_type.display_name }}</td>
<td>-</td>
<td>-</td>
<td>
<a href="{% url domain_type.configuration_url %}"
role="button" class="btn btn-md btn-default">
{% trans "Configure" %}
</a>
</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
<h3>{% trans "Resolver Status" %}</h3>
{% if resolved_status %}
<div class="table-responsive">
<table class="table resolved-status-table">
<tbody>
{% for link in resolved_status %}
<tr>
<th colspan="2">
{% if link.link_index == 0 %}
{% trans "Global" %}
{% else %}
{% trans "Link" %} {{ link.link_index }} ({{link.interface_name}})
{% endif %}
</th>
</tr>
<tr>
<td>{% trans "DNS-over-TLS" %}</td>
<td>{{ link.dns_over_tls_string }}</td>
</tr>
<tr>
<td>{% trans "DNSSEC" %}</td>
<td>{{ link.dnssec_string }}/{{ link.dnssec_supported_string }}</td>
</tr>
{% if link.current_dns_server %}
<tr>
<td>{% trans "Current DNS Server" %}</td>
<td>{{ link.current_dns_server }}</td>
</tr>
{% endif %}
{% if link.dns_servers %}
<tr>
<td>{% trans "DNS Servers" %}</td>
<td>
{% for server in link.dns_servers %}
{{ server }}<br />
{% endfor %}
</td>
</tr>
{% endif %}
{% if link.fallback_dns_servers %}
<tr>
<td>{% trans "Fallback DNS Servers" %}</td>
<td>
{% for server in link.fallback_dns_servers %}
{{ server }}<br />
{% endfor %}
</td>
</tr>
{% endif %}
{% endfor %}
</tbody>
</table>
</div>
{% else %}
<div class="alert alert-danger">
{% trans "Error retrieving status:" %} {{ resolved_status_error }}
</div>
{% endif %}
{% endblock %}