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

Emit primary_domain_code via respondd #2027

Closed
wants to merge 9 commits into from

Conversation

lemoer
Copy link
Member

@lemoer lemoer commented May 16, 2020

Implements #1974

Copy link
Member

@neocturne neocturne left a 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.

package/libgluonutil/src/libgluonutil.c Outdated Show resolved Hide resolved
package/libgluonutil/src/libgluonutil.c Outdated Show resolved Hide resolved
package/libgluonutil/src/libgluonutil.c Outdated Show resolved Hide resolved
package/libgluonutil/src/libgluonutil.c Outdated Show resolved Hide resolved
@lemoer
Copy link
Member Author

lemoer commented May 16, 2020

@NeoRaider Updated and tested.

@lemoer
Copy link
Member Author

lemoer commented May 16, 2020

I added the field to the staus-page aswell.

@neocturne
Copy link
Member

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.

@lemoer
Copy link
Member Author

lemoer commented May 16, 2020

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 bat12 = "Domäne 12" for the primary domains. Having yet another source of truths is cumbersome here.

@mweinelt
Copy link
Contributor

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.

@mweinelt
Copy link
Contributor

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:

**Domain**
Darmstadt: Waldkolonie (dom4)

@lemoer
Copy link
Member Author

lemoer commented May 16, 2020

@mweinelt Good idea! I implemented it like this.

@mweinelt
Copy link
Contributor

Live @ https://[2001:67c:2ed8:1001:e695:6eff:fe41:f7a0]/cgi-bin/status

@rotanid rotanid added the 0. type: enhancement The changeset is an enhancement label May 18, 2020
@lemoer
Copy link
Member Author

lemoer commented May 21, 2020

@NeoRaider done.

if (errno != EINVAL)
return NULL;

primary_domain_code = basename(domain_path);
Copy link
Member

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.

@neocturne
Copy link
Member

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.
@lemoer
Copy link
Member Author

lemoer commented May 21, 2020

Oh, sorry. I fixed this.

@neocturne
Copy link
Member

Thanks! I squashed the fixups and merged this.

@neocturne neocturne closed this May 21, 2020
@lemoer lemoer deleted the pr_primary_domain branch February 17, 2023 00:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0. type: enhancement The changeset is an enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants