elementary / wingpanel-indicator-network

Wingpanel Network Indicator
GNU Lesser General Public License v2.1
25 stars 14 forks source link

List Wireguard connection as possible VPN #244

Closed milouse closed 10 months ago

milouse commented 2 years ago

This MR comes as a complementary work of https://github.com/elementary/switchboard-plug-network/pull/338 to make wireguard connections first class citizens alongside more classical VPN.

Warning, in order to build this, you need an up-to-date version of libnm (myself I have 1.32.12 installed). The packaged libnm.vapi is outdated, that’s why I take the liberty to remove it from this repository. Even after removing it, the project build just fine.

This MR fixes #245

milouse commented 1 year ago

Rebased on last master and fixed all compilation warnings (not due to this MR).

milouse commented 1 year ago

Flagging it as draft as I just discover an incompatibility bug when listing both OpenVPN and Wireguard connection: When activating OpenVPN connection, the whole panel freeze and make the session crash.

milouse commented 1 year ago

Crash fixed, but another problem arised: current widget only list 1 "vpn" active connection at a time, when we can actually have several in parallel. I’ll try to fix that later.

milouse commented 1 year ago

Fixed done, now the popover allow the connection of several VPN or wireguard connection in parallel.

This MR is open again for review if one is interested?

danirabbit commented 1 year ago

Hey @milouse apologies for not looking at this sooner! It looks like this branch was touching a number of things outside of just adding wireguard support which probably made it more difficult for someone to review. For future branches try to leave things like cleaning up unrelated deprecation warnings etc for another branch 😀

If you're still interested in working on this, and want to resolve conflicts, I'd love to review it! I've been working recently on revamping VPNs and cleaning up some of the mess that was here so it should be much more straightforward to add wireguard support.

Thanks again!

milouse commented 1 year ago

Hi,

I can take time to look again on this. I’ll rebase this branch on your last developments to take them into account.

I agree this branch touch a lot of different thing, but from my point of view, that was required refactoring to improve maintenability of the whole "vpn+wireguard" set of feature. Not sure an MR just refactoring things out of the blue would have make sense for reviewer :/

danirabbit commented 1 year ago

Refactoring branches are always appreciated! The more things can be broken up into smaller chunks the easier they are to review quickly. You can always leave a description that indicates why a certain refactor makes sense for a future branch etc. I think we've all had that experience of knowing some old code needs to change so we can eventually add a new feature :)

milouse commented 1 year ago

In the next months, I’ll take time to have a fresh new looks on this, so you can expect new MR / iteration on the subject. Have a good week ! :)

milouse commented 1 year ago

@danirabbit It was finally way much easier than I thought to rebase this MR on master. This is now done, thus feel free to review when you can.

I already use it without any trouble.

milouse commented 1 year ago

(just rebased on master)

rasmus91 commented 11 months ago

I have tested this on Ubuntu 22.04 with elementary Desktop installed (and will on elementary too, and update here accordingly)

procedure to install:

git clone https://github.com/milouse/wingpanel-indicator-network
cd wingpanel-indicator-network
git switch feat-support-wireguard
meson build --prefix=/usr
cd build
ninja
sudo cp libnetwork.so /usr/lib/x86_64-linux-gnu/wingpanel/libnetwork.so
sudo chmod 644 /usr/lib/x86_64-linux-gnu/wingpanel/libnetwork.so
sudo chown root:root /usr/lib/x86_64-linux-gnu/wingpanel/libnetwork.so
killall io.elementary.wingpanel # to make the indicator reload

any wireguard connection you wish to manage this way should be set up using nm-connection-editor

On Ubuntu with elementary Desktop: It works very well, Only there's a very generic looking network notification coming up when connecting or disconnecting for the wg interface.

On elementary OS: This works even better. When disconnecting the annoying generic looking notification does not pop up (meaning that's probably an ubuntu thing I haven't gotten cleaned up on the other setup.)

zeebok commented 10 months ago

Before I merge into main, @milouse are there any more updates to get merged into this or the other repo?

tintou commented 10 months ago

Works for me!

milouse commented 10 months ago

Sorry I was in holiday. Glad it’s finally merged :) Hope it will help lot of people :)

Thank you all for reviewing/testing!