Files
firezone/scripts
Thomas Eizinger eec615eddb refactor(connlib): drop all connections when roaming (#5308)
Currently, `snownet` tries to be very clever in how it roams
connections. This is/was necessary because we associated DNS-specific
state with a connection. More specifically, the assigned proxy IPs for a
DNS resource are stored as part of a connection with the gateway.

As a result, DNS resources would always break if the underlying
connection in `snownet` failed. This is quite error prone and means,
`snownet` must be very careful to never-ever fail a connection
erroneously. With #5049, we no longer store any important state with a
connection and thus, can implement roaming in much simpler way: Drop all
connections and let the incoming packets create new ones. This is much
more robust as we don't have to "patch" existing state in `snownet` as
part of roaming.

We test this new functionality by adding a `RoamClient` transition to
`tunnel_test`. This ensures roaming works in a lot of scenarios,
including relayed and non-relayed situations as well as roaming between
either of them. As a result, we can delete several of the more specific
test cases of `snownet`.

Depends-On: #5049.
Replaces: #5060.
Resolves: #5080.
2024-06-25 03:53:00 +00:00
..

Firezone shell scripts

This directory contains various shell scripts used for development, testing, and deployment of the Firezone product.

Developer Setup

We lint shell scripts in CI. To get your PR to pass, you'll want to ensure your local development environment is set up to lint shell scripts:

  1. Install shfmt:
  2. Install shellcheck:
    • brew install shellcheck on macOS
    • sudo apt-get install shellcheck on Ubuntu

Then just lint and format your shell scripts before you commit:

shfmt -i 4 **/*.sh
shellcheck --severity=warning **/*.sh

You can achieve this more easily by using pre-commit. See CONTRIBUTING.

Editor setup

Scripting tips

  • Use #!/usr/bin/env bash along with set -euox pipefail in general for dev and test scripts.
  • In Docker images and other minimal envs, stick to #!/bin/sh and simply set -eu.