Commit Graph

1168 Commits

Author SHA1 Message Date
Maxime Van Hees ca4792f247 added nu-ansi-term feature 2024-07-12 14:59:30 +02:00
Maxime Van Hees d4c8e73611 moved LICENSE.rtf file + changed installer script to reflect new location 2024-07-12 14:59:30 +02:00
Maxime Van Hees f0f901b93c moved config example file to root dir + changed wix file to reflect that change 2024-07-12 14:59:30 +02:00
Maxime Van Hees 647522aa4c Windows installer now creates a default configuration file in C:\Users\Gebruiker\AppData\Roaming 2024-07-12 14:59:30 +02:00
Maxime Van Hees f9bc18b386 Updated CHANGELOG.md about Windows installer 2024-07-12 14:59:30 +02:00
Maxime Van Hees b0fd7c629b Added github action for MSI build + updated README + added WiX installer files 2024-07-12 14:59:30 +02:00
Maxime Van Hees d50e3cea86 Removed toml crate 2024-07-12 13:10:44 +02:00
Maxime Van Hees bf062ed264 Added all public nodes to example config file 2024-07-12 13:10:44 +02:00
Maxime Van Hees 74a9fb2e81 Config file support for myceliumd-private + slight optimization to merge_configs function 2024-07-12 13:10:44 +02:00
Maxime Van Hees 3d9ad65704 Fixed requested changes 2024-07-12 13:10:44 +02:00
Maxime Van Hees f9e0560990 Moved information from CHANGELOG to README 2024-07-12 13:10:44 +02:00
Maxime Van Hees 1667e71e0b updated mac os config path + updated changelog to reflect changes 2024-07-12 13:10:44 +02:00
Maxime Van Hees 3298c78719 Removed debug println 2024-07-12 13:10:44 +02:00
Maxime Van Hees 65c3c34e0f Platform specific config file location support 2024-07-12 13:10:44 +02:00
Maxime Van Hees 0ab40a7593 no_tun and disable_peer_disovery support in config file 2024-07-12 13:10:44 +02:00
Maxime Van Hees 5a103b7fca start mycelium with configuration file 2024-07-12 13:10:44 +02:00
Lee Smet f96cce9c70 Immediately remove expired unselected routes
There is no point in keeping an expired route, which is not selected, as
part of the fallback routes with infinite metric. Either there was no
selected route, so it can be removed, or the selected route got
retracted in which case that already caused a retraction to be sent.

Closes #330

Signed-off-by: Lee Smet <lee.smet@hotmail.com>
2024-07-11 15:47:28 +02:00
Lee Smet 81b44f9ddc Don't refresh route timer on unfeasible update
If an update is unfeasible, apply it as per the spec but don't update
the route timer. The main reason unfeasible routes are kept, is because
"it migh become feasible in the future". In our case, since we use
reliable transports (for protocol messages), and we send a seqno request
when a route is lost, we know that if a feasible route exists in one of
our peers, we will get it shortly after a route is lost. Even if we keep
the unfeasible route as fallback route, it won't be selected, and a
seqno request is needed to refresh it. In short, there is functionally
no difference for the route if we keep the unfeasible entry around or
not: a seqno request _must_ be send to a peer in the hopes of getting a
valid route again. All things considered, this changes allows unfeasible
routes to gracefully go out of scope, after which the unfeasible update
will be blocked.

Closes #320
Closes #159

Signed-off-by: Lee Smet <lee.smet@hotmail.com>
2024-07-10 12:49:22 +02:00
Lee Smet 895eff5616 Split line in CHANGELOG.md to adhere to line length
Signed-off-by: Lee Smet <lee.smet@hotmail.com>
2024-07-10 11:26:08 +02:00
Lee Smet 7682bc60c2 Skip route selection after unfeasible route update
If an unfeasible update is applied to an existing, unselected route, we
now skip route selection altogether. Since the route is not selected,
it can obviously not be unselected, and selecting it won't be possible
since its now not feasible.

By immediately returning we also can't notify downstream peers which
have sent a seqno request for this combination. This is fine, since if
there is an outstanding request for this seqno, considering it is
unfeasible, it won't be of interest to the downstream peer. Note that if
the seqno request triggered a bump of the route seqno, the _first_ update
is always feasible.

Also expose a metric value to track how often we just skip route
selection.

Closes #329

Signed-off-by: Lee Smet <lee.smet@hotmail.com>
2024-07-10 11:17:32 +02:00
Lee Smet 33730dbda9 Update binary lockfiles
Signed-off-by: Lee Smet <lee.smet@hotmail.com>
2024-07-09 10:45:25 +02:00
dependabot[bot] 58eab5f6dc Bump serde from 1.0.203 to 1.0.204 in /myceliumd-private
Bumps [serde](https://github.com/serde-rs/serde) from 1.0.203 to 1.0.204.
- [Release notes](https://github.com/serde-rs/serde/releases)
- [Commits](https://github.com/serde-rs/serde/compare/v1.0.203...v1.0.204)

---
updated-dependencies:
- dependency-name: serde
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-07-09 10:42:57 +02:00
dependabot[bot] 9510bd3796 Bump serde from 1.0.203 to 1.0.204 in /myceliumd
Bumps [serde](https://github.com/serde-rs/serde) from 1.0.203 to 1.0.204.
- [Release notes](https://github.com/serde-rs/serde/releases)
- [Commits](https://github.com/serde-rs/serde/compare/v1.0.203...v1.0.204)

---
updated-dependencies:
- dependency-name: serde
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-07-09 10:42:31 +02:00
dependabot[bot] f7a2e1c2ef Bump netdev from 0.29.0 to 0.30.0
Bumps [netdev](https://github.com/shellrow/netdev) from 0.29.0 to 0.30.0.
- [Release notes](https://github.com/shellrow/netdev/releases)
- [Commits](https://github.com/shellrow/netdev/compare/v0.29.0...v0.30.0)

---
updated-dependencies:
- dependency-name: netdev
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-07-09 10:42:01 +02:00
dependabot[bot] 06ea8add68 Bump rustls from 0.23.10 to 0.23.11
Bumps [rustls](https://github.com/rustls/rustls) from 0.23.10 to 0.23.11.
- [Release notes](https://github.com/rustls/rustls/releases)
- [Changelog](https://github.com/rustls/rustls/blob/main/CHANGELOG.md)
- [Commits](https://github.com/rustls/rustls/compare/v/0.23.10...v/0.23.11)

---
updated-dependencies:
- dependency-name: rustls
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-07-09 10:41:41 +02:00
Lee Smet 9c4b7257b6 Move shared secret from RouteEntry to RouteList
This avoids duplication of the field between all RouteEntries in the
same RouteList, which should reduce memory consumption (especially on
public nodes) of the route table.

Closes #321

Signed-off-by: Lee Smet <lee.smet@hotmail.com>
2024-07-08 15:51:06 +02:00
Florian Klink c2ede66b17 peer_manager: make some variables log fields
This starts using structured logging a bit, causing log messages to
mostly more static strings, and the actual error messages, specific
endpoint addresses etc. be log fields.

This makes it easier to grep for specific log messages, as well as
filter things down for a specific peer.

Code-wise, this is mostly a matter of moving from format-strings
interpolating various variables to actually putting these in front of
the message.

Frequently, we can also avoid writing it out explicitly alltogether:

In `connect_peer` we already have `endpoint`, so we can ask it for
`proto()` and `address()`, and just record it in a span, and it'll be
present in all child log messages - as it's somewhere part of the span
hierarchy and printed by our log formatters.
2024-07-08 14:40:03 +02:00
Florian Klink 0e353cbc72 myceliumd[-private]: add --log-format option
In addition to the previous format "compact", which is the default, this
can be set to "logfmt".

This isn't colorful yet, so `ansi_logs` is not enabled, as we'd only
want that for interactive usage, not when run via a service manager.

There's some amount of duplication between the two CLI entrypoints, but
I was a bit unsure where to put the shared code for tracing setup.
Happy to move this elsewhere too.
2024-07-08 14:28:21 +02:00
Maxime Van Hees a502a79350 Update README.md
Typo

Signed-off-by: Maxime Van Hees <vanheesm@threefold.tech>
2024-07-08 11:38:00 +02:00
Lee Smet 16ab186615 Remove unused selected_mut method
Signed-off-by: Lee Smet <lee.smet@hotmail.com>
2024-07-03 14:29:48 +02:00
Lee Smet f7a153f327 Simplify unselecting route after update if needed
Signed-off-by: Lee Smet <lee.smet@hotmail.com>
2024-07-03 12:31:20 +02:00
Lee Smet 772b37fd11 Simplify static subnet check
Signed-off-by: Lee Smet <lee.smet@hotmail.com>
2024-07-03 12:25:20 +02:00
Lee Smet 459de51493 Use Peer instead of RouteKey in entry_mut
Signed-off-by: Lee Smet <lee.smet@hotmail.com>
2024-07-03 11:59:58 +02:00
Lee Smet 906d8f2d85 Add more structured traces
Signed-off-by: Lee Smet <lee.smet@hotmail.com>
2024-07-03 11:51:07 +02:00
Lee Smet bb5bcc1089 Change some logs to strucutred traces
Signed-off-by: Lee Smet <lee.smet@hotmail.com>
2024-07-03 10:48:00 +02:00
Lee Smet 17c8d6f468 Use Display impl to log fields in structured log
Where we already use it, use the % sigil to inform tracing we want to
use the display impl of the fields to log them.

Signed-off-by: Lee Smet <lee.smet@hotmail.com>
2024-07-03 10:39:22 +02:00
Lee Smet 63e6b62fb7 Add Display impl for SeqnoRequest
Signed-off-by: Lee Smet <lee.smet@hotmail.com>
2024-07-03 10:38:23 +02:00
Lee Smet 5acb0b09d5 Use dedicated unselect method in router
Signed-off-by: Lee Smet <lee.smet@hotmail.com>
2024-07-03 10:20:02 +02:00
Lee Smet 70ddd49053 Remove unused RouteList::entry method
Signed-off-by: Lee Smet <lee.smet@hotmail.com>
2024-07-03 10:19:42 +02:00
Lee Smet c3fd23469f Remove leftover allow(dead_code) module attribute
Signed-off-by: Lee Smet <lee.smet@hotmail.com>
2024-07-03 10:18:53 +02:00
Lee Smet 4b94d05f53 Remove unused IndexMut import
Signed-off-by: Lee Smet <lee.smet@hotmail.com>
2024-07-03 10:18:24 +02:00
Lee Smet 6b10c033fd Add unselect method
Just makes sure no route is selected for a list of routes to a subnet

Signed-off-by: Lee Smet <lee.smet@hotmail.com>
2024-07-03 10:17:18 +02:00
Lee Smet 2765b97aec Fix doc comment typo
Signed-off-by: Lee Smet <lee.smet@hotmail.com>
2024-07-03 10:13:14 +02:00
Lee Smet 2f06bff7f8 Rework update handler to get entry more directly
Previously we got the index of a possible entry and then loaded the
entry (using the now removed IndexMut impl). Now we just get the entry
and unwrap it based on it's internal value.

Signed-off-by: Lee Smet <lee.smet@hotmail.com>
2024-07-03 10:11:04 +02:00
Lee Smet e59152abe0 Add RouteEntryGuard::is_some method
Signed-off-by: Lee Smet <lee.smet@hotmail.com>
2024-07-03 10:10:38 +02:00
Lee Smet ac5c87f664 Remove broken IndexMut for RouteList
Since it returned a &mut RouteEntry instead of a RouteEntryGuard, items
returned by it are not updated, so outright remove it.

Signed-off-by: Lee Smet <lee.smet@hotmail.com>
2024-07-03 10:02:03 +02:00
Lee Smet f2198ee116 Use dedicated selected method of RouteList
Instead of iterating, which is wastefull since the RouteList internally
keeps the selected route as the first element (if one exists).

Signed-off-by: Lee Smet <lee.smet@hotmail.com>
2024-07-02 14:43:23 +02:00
dependabot[bot] b1f9f5203a Bump serde_json from 1.0.117 to 1.0.120 in /myceliumd
Bumps [serde_json](https://github.com/serde-rs/json) from 1.0.117 to 1.0.120.
- [Release notes](https://github.com/serde-rs/json/releases)
- [Commits](https://github.com/serde-rs/json/compare/v1.0.117...v1.0.120)

---
updated-dependencies:
- dependency-name: serde_json
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-07-02 11:37:15 +02:00
dependabot[bot] 172ca1d068 Bump clap from 4.5.7 to 4.5.8 in /myceliumd
Bumps [clap](https://github.com/clap-rs/clap) from 4.5.7 to 4.5.8.
- [Release notes](https://github.com/clap-rs/clap/releases)
- [Changelog](https://github.com/clap-rs/clap/blob/master/CHANGELOG.md)
- [Commits](https://github.com/clap-rs/clap/compare/clap_complete-v4.5.7...v4.5.8)

---
updated-dependencies:
- dependency-name: clap
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-07-02 11:36:55 +02:00
dependabot[bot] f8a95840a5 Bump clap from 4.5.7 to 4.5.8 in /myceliumd-private
Bumps [clap](https://github.com/clap-rs/clap) from 4.5.7 to 4.5.8.
- [Release notes](https://github.com/clap-rs/clap/releases)
- [Changelog](https://github.com/clap-rs/clap/blob/master/CHANGELOG.md)
- [Commits](https://github.com/clap-rs/clap/compare/clap_complete-v4.5.7...v4.5.8)

---
updated-dependencies:
- dependency-name: clap
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-07-02 11:36:09 +02:00