Commit Graph

45 Commits

Author SHA1 Message Date
Quentin McGaw (desktop)
cf95692b93 Maint: package local narrow Logger interfaces 2021-09-23 17:06:09 +00:00
Quentin McGaw (desktop)
87f4b9e422 Docs: update maintenance document 2021-09-11 15:29:29 +00:00
Quentin McGaw (desktop)
501ae2741b Fix: FIREWALL_OUTBOUND_SUBNETS ip rules 2021-08-26 15:46:19 +00:00
Quentin McGaw (desktop)
5b75635386 Maint: fix rules equality check for nil networks 2021-08-26 14:33:51 +00:00
Quentin McGaw (desktop)
2901db3cf3 Maint: internal/routing IP rules functions
- Take in `src` as `*net.IPNet` instead of `net.IP`
- Take `dst` IP network
- Debug logged `ip rule` dynamically built
- Add unit tests for all IP rules functions
2021-08-26 13:59:43 +00:00
Quentin McGaw (desktop)
6c2a3e36b5 Maint: rename outboundsubnets.go to outbound.go 2021-08-25 19:09:42 +00:00
Quentin McGaw (desktop)
8b125e6e95 Maint: internal/routing/inbound.go file 2021-08-25 19:08:55 +00:00
Quentin McGaw (desktop)
d6659552df Maint: refactor internal/routing
- Split Go files better
- Reduce public API for exported errors
2021-08-25 17:52:05 +00:00
Quentin McGaw (desktop)
ffeeae91ab Maint: merge subnet.FindSubnetsToAdd and subnet.FindSubnetsToRemove in subnet.FindSubnetsToChange 2021-08-25 17:25:36 +00:00
Quentin McGaw (desktop)
04fad1b781 Maint: internal/subnet package 2021-08-25 17:22:48 +00:00
Quentin McGaw (desktop)
b3d8b78205 Maint: only internal/netlink depends on github.com/vishvananda/netlink 2021-08-23 21:12:28 +00:00
Quentin McGaw (desktop)
ee82a85543 Maint: internal/routing uses internal/netlink 2021-08-23 20:56:10 +00:00
Quentin McGaw (desktop)
7907146aaf Maint: rework IPIsPrivate in internal/routing 2021-08-23 20:50:50 +00:00
Quentin McGaw (desktop)
1a677ce4f7 Maint: internal/routing returns *Routine struct 2021-08-23 20:50:32 +00:00
Quentin McGaw (desktop)
bec8ff27ae Feat: OPENVPN_INTERFACE defaulting to tun0
- Fix: custom config with custom network interface name for firewall
- Keep VPN tunnel interface in firewall state
- Vul fix: only allow traffic through vpn interface when needed
- Adapt code to adapt to network interface name
- Remove outdated TUN and TAP constants
2021-08-19 23:22:55 +00:00
Quentin McGaw (desktop)
d7a6caa2ac Maint: routing interface composition 2021-07-26 16:18:53 +00:00
Quentin McGaw (desktop)
94b60d9f70 Maint: firewall and routing use logger.Debug
- Remove SetVerbose and SetDebug from both
- Log routing teardown
- Default logging level set to info
2021-07-23 18:20:18 +00:00
Quentin McGaw (desktop)
b23eb8f29d Maint: prefer empty string comparison 2021-07-23 17:39:38 +00:00
Quentin McGaw (desktop)
3c44214d01 Maint: pass only single strings to logger methods
- Do not assume formatting from logger's interface
- Allow to change golibs in the future to accept only strings for logger methods
2021-07-23 17:36:08 +00:00
Quentin McGaw (desktop)
400affe429 Maintenance: add revive linter 2021-06-20 16:12:39 +00:00
Quentin McGaw
7d6763cde7 Maintenance: upgrade golibs (affects logger) 2021-05-14 14:07:16 +00:00
Quentin McGaw
1cb93d76ed Feature: only teardown routing if changes occurred 2021-05-10 22:16:26 +00:00
Quentin McGaw
810ff62c26 Maintenance: improve error codes in IP routing 2021-05-10 17:33:31 +00:00
Michael Robbins
69f9461bcd Fix: restricting route listing to IPv4 only (#419) 2021-04-11 08:50:59 -04:00
Michael Robbins
8230596f98 Feature: uplift the 'localSubnet' concept to cover all local ethernet interfaces (#413) 2021-04-09 13:08:20 -04:00
Quentin McGaw
c54ee71e1d Maintenance: new logging, shorter with less deps 2021-02-25 23:51:29 +00:00
Quentin McGaw
43e140e6cc Fix linting errors 2021-02-06 17:16:58 +00:00
Quentin McGaw
7ca9d445f1 Maintenance: package comments 2021-02-06 16:26:23 +00:00
Quentin McGaw
b5fb2b849a DOT listens on all interfaces, refers to #281 2020-11-04 03:14:27 +00:00
Quentin McGaw
db64dea664 Fix #273 (#277), adding FIREWALL_OUTBOUND_SUBNETS 2020-10-29 19:23:44 -04:00
Quentin McGaw
c64fe7e45d Routing: use 0.0.0.0/0 instead of nil 2020-10-25 20:41:09 +00:00
Quentin McGaw
a062135148 Add routing verbose option in code 2020-10-25 20:40:17 +00:00
Quentin McGaw
ed4fcc17b3 Routing improvements (#268)
- Fixes #82 
- Remove `EXTRA_SUBNETS`
- Remove no longer needed iptables rules
- Reduce routing interface arity
- Routing setup is done in main.go instead of in the firewall
- Routing setup gets reverted at shutdown
2020-10-24 18:05:11 -04:00
Quentin McGaw
ea3b3bc8a3 Netlink Go library to interact with IP routes (#267) 2020-10-22 18:55:28 -04:00
Quentin McGaw
9c73faaaeb Add linters and fix lint issues 2020-10-20 02:45:28 +00:00
Quentin McGaw
ec157f102b PIA nextgen portforward (#242)
* Split provider/pia.go in piav3.go and piav4.go
* Change port forwarding signature
* Enable port forwarding parameter for PIA v4
* Fix VPN gateway IP obtention
* Setup HTTP client for TLS with custom cert
* Error message for regions not supporting pf
2020-10-12 10:55:08 -04:00
Quentin McGaw
f95f6201b1 Rename repo to Gluetun, refers to #112 2020-07-26 12:07:06 +00:00
Quentin McGaw
0fc69e068e FIREWALL_DEBUG variable, refers to #190, #194 2020-07-13 02:14:56 +00:00
Quentin McGaw
6afa4f69a0 Fix routing reading issues
- Detect VPN gateway properly
- Fix local subnet detection, refers to #188
- Split LocalSubnet from DefaultRoute (2 different routes actually)
2020-07-12 19:05:48 +00:00
Quentin McGaw
b1596bc7e4 Firewall refactoring
- Ability to enable and disable rules in various loops
- Simplified code overall
- Port forwarding moved into openvpn loop
- Route addition and removal improved
2020-07-11 21:03:55 +00:00
Quentin McGaw
e33a6a8503 Fix #170 2020-06-05 19:32:12 -04:00
Quentin McGaw
e805d42197 Updated dependencies 2020-04-19 18:13:48 +00:00
Quentin McGaw
768147095f Golangcilint in build pipeline and fix lint errors
- Fix bad permissions bits for files
- VPNSP is 'private internet access' instead of 'pia' (retro compatible)
- Check errors of deferred unsetEnv functions in params package
-  Other lint errors fixing and code simplifications
2020-04-12 20:05:28 +00:00
Quentin McGaw
d42de99879 Updated golibs and using gomock+mockgen for tests 2020-04-12 18:09:46 +00:00
Quentin McGaw
3ac3e5022c IP_STATUS_FILE and routing improvements (#130)
- Obtains VPN public IP address from routing table
- Logs and writes VPN Public IP address to `/ip` as soon as VPN is up
- Obtain port forward, logs it and writes it as soon as VPN is up
- Routing fully refactored and tested
- Routing reads from `/proc/net/route`
- Routing mutates the routes using `ip route ...`
2020-04-12 08:55:13 -04:00