I’ve started working on a node-js library for interacting with NetworkManager via DBus. It implements some basic functionality–scanning for access points, connecting to networks, and showing the status of the ethernet/wifi adapters.
It’s definitely a work in progress; NetworkManager has loads more functionality that could be implemented (enterprise networks, cellular modems, etc.).
I assume that you went through the same process as I did in the last couple of days:
digging into DBus
trying to use it with NodeJS
finding a lot of abandoned or half-assed DBus packages for NodeJS
wondering why a basic technology like DBus has such poor support in NodeJS
starting to write your own half-assed bindings
realizing that this is way more difficult than expected (because DBus itself has very poor docs)
I’m really confused how a basic infrastructure can have such poor docs and support in common languages (Python seems to have a lot of half-assed bindings as well but at least they appear in the recommended bindings while there seems to be no recommendation for NodeJS at all).
@majorz: which language/ecosystem would be your recommendation to write a REST API that allows to configure the NetworkManager via DBus? I couldn’t find any REST API that does this via DBus and so I went down the rabbit hole and now I’m fairly frustrated about the whole thing
Lol no sweat! I had the same experience. I spent a TON of time reading through the dbus api and essentially translating parts of the python network manager dbus library into typescript. I hope my library is useful to you!
I went with dbus cause it has typescript bindings and seemed mostly work-able. But if I were making it now and knew about dbus-next, I’d use that instead
If you’re interested in collaborating, feel free to submit an MR on the repo! I’d love to have some teammates!
Thanks for the invitation TypeScript is not my thing (yet). I tried to understand your approach but didn’t get far, but this is also caused by my poor understanding of DBus and NetworkManager. For now I will try to create my own library to get a better understanding of DBus and NetworkManager. Depending on how that turns out, I might switch over to support you Right now it’s just too many new things I have to learn and TS would add another level of complexity