Commit Graph

1243 Commits

Author SHA1 Message Date
Thomas Eizinger
4937291d23 refactor(connlib): deal with resources one at a time (#5886)
The two primary users of the `add_resources` and `remove_resources` are
the client's eventloop and the `tunnel_test`. Both of them only ever
pass a single resource at a time.

It is thus simpler to remove the inner loop from within `ClientState`
and simply process a single resource at a time.
2024-07-18 04:59:12 +00:00
Thomas Eizinger
5268756b60 feat(connlib): add placeholder for Internet Resource (#5900)
In preparation for #2667, we add an `internet` variant to our list of
possible resource types. This is backwards-compatible with existing
clients and ensures that, once the portal starts sending Internet
resources to clients, they won't fail to deserialise these messages.

The portal will have a version check to not send this to older clients
anyway but the sooner we can land this, the better. It simplifies the
initial development as we start preparing for the next client release.

Adding new fields to a JSON message is always backwards-compatible so we
can extend this later with whatever we need.
2024-07-18 04:28:02 +00:00
Thomas Eizinger
066270051b test(connlib): always run all assertions (#5892)
Currently, `tunnel_test` aborts a `Transition` as soon as one assertion
fails. This often makes it hard to debug a problem as it can be useful
to see which assertions pass and which fail to figure out, what went
wrong.

To resolve this, we replace all `assert` macros with either `info!` or
`error!` trace events. All "failed assertions" must be logged as
`error!`.

Before running these assertions, we temporarily install a custom tracing
layer that keeps track of how many `error!` events are emitted. If we
emit at least one `error!` event, the layer pancis upon `Drop` which
happens at the end of the `check_invariants` function.
2024-07-18 02:16:17 +00:00
Thomas Eizinger
da52c66023 refactor(clients): init PhoenixChannel in upper layers (#5884)
This represents a step towards #3837. Eventually, we'd like the
abstractions of `Session` and `Eventloop` to go away entirely. For that,
we need to thin them out.

The introduction of `ConnectArgs` was already a hint that we are passing
a lot of data across layers that we shouldn't. To avoid that, we can
simply initialise `PhoenixChannel` earlier and thus each callsite can
specify the desired configuration directly.

I've left `ConnectArgs` intact to keep the diff small.
2024-07-18 02:08:38 +00:00
Gabi
5c1f5e1ece fix(connlib): prioritize dns resources to CIDR ones in case of an overlap (#5840)
For full route this happens always and if we don't prioritize DNS
resources any packet for DNS IPs will get routed to the full route
gateway which might not have the correct resource.

TODO: this still needs unit tests
TODO: Waiting on #5891
2024-07-18 01:27:07 +00:00
Thomas Eizinger
4f4134b000 test(connlib): model gateway <> site <> resource relationship (#5871)
Currently, the relationship between gateways, sites and resources is
modeled in an ad-hoc fashion within `tunnel_test`. The correct
relationship is:

- The portal knows about all sites.
- A resource can only be added for an existing site.
- One or more gateways belong to a single site.

To express this relationship in `tunnel_test`, we first sample between 1
and 3 sites. Then we sample between 1 and 3 gateways and assign them a
site each. When adding new resources, we sample a site that the resource
belongs to. Upon a connection intent, we sample a gateway from all
gateways that belong to the site that the resource is defined in.

In addition, this patch-set removes multi-site resources from the
`tunnel_test`. As far as connlib's routing logic is concerned, we route
packets to a resource on a selected gateway. How the portal selected the
site of the gateway doesn't matter to connlib and thus doesn't need to
be covered in these tests.
2024-07-17 22:41:47 +00:00
Reactor Scram
6b1b14dc2c chore(gui-client): release GUI Client 1.1.7 (#5897)
Signed-off-by: Reactor Scram <ReactorScram@users.noreply.github.com>
2024-07-17 22:23:43 +00:00
Thomas Eizinger
aa279d7731 ci: never tolerate warnings in Rust code (#5893)
Our Rust CI runs various jobs in different configurations of packages
and / or features. Currently, only the clippy job denies warnings which
makes it possible that some code still generates warnings under
particular configurations.

To ensure we always fail on warnings, we set a global env var to deny
warnings for all Rust CI jobs.

---------

Signed-off-by: Thomas Eizinger <thomas@eizinger.io>
Co-authored-by: Reactor Scram <ReactorScram@users.noreply.github.com>
2024-07-17 22:22:12 +00:00
Reactor Scram
cfab7579b6 ci(rust): fix stale entries in Cargo.lock (#5896)
I think this is because there was a force-push in the `proptest` repo,
which caused the locked revision to no longer belong to the branch
specified by `Cargo.toml`

It happened to affect macOS and not Linux or Windows, nor local builds,
maybe because they have different caching setups.

<img width="326" alt="image"
src="https://github.com/user-attachments/assets/4c8f8ba5-d2f1-4f89-8895-e533178b6348">
2024-07-17 20:33:04 +00:00
Gabi
7e963f74ca chore(connlib): performance improvement for picking cidr resources (#5891)
Extracted from  #5840

Some cleanup on generating IPs and improve performance of picking a host
within an IP range by doing some math instead of iterating through the
ip range.
2024-07-17 06:24:34 +00:00
Thomas Eizinger
93651d483c build(deps): bump quinn-udp dependency (#5872)
In the new version, `quinn-udp` no longer supports sending multiple
`Transmit`s at once via `sendmmsg`. We made use of that to send all
buffered packets in one go.

In reality, these buffered packets can only be control messages like
STUN requests to relays or something like that. For the hot-patch of
routing packets, we only ever read a single IP packet from the TUN
device and attempt to send it out right away. At most, we may buffer one
packet at a time here in case the socket is busy.

Getting these wake-ups right is quite tricky. I think we should
prioritise #3837 soon. Once that is integrated, we can use `async/await`
for the high-level integration between `Io` and the state which allows
us to simply suspend until we can send the message, avoiding the need
for a dedicated buffer.

---------

Signed-off-by: Thomas Eizinger <thomas@eizinger.io>
Co-authored-by: Reactor Scram <ReactorScram@users.noreply.github.com>
2024-07-16 22:46:18 +00:00
Reactor Scram
63623346b9 fix(headless-client/windows): improve Client startup times on Windows (#5375)
Closes #5026
Closes #5879 

On the resource-constrained Windows Server 2022 test VM, the median
sign-in time dropped from 5.0 seconds to 2.2 seconds.

# Changes

- Measure end-to-end connection time in the GUI process
- Use `ipconfig` instead of Powershell to flush DNS faster
- Activate DNS control by manipulating the Windows Registry directly
instead of calling Powershell
- Remove deactivate step when changing DNS servers (seals a DNS leak
when roaming networks)
- Remove completely redundant `Set-DnsClientServerAddress` step from
activating DNS control
- Remove `Remove-NetRoute` powershell cmdlet that seems to do nothing

# Benchmark 7

- Optimized release builds
- x86-64 constrained VM (1 CPU thread, 2 GB RAM)

Main with measurement added, `c1c99197e` from #5864 

- 6.0 s
- 5.5 s
- 4.1 s
- 5.0 s
- 4.1 s
- (Median = 5.0 s)

Main with speedups added, `2128329f9` from #5375, this PR

- 3.7 s
- 2.2 s
- 1.9 s
- 2.3 s
- 2.0 s
- (Median = 2.2 s)

```[tasklist]
### Next steps
- [x] Benchmark on the resource-constrained VM
- [x] Move raw benchmark data to a comment and summarize in the description
- [x] Clean up tasks that don't need to be in the commit
- [x] Merge
```

# Hypothetical further optimizations

- Ditch the `netsh` subprocess in `set_ips`

---------

Signed-off-by: Reactor Scram <ReactorScram@users.noreply.github.com>
2024-07-16 21:55:29 +00:00
Thomas Eizinger
58db5f0639 refactor(connlib): remove Callbacks from Tunnel (#5885)
Following the removal of the return type from the callback functions in
#5839, we can now move the use of the `Callbacks` one layer up the stack
and decouple them entirely from the `Tunnel`.

---------

Signed-off-by: Thomas Eizinger <thomas@eizinger.io>
Co-authored-by: Gabi <gabrielalejandro7@gmail.com>
2024-07-16 21:00:40 +00:00
Reactor Scram
c0ebb98ec9 chore(gui-client): measure startup time (#5864)
Refs #5026
2024-07-16 14:49:12 +00:00
Reactor Scram
03089c0bde docs(gui-client): update dev docs (#5858)
The docs for DNS control and process splitting no longer have any
information more useful, accurate, or fresh than the code itself
2024-07-16 14:49:00 +00:00
Gabi
5b0aaa6f81 fix(connlib): protect all sockets from routing loops (#5797)
Currently, only connlib's UDP sockets for sending and receiving STUN &
WireGuard traffic are protected from routing loops. This is was done via
the `Sockets::with_protect` function. Connlib has additional sockets
though:

- A TCP socket to the portal.
- UDP & TCP sockets for DNS resolution via hickory.

Both of these can incur routing loops on certain platforms which becomes
evident as we try to implement #2667.

To fix this, we generalise the idea of "protecting" a socket via a
`SocketFactory` abstraction. By allowing the different platforms to
provide a specialised `SocketFactory`, anything Linux-based can give
special treatment to the socket before handing it to connlib.

As an additional benefit, this allows us to remove the `Sockets`
abstraction from connlib's API again because we can now initialise it
internally via the provided `SocketFactory` for UDP sockets.

---------

Signed-off-by: Gabi <gabrielalejandro7@gmail.com>
Co-authored-by: Thomas Eizinger <thomas@eizinger.io>
2024-07-16 00:40:05 +00:00
Thomas Eizinger
14abda01fd refactor(connlib): polish DNS resource matching (#5866)
In preparation for implementing #5056, I familiarized myself with the
current code and ended up implementing a couple of refactorings.
2024-07-15 23:56:48 +00:00
Gabi
7436f86332 chore(connlib): remove warnings for non-proptest tests (#5883)
Extracted from #5797
2024-07-15 21:52:22 +00:00
Thomas Eizinger
847e7801f6 test(connlib): remove Tick transition (#5867)
When the property-based state machine test was first created, I
envisioned that we could also easily test advancing time. Unfortunately,
the tricky part of advancing time is to correctly encode the _expected_
behaviour as it requires knowledge of all timeouts etc.

Thus, the `Tick` transition has been left lingering and doesn't actually
test much. It is obviously still sampled by the test runner and thus
"wastes" test cases that don't end up exercising anything meaningful
because the time advancements are < 1000ms.

There are plans to more roughly test time-related things by implementing
delays between applying `Transmit`s. Until then, we can remove the
`Tick` transition.
2024-07-15 21:08:22 +00:00
Reactor Scram
b539c01cab fix(gui-client/linux): show a specific error message in the GUI when updating (#5848)
Closes #5790 (we could do more, but this might be sufficient)

<img width="892" alt="image"
src="https://github.com/firezone/firezone/assets/13400041/5ce84a05-2f6c-4ffd-ba21-19d3087c8c7f">
<img width="641" alt="image"
src="https://github.com/firezone/firezone/assets/13400041/2da7ff36-a969-444e-885c-ae0919577f56">


The code is cross-platform, but this is unlikely to happen on Windows
because the MSI refuses to update if the GUI process is running. On
Linux `apt-get` will update and restart the IPC service without touching
the GUI process.

```[tasklist]
- [x] Test on Linux with `apt-get install`
- [x] Update changelog
- [x] Run a 5-minute smoke test on Linux
- [x] Run a 5-minute smoke test on Windows
- [x] Open for review
- [ ] Merge
```

---------

Signed-off-by: Reactor Scram <ReactorScram@users.noreply.github.com>
2024-07-15 17:53:24 +00:00
Thomas Eizinger
a4a8221b8b refactor(connlib): explicitly initialise Tun (#5839)
Connlib's routing logic and networking code is entirely platform
agnostic. The only platform-specific bit is how we interact with the TUN
device. From connlib's perspective though, all it needs is an interface
for reading and writing. How the device gets initialised and updated is
client-business.

For the most part, this is the same on all platforms: We call callbacks
and the client updates the state accordingly. The only annoying bit here
is that Android recreates the TUN interface on every update and thus our
old file descriptor is invalid. The current design works around this by
returning the new file descriptor on Android. This is a problematic
design for several reasons:

- It forces the callback handler to finish synchronously, and halting
connlib until this is complete.
- The synchronous nature also means we cannot replace the callbacks with
events as events don't have a return value.

To fix this, we introduce a new `set_tun` method on `Tunnel`. This moves
the business of how the `Tun` device is created up to the client. The
clients are already platform-specific so this makes sense. In a future
iteration, we can move all the various `Tun` implementations all the way
up to the client-specific crates, thus co-locating the platform-specific
code.

Initialising `Tun` from the outside surfaces another issue: The routes
are still set via the `Tun` handle on Windows. To fix this, we introduce
a `make_tun` function on `TunDeviceManager` in order for it to remember
the interface index on Windows and being able to move the setting of
routes to `TunDeviceManager`.

This simplifies several of connlib's APIs which are now infallible.

Resolves: #4473.

---------

Co-authored-by: Reactor Scram <ReactorScram@users.noreply.github.com>
Co-authored-by: conectado <gabrielalejandro7@gmail.com>
2024-07-12 23:54:15 +00:00
Reactor Scram
a8ece49d9e chore: bump GUI to 1.1.6 (#5862)
I started a playbook for publishing GUI releases, I didn't see any other
one around.

I think there's a middle step I'm not clear on:

1. Open this PR and get it approved
2. Do something? Publish the draft release maybe? Run a special CI
workflow?
3. Merge this PR to update the changelog and bump the versions in Git

```[tasklist]
### Tasks
```
2024-07-12 18:45:56 +00:00
Thomas Eizinger
a4714d6de3 chore(connlib): print error after panicking (#5854) 2024-07-12 14:30:11 +00:00
Thomas Eizinger
c92dd559f7 chore(rust): format Cargo.toml using cargo-sort (#5851) 2024-07-12 04:57:22 +00:00
Thomas Eizinger
71f8b86b78 test(connlib): don't update resources as part of adding new ones (#5834)
Currently, `tunnel_test` has some old code that attempted to handle
resource _updates_ as part of adding new ones. That is outdated and
wrong. The test is easier to reason about if we disallow updates to
resources as part of _adding_ a new one.

In production, resources IDs are unique so this shouldn't actually
happen. At a later point, we can add explicit transitions for updating
an existing resource.
2024-07-12 00:30:18 +00:00
Thomas Eizinger
d95193be7d test(connlib): introduce dynamic number of gateways to tunnel_test (#5823)
Currently, `tunnel_test` exercises a lot of code paths within connlib
already by adding & removing resources, roaming the client and sending
ICMP packets. Yet, it does all of this with just a single gateway
whereas in production, we are very likely using more than one gateway.

To capture these other code-paths, we now sample between 1 and 3
gateways and randomly assign the added resources to one of them, which
makes us hit the codepaths that select between different gateways.

Most importantly, the reference implementation has barely any knowledge
about those individual connections. Instead, it is implementation in
terms of connectivity to resources.
2024-07-11 23:42:46 +00:00
Thomas Eizinger
960ce80680 refactor(connlib): move TunDeviceManager into firezone-bin-shared (#5843)
The `TunDeviceManager` is a component that the leaf-nodes of our
dependency tree need: the binaries. Thus, it is misplaced in the
`connlib-shared` crate which is at the very bottom of the dependency
tree.

This is necessary to allow the `TunDeviceManager` to actually construct
a `Tun` (which currently lives in `firezone-tunnel`).

Related: #5839.

---------

Signed-off-by: Thomas Eizinger <thomas@eizinger.io>
Co-authored-by: Reactor Scram <ReactorScram@users.noreply.github.com>
2024-07-11 23:42:33 +00:00
Thomas Eizinger
2013d6a2bf chore(connlib): improve logging (#5836)
Currently, the logging of fields in spans for encapsulate and
decapsulate operations is a bit inconsistent between client and gateway.
Logging the `from` field for every message is actually quite redundant
because most of these logs are emitted within `snownet`'s `Allocation`
which can add its own span to indicate, which relay we are talking to.

For most other operations, it is much more useful to log the connection
ID instead of IPs.

This should make the logs a bit more succinct.
2024-07-11 23:38:19 +00:00
Reactor Scram
64e0b71b77 feat(gui-client): set a different tray icon when signed out (#5817)
Closes #5810 

```[tasklist]
### Tasks
- [x] Try not to set the icon every time we change Resources
- [x] Get production icons
- [x] Add changelog comment
- [x] Add CI stress test that sets the icon 10,000 times
- [x] Open for review
- [x] Repair changelog
- [ ] Merge
```

---------

Signed-off-by: Reactor Scram <ReactorScram@users.noreply.github.com>
2024-07-11 20:50:44 +00:00
Thomas Eizinger
08182913a5 refactor(connlib): remove CidrV4 and CidrV6 types from callbacks (#5842)
These are only necessary for the Android and Apple client. Other clients
should not need to bother with these custom types.

Required-for: #5843.
2024-07-11 14:25:26 +00:00
Thomas Eizinger
f39a57fa50 refactor(connlib): remove cyclic From impls (#5837)
We have several representations of `ResourceDescription` within connlib.
The ones within the `callbacks` module are meant for _presentation_ to
the clients and thus contain additional information like the site
status.

The `From` impls deleted within the PR are only used within tests. We
can rewrite those tests by asserting on the presented data instead.

This is better because it means information about resources only flows
in one direction: From connlib to the clients.
2024-07-11 14:21:33 +00:00
Thomas Eizinger
03c0da8995 chore(connlib): ensure span is activate during test init (#5835)
Applying the initial `init` closure may also print logs that are
currently not captured within the corresponding span. By using
`in_scope`, we ensure those logs are also correctly captured in the
corresponding span.
2024-07-11 14:20:15 +00:00
Reactor Scram
cb2bddae7e refactor(ipc-service/windows): remove unnecessary tokio::spawn (#5813)
This also improves some function names (i.e. don't say `windows_` when
we're already in `windows.rs`) and adds comments justifying why some
functions with only one call site are split out

I started this intending to use it to practice the sans-I/O style. It
didn't come up but I did get rid of that `spawn`
2024-07-11 14:17:55 +00:00
Thomas Eizinger
8ec6a809a1 refactor(relay): use RangeInclusive to specify available ports (#5820) 2024-07-11 06:26:21 +00:00
Thomas Eizinger
00a3940717 chore(rust): introduce tokio workspace dependency (#5821)
We are referencing the `tokio` dependency a lot and it makes sense to
ensure that version is tracked only once across the whole workspace.

Extracted out of #5797.

---------

Co-authored-by: Not Applicable <ReactorScram@users.noreply.github.com>
2024-07-10 23:40:34 +00:00
Thomas Eizinger
0c2648dae2 test(connlib): correctly scope state within tunnel_test (#5809)
Currently, the type hierarchy within `tunnel_test` is already quite
nested: We have a `Host` that wraps a `SimNode` which wraps a
`ClientState` or `GatewayState`. Additionally, a lot of state that is
actually _per_ client or _per_ gateway is tracked in the root of
`ReferenceState` and `TunnelTest`. That makes it difficult to introduce
multiple gateways / clients to this test.

To fix this, we introduce dedicated `RefClient` and `RefGateway` states.
Those track the expected state of a particular client / gateway.
Similarly, we introduce dedicated `SimClient` and `SimGateway` structs
that track the simulation state by wrapping the corresponding
system-under-test: `ClientState` a `GatewayState`.

This ends up moving a lot of code around but has the great benefit that
all the state is now scoped to a particular instance of a client or a
gateway, paving the way for creating multiple clients & gateways in a
single test.
2024-07-10 23:22:19 +00:00
Reactor Scram
7e04d62daa fix(gui-client): catch IPC connection dropouts as fatal errors (#5795)
Closes #5760, refs #5790

Also removes some redundant IPC-related code that was nearby.

If you stop the IPC service, e.g. due to an update on Linux, it will say
"IPC connection closed". This isn't ideal but at least the Client does
catch it now, instead of failing on the next IPC send.

---------

Signed-off-by: Reactor Scram <ReactorScram@users.noreply.github.com>
2024-07-10 22:38:55 +00:00
Reactor Scram
c8c349ac41 refactor(gui-client): simplify IPC and how Resources in the menu are updated (#5824)
The Arc+Notify thing was always overkill, I just thought it was useful
early on. With the IPC change it's easier to just use the existing MPSC
channel

Also removing `TunnelReady` and assuming that the tunnel is ready
whenever connlib sends us the first Resource list

---------

Signed-off-by: Reactor Scram <ReactorScram@users.noreply.github.com>
2024-07-10 21:37:59 +00:00
Reactor Scram
c3380daa75 fix(gui-client/windows): deactivate DNS control when we stop connlib (#5828)
Closes #5827

---------

Signed-off-by: Reactor Scram <ReactorScram@users.noreply.github.com>
Co-authored-by: Jamil <jamilbk@users.noreply.github.com>
2024-07-10 20:29:16 +00:00
Reactor Scram
78f1c7c519 test(firezone-tunnel/windows): Test Windows upload speed in CI (#5607)
Closes #5601
It looks like we can hit 100+ Mbps in theory. This covers Wintun, Tokio,
and Windows OS overhead. It doesn't cover the cryptography or anything
in connlib itself.

The code is kinda messy but I'm not sure how to clean it up so I'll just
leave it for review.

This test should fail if there's any regressions in #5598.

It fails if any packet is dropped or if the speed is under 100 Mbps

```[tasklist]
### Tasks
- [x] Use `ip_packet::make`
- [x] Switch to `cargo bench`
- [x] Extract windows ARM PR
- [x] Clean up wintun.dll install code
- [x] Re-request review
```
2024-07-10 19:09:45 +00:00
Reactor Scram
565602fadb refactor(headless-client): clean up signal handling code (#5799)
Left over from #5789 

This removes SIGHUP for the IPC service, which doesn't handle it anyway,
so it removes a code path that would just panic.

```[tasklist]
### Tasks
- [ ] Can we test this at all?
```
2024-07-10 18:38:24 +00:00
Thomas Eizinger
0e6ac2040c test(connlib): use two relays in tunnel_test (#5804)
With the introduction of a routing table in #5786, we can very easily
introduce an additional relay to `tunnel_test`. In production, we are
always given two relays and thus, this mimics the production setup more
closely.
2024-07-09 23:47:35 +00:00
Thomas Eizinger
f3fa0c7e5f test(connlib): reduce cycles of resource_management test (#5807)
With the performance improvements of `tunnel_test` in #5786, the
`resource_management` test is now in the hot-path of CI runtime. We
reduce the cycles to 50 should cut down overall CI time by ~ 1 minute as
the Windows builds are among the slowest.

Signed-off-by: Reactor Scram <ReactorScram@users.noreply.github.com>
Co-authored-by: Reactor Scram <ReactorScram@users.noreply.github.com>
2024-07-09 14:50:12 +00:00
Thomas Eizinger
d15c43b6f2 test(connlib): render IDs as hex u128 (#5803)
This is a bit of a hack because features should never change behaviour.
Unfortunately, we can't use `cfg(test)` here because the proptests live
in a different crate and thus for the tests, we import the crate using
`cfg(not(test))`.

Our `proptest` feature is really only meant to be activated during
testing so I think this is fine for now.

The benefit is that the test logs are much more terse because proptest
will shrink the IDs to `0`, `1` etc. With the upcoming addition of
multiple gateways and multiple relays, we will have a lot more IDs in
the logs. Thus, it is important that they stay legible.
2024-07-09 14:23:37 +00:00
Thomas Eizinger
a3c9617faa test(connlib): ensure Windows test module follows conventions (#5806)
By convention, `tests` modules are usually feature-flagged to not end up
in production code. Additionally, a `use super::*;` import line ensures
we have access to the parent module which is usually the one you want to
test.
2024-07-09 14:12:44 +00:00
Thomas Eizinger
f8468813c3 test(tunnel): use hex notation for IPv6 network (#5808) 2024-07-09 14:11:46 +00:00
Jamil
ef3b4e5dfe feat(linux-gui): Bump GUI to 1.1.5 for arm64 support (#5800) 2024-07-08 21:58:10 -07:00
Thomas Eizinger
9caca475dc test(connlib): introduce routing table to tunnel_test (#5786)
Currently, `tunnel_test` uses a rather naive approach when dispatching
`Transmit`s. In particular, it checks client, gateway and relay
separately whether they "want" a certain packet. In a real network,
these packets are routed based on their IP.

To mimic something similar, we introduce a `Host` abstraction that wraps
each component: client, gateway and relay. Additionally, we introduce a
`RoutingTable` where we can add and remove hosts. With these things in
place, routing a `Transmit` is as easy as looking up the destination IP
in the routing table and dispatching to the corresponding host.

Our hosts are type-safe: client, gateway and relay have different types.
Thus, we abstract over them using a `HostId` in order to know, which
host a certain message is for. Following these patches, we can easily
introduce multiple gateways and relays to this test by simply making
more entries in this routing table. This will increase the test coverage
of connlib.

Lastly, this patch massively increases the performance of `tunnel_test`.
It turns out that previously, we spent a lot of CPU cycles accessing
"random" IPs from very large iterators. With this patch, we take a
limited range of 100 IPs that we sample from, thus drastically
increasing performance of this test. The configured 1000 testcases
execute in 3s on my machine now (with opt-level 1 which is what we use
in CI).

---------

Signed-off-by: Thomas Eizinger <thomas@eizinger.io>
2024-07-09 01:48:54 +00:00
Reactor Scram
927702cd2f chore(gui-client): fix papercuts (#5792)
Closes #5789 

The SIGTERM catching would have helped debug #5790 

```[tasklist]
### Tasks
- [x] catch SIGTERM and log when systemd shuts us down gracefully
- [x] Log architecture at startup
```
2024-07-08 22:20:57 +00:00
Jamil
0ff45c34f9 fix(style): Set prettier prosewrap to preserve to let authors write MD in their own style (#5722)
Prettier has three options for prose-wrap:

- `always`: Format prose (markdown) to the line-length (current)
- `never`: Use a single line for all prose (proposed)
- `preserve`: Don't lint prose

Settled on `preserve` due to discussion.


Fixes #5686

---------

Signed-off-by: Jamil <jamilbk@users.noreply.github.com>
Co-authored-by: Reactor Scram <ReactorScram@users.noreply.github.com>
2024-07-08 14:26:58 +00:00