add nodeid and use hostname as cname#6
add nodeid and use hostname as cname#6T0biii wants to merge 1 commit intoFreifunk-Rhein-Neckar:masterfrom
Conversation
|
At a quick glance i don't think possible duplicates are handled suffiently well. What if a node has the name of another ones nodeid? Also not sure wheter there has to be a check and handling for duplicate nodeid's. Further i'll have to think about wheter i even like the idea of merging two diffrent namespaces. My first thought would be that it should probably be a subdomain. For example like so: But not convinced either way. One a more genereal level i think having the nodeid's somewhere is helpfull. Thanks for taking a look at it! :) |
|
thanks for the quick response. |
|
Also there probably should be a check regarding the integrity of the nodeid. That there is one, that it's the correct amount of characters ... Not sure how well yanic does input/output validation. I've just recently seen a community's mehshviewer.json where the dot in the long- and latitude was missing. So something like 492143232 rather then 49.2143232 which is quite obviously not a valid value. |
|
with .id this look something like this for node in nodes:
for address in node.addresses:
lines.append(LINE_TPL.format(name=f"{node.nodeid}.id", type="AAAA", data=address))
if(node.hostname != node.nodeid):
lines.append(LINE_TPL.format(name=node.hostname, type="CNAME", data=f"{node.nodeid}.id"))
hostname_list.append(node.hostname)
else:
lines.append(LINE_TPL.format(name=node.nodeid, type="CNAME", data=f"{node.nodeid}.id"))
hostname_list.append(node.nodeid)
hostname_list.append(f"{node.nodeid}.id")but sure more integrity check would also be very good as we also had recently some problems with e.g. withspaces |
|
The "id" subdomain" should then also probably be appended to the "NOTALLOWED" config option. Even if it's not strictly neccesary ... The gist is that I don't want to trust user input and want to prevent breakage and misuse as much as possible. |

closes #5