34 Commits

Author SHA1 Message Date
Thomas Eizinger
9016ffc9dc build(rust): bump to Rust 1.91.0 (#10767)
Rust 1.91 has been released and brings with it a few new lints that we
need to tidy up. In addition, it also stabilizes `BTreeMap::extract_if`:
A really nifty std-lib function that allows us to conditionally take
elements from a map. We need that in a bunch of places.
2025-11-03 01:56:12 +00:00
Thomas Eizinger
e20929ad73 build(deps): bump Rust version to 1.90 (#10380)
One of the more quiet Rust releases with no new clippy lints that would
require code updates.
2025-09-20 04:28:03 +00:00
Thomas Eizinger
2dd61d7c5c chore: Support Docker builds of Rust (#10230)
Signed-off-by: Mariusz Klochowicz <mariusz@klochowicz.com>
Co-authored-by: Mariusz Klochowicz <mariusz@klochowicz.com>
2025-09-02 02:21:07 +00:00
Thomas Eizinger
da00848549 build(deps): bump to Rust 1.89 (#10208)
Rust 1.89 comes with a new lint that wants us to use explicitly refer to
lifetimes, even if they are elided.
2025-08-18 05:04:55 +00:00
Thomas Eizinger
d6805d7e48 chore(rust): bump to Rust 1.88 (#9714)
Rust 1.88 has been released and brings with it a quite exciting feature:
let-chains! It allows us to mix-and-match `if` and `let` expressions,
therefore often reducing the "right-drift" of the relevant code, making
it easier to read.

Rust.188 also comes with a new clippy lint that warns when creating a
mutable reference from an immutable pointer. Attempting to fix this
revealed that this is exactly what we are doing in the eBPF kernel.
Unfortunately, it doesn't seem to be possible to design this in a way
that is both accepted by the borrow-checker AND by the eBPF verifier.
Hence, we simply make the function `unsafe` and document for the
programmer, what needs to be upheld.
2025-07-12 06:42:50 +00:00
Thomas Eizinger
6165555add build(deps): bump Rust to 1.87.0 (#9159) 2025-05-16 01:58:17 +00:00
Thomas Eizinger
0a46fdf7b5 chore(rust): remove dev stage in Dockerfile (#8688)
We don't ever use the `dev` stage within our Rust Dockerfile that
actually builds the binaries within the container. In CI, we build the
binaries on the host and then copy them in. During local development, I
always do the same because it is much faster to iterate that way.

Long story short: We don't need this stage within our Dockerfile and it
causes confusion when people try to use `docker compose build`. If
somebody really wanted to do that, they need to follow the instructions
in the Dockerfile and build the binary first.

Related: #8687

---------

Signed-off-by: Thomas Eizinger <thomas@eizinger.io>
Co-authored-by: Jamil <jamilbk@users.noreply.github.com>
2025-04-10 04:00:58 +00:00
Thomas Eizinger
dce5ab9178 build(deps): bump Rust to 1.86 (#8636) 2025-04-03 21:14:08 +00:00
Thomas Eizinger
84a2c275ca build(rust): upgrade to Rust 1.85 and Edition 2024 (#8240)
Updates our codebase to the 2024 Edition. For highlights on what
changes, see the following blogpost:
https://blog.rust-lang.org/2025/02/20/Rust-1.85.0.html
2025-03-19 02:58:55 +00:00
Thomas Eizinger
4cb2b01c26 build(nix): manage Rust installation via rustup (#8235)
Using `rustup` - even on NixOS - is easier to manage the Rust toolchain
as some tools rely on being able to use the `rustup` shims such as
`+nightly` to run a nightly toolchain.
2025-02-24 01:33:13 +00:00
Thomas Eizinger
7ece89b517 chore: bump Rust to 1.84 (#7719) 2025-01-12 17:32:48 +00:00
Thomas Eizinger
c6e7e6192e build(rust): bump Rust to 1.83 (#7409)
Rust 1.83 comes with a bunch of new lints for elidible lifetimes. Those
also trigger in the generated code of `derivative`. That crate is
actually unmaintained so we replace our usages of it with `derive_more`.
2024-11-29 01:04:06 +00:00
Thomas Eizinger
3365981e1b chore(rust): bump Rust to 1.82 and run cargo update (#7086)
I decided to throw in a `cargo update` as well to bump some of the Git
dependencies.
2024-10-17 22:33:31 +00:00
Thomas Eizinger
89c9946d3c build: bump Rust to 1.81.0 (#6616) 2024-09-09 19:47:16 +00:00
Reactor Scram
a558ce8cf6 chore(rust): bump Rust to 1.80.1 (#6346)
This fixes some little bugs that probably don't affect us.
2024-08-19 18:05:51 +00:00
Reactor Scram
6e24e0201e chore(rust): bump Rust to 1.80 (#6065)
Co-authored-by: Thomas Eizinger <thomas@eizinger.io>
2024-07-29 14:16:22 +00:00
Reactor Scram
1cf10f0c3f chore(rust): bump to Rust 1.79 (#5356)
Co-authored-by: Thomas Eizinger <thomas@eizinger.io>
Co-authored-by: Jamil <jamilbk@users.noreply.github.com>
2024-06-16 22:06:18 +00:00
Reactor Scram
b1dde546ab chore(rust): update to Rust 1.78 (#5006)
```[tasklist]
### Before merging
- [x] Apple smoke test
- [x] Android smoke test
```
2024-05-17 14:08:35 +00:00
Reactor Scram
80fc58464e chore(windows): bump Rust to handle CVE-2024-24576 (#4576)
https://blog.rust-lang.org/2024/04/09/cve-2024-24576.html

The Dockerfile just specifies 1.77 so it should automatically update,
probably.

Closes #4566
2024-04-10 17:15:10 +00:00
Jamil
d79992bd1e build(rust): Use Rust base image and bump to 1.77 (#4401)
These customizations were from before we used `cargo cross` for all
architectures in CI.

1.77.1 has been tested to work with the following clients:

- [x] Apple
- [x] Android
- [x] Windows
2024-03-31 15:01:27 +00:00
Reactor Scram
e4d828b9b1 ci(docker): bump Rust from 1.74 to 1.76 (#4033)
This was accidentally missed in #3632. Jamil said it may fix
`cargo-chef`'s caching once merged.

Part of #3995
2024-03-07 19:08:23 +00:00
Thomas Eizinger
6c2fdcfd0a chore: bump Rust version to 1.76 (#3632) 2024-02-13 17:01:22 +00:00
Jamil
b1738bdd46 feat(ci): Add e2e test bed (#3135)
- [x] Launch control plane via docker compose
- [x] Ensure all clients build
2024-01-16 01:57:41 +00:00
Thomas Eizinger
5549044afe ci: use sccache for Rust (#2402)
Our caches in GitHub actions are hopelessly overflowing, plus for the
Kotlin and Swift jobs, we don't seem to be doing a particularly good job
at caching the build outputs because those jobs take forever.

Instead of using GitHub actions, this PR configures `sccache` for all
Rust compilation commands and uses a GCP bucket to store the artifacts.
This speeds up some of the builds a fair bit. Android now finishes in
~6minutes.

Apart from the self-hosted MacOS 14 runner, the Swift jobs are slow but
still a lot faster than what we currently have.

Windows seems to be quite slow at compiling / fetching artefacts which
is negatively impacted by this change because they now have to be
fetched from the bucket.

Overall, I think this is a net-positive though and should be much easier
to maintain going forward.

---------

Co-authored-by: Jamil <jamilbk@users.noreply.github.com>
2023-10-18 10:25:31 -07:00
Thomas Eizinger
dbb1dd4a3a deps(rust): bump to Rust version 1.73 (#2291)
See https://releases.rs/docs/1.73.0/ for details.
2023-10-10 13:03:06 -07:00
Jamil
80234f9c71 Github Actions cache on main and scope caches for all languages/runtimes (#2233) 2023-10-04 17:29:04 -07:00
Jamil
c4c6f3e4ca refactor(portal): Don't pin session token to user_agent or remote_ip (#2195)
Removing the check to get Rust PRs to pass.

**Note**: #2182 was dependent on this one, and has since merged into
this one.
2023-09-30 07:40:57 -07:00
Thomas Eizinger
8f9330ac03 chore: bump Rust to 1.71 (#1804)
There is nothing particularly exciting in this release but it is good to
keep up with them anyway. See https://releases.rs/docs/1.71.0/.

Co-authored-by: Gabi <gabrielalejandro7@gmail.com>
2023-07-24 19:58:30 +00:00
Gabi
e9be4b9ef5 connlib: moves it to the main firezone library
This brindgs connlib from its own separated repo to firezone's monorepo.
    
 On top of bringing connlib we also add and unify the Dockerfile for all
 rust binaries and add a docker-compose that can run a headless client, a
 relay and a gateway which eventually will test the whole flow between a
 client and a resource. For this to work we also incorporated some elixir
 scripts to generate portal tokens for those components.
2023-06-23 16:39:58 -06:00
Thomas Eizinger
0f594f44bc ci: install musl target via rust-toolchain.toml file (#1664)
Targets specified in the `rust-toolchain.toml` file are automatically installed by `rustup`. This avoid setup steps for other devs and also simplifies the CI setup.

To be able to compile native code to musl, we do need `musl-gcc` which comes with the `musl-tools` package on ubuntu.
2023-06-19 18:51:54 -03:00
Thomas Eizinger
ec453a2d9c feat(rust): bump to new stable release 1.70.0 (#1648) 2023-06-09 14:32:52 -07:00
Thomas Eizinger
f5fdd56812 relay: create channel bindings and relay data (#1618)
Here is a short demo:


[Relay](https://github.com/firezone/firezone/assets/5486389/c0199294-70ca-47b4-90ae-2c96428bdb56)

You can run this locally using the `./run_smoke_test.sh` shell-script.
It is not reliable enough yet to be used in CI but I used one if its
outputs to make a regression test.

---------

Co-authored-by: Jamil <jamilbk@users.noreply.github.com>
2023-05-22 17:25:16 -07:00
Thomas Eizinger
70e6982e45 Implement basic STUN server (#1603)
This is an alternative to https://github.com/firezone/firezone/pull/1602
that implements the server using a library I've found called
`stun_codec`.

It already has support for parsing a variety of attributes.

The following is a nice website to test some of the functionality:
https://icetest.info/

The server is still listening on:
`ec2-3-89-112-240.compute-1.amazonaws.com:3478`.
2023-05-10 07:58:32 -07:00
Thomas Eizinger
718e4da41a Move rust-toolchain to workspace root 2023-05-08 19:06:34 -03:00