Quentin McGaw
920ad8b54b
chore(errors): review all errors in codebase
2022-02-20 02:58:16 +00:00
Quentin McGaw
7d824a5179
chore(settings): refactor settings processing ( #756 )
...
- Better settings tree structure logged using `qdm12/gotree`
- Read settings from environment variables, then files, then secret files
- Settings methods to default them, merge them and override them
- `DNS_PLAINTEXT_ADDRESS` default changed to `127.0.0.1` to use DoT. Warning added if set to something else.
- `HTTPPROXY_LISTENING_ADDRESS` instead of `HTTPPROXY_PORT` (with retro-compatibility)
2022-01-06 06:40:23 -05:00
Quentin McGaw (desktop)
e7c952cbf7
Maint: remove opendns.com due to bad x509 cert
2021-09-30 16:01:35 +00:00
Quentin McGaw (desktop)
cf95692b93
Maint: package local narrow Logger interfaces
2021-09-23 17:06:09 +00:00
Quentin McGaw (desktop)
d39201f9b3
Fix: public IP loop deadlock
2021-09-10 22:54:02 +00:00
Quentin McGaw (desktop)
6b6caa435f
Fix: clear IP data when VPN is stopped
2021-09-06 13:28:05 +00:00
Quentin McGaw (desktop)
f9cb71027c
Feat: location data at /v1/publicip/ip
2021-09-05 22:54:10 +00:00
Quentin McGaw (desktop)
b98f2456c0
Fix: deadlock for openvpn, dns and publicip loops
2021-07-27 14:12:22 +00:00
Quentin McGaw (desktop)
ab910403c6
Fix: public IP loop being stuck
2021-07-26 01:35:43 +00:00
Quentin McGaw (laptop)
8105437815
Maint: add missing interface compilation checks
2021-07-24 19:54:15 +00:00
Quentin McGaw (laptop)
7b20cec035
Maint: rename SettingsGetterSetter to SettingsGetSetter
2021-07-24 19:49:50 +00:00
Quentin McGaw (laptop)
8d512852a4
Maint: rework publicip package
...
- Use loopstate package
- Loop interface composition
- Return concrete struct from constructors
- Split into more files
- Add publicip/state package
2021-07-24 19:49:11 +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)
21f4cf7ab5
Maint: do not mock os functions
...
- Use filepaths with /tmp for tests instead
- Only mock functions where filepath can't be specified such as user.Lookup
2021-07-23 16:06:19 +00:00
Quentin McGaw (desktop)
0ed738cd61
Maint: make all set status context aware
2021-07-16 00:49:59 +00:00
Quentin McGaw (desktop)
876563c492
Maintenance: improve error wrapping
2021-05-30 16:14:08 +00:00
Quentin McGaw (desktop)
be22c8547f
Maintenance: use io instead of ioutil if possible
2021-05-30 03:13:19 +00:00
Quentin McGaw
7d6763cde7
Maintenance: upgrade golibs (affects logger)
2021-05-14 14:07:16 +00:00
Quentin McGaw
cff5e693d2
Maintenance: shutdown order
...
- Order of threads to shutdown (control then tickers then health etc.)
- Rely on closing channels instead of waitgroups
- Move exit logs from each package to the shutdown package
2021-05-11 22:24:32 +00:00
Quentin McGaw
a7a5cca8dd
Maintenance: parallelize IP information fetch
2021-05-08 23:37:32 +00:00
Quentin McGaw
d9a70fd094
Maintenance: improve publicip with Result struct
2021-05-08 23:30:29 +00:00
Quentin McGaw
c54ee71e1d
Maintenance: new logging, shorter with less deps
2021-02-25 23:51:29 +00:00
Quentin McGaw
3deb65b529
Feature: log out country, region and city of IP
2021-02-08 00:01:14 +00:00
Quentin McGaw
b1f1f94a76
Maintenance: remove some type aliases
2021-02-06 18:31:14 +00:00
Quentin McGaw
7ca9d445f1
Maintenance: package comments
2021-02-06 16:26:23 +00:00
Quentin McGaw
90aaf71270
Configuration package ( #369 )
2021-02-06 11:05:50 -05:00
Quentin McGaw
5757f0e201
Fix: Only log subproc error when it's not nil
2021-01-30 18:07:12 +00:00
Quentin McGaw
5194361f3b
Fix public IP on restarts, refers to 359
2021-01-29 00:06:55 +00:00
Quentin McGaw
5dcbe79fa8
Move OS package to golibs
2021-01-02 01:57:00 +00:00
Quentin McGaw
25acbf8501
Feature: Increasing backoff time for crashes
...
- Fix #247
2020-12-30 17:22:54 +00:00
Quentin McGaw
e643ce5b99
Fix publicip and updater loops exit bugs
2020-12-29 16:44:55 +00:00
Quentin McGaw
cb64302294
Rename UID and GID to PUID and PGID
2020-12-29 16:44:35 +00:00
Quentin McGaw
8d5f2fec09
Code maintenance: use native Go HTTP client
2020-12-29 02:55:34 +00:00
Quentin McGaw
73479bab26
Code maintenance: OS package for file system
...
- OS custom internal package for file system interaction
- Remove fileManager external dependency
- Closer API to Go's native API on the OS
- Create directories at startup
- Better testability
- Move Unsetenv to os interface
2020-12-29 00:55:31 +00:00
Quentin McGaw
db886163c2
Public IP getter loop refactored
2020-12-28 01:51:55 +00:00
Quentin McGaw
82a02287ac
Public IP endpoint with GET /ip fixing #319
2020-12-27 21:06:00 +00:00
Quentin McGaw
9c73faaaeb
Add linters and fix lint issues
2020-10-20 02:45:28 +00:00
Quentin McGaw
84c1f46ae4
Upgrade dependencies
...
- Use of context for custom http client
- Remove unused nodeid for logger
- Upgrade shadowsocks dependency
2020-10-18 02:24:34 +00:00
Quentin McGaw
98f778c3bb
Improve timing behavior of ticking in loops
2020-10-15 23:20:36 +00:00
Quentin McGaw
e0e450ca1c
Revisit waitgroup ( #241 )
...
* Fix Add to waitgroup out of goroutines calling wg.Done()
* Pass waitgroup to other loop functions
2020-09-12 14:34:15 -04:00
Quentin McGaw
f95f6201b1
Rename repo to Gluetun, refers to #112
2020-07-26 12:07:06 +00:00
Quentin McGaw
b4a4e441c1
Fix #199 when ticker period is 0
2020-07-16 12:00:25 +00:00
Quentin McGaw
9b92ece5a1
Fix race condition for public ip loop
2020-07-16 01:44:48 +00:00
Quentin McGaw
51af8d1ab0
PUBLICIP_PERIOD environment variable
2020-07-16 01:12:54 +00:00
Quentin McGaw
616ba0c538
Replace explicit channels with functions
2020-07-15 01:34:46 +00:00
Quentin McGaw
2f9d1f09d3
Minor changes
...
- Remove https://ip4.ddnss.de/meineip.php
- Logs when falling back to plaintext DNS
2020-07-11 21:04:46 +00:00
Quentin McGaw
ccf11990f1
Fix several async issues
...
- race conditions between ctx.Done and waitError channel
- Sleep for retry cancels on cancelation of context
- Stops the any loop at the start if the context was canceled
- Mentions when loops exit
- Wait for errors on triggered loop restarts
2020-07-11 20:59:30 +00:00
Quentin McGaw
758f316816
Small constants changes
...
- ifconfig.me/ip added, see #186
- Remove trailing space for a Surfshark region
2020-07-08 22:47:48 +00:00
Quentin McGaw
ad73a027f3
Gets public IP every hour
2020-07-08 22:47:12 +00:00
Quentin McGaw
53b7fafc49
Public IP loop, fixes #186
...
- Uses common http client with 15 seconds timeout
- Repeats on fail after 5 seconds sleep time
2020-07-08 22:33:28 +00:00