Open SmithChart opened 2 years ago
Could you test, whether this occurs with builds with a recent gluon? (after the merge of https://github.com/freifunk-gluon/gluon/pull/2322?)
e.g. our nightly: https://build.ffh.zone/job/gluon-nightly/ws/download/images/sysupgrade/
Thank! I will give it a spin and will get back to you.
Nevertheless you and neoraider are right, the input should forbid too long inputs.
There are various length limits we could consider:
Labels in dns-names (the part between dots) are not supposed to be longer than 63 characters. This is our current limit.
NetBIOS is even stricter; I think that was the reason you could not name windows PCs longer than 15 characters. (Have not used Windows in a while, quite possible that's no longer a restriction)
In hanover there are various routers with a descriptive name like "UFU-FWH-A273-Mecklenheide-Buero" (31 chars).
I think 15 would be too short, any other length suggestions @neoraider?
I think it would suffice to use the 63 character limit and make the wizard, as well as pretty-hostname respect it.
edit the setup-mode does import the lua implementation of pretty-hostname
Not sure whether there are parallels to hostnamectl --pretty
but as an excerpt its pretty hostname does not limit the length to anything below even 400 chars:
Note that the pretty hostname has little restrictions on the characters and length used, while the static and transient hostnames are limited to the usually accepted characters of Internet domain names, and 64 characters at maximum (the latter being a Linux limitation).
Maybe the cleanest would be to leave it untouched then, but partly revert or alter https://github.com/freifunk-gluon/gluon/commit/7e0075584de98f3fbad5694b2ceeffac5b215301#diff-1a84d4504bf1020582522dcad02ba53c32f4c261f0fa5d36280ce524049642bdR82 (I don't like that approach too much and already can hear utf-n fans crying)
I check the hostname length for our domains and the majority is below 30 characters but there are a few with up to 50 characters.
This is the command I used to run a quick check on our Meshviewer data.
curl -s https://map.freifunk-mwu.de/data/nodelist.json | jq -r '.nodes[].name' | awk '{print length}' | sort -n | uniq -c
I think one of the following options to solve this would make sense:
Note that this doesn't only apply to the node name, but to all user-defined data (like the contact field, which is currently also unlimited). A limit of 100 characters might be good enough.
e.g. our nightly: https://build.ffh.zone/job/gluon-nightly/ws/download/images/sysupgrade/
Tested the behavior on:
Gluon version / Site version: v2021.1-265-gbb25f35 / vH20-34-gd6ce7f4
Firmware release: vH21.N20220220
Now gluon-neighbour-info -i lo -d ::1 -r nodeinfo
returns valid JSON with the very long hostname.
That's good to see, thanks for testing it. Yet neoraider is right about the unneccessary length.
One can discuss the visualization in the meshviewer, but it works to have 126 char names, which I think is enough for all sane cases. I think this issue can be closed..?
Bug report
What is the problem? During our weekly meetup a community member reported that a node did not show up on our map. We investigated the issue and traced it back to respondd.
Steps to reproduce: 1) Flash a router with a fresh gluon installation. 2) Get yourself a really long string as a hostname, eg. using
curl https://gluon.readthedocs.io/en/latest/ | base64 | xclip -selection c -i
. 3) Use this string as the name of the new node in the config mode wizard. 4) After reboot we will find the following config inuci
:5) The node will not show up on the communities map. 6) If we query respndd on the node itself we will see the following:
(The missing end of the json-string is not a copy-and-paste error. There is simply something missing.) I assume that the broken JSON-object here is the reason the nodes do not show up on the map.
We do not expect respondd to work with such long pretty-hostnames - there not really a point in having such name :-D But we would expect the input field in the wizard to prevent a user from doing so.
What is the expected behaviour? The input field should limit the input to something sane, e.g. 100 chars. The field is defined in
./package/gluon-config-mode-hostname/luasrc/lib/gluon/config-mode/wizard/0100-hostname.lua
. And there is already a limit set - but this limit is the minimal length. And as far as I can see there is no way to add a upper limit at the same time.I am not really sure how to go about this. Do you know a simple way to limit the length in the input field? Should respondd take care of this?
Gluon Version: Tested with Freifunk Braunschweig: Gluon v2020.2.3 + Site https://gitli.stratum0.org/ffbs/ffbs-site/-/commit/f5ab2d55f7d47db2a91ab16f84503afdf88a59a7 And tested with Freifunk Nord: Gluon v2021.1.x + Site https://git.ffnw.de/ffnw-firmware/siteconf/-/compare/20210915...rc%2F20211030
Thanks! Chris