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

Implement Network Settings for Ubuntu Core - closes #3155 #3168

Open
wants to merge 18 commits into
base: master
Choose a base branch
from

Conversation

benfrancis
Copy link
Member

@benfrancis benfrancis commented Sep 13, 2024

Closes #3155

This PR implements a back end for network settings which works inside a snap running on Ubuntu or Ubuntu Core. It configures network settings using NetworkManager via its DBus API.

Previously all the Platform methods were synchronous but this introduces optional asynchronous versions of those methods.

The snap will require the network-manager and system-observe snap interfaces, which must be connected in order for it to work.

I will squash these commits before merging but have kept the commit log for now.

@benfrancis benfrancis changed the title WIP: Implement Network Settings for Ubuntu Core - closes #3155 Implement Network Settings for Ubuntu Core - closes #3155 Oct 25, 2024
@benfrancis
Copy link
Member Author

I think I've been working on this long enough that I should probably get someone to start reviewing it! Sorry this is such a huge patch but it made sense to do it all in one go.

@tim-hellhake I would value your input on this if you have time to review, if not let me know and I will try to find someone.

Note that the build is currently failing in CI because the dbus npm package needs libdbus to build (libdbus-1-dev apt package on Debian-based distros). I'm not exactly sure where to add that in the GitHub Action. Maybe https://github.com/WebThingsIO/gateway/blob/master/.github/workflows/build.yml#L33 ? But I feel like apt packages may be installed somewhere else as well.

If you want to give this a test drive then it should work on Ubuntu Deskop if you build from source locally as normal (need to apt install libdbus-1-dev first).


Generating a snap package from this branch to test on Ubuntu Desktop is a bit more involved but if you want to try it:

  • Install snapcraft
  • Edit snapcraft.yaml to change the "source" of each "part" to "." so that it builds from the local source instead of GitHub master
  • $ snapcraft
  • $ snap install --dangerous webthings-gateway_2.0.0_amd64.snap
  • $ snap connect webthings-gateway:system-observe
  • $ snap connect webthings-gateway:network-manager
  • $ snap restart webthings-gateway

The snap currently runs on port 8080 by default.

The same snap should run on Ubuntu Core on the same architecture.

@benfrancis benfrancis marked this pull request as ready for review October 25, 2024 17:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Snap] Implement Network Settings
1 participant