-
Notifications
You must be signed in to change notification settings - Fork 325
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
Emit primary_domain_code via respondd #2027
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! I've added a few comments.
@NeoRaider Updated and tested. |
I added the field to the staus-page aswell. |
IMO this is too technical for the status page. It is only interesting for software that wants to group nodes by their actual mesh domain, independently of the user-visible domain name, but it should not be shown to the user. |
In theory, I would agree with you. But in practice it happens very often that you want to know the underlying layer 2 network. E.g. if you want to go to the gateway server and figure out which bat device you have to look at. In our setup, we have the scheme |
IMO adding it to the status page is a benefit, since we otherwise hide important technical details from users. The real domain name is a good indicator if whether two nodes in different "pretty name"-domains can mesh with each other. |
But please don't make it a separate value, just add it as a detail to the already existing domain field. Maybe something like this:
|
@mweinelt Good idea! I implemented it like this. |
Live @ https://[2001:67c:2ed8:1001:e695:6eff:fe41:f7a0]/cgi-bin/status |
@NeoRaider done. |
if (errno != EINVAL) | ||
return NULL; | ||
|
||
primary_domain_code = basename(domain_path); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, I guess we could just return domain_code
in this branch after all if we move the free
below this point.
The following lines could be moved out of the else
branch then.
It seems you have accidentally pushed a few unrelated commits into this branch. |
Implemented using readlink() and basename() to the selected domain in /lib/gluon/domains/${DOMAIN}.json.
Implements freifunk-gluon#1974 Situation: ========== $ ls -l /lib/gluon/domains/lindennord.json lrwxrwxrwx 1 root root 10 Jan 6 03:42 /lib/gluon/domains/lindennord.json -> dom17.json Before: ======= $ gluon-neighbour-info -d ::1 -p 1001 -r nodeinfo -c 1 { "node_id": "525400123456", "system": { "domain_code": "lindennord", "site_code": "ffh" }, ... } After: ====== $ gluon-neighbour-info -d ::1 -p 1001 -r nodeinfo -c 1 { "node_id": "525400123456", "system": { "primary_domain_code": "dom17", "domain_code": "lindennord", "site_code": "ffh" }, ... }
This reverts commit c76e08cad06f7d5b5dd109441f444f926ab9f2b0.
Oh, sorry. I fixed this. |
Thanks! I squashed the fixups and merged this. |
Implements #1974