* Use our Endpoints type alias
* Add the recent wireguard endpoint to NAT candidates if a peer has an endpoint override
* Simplify logic in the inject_endpoints() function
Co-authored-by: Matěj Laitl <matej@laitl.cz>
* Specify mock wireguard endpoints for developer 1 and 2 in the test data
* Add a test for verifying the wireguard endpoint is returned in the list of NAT candidates
* Remove FromStr usage
* Appease clippy
---------
Co-authored-by: Matěj Laitl <matej@laitl.cz>
* Add CLI parameters for disable/enable peer
Fixestonarino/innernet#214.
* Formatting
* Remove redundant clones
* Require name for yes param
Yes param only makes sense if name is provided.
* Formatting
* client: Update enable_or_disable_peer exit message to be more accurate
* server: Implement disable-peer and enable-peer commands
* server: Immediately apply enable- and disable-peer to device
- fix#228
- the musl libc is used on Alpine, a minimal linux distribution commonly
used in docker images. It's also used on OpenWRT which might be of
interest to innernet.
Surprisingly, Restart=always may not _always_ restart the unit if it restarts too fast.
Set a combination of options which should make systemd truly restart innernet always.
See https://unix.stackexchange.com/q/289629/352972.
The `RestartSec=60` is the main and important one which would prevent systemd from ever failing
to restart innernet in the default settings (because with it it would never exceed the default
limit of 5 restarts in 10 seconds).
`StartLimitIntervalSec=0` option is a complementary one for explicitly disabling the logic, and
may be removed from this PR if deemed unnecessary.
* client: allow config/data dirs to be changed
* server: allow config/data dirs to be changed
* meta: cargo clippy & cargo fmt
* shared: use const for Duration instead of lazy_static
added to `innernet {up,fetch,install}`:
--no-nat-traversal: Doesn't attempt NAT traversal
(prevents long time delays in execution of command)
--exclude-nat-candidates: Exclude a list of CIDRs from being
considered candidates
--no-nat-candidates: Don't report NAT candidates.
(shorthand for '--exclude-nat-candidates 0.0.0.0/0')
Closes#160