WebThingsIO / gateway

WebThings Gateway - a self-hosted web application for monitoring and controlling a building over the web
http://webthings.io/gateway
Mozilla Public License 2.0
2.61k stars 339 forks source link

RFE: Add support for configuring network options using NetworkManager using the dbus API #1639

Open nullr0ute opened 5 years ago

nullr0ute commented 5 years ago

The majority of mainstream distributions use NetworkManager for WiFi and other network configuration. It allows configuration using a well documented API over dbus which abstracts all the various distribution backends away from the Things Gateway, as well as allowing configuration by a standard user, or to run in a constrained container with access to the dbus.

It would also allow changing the WiFi backends (wpa_supplicant, iwd etc) without having to changing any code.

It support connecting to wired, wireless as well as configuring a WiFi AP (#895).

It would also integrate well for issues like #1596 and integrate well with #423

dbus API is well documented: https://developer.gnome.org/NetworkManager/stable/spec.html https://developer.gnome.org/NetworkManager/stable/nm-dbus-types.html

nullr0ute commented 5 years ago

As requested by @kgiori for Fedora IoT context.

benfrancis commented 5 years ago

Hi @nullr0ute,

What exactly is it you want to do with this? Is the idea that you want network settings to work across both Raspbian and Fedora with the same implementation?

For 2019 our main focus is going to be OpenWrt, which uses ubus by default. However, as long as we continue to support Raspbian there may be some reason to do this.

nullr0ute commented 5 years ago

@benfrancis well I'm focused on Fedora but it would make it much easier to use across generic distributions. I've been working with @kgiori so you might want to sync with her.

kgiori commented 5 years ago

@nullr0ute - indeed a platform agnostic approach to network config seems best for Fedora. while Mozilla's IoT team is looking at doing this for ubus on OpenWrt, any chance someone from your team can propose a solution for dbus? or point me where to look for similar open source solutions to a project like this?

mrstegeman commented 5 years ago

This should now be possible by adding a new platform here: https://github.com/mozilla-iot/gateway/tree/master/src/platforms

kgiori commented 5 years ago

@mrstegeman to add a new "platform", do you mean define them by distro, such as linux-debian, linux-fedora, ... ?

mrstegeman commented 5 years ago

Yes. That’s how things are currently set up.