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

Validate settings #349

Open
kurahaupo opened this issue Nov 15, 2023 · 0 comments
Open

Validate settings #349

kurahaupo opened this issue Nov 15, 2023 · 0 comments

Comments

@kurahaupo
Copy link
Contributor

Validate the fields and give warnings when validations fail.

In particular:

  • validate the hostname field by looking in the DNS for an A or AAAA record.
    • give a warning
    • on a device with no routable IPv6 address, give a warning if the hostname has no A record,
    • on a device with no routable IPv4 address, give a warning if the hostname has no AAAA record
  • validate the port number field as being a positive 16-bit integer (between 1 and 65535).

Among other things, this will detect the case where people try to put a URI instead of a hostname (as exemplified by #328).


Future enhancement: also permit a name that (when prefixed by _irc._tcp. or _ircs._tcp) has a DNS SRV record. (This would require additional logic when connecting.)

These give a list of priority, weight, hostname, port tuples:

$ dig +short srv _irc._tcp.example.chat.
 1 100 6667 loadbalancer.irc.example.chat.
 2  20  194 host1.irc.example.chat.
 2  80  194 bighost.irc.example.chat.
 3 100 7000 fallback.irc.example.chat.
$ dig +short srv _ircs._tcp.example.chat.
 1 100 6697 loadbalancer.irc.example.chat.
 2  40 6697 host1.irc.example.chat.
 2  20 6697 host2.irc.example.chat.
 2  20 6697 host3.irc.example.chat.
 2  20 6697 host4.irc.example.chat.
 3 100 7001 fallback.irc.example.chat.
$ dig +short srv _irc._tcp.libera.example.lookaside.
 1   1 6667 irc.libera.chat.
$ dig +short srv _ircs._tcp.libera.example.lookaside.
 1   1 6697 irc.libera.chat.
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

No branches or pull requests

1 participant