WireGuard

UUID: wireguard@nicoulaj.net
Last edited:
11 months ago 2023-05-18, 00:42
Last commit: [b27db728] French translations for various applets (#4857)

Enable/disable WireGuard connections.

Log In To Comment!

12 Comments

ziogref
ziogref-2 months ago
Probably again for just future me, Make sure the following packages are installed apt install wireguard wireguard-tools resolvconf
pzim
pzim-1 year ago
For not entering the password every times you want to connect or disconnect, replace in ~/.local/share/cinnamon/applets/wireguard@nicoulaj.net/applet.js 'pkexec' by 'sudo' line 123 : replace : ``` ['pkexec', 'wg-quick', enable ? 'up' : 'down', iface], ``` by : ``` ['sudo', 'wg-quick', enable ? 'up' : 'down', iface], ``` Then in sudo visudo add this line : with no empty line : ``` # Allow members of group sudo to execute any command %sudo ALL=(ALL:ALL) ALL YOUR_USER_NAME ALL=(ALL) NOPASSWD: /usr/bin/wg-quick # See sudoers(5) for more information on "@include" directives: ``` Replace YOUR_USER_NAME by your username or ALL ######################## The config files need to be in /etc/wireguard/ (e.g /etc/wireguard/wg0.conf) as @ziogref said And you must let access for reading to your username to the folder wiregard ######################## Finnaly restart Cinnamon to make it works
Pablo Gutierrez
Pablo Gutierrez-9 months ago
In the text # Allow members of group sudo to execute any command %sudo ALL=(ALL:ALL) ALL YOUR_USER_NAME ALL=(ALL) NOPASSWD: /usr/bin/wg-quick # See sudoers(5) for more information on "@include" directives: I should only place my username where it says YOUR_USER_NAME? or do i need to replace it where it says ALL as well?
pzim
pzim-1 year ago
- To let reading access for your username to the folder wiregard : sudo chmod o+r /etc/wireguard - To restart Cinnamon : ( Alt+F2, type r and hit enter)
pzim
pzim-1 year ago
And thank you to @nicoulaj for this usefull applet ;-) If you want to import NordVPN's Wireguard's conf files : https://gist.github.com/bluewalk/7b3db071c488c82c604baf76a42eaad3?permalink_comment_id=4189557#gistcomment-4189557 https://github.com/sfiorini/NordVPN-Wireguard
ziogref
ziogref-1 year ago
Wireguard config files need to be in /etc/wireguard/ (e.g /etc/wireguard/wg0.conf) Probably for future me, but this is where the plugin looks for the wireguard profiles.
oleole39
oleole39-1 year ago
Hello, glad to find this! Would you consider adding an option enabling to launch a given config automically at startup ?
johsoderi
johsoderi-4 years ago
I couldn't get this to work either, but If you only have one vpn you can use the applet "Bash Sensors" instead. Since wg-quick needs sudo, I added the following line with visudo: ALL ALL=(root) NOPASSWD: /usr/bin/wg-quick Warning: This is a huge security risk! Since wg_quick a bash script, you're giving root access to anyone who can edit it. I used these settings for Bash Sensors: - Refresh interval: 10 sec - Shell: sh - Command 1: echo '' - Two-line mode: Off - Dynamic icon: On - Cmd: ls /sys/class/net | grep <wg config name> > /dev/null && echo "<path to On icon>" || echo "<path to Off icon>" Note: PNG's can be used for icons. These are the ones I used: https://findicons.com/files/icons/1933/symbols/128/green_light.png https://findicons.com/files/icons/1933/symbols/128/red_light.png - Dynamic tooltip: On - Cmd: ls /sys/class/net | grep <wg config name> > /dev/null && echo "<wg config name>: UP" || echo "<wg config name>: DOWN" - Menu command (on applet left-click): ls /sys/class/net | grep <wg config name> > /dev/null && sudo wg-quick up <wg config name> || sudo wg-quick down <wg config name> - Display output: Off My config for the lazy (~/.cinnamon/configs/bash-sensors@pkkk/45.json): https://pastebin.com/KqQQNcJc
johsoderi
johsoderi-4 years ago
I can't find any way to edit my comment, but the "Menu command (on applet left-click)" part is wrong. It should be: "ls /sys/class/net | grep <wg config name> && sudo wg-quick down <wg config name> || sudo wg-quick up <wg config name>". The file on pastebin is updated, you can import it by clicking the "hamburger" icon and import. Then fix the icon paths and change all instances of "integrity_vpn" to the name of your WireGuard config.
nicoulaj
nicoulaj-2 years ago
Can you try latest version and file an issue at https://github.com/nicoulaj/cinnamon-applet-wireguard if it does not work ?
Michael Parker
Michael Parker-4 years ago
Hello everytime my kernel updates your extension breaks it seems it has to do with the name of the updated file i was wondering if you can update this applet to detect those changes
nicoulaj
nicoulaj-2 years ago
What distribution do you use ? Anyway wireguard is a kernel module, so after a kernel update you need to reboot or at least reload it, it depends on how it is handled on your distribution. But I guess the extension could detect this situation and show a proper error, please file an issue at https://github.com/nicoulaj/cinnamon-applet-wireguard