Commit Graph

91 Commits

Author SHA1 Message Date
Stanislas Lange 71c317bf91
Add support for custom AllowedIPs
Close https://github.com/angristan/wireguard-install/pull/375

Co-authored-by: legale <32621719+legale@users.noreply.github.com>
2023-01-22 16:21:12 +01:00
Stanislas Lange d36a6459a3
Don't auto remove dependencies when uninstalling
Fix https://github.com/angristan/wireguard-install/issues/301
2023-01-22 15:44:37 +01:00
Stanislas Lange c97e3cc6b3
Handle IPv6 format for server endpoint
Fix https://github.com/angristan/wireguard-install/issues/352
2023-01-22 15:25:13 +01:00
Stanislas Lange 0a612774ac
Create client: fix check for existing IP and name
Fix https://github.com/angristan/wireguard-install/issues/371
2023-01-22 12:30:06 +01:00
Stanislas Lange 77185dcdf8
Add more colors + warning to reboot on install
Might help for https://github.com/angristan/wireguard-install/issues/377
2023-01-22 12:18:42 +01:00
Stanislas Lange 3c7c8535d0
Set Cloudflare as default DNS
Might help https://github.com/angristan/wireguard-install/issues/377
2023-01-22 12:12:06 +01:00
Stanislas Lange d02b753677
Add colors to uninstall warning 2023-01-22 12:11:35 +01:00
Stanislas Lange 2f7e346767
Fix Ubuntu detection 2023-01-22 12:11:19 +01:00
Stanislas Lange 5b483ecb89
Fix support for CentOS, Rocky and AlmaLinux
Fix https://github.com/angristan/wireguard-install/pull/253
Fix https://github.com/angristan/wireguard-install/issues/374
Fix https://github.com/angristan/wireguard-install/issues/231
2023-01-22 12:02:44 +01:00
Stanislas Lange 258eb9441b
Overwrite existing file when creating client 2023-01-22 10:55:56 +01:00
Stanislas Lange 424a92d1e0
Add more warnings for uninstall option
Fix https://github.com/angristan/wireguard-install/pull/176
2023-01-22 10:45:15 +01:00
Stanislas Lange 7565f26b5d
Fix removal of client config 2023-01-22 10:41:55 +01:00
turbozapekanka 444a0f87fb
Fix firewall for Oracle cloud VMs (#334) 2023-01-22 10:30:32 +01:00
Elie Obeid 0a405eb03e
Added listClients which lists all the wireguard profile names (#312)
Co-authored-by: Stanislas Lange <git@slange.me>
2023-01-22 10:22:49 +01:00
Xavier Le Vourch 7a1b3c04ed
Typos and rewordings (#346) 2023-01-22 10:15:58 +01:00
Xavier Le Vourch 99a199ffa5
AlmaLinux support added (#345) 2022-11-21 18:55:18 +01:00
Stanislas Lange 193fe396a1
Remove trailing space 2022-10-16 22:01:08 +02:00
Hasan Aga f895b55058
remove default char "n" from uninstall step (#370) 2022-10-16 21:59:16 +02:00
Stanislas 842361bc6e Update supported versions 2021-11-12 17:33:29 +01:00
Anatolii Cherednichenko 616e123e6f
Added support for Oracle Linux 8 (#269)
https://www.wireguard.com/install/#oracle-linux-8-uek6-tools
2021-11-12 17:31:39 +01:00
Ravinou e05e633014
Better IPv4 detection (#278)
On some systems like Hetzner VM cloud i have a Point-to-Point interface so i have a peer address on the same line as my public IPv4 (look at peer here : https://linux.die.net/man/8/ip )

An example of `ip a` with peer is : 
```
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
    link/ether 96:00:00:a2:88:c2 brd ff:ff:ff:ff:ff:ff
    altname enp0s3
    inet XX.XX.XX.XX peer XX.XX.XX.XX/32 brd XX.XX.XX.XX scope global eth0
       valid_lft forever preferred_lft forever
    inet6 fe80::9400:ff:fea2:88c2/64 scope link 
       valid_lft forever preferred_lft forever
```

With a peer, the output of the command line 74 is : `XX.XX.XX.XX peer XX.XX.XX.XX`

I just modify this line with awk to print only the first field which is always the IPv4.
I think it's correct and it's work like a charm when there is a peer or not now. But tell me if it's not good for you :)

Thanks for your work !
2021-10-15 18:13:06 +02:00
Andréi Pampukha 5f4c2f8a38
Fix installation on Raspbian systems (#271)
Co-authored-by: Andrei Pampukha <andrei.pampukha@citynetwork.eu>
Co-authored-by: Stanislas <stanislas.lange@pm.me>
2021-10-03 14:59:40 +02:00
Mikodev 574cc06b31
Add support for Debian 11 Bullseye (#262) 2021-08-22 11:34:08 +02:00
Filipe Melo 9bce7d6e82
Add hot reloading (#181) 2021-04-27 22:44:29 +02:00
enolp b7855925e6
Remove unneeded packages on Arch Linux (#225) 2021-04-27 22:40:13 +02:00
Stanislas Lange 5c41fa0ab5
Be very explicit when WireGuard is not running 2021-03-18 14:31:30 +01:00
Stanislas Lange bd37d606f1
Improve IP parsing (fix #204) 2021-03-18 14:03:25 +01:00
Stanislas 9fae7ad587
Fix HOME_DIR check (#194)
Fix #189
2021-03-10 22:14:50 +01:00
Patrick M 21b5e56eea
Fix unnecessary reinstall of packages (#172) 2021-01-02 00:41:13 +01:00
glenn wolfe 88ae1c0d0f
Update AdGuard default public DNS addresses (#162)
- Since September 2020, AdGuard public DNS servers have moved to new
  address. See here - https://adguard.com/en/blog/adguard-dns-new-addresses.html
2020-12-08 10:54:17 +01:00
Julian Gaal af935850cd
Forbid interface names exceeding 15 chars in length (#157) 2020-11-24 15:33:39 +01:00
randomshell a1b1ac2ece
Add confirmation before removing WireGuard (#156) 2020-11-14 01:47:36 +01:00
Stefan A 664b6dca17
Add forwarding eth0 -> wg0 (#132)
If the FORWARD chain policy defaults to DENY, it must explicitly allow traffic from the external to the wg interface.
To solve this, the patch just adds
 iptables -A FORWARD -i ${SERVER_PUB_NIC} -o ${SERVER_WG_NIC} -j ACCEPT;
2020-10-10 15:50:42 +02:00
Stanislas Lange ddbaca7fbb
centos: update installation process
From https://www.wireguard.com/install/. Using kmod instead of dkms. Seems to work without reboot now.

Close #118 #111 #147
2020-10-10 15:49:18 +02:00
Farzin Monsef 487aa4feda
arch: Install LTS kernel headers when running LTS kernel (#135) 2020-10-10 14:42:19 +02:00
xiagw 8cdb0c5968
remove duplicate if -d /etc/debian_version (#136) 2020-09-21 09:01:12 +02:00
Aleksander 2125b67cd7
Updated client name input restrictions and hint 2020-08-05 21:16:03 +03:00
randomshell d7523dc30e Fix reboot message 2020-08-04 10:50:59 +00:00
Stanislas Lange 2848ceefa5
Remove PPA removal for Ubuntu
An oversight from https://github.com/angristan/wireguard-install/pull/109
2020-08-04 12:20:27 +02:00
Stanislas Lange 2363b36735
Shellcheck: move excludes to action env 2020-08-03 17:47:31 +02:00
Stanislas Lange f147518050
Ubuntu: remove PPA, use native packages
Fix #108
2020-08-03 17:06:03 +02:00
Stanislas Lange 4138ada539
Format with shfmt 2020-08-03 16:26:29 +02:00
randomshell 1923aa17e6
Add clientRevoke() and improve addClient() (#94)
Added `clientRevoke()` based on openvpn-install repo, fixes #4 

Some other changes were required for this to work:
- client names aren't random anymore
- client names are saved above the `[Peer]` block of the server configuration file to keep track of them
- checks added for existing IPv4, IPv6 and client name. I used `until` to ask the user again if this is the case to not make him loose its work if, for example, the client name and IPv4 inserted are unique but not the IPv6.
  - using `until` instead of `exit` isn't idempotent but it's more user friendly. This will be a future goal.
- default options should be safe to use so the suggestion for the client IP is automatically incremented. The subnet of `SERVER_WG_IPV` is hard-coded inside `CLIENT_WG_IPV` for obvious reasons
2020-08-03 16:24:43 +02:00
Navratan Gupta 40cc13b1f4
Add uninstall feature (#88)
Fix #2 

Co-authored-by: Stanislas Lange <stanislas.lange@pm.me>
Co-authored-by: randomshell <randshell@protonmail.com>
2020-07-31 15:53:05 +02:00
Stanislas Lange 31bee45429
Format with shfmt 2020-07-31 15:02:26 +02:00
randomshell 5f82b76bc0
Refactor script (#92)
- cleaned some minor code
- use IPv6 if IPv4 isn't available
- add input validations, fixes #86 .
  - assign secondary DNS to primary DNS value if it's empty. Fixes #68 
- use `$SERVER_WG_IPV4` and `$SERVER_WG_IPV6` when suggesting the client IP
- save user DNS to `params` file and apply it to all clients, removing support for customizing DNS for individual clients. If this is a problem we can add again the code to allow customization but maybe use the sourced DNS as a suggestion for clients that need a different one
- add shellcheck ignores, needed for IDE that have shellcheck support
- escaped variables to `"${var}"` style
- updated README to reflect changes
- fixed the kernel mismatch issue on CentOS by updating the kernel https://github.com/angristan/wireguard-install/issues/95#issuecomment-653696198. Fedora might need this change too
- Use `firewall-cmd` only if `firewalld` is running. Fixes #95 
- Fix the client's subnet mask. Fixes #87 
- Save the client configuration in the correct `$HOME`. Fixes #96 

Co-authored-by: Chris Lewicki <chris@lewicki.dev>
Co-authored-by: Stanislas <angristan@pm.me>
2020-07-31 14:59:20 +02:00
Stanislas c9b01e8d62
Merge pull request #106 from angristan/debian-backports
Fix Debian installation: use backports
2020-07-30 11:33:43 +02:00
Stanislas Lange 6e518633f3
Fix Debian installation: use backports
And limit to Debian 10. Fix #101
2020-07-29 12:24:22 +02:00
Ian dfd7736a7d
Add colon 2020-07-27 11:54:06 +02:00
randomshell e04fa5356d
Change check for previously installed wireguard 2020-06-26 18:38:29 +00:00