Commit Graph

272 Commits

Author SHA1 Message Date
Reactor Scram
04fd2f9581 chore(gui-client): disable the Welcome screen only after the first sign-in (#5066)
Closes #5015.

This way if the user opens and closes the GUI without doing anything,
the Welcome screen still appears until they successfully sign in.
Previously the `ran_before` flag was set after the first GUI startup.

Tested on Windows once.
2024-05-21 18:20:40 +00:00
Reactor Scram
d59c3fef0a build(gui-client): add post-install and pre-remove scripts to the deb package (#5011)
Closes #4987

```[tasklist]
### Before merging
- [x] Get an x64 test VM on the Windows laptop and test a CI-built deb
```
2024-05-16 23:03:21 +00:00
Reactor Scram
770bb3432e chore(client): update internal docs for Windows and Linux GUI Clients (#5003)
Copied out of #4978
2024-05-15 22:19:04 +00:00
Reactor Scram
9c143bced3 test: remove backwards compatibility code for older Docker images (#4993)
Closes #4951
2024-05-15 17:08:30 +00:00
Jamil
e50b3bd865 chore: bump versions for 1.0.4 release (#4985)
Update download links etc for the 1.0.4 release
2024-05-14 16:11:12 +00:00
Jamil
469e970056 ci: fix flaky dns-systemd test by waiting a second before running (#4962)
It
[appears](https://github.com/firezone/firezone/actions/runs/9052492759/job/24870262108?pr=4961)
that occasionally the test runs before DNS sentinel is applied and/or
Resources updated.
2024-05-13 14:10:04 +00:00
Reactor Scram
5814efc036 chore(windows-client): proof of concept for installing a system service with WiX (#4903)
```[tasklist]
### Before merging
- [x] Make sure the service auto-starts
- [x] Make the process idle and report its status to Windows properly using https://github.com/mullvad/windows-service-rs
- [x] DRY log dir code
- [x] Figure out where service logs will go and how the GUI will zip them
- [x] Make sure the service gets a shut down signal from Windows (this is hard to catch in the Tauri GUI)
- [x] Make sure the service restarts when Firezone is updated
- [x] Make sure the service is stopped and un-installed when Firezone is un-installed
- [x] Add test to install the MSI and check that the service runs
- [x] (will move to another PR) ~~Clean up function names~~
- [x] Make sure the Linux GUI was not broken by refactoring
```
2024-05-13 14:08:21 +00:00
Jamil
0f112e0e69 fix(gateway): Detect executables with 'ELF' string (#4974)
On some older systems (CentOS 7), `file gateway` will produce this:

```
firezone-gateway: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, stripped
```

`ELF` is a much more reliable means of detecting the file is a binary
executable.
2024-05-13 07:16:52 -07:00
Reactor Scram
0ad72f00d1 refactor(headless-client): remove "linux-client" alias (#4933)
Is this worth it?

```[tasklist]
### Before merging
- [x] Double-check docs and ask Jamil to review
- [x] Would need Brian to review the terraform thing
- [x] Make sure Docker compat isn't broken for existing users (shouldn't be, the image is still just `client`)
- [x] Decide whether compatibility tests need to pass (if something breaks after merge we can revert this)
```
2024-05-10 15:43:02 +00:00
Reactor Scram
390f9de811 refactor(ci): use the same test framework for headless client and IPC service (#4943)
This will fix an issue with `linux-group` and `token-path` that happens
when I try to split up the binaries.

```[tasklist]
### Before merging
- [x] Fix linux-group. That stub-ipc-client command doesn't even exist anymore
```
2024-05-10 14:57:55 +00:00
Reactor Scram
42bafa898c chore(ci): fix debug_exit in the flaky systemd DNS test (#4934)
If these fail we shouldn't bail out since we're already bailing out and
we need them to continue for debug output.

Refs #4921
2024-05-09 15:06:01 +00:00
Reactor Scram
65064b1907 chore(ci): add debugging for that flaky DNS test (#4926)
Refs #4921 

I'm not sure of the cause yet. This extra debugging code should narrow
it down.
2024-05-08 21:39:55 +00:00
Jamil
1be77d4e2d chore: Bump versions to link 1.0.3 packages (#4924)
Link to latest binaries

Generated with `make -f scripts/Makefile`.

Just need a rubber-stamp, changes should be GTG
2024-05-08 21:09:50 +00:00
Reactor Scram
7870dcab25 ci(gui-client/linux): publish deb package in the release (#4876)
```[tasklist]
### Before merging
- [x] (FAILED) Test CI deb on Ubuntu 24.04 #4883
- [x] Wait for everything else to merge: #3884
- [x] Fix #4889
- [x] Fix #4890
- [x] Test on Ubuntu 20.04 (683bddc0b passed)
- [x] Test on Ubuntu 22.04 (683bddc0b passed)
- [x] diff between main and 683bddc0b to make sure nothing in the code changed
- [ ] Someone other than me should give it a once-over. `intended_behavior.md` has the manual smoke test I've been doing on it. Install script is <a943a9dba1/scripts/firezone-client-gui-install.sh> Deb package from CI is <https://github.com/firezone/firezone/actions/runs/8972824465/artifacts/1477261361> 
```
2024-05-07 14:11:24 +00:00
Reactor Scram
cdebfa6901 chore(gui-client/linux): fix group name, firezone should be firezone-client (#4889)
Also improved the manual testing checklist a little
2024-05-06 14:09:30 +00:00
Reactor Scram
e8b1736cb0 chore(gui-client/linux): show an error if the user doesn't belong to the firezone group (#4822)
Ran into this during testing. For some reason Ubuntu 20.04, maybe
others, requires a reboot to add the desktop user to a group. I thought
logging out and back in should be enough but it's not.

<img width="527" alt="image"
src="https://github.com/firezone/firezone/assets/13400041/4f7c2551-c7aa-4ecc-be55-66c6e6ac32a0">

---------

Signed-off-by: Reactor Scram <ReactorScram@users.noreply.github.com>
2024-05-03 14:04:21 +00:00
Reactor Scram
93f7c86f55 chore(gui-client/linux): add smoke test checklist (#4882)
This is what I've been doing on the testing VMs to exercise the
first-run behavior.

---------

Signed-off-by: Reactor Scram <ReactorScram@users.noreply.github.com>
2024-05-02 19:33:14 +00:00
Reactor Scram
35a802d6d9 chore(gui-client/linux): add install script and change group to firezone-client (#4879)
Closes #4873
2024-05-02 17:51:28 +00:00
Andrew Dryga
6f3ac132ae Disable log colors when gateway is logging to systemd 2024-05-01 20:33:37 -06:00
Andrew Dryga
09f25d6e0c refactor(infra): Install gateways without using Docker (#4839) 2024-05-01 10:31:18 -06:00
dependabot[bot]
6172d6c080 build(deps): Bump puppeteer from 22.6.4 to 22.7.1 in /scripts/tests/browser (#4866)
Bumps [puppeteer](https://github.com/puppeteer/puppeteer) from 22.6.4 to
22.7.1.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/puppeteer/puppeteer/releases">puppeteer's
releases</a>.</em></p>
<blockquote>
<h2>puppeteer-core: v22.7.1</h2>
<h2><a
href="https://github.com/puppeteer/puppeteer/compare/puppeteer-core-v22.7.0...puppeteer-core-v22.7.1">22.7.1</a>
(2024-04-25)</h2>
<h3>Bug Fixes</h3>
<ul>
<li>roll to Chrome 124.0.6367.78 (r1274542) (<a
href="https://redirect.github.com/puppeteer/puppeteer/issues/12314">#12314</a>)
(<a
href="1241ccc908">1241ccc</a>)</li>
</ul>
<h3>Dependencies</h3>
<ul>
<li>The following workspace dependencies were updated
<ul>
<li>dependencies
<ul>
<li><code>@​puppeteer/browsers</code> bumped from 2.2.2 to 2.2.3</li>
</ul>
</li>
</ul>
</li>
</ul>
<h2>puppeteer: v22.7.1</h2>
<h2><a
href="https://github.com/puppeteer/puppeteer/compare/puppeteer-v22.7.0...puppeteer-v22.7.1">22.7.1</a>
(2024-04-25)</h2>
<h3>Miscellaneous Chores</h3>
<ul>
<li><strong>puppeteer:</strong> Synchronize puppeteer versions</li>
</ul>
<h3>Dependencies</h3>
<ul>
<li>The following workspace dependencies were updated
<ul>
<li>dependencies
<ul>
<li>puppeteer-core bumped from 22.7.0 to 22.7.1</li>
<li><code>@​puppeteer/browsers</code> bumped from 2.2.2 to 2.2.3</li>
</ul>
</li>
</ul>
</li>
</ul>
<h2>puppeteer-core: v22.7.0</h2>
<h2><a
href="https://github.com/puppeteer/puppeteer/compare/puppeteer-core-v22.6.5...puppeteer-core-v22.7.0">22.7.0</a>
(2024-04-23)</h2>
<h3>Features</h3>
<ul>
<li>roll to Chrome 124.0.6367.60 (r1274542) (<a
href="https://redirect.github.com/puppeteer/puppeteer/issues/12305">#12305</a>)
(<a
href="ed9d7dd2f5">ed9d7dd</a>)</li>
<li><strong>webdriver:</strong> support Network interception (<a
href="https://redirect.github.com/puppeteer/puppeteer/issues/12279">#12279</a>)
(<a
href="8fa52a50bd">8fa52a5</a>)</li>
</ul>
<h3>Bug Fixes</h3>
<ul>
<li><strong>performance:</strong> cache isolatedHandle (<a
href="https://redirect.github.com/puppeteer/puppeteer/issues/12150">#12150</a>)
(<a
href="9a17ec3b2a">9a17ec3</a>)</li>
</ul>
<h2>puppeteer: v22.7.0</h2>
<h2><a
href="https://github.com/puppeteer/puppeteer/compare/puppeteer-v22.6.5...puppeteer-v22.7.0">22.7.0</a>
(2024-04-23)</h2>
<h3>Features</h3>
<!-- raw HTML omitted -->
</blockquote>
<p>... (truncated)</p>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="feef2a300e"><code>feef2a3</code></a>
chore: release main (<a
href="https://redirect.github.com/puppeteer/puppeteer/issues/12318">#12318</a>)</li>
<li><a
href="eba46368d8"><code>eba4636</code></a>
ci: switch to macos-13 (<a
href="https://redirect.github.com/puppeteer/puppeteer/issues/12326">#12326</a>)</li>
<li><a
href="e35e783a74"><code>e35e783</code></a>
chore: make a single visibility check (<a
href="https://redirect.github.com/puppeteer/puppeteer/issues/12317">#12317</a>)</li>
<li><a
href="e254f746ee"><code>e254f74</code></a>
chore: remove type castings (<a
href="https://redirect.github.com/puppeteer/puppeteer/issues/12322">#12322</a>)</li>
<li><a
href="97637036c1"><code>9763703</code></a>
test: change test for BrowserContext (<a
href="https://redirect.github.com/puppeteer/puppeteer/issues/12321">#12321</a>)</li>
<li><a
href="c9a5644c65"><code>c9a5644</code></a>
fix(performance): speed up Firefox profile creation (<a
href="https://redirect.github.com/puppeteer/puppeteer/issues/12320">#12320</a>)</li>
<li><a
href="943ade77b7"><code>943ade7</code></a>
build(deps): bump chromium-bidi to 0.5.19 (<a
href="https://redirect.github.com/puppeteer/puppeteer/issues/12319">#12319</a>)</li>
<li><a
href="1241ccc908"><code>1241ccc</code></a>
fix: roll to Chrome 124.0.6367.78 (r1274542) (<a
href="https://redirect.github.com/puppeteer/puppeteer/issues/12314">#12314</a>)</li>
<li><a
href="165e3ec10d"><code>165e3ec</code></a>
chore: update FF expectations after latest nighty (<a
href="https://redirect.github.com/puppeteer/puppeteer/issues/12316">#12316</a>)</li>
<li><a
href="be259de95f"><code>be259de</code></a>
test: fail faster if browser crashes (<a
href="https://redirect.github.com/puppeteer/puppeteer/issues/12310">#12310</a>)</li>
<li>Additional commits viewable in <a
href="https://github.com/puppeteer/puppeteer/compare/puppeteer-v22.6.4...puppeteer-v22.7.1">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=puppeteer&package-manager=npm_and_yarn&previous-version=22.6.4&new-version=22.7.1)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-05-01 14:39:38 +00:00
Reactor Scram
be4053f4f5 refactor(gui-client/linux): use the same systemd service file in CI as in production (#4832)
This will keep the files from going out of sync.

This PR also checks that the IPC service creates the IPC socket with
`root:firezone` as the owner and group, when running under systemd.
2024-05-01 14:05:50 +00:00
Jamil
4dc656c90a chore(ci): bump versions (#4840) 2024-04-30 16:31:20 -07:00
Jamil
b79ce96bc6 chore(website): Bump versions (#4821)
- Bump versions to point to latest binaries
- Stage versions for next release
2024-04-29 22:06:00 +00:00
Reactor Scram
d0155bc786 fix(windows-client): package name should be "Firezone" not "firezone-client-gui" (#4814)
Closes #4813 

After PR, the installer, UAC dialog, and notifications all say
"Firezone" again

<img width="494" alt="image"
src="https://github.com/firezone/firezone/assets/13400041/69a4fe0b-78fa-4945-b17f-625e68ac09db">
2024-04-29 17:34:25 +00:00
Jamil
dc159ffbcb revert(android): revert to unpublished version (#4807) 2024-04-28 18:39:20 -07:00
Reactor Scram
b93e8870c3 refactor(linux-client): package systemd unit for IPC service (#4752)
This aligns some of the internal names with #4531, but it shouldn't
break the externally-visible things like package names or permalinks.

---------

Signed-off-by: Reactor Scram <ReactorScram@users.noreply.github.com>
2024-04-26 23:07:02 +00:00
Jamil
a43f39ae8b perf: increase UDP send rate for performance test (#4793)
Now that we've worked out the flakiness from the iperf tests, we should
increase the UDP send rate so we have some benchmark of how many packets
we can actually handle before dropping.
2024-04-26 21:11:44 +00:00
Jamil
963d79f40e fix(gateway): Fix conditional used to check for upgrades (#4796)
See https://firezonehq.slack.com/archives/C06L41XN05T/p1714071689814809
2024-04-26 07:55:26 -07:00
Reactor Scram
bc940784bd refactor(linux-client): remove FIREZONE_ID from example systemd file (#4714)
For tests it doesn't hurt, but this will be used as a template for the
systemd service we ship to production, and that can't have the ID there.

So I'm also cleaning up a few other problems I noticed:
- I wanted to split the service files as part of #4531, so that the GUI
Client and headless Client can have separate sandbox rules. e.g, the
headless Client won't be allowed to create Unix domain sockets
- I'm punting more things to systemd, which allows us to tighten down
the sandbox further, e.g. creating `/var/lib/dev.firezone.client` and
`/run/dev.firezone.client` for us
- Closes #4461

---------

Signed-off-by: Reactor Scram <ReactorScram@users.noreply.github.com>
2024-04-25 23:08:06 +00:00
Jamil
4471a42762 chore(gateway): Handle edge cases where gateway binary couldn't be downloaded (#4783)
Increases robustness of the systemd gateway upgrade mechanism.
2024-04-24 23:04:30 -07:00
Jamil
af066dcb97 ci: use consistent binary dest path naming (#4772) 2024-04-24 20:11:00 +00:00
Jamil
5dc52edecc ci: Bump versions and fix release overwrites (#4769) 2024-04-24 11:43:19 -07:00
Jamil
0b83b12fd2 ci: bootstrap browser test harness if missing (#4767)
Should be a less brittle fix to the problem of testing release images
for `compat-tests` with the browser harness.
2024-04-24 17:02:47 +00:00
Reactor Scram
e1eda7977c refactor: Make published artifact names consistent and use permalinks (#4746)
```[tasklist]
- [x] Update website
- [x] Update blog entry with old link
- [ ] ~~Replace Github URL in GUI Client updater with our own links~~
- [ ] Wait for CI to go green
```

Refs #4531 

This proposes a unified scheme for deb and MSI packages, and moves
Windows to that scheme.

This breaks compatibility. Existing Clients won't recognize the new
asset names once this is merged, so they won't show the "Firezone 1.0.0
is available" pop-up.

---------

Co-authored-by: Jamil Bou Kheir <jamilbk@users.noreply.github.com>
2024-04-24 09:42:12 -07:00
Reactor Scram
869dcfa02f fix(linux-client): forbid passing the token as a CLI arg (#4683)
Closes #4682 
Closes #4691 

```[tasklist]
# Before merging
- [x] Wait for `linux-group` test to go green on `main` (#4692)
- [ ] Wait for those browsers tests to get fixed
- [ ] *All* compatibility tests must pass on this branch
```

---------

Signed-off-by: Reactor Scram <ReactorScram@users.noreply.github.com>
Co-authored-by: Thomas Eizinger <thomas@eizinger.io>
2024-04-24 14:09:08 +00:00
Jamil
d656cd54f6 chore: remove test lib bash sourcing from customer-run scripts (#4753)
Didn't catch this in code review. These are run on customer's systems
and can't possibly source our shared script.
2024-04-23 19:04:02 +00:00
Gabi
adc0bb73f7 test(client): add reconnection tests from a client using a headless browser (#4569)
Considered using Elixir and Rust to write the tests.

For Elixir, `wallaby` doesn't seem to have a way to attach to an
existing `chromium` instance, launching it each time, which makes it
hard to coordinate with the relay restart.

For Rust we considered `thirtyfour` which would be very nice since we
could test both firefox and chrome but each time it connects to the
instance it launches a new session making it hard to test the DNS cache
behavior.

We also considered `chrome_headless` for Rust it needs a small patch to
prevent it from closing the browser after `Drop` but it still presents a
problem, since it has no easy way to retrieve if loading a page has
succeeded. There are some workarounds such as retrieving the title that
we could have used but after some testing they are quite finnicky and we
don't want that for CI.

So I ended up settling for TypeScript but I'm open to other options, or
a fix for the previous ones!

There are some modifications still incoming for this PR, around the test
name and that sleep in the middle of the test doesn't look good so I
will probably add some retries, but the gist is here, will keep it in
draft until we expect it to be passing.

So feel free to do some initial reviews.

Note: the number of lines changed is greatly exaggerated by
`package.lock`

---------

Signed-off-by: Thomas Eizinger <thomas@eizinger.io>
Co-authored-by: Jamil Bou Kheir <jamilbk@users.noreply.github.com>
Co-authored-by: Thomas Eizinger <thomas@eizinger.io>
2024-04-20 06:57:07 +00:00
Thomas Eizinger
51089b89e7 feat(connlib): smoothly migrate relayed connections (#4568)
Whenever we receive a `relays_presence` message from the portal, we
invalidate the candidates of all now disconnected relays and make
allocations on the new ones. This triggers signalling of new candidates
to the remote party and migrates the connection to the newly nominated
socket.

This still relies on #4613 until we have #4634.

Resolves: #4548.

---------

Co-authored-by: Jamil <jamilbk@users.noreply.github.com>
2024-04-20 06:16:35 +00:00
Reactor Scram
7081c71c10 chore(linux-client): allow custom token path (#4666)
```[tasklist]
# Before merging
- [x] Remove file extension `.txt`
- [x] Wait for `linux-group` test to go green on `main` (#4692)
- [x] *all* compatibility tests must be green on this branch
```

Closes #4664 
Closes #4665 

~~The compatibility tests are expected to fail until the next release is
cut, for the same reasons as in #4686~~

The compatibility test must be handled somehow, otherwise it'll turn
main red.
`linux-group` was moved out of integration / compatibility testing, but
the DNS tests do need the whole Docker + portal setup, so that one can't
move.

---------

Signed-off-by: Reactor Scram <ReactorScram@users.noreply.github.com>
Co-authored-by: Thomas Eizinger <thomas@eizinger.io>
2024-04-19 18:50:24 +00:00
Reactor Scram
bc22fb2bf2 test(linux-client): move linux-group test out of integration tests (#4692)
Closes #4669 

This should stop the problem of `linux-group` failing because of trying
to test an older release that doesn't have the right CLI features

---------

Co-authored-by: Jamil <jamilbk@users.noreply.github.com>
Co-authored-by: Thomas Eizinger <thomas@eizinger.io>
2024-04-19 02:52:31 +00:00
Thomas Eizinger
4972e49b34 ci: run assertions inside docker container (#4680)
As part of #4568, we are adding a 2nd relay which showed some
short-comings of the current process state assertions because they were
running outside the docker containers, thus listing all relays as soon
as there are multiple.
2024-04-18 23:48:42 +00:00
Reactor Scram
926ffe6f07 test(linux-client): fix linux-group integration test (#4671)
Closes #4669 
(Once I figure out the cause and then fix it)
2024-04-18 14:05:24 +00:00
Reactor Scram
e7a4a83e3d chore(linux): only allow IPC connections from members of the firezone group (#4628)
```[tasklist]
### Before merging
- [x] Update KB
```

Maybe not a feature since Linux IPC isn't available to users yet?

I think it's okay if the new `linux-group` test fails in compatibility,
since it wasn't implemented at all back then.

Closes #4659
Closes #4660

---------

Signed-off-by: Reactor Scram <ReactorScram@users.noreply.github.com>
Co-authored-by: Thomas Eizinger <thomas@eizinger.io>
2024-04-17 21:42:29 +00:00
Reactor Scram
2f6f2ef260 test(linux-client): check if we can add the user to a group in a CI test (#4600)
Refs #4513

The next step after this is to use this to test security in the Linux
IPC code, it should reject any IPC commands from users not in the
`firezone` group.
2024-04-17 20:40:27 +00:00
Reactor Scram
1f2821415f chore(linux): ask systemd to limit our privileges (#4630)
Should drop our `systemd-analyze security` level from 9.7 to about 2.5.
We could go a little further, but it would take a lot more effort, and
this is a good starting point.

```[tasklist]
# Before review
- [x] Remove unused trap function in Bash
- [x] Remove `systemd-analyze` call
```
2024-04-17 16:11:29 +00:00
Reactor Scram
cdf2bc8838 refactor(test): use 'set -euox' instead of manual echos (#4637)
I wasn't aware of `set x` when I wrote this, and it looks good in the
other test scripts.

I'm not sourcing `lib.sh` yet, because I don't happen to need any
functions from it. I have other draft PRs that will probably end up
using it.
2024-04-16 17:36:43 +00:00
Jamil
05386b8b4b chore(ci): Use netstat instead of ss for release image tests (#4640)
Fixes #4636
2024-04-16 11:14:52 -06:00
Reactor Scram
7bc1d51b0f test(linux-client): separate the token from the systemd unit file (#4626)
This is needed so that we can auto-update the systemd unit file, either
manually, or with a package manager like `apt`. We don't want users
cut-and-pasting these together on every update, and we don't want
machines doing it. Making the file updatable means we can make security
fixes to it easily.
2024-04-15 20:38:49 +00:00
Thomas Eizinger
be1a719e2c chore(relay): perform graceful shutdown upon receiving SIGTERM (#4552)
Upon receiving a SIGTERM, we immediately disconnect from the websocket
connection to the portal and set a flag that we are shutting down.

Once we are disconnected from the portal and no longer have an active
allocations, we exit with 0. A repeated SIGTERM signal will interrupt
this process and force the relay to shutdown.

Disconnecting from the portal will (eventually) trigger a message to
clients and gateways that this relay should no longer be used. Thus,
depending on the timeout our supervisor has configured after sending
SIGTERM, the relay will continue all TURN operations until the number of
allocations drops to 0.

Currently, we also allow clients to make new allocations and refreshing
existing allocations. In the future, it may make sense to implement a
dedicated status code and refuse `ALLOCATE` and `REFRESH` messages
whilst we are shutting down.

Related: #4548.

---------

Signed-off-by: Thomas Eizinger <thomas@eizinger.io>
Co-authored-by: Jamil <jamilbk@users.noreply.github.com>
2024-04-12 08:45:08 +00:00