26 Commits

Author SHA1 Message Date
Jamil
1acfcd5678 fix(gateway): bump timeoutstart to 15s (#9685)
3s on a fresh install may be too low for the binary to download.

Related:
https://firezonehq.slack.com/archives/C08FPHECLUF/p1750946191078759?thread_ts=1750940488.328739&cid=C08FPHECLUF
2025-06-26 14:19:44 +00:00
Thomas Eizinger
4cf36cd8bd docs(kb): update path to Gateway to new location (#8794)
In #8480, we changed the location that `firezone-gateway` gets
downloaded to but forgot to update the knowledgebase with the new path.

---------

Signed-off-by: Thomas Eizinger <thomas@eizinger.io>
2025-04-16 13:20:28 +00:00
Jamil
91db00f3d7 fix(gateway): Apply more specific firewall rules on start (#8483)
On some Linux distributions (Amazon Linux 2023), the default `iptables`
install includes a blanket deny rule in the `FORWARD` chain that
prevents packets from the tunnel interface from ever leaving the host.
To fix this, we ensure our `FORWARD` chain rules are inserted with
priority 1 which takes precedence over the blanket-deny rule.

We also update our MASQUERADE in the NAT table to apply only to the CIDR
range possible for Gateway tunnel IPs, as opposed to the default
`0.0.0.0/0`.

Fixes #8481
2025-03-19 05:32:50 +00:00
Jamil
9aa60b747e fix(gateway): Fix gateway install script for systemd 219 (#8480)
On older systemd versions (such as 219 bundled with Amazon Linux 2), the
`ExecStartPre` script isn't able to write to the `/usr/local/bin`
directory. This causes an error on unit startup.

To fix this, we update the `firezone-gateway-init` script to write to
`/opt/firezone` instead, which is `chown` `firezone:firezone`.

Tested to work on Amazon Linux 2.

Fixes #8471
2025-03-18 20:31:53 +00:00
Jamil
366215b1d6 fix(gateway): Prefer setting FIREZONE_ID over /var/lib/firezone (#8475)
When deploying a Gateway from the admin portal UI, we show various
environment variables required for setup. Until now, we've relied on the
`/var/lib/firezone` persistence method for identifying the Gateway.

However, this can cause issues on some systems that don't have writeable
access to /var/lib/firezone, or old versions of systemd that don't
support sandboxed access to this directory.

This PR updates each deployment method to use `FIREZONE_ID` instead
everywhere. Additionally, since the Docker upgrade script needs to
reinvoke the new container using the same arguments (more or less) as
the install, we need to extract the old `/var/lib/firezone/gateway_id`
file out of the existing container if it exists, and try to insert it
into the upgraded container.

Tested both scripts, including upgrades for the Docker script.

Fixes: #8471
2025-03-18 04:08:21 +00:00
Jamil
2b1e9ac17f fix(gateway): Use StateDirectory to create /var/lib/firezone (#8120)
This is needed on fresh installations.
2025-02-13 05:35:44 -08:00
Jamil
36f06b84ea fix(gateway): Harden systemd gateway unit file (#8102)
Tested this with Vultr. No errors or issues reported for either IP or
CIDR resources.

Fixes:
https://firezonehq.slack.com/archives/C06L41XN05T/p1739275605563679?thread_ts=1739267494.554949&cid=C06L41XN05T
2025-02-12 11:09:27 +00:00
Thomas Eizinger
05e895525b chore: set simpler default log filters (#7028)
Follow-up from #6985 to simplify our log filters everywhere. If any of
this doesn't fit, we should adjust the things here:


17ea827c03/rust/logging/src/lib.rs (L32-L40)
2024-10-14 18:54:36 +00:00
Thomas Eizinger
1fb41a87ef chore: instruct users to use systemctl edit (#6098)
Edit to unit files are likely to be overwritten by upgrades to it. To
prevent users from losing their edits, redirect them to use `systemd`'s
`edit` functionality instead.

Signed-off-by: Thomas Eizinger <thomas@eizinger.io>
2024-07-31 03:37:30 +00:00
Jamil
b7227d1abc docs: GitHub releases -> Changelog (#5763)
Needs to be updated with proper links pointing to changelog, not GH
releases.
2024-07-05 13:19:43 -07:00
Jamil
33dff8af96 docs: Add more Gateway deploy examples (#5646)
- ~~Adds `fontawesome` icons to the portal and integrates them into the
existing `icon` component. Use just like the heroicons except prefixed
`fa-`.~~ Edit: removed these because I don't think it's worth the
increased bundle size. Just going to inline the icons we need instead.
- Fixes #3041
- Fixes #5072
2024-07-02 19:59:04 +00:00
Jamil
a3970c2f0a chore: Revert hardcoding gateway artifact URL (#5407)
This was needed to work around an issue with installing systemd Gateways
from our Terraform examples. Now that the publish workflow is fixed this
is no longer necessary.
2024-06-17 12:04:11 -07:00
Jamil
7c20243733 fix(ci): Copy artifacts to prod on publish, not deploy (#5388)
Fixes hopefully the last remaining issue from #4397 


Fixes #5370
2024-06-17 07:30:53 -07:00
Jamil
cf093f2e9a fix: hotfix install to use GH (#5371)
Refs #5370
2024-06-13 20:51:03 -07: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
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
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
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
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
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
Thomas Eizinger
26494b0e34 ci: reduce duplication in integration tests (#4583)
Co-authored-by: Jamil <jamilbk@users.noreply.github.com>
2024-04-11 23:01:12 +00:00
Jamil
7c369e5b39 fix(gateway): Fix systemd gateway install script (#4407)
On some OSes (Debian 12) the script fails to get the correct version to
download (likely because of `sed` version), so this simplifies things a
bit.

---------

Signed-off-by: Jamil <jamilbk@users.noreply.github.com>
2024-03-31 15:56:24 +00:00
Jamil
16337d57f3 refactor(connlib): Reduce log noisiness for GA (#4381)
Fixes #4380 
Fixes #4379
2024-03-28 20:51:59 +00:00
Jamil
f358f824a1 chore(devops): Make some vars optional in systemd install script (#4017) 2024-03-06 17:18:25 -08:00
Jamil
92261be9e0 chore(devops): Use separate script to install systemd gateway (#4016)
This prevents us from backslack escape hell when trying to expose this
script in different contexts.

Needed as a pre-req to #4011
2024-03-06 17:04:22 -08:00