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

fix null values for unconfigured vpn-providers #84

Closed AiyionPrime closed 1 year ago

AiyionPrime commented 2 years ago

resolves #83

This is not yet tested at all, but a mere draft on what syntax I'd prefer.

Using the colon as a seperator mirrors the colon in dicts. The changes in the __ini__.py use everything before the first colon as key and treat everything after that as values. values must all be in the keys configured values.

tibet is a regular key as before, it must exist and its assigned value must not be None.

tibet:lama wants tibet to exist like before, but the assigned value must contain lama.

tibet:dalai:lama wants tibet to exist like before, but requires both values dalai and lama to be configured in tibet.

A Config line that fulfils the last requirement:

tibet = dalai,lama

another one:

tibet = lama,dalai

and a negative example:

tibet = unrelated,lama

Sidenote: all three config-lines above fulfil tibet:lama.

AiyionPrime commented 2 years ago

This one would resolve #83.

AiyionPrime commented 2 years ago

I'm currently running this on harvester.ffh.zone. If someone could verify this is working as intended, I'd be grateful.

AiyionPrime commented 2 years ago

@TobleMiner What do you think about the chosen approach?

This has been running on one of our machines without problems since Monday. The resulting data can be read using curl -s http://harvester.ffh.zone/cgi-bin/dyn/neighbours-nodeinfo?mesh_fastd_10 | head -n2 and successfully feeds the rightmost of the three columns on http://harvester.ffh.zone.

PS: obviously this is fully backwards compatible.

herbetom commented 2 years ago

@AiyionPrime Maybe just squash those commits and add a resolves #83 so that the issues is automatically closed once this get's merged.

AiyionPrime commented 2 years ago

@AiyionPrime Maybe just squash those commits and add a resolves #83 so that the issues is automatically closed once this get's merged.

Done. Thanks again for reviewing!

herbetom commented 2 years ago

@TobleMiner is there a reason this wasn't merged?

maurerle commented 1 year ago

I am also using this without any issues. Would be good to merge this!