ffnord / mesh-announce

Discussion at #mesh-announce:irc.hackint.org and (separately) at
https://matrix.to/#/!MjLIHcALOcENXZWQlH:irc.hackint.org/$1547640760901FmKaD:matrix.eclabs.de
13 stars 45 forks source link

[FEATURE] Add Provider for domain_code #55

Closed margau closed 4 years ago

margau commented 4 years ago

This PR adds a provider for domain_code, which allows to display the domain of the gateway inside meshviewer etc. Example usage: https://map.ffm.freifunk.net/#!/de/map/aaff04000802

rubo77 commented 4 years ago

Sieht gut aus, ist einfacher als wenn man bei jedem Gateway einzeln die Domain in den alias.json eintragen muss

TobleMiner commented 4 years ago

I'd suggest this solution: https://github.com/ffnord/mesh-announce/compare/master...TobleMiner:feature-domain-name?expand=1

Please test and leave feedback.

margau commented 4 years ago

The "is_enabled" flag seems to be broken at the moment:


  File "/opt/mesh-announce/providers/__init__.py", line 145, in call  
    if source.is_enabled(env):  
AttributeError: 'Source' object has no attribute 'is_enabled'```

Thanks for the improvements!
TobleMiner commented 4 years ago

Ah, my fault. Need to proxy the call through the Source object. Should be fixed now. Please try again.

margau commented 4 years ago

Test without and with the Gateway-Option was successfull, everything okay from my side.

TobleMiner commented 4 years ago

Just tested it as well. Seems to work fine.

TobleMiner commented 4 years ago

Merged, thanks for the PR!

herbetom commented 4 years ago

Is there an option to set the domain_code without starting multiple instances (in a multi-domain Setup)?

From the README.md this seems to be the way to start mesh-announce for a multi-domain site: respondd.py -d /opt/mesh-announce/providers -i meshvpn-one -i br-one -i bat-one -b bat-one -i meshvpn-two -i br-two -i bat-two -b bat-two -i meshvpn-three -i br-three -i bat-three -b bat-three

As far as i can see, it is only possible to specify a single -n <domain code>?

TobleMiner commented 4 years ago

Hm, right. That is kind of required. However currently it is not possible.

It's actually an option that would probably need to be attached to the -i option again. Please make a separate issue for that. Makes it easier to track it.