Commit Graph

2029 Commits

Author SHA1 Message Date
Jamil
38c41feb67 Don't cache Elixir build in static_analysis workflow (#1227)
Still [having
issues](https://github.com/firezone/firezone/actions/runs/3759257641)
with the Elixir cache.

Things tried that didn't work:
- Namespacing by branch name. Github does this already.
- Removing the `restore-keys` in order to only restore the cache if it's
a direct hit.

The `static_analysis` workflow runs `mix compile --force
--warnings-as-errors` which doesn't use the build cache, so it's
removed, which fixes the problem.
2022-12-22 13:08:04 -06:00
Jamil
5e8407c017 Fix missing PLT cache key (#1225) 2022-12-21 23:35:49 -06:00
Jamil
26cb59d74b Fix rollback for release_test.exs due to Ecto 3.9.2 (#1223)
* Fix rollback for release_test.exs due to Ecto 3.9.2

4371bb7de8

* We don't support rollbacks

* Update .github/workflows/static_analysis.yml

Co-authored-by: Andrew Dryga <andrew@dryga.com>
Signed-off-by: Jamil <jamilbk@users.noreply.github.com>

Signed-off-by: Jamil <jamilbk@users.noreply.github.com>
Co-authored-by: Andrew Dryga <andrew@dryga.com>
2022-12-21 13:42:31 -06:00
Jamil
495109a418 Support more dense QR codes with error correction level L (#1222)
This also removes the QR code <canvas> from the DOM if there's a
render error.

Fixes #1217
2022-12-21 13:10:41 -06:00
Jamil
3a2c03d98f Use $tid
Signed-off-by: Jamil <jamilbk@users.noreply.github.com>
2022-12-20 22:27:43 -06:00
Jamil
7e34b0fc71 Fix install script param
Signed-off-by: Jamil <jamilbk@users.noreply.github.com>
2022-12-20 22:24:48 -06:00
Jamil
25e7de4f24 Enrichment (#1220)
* Debug TID

* Use new TID from wrapped install script

* Add as script param
2022-12-20 22:20:30 -06:00
Jamil
ed6784d598 Update upgrade.mdx
Signed-off-by: Jamil <jamilbk@users.noreply.github.com>
2022-12-19 11:00:22 -06:00
Jamil
8a677272a4 Add note about WIREGUARD_ env vars moving to DB
Signed-off-by: Jamil <jamilbk@users.noreply.github.com>
2022-12-19 08:58:13 -06:00
Jamil
ccf2ecd633 Document WIREGUARD_MTU is for server interface only (#1212)
Client configs will be generated based on runtime configuration
stored in the `sites` table, while server configuration (which
requires a restart of the server) will be configurable via ENV vars.

Refs #1270
2022-12-19 07:37:56 -06:00
Jamil
2b216a1d58 Update Docker IPv6 CIDR to use 2001:db8:1::/64 (#1213)
See https://github.com/firezone/firezone/issues/1202#issuecomment-1357294785
2022-12-19 07:37:36 -06:00
dependabot[bot]
0a6807c8fa Bump wireguardex from 0.3.5 to 0.3.6 (#1209)
Bumps [wireguardex](https://github.com/firezone/wireguardex) from 0.3.5 to 0.3.6.
- [Release notes](https://github.com/firezone/wireguardex/releases)
- [Commits](https://github.com/firezone/wireguardex/compare/v0.3.5...v0.3.6)

---
updated-dependencies:
- dependency-name: wireguardex
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-12-19 06:03:38 -06:00
Jamil
ec3c075c67 Use site table fields, not ENV vars for optional WireGuard config (#1207)
This takes us a step closer to having all runtime config
in the DB as opposed to ENV vars.

Fixes #1197
2022-12-18 21:39:33 -06:00
Jamil
acf29dcab9 Fix whitespace (#1208) 2022-12-18 21:15:46 -06:00
Jason G
5f6685c5aa General Docs Improvements (#1194)
* docs: add logs and update troubleshooting

Updates the troubleshooting doc for Docker based deployments and adds a general logs doc with more info on what Firezone logs.

Also added a mention of Audit logs in beta to source more convos.

* docs: further Docker clarifications

Clarifying some troubleshooting guides that refer to firezone-ctl.

Not everyone arrives at the env-vars or config file through the deploy/configure guide. Some load these pages directly via search. Adding a more prominent note that it's for Omnibus based deploy.

* docs: add troubleshooting docs on locked out state

Adding a section on reseting admin passwords for both docker and omnibus deployments. I realize we removed the omnibus firezone-ctl reference. I won't add it back since I have no idea where to put it.

* docs: update split tunnel doc

Was originally going to write more about other ways you can achieve split tunneling with wireguard, but will leave that for now

* fix whitespace

* update split tunnel doc

* docs: add DNS considerations to split tunnel doc

https://github.com/firezone/product/issues/527

* update split tunnel doc

* further clarify split tunnel doc

* add note about on-demand feature

* Docs - Improve titles and descriptions (#1187)

* docs: update titles, descriptions

Changes:
- set more descriptive titles (better for readers and SEO)
- add meta descriptions
- convert titles to sentence case for consistency

* docs: small fixes

* fix trailing whitespaces

* fix spelling

* Apply suggestions from code review

Co-authored-by: Jamil <jamilbk@users.noreply.github.com>
Signed-off-by: Jason G <jason@firez.one>

* add descriptions to client instructions

Signed-off-by: Jason G <jason@firez.one>
Co-authored-by: Jamil <jamilbk@users.noreply.github.com>

* chore: update logs doc

* chore: apply suggestions from code review

Co-authored-by: Jamil <jamilbk@users.noreply.github.com>
Signed-off-by: Jason G <jason@firez.one>

* chore: line length and log description

* chore: rename debug logs

* chore: apply suggestions from code review

Co-authored-by: Jamil <jamilbk@users.noreply.github.com>
Signed-off-by: Jason G <jason@firez.one>

* Docs - Add draft whitelist sso doc (#1185)

* doc: adding whitelist sso doc

redo of https://github.com/firezone/firezone/pull/995

* docs: add seo titles

* docs: improve titles

* grammar fixes

* fix trailing whitespace

apparently my vscode plugin does not find trailing whitespace in front matter

* put doc in draftmode

* add note on wireguard client apps

* Revert "add note on wireguard client apps"

This reverts commit 9013ce1c3b1bcb8b825f0fcbb1c5fe7e050cae82.

* Apply suggestions from code review

Co-authored-by: Jamil <jamilbk@users.noreply.github.com>
Signed-off-by: Jason G <jason@firez.one>

Signed-off-by: Jason G <jason@firez.one>
Co-authored-by: Jamil <jamilbk@users.noreply.github.com>

* chore: apply suggestions from code review

Co-authored-by: Jamil <jamilbk@users.noreply.github.com>
Signed-off-by: Jason G <jason@firez.one>

* chore: Update docs/docs/user-guides/client-instructions.mdx

Co-authored-by: Jamil <jamilbk@users.noreply.github.com>
Signed-off-by: Jason G <jason@firez.one>

* chore: update title capitalization and other small fixes

* Apply suggestions from code review

Signed-off-by: Jamil <jamilbk@users.noreply.github.com>

Signed-off-by: Jason G <jason@firez.one>
Signed-off-by: Jamil <jamilbk@users.noreply.github.com>
Co-authored-by: Jamil <jamilbk@users.noreply.github.com>
2022-12-18 21:07:11 -06:00
Jamil
6978504da0 Allow IPv6 remote_ips in StatsUpdater (#1206)
This fixes a bug where we assumed a peer's `endpoint`
(and therefore device `remote_ip`) would always be
an IPv4 address.
2022-12-18 18:10:22 -06:00
Jamil
c18d52cec8 Fix IPv6 routing for Docker-based deployments (#1204)
* Add instructions for enabling IPv6 within Docker

IPv6 routing is disabled by default on Docker. To have IPv6 work in Firezone
the same way IPv4 currently does (and IPv6 on Omnibus), four things are
generally required:

1. First, ensure your Docker host has IPv6 correctly set up with a quick
   ping test:
  ```
  > ping6 -c 4 google.com

  PING google.com(sfo03s32-in-x0e.1e100.net (2607:f8b0:4005:814::200e)) 56 data bytes
  64 bytes from sfo03s32-in-x0e.1e100.net (2607:f8b0:4005:814::200e): icmp_seq=1 ttl=51 time=1.96 ms
  64 bytes from sfo03s32-in-x0e.1e100.net (2607:f8b0:4005:814::200e): icmp_seq=2 ttl=51 time=1.94 ms
  64 bytes from sfo03s32-in-x0e.1e100.net (2607:f8b0:4005:814::200e): icmp_seq=3 ttl=51 time=1.92 ms
  64 bytes from sfo03s32-in-x0e.1e100.net (2607:f8b0:4005:814::200e): icmp_seq=4 ttl=51 time=1.90 ms
  ```
2. Add an IPv6 address, subnet, and `enable_ipv6: true` to the Docker
   compose. **Note**: Various Googling around the interwebs will uncover
   the myth that `enable_ipv6` is not supported on Docker Compose file
   versions 3+ -- this seems to be incorrect. Leaving out `enable_ipv6: true`
   prevented Docker from automatically assigning IPv6 addresses for
   containers attaching to that network.
3. Add the following to `/etc/docker/daemon.json`:
  ```json
  {
    "ipv6": true,
    "ip6tables": true,
    "experimental": true,
    "fixed-cidr-v6": "fd00:dead:beef::/80"
  }
  ```
4. The above causes Docker to automatically add `ip6tables` rules to
  set up IPv6 NAT/Masquerade for containers. However, this breaks DHCPv6
  Router Advertisements, so you'll need to re-enable them for your
  default interface with:
  ```
  egress=`ip route show default 0.0.0.0/0 | grep -oP '(?<=dev ).*' | cut -f1 -d' ' | tr -d '\n'`
  sudo echo "net.ipv6.conf.${egress}.accept_ra=2" >> /etc/sysctl.conf
  ```

* Fix bash cmd

* Apply suggestions from code review

Self-review

Signed-off-by: Jamil <jamilbk@users.noreply.github.com>

* Apply suggestions from code review

Signed-off-by: Jamil <jamilbk@users.noreply.github.com>

Signed-off-by: Jamil <jamilbk@users.noreply.github.com>
2022-12-18 16:49:36 -06:00
Jamil
eab4a3c13e Add IPv6 address to interface (#1203) 2022-12-17 18:17:23 -08:00
Andrew
d8a6e1712c Move IdP services to separate docker compose file (#1198)
* Move keycloak service in docker-compose.yml to commented out section for IdPs

* Move IdP services to separate compose file.

* fix whitespace
2022-12-17 08:31:07 -08:00
dependabot[bot]
3e380cdfc8 Bump rubocop from 1.39.0 to 1.40.0 (#1195)
Bumps [rubocop](https://github.com/rubocop/rubocop) from 1.39.0 to 1.40.0.
- [Release notes](https://github.com/rubocop/rubocop/releases)
- [Changelog](https://github.com/rubocop/rubocop/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rubocop/rubocop/compare/v1.39.0...v1.40.0)

---
updated-dependencies:
- dependency-name: rubocop
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-12-13 07:35:32 -08:00
Jamil
171d2895e0 Revert offline_access
Signed-off-by: Jamil <jamilbk@users.noreply.github.com>
2022-12-13 05:17:56 -08:00
Jamil
953ba80312 Add offline_access to Google doc
Signed-off-by: Jamil <jamilbk@users.noreply.github.com>
2022-12-13 01:37:48 -08:00
Jamil
1cbd96be6d Fix double-quotes in docker migrate
Signed-off-by: Jamil <jamilbk@users.noreply.github.com>
2022-12-11 14:09:28 -08:00
Jamil
0a19c67cd1 Use application_version() to link back to repo (#1181) 2022-12-07 11:11:30 -08:00
Andrew Dryga
28fe571543 Small improvements to make setup process easier for OS contributors (#1171)
* Remove _build folders for umbrella apps

For umbrella apps everything goes into /_build directory so there no need to ignore directories that should never be created

* Change mix aliases to be more aligned with what OS community would expect

1. We want ecto.create and ecto.migrate to be run on each tests, this will simplify setup steps (no need to run migrations manually)

2. ecto.remigrate is not needed because now you can just run ecto.drop and on tests migrations would be executed anyways.

* Rename docker-compose step name in CONTRIBUTING.md

The step was renamed here: dd67baf629 (diff-67a4805fdcc6145d7b3ada2a6099a9b2e91c9d0fd108c22f95d2f01d219793d1R10)

* Remove .devcontainer

This an is opinionated change. Right now devcontainer doesn't work but should be easy to fix (with renaming step name), but at the same time it forces developers that use VS code to have unified development environment (including plugins for the editor itself).

I feel like it's not a good path to go for OS and for small team - everyone should be allowed to use setup they like. Especially for people like me that tend to recompile ls-elixir for Elixir plugin from master branch.

Plus it's yet another thing to maintain while nobody on the team is using it, which means it will be always causing issues.

* Make fz_http mix.exs aliases aligned with umbrella app ones

* Redirect stderr to stdout in a command called from dev.exs

Otherwise I'm getting this on my MacOS (that has a `route` implementation that doesn't show interfaces) when `mix phx.server` is executed:
```
usage: route [-dnqtv] command [[modifiers] args]
```

* Fix race condition due to static device field values

Both public_key and name are unique and we should not use static values for field covered by unique index, otherwise deadlocks and slow tests are expected.

* Remove unwanted transaction block

The changeset code doesn't have any code that accesses the database and individual Ecto.SQL commands are already wrapped in transactions by default, so there is no need to start it manually and hold for longer than expected (while irrelevant Elixir code is running).

* Use netstat to identify egress interface on MacOS

* Rename uninstall.sh to omnibus-uninstall.sh

* Fix uninstall path in omnibus_build.yml
2022-12-06 15:07:45 -08:00
dependabot[bot]
94061a3581 Bump hammer_plug from 2.1.1 to 3.0.0 (#1176)
Bumps [hammer_plug](https://github.com/ExHammer/hammer-plug) from 2.1.1 to 3.0.0.
- [Release notes](https://github.com/ExHammer/hammer-plug/releases)
- [Changelog](https://github.com/ExHammer/hammer-plug/blob/master/CHANGELOG.md)
- [Commits](https://github.com/ExHammer/hammer-plug/compare/v2.1.1...v3.0.0)

---
updated-dependencies:
- dependency-name: hammer_plug
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-12-06 14:32:58 -08:00
Jamil
1feaf2ce12 Fix AsyncAPI specification errors (#1177)
Needed for the work @connectado is doing with the WebSocket API.
2022-12-06 13:02:40 -08:00
dependabot[bot]
1dde0c1952 Bump phoenix_live_reload from 1.4.0 to 1.4.1 (#1174)
Bumps [phoenix_live_reload](https://github.com/phoenixframework/phoenix_live_reload) from 1.4.0 to 1.4.1.
- [Release notes](https://github.com/phoenixframework/phoenix_live_reload/releases)
- [Changelog](https://github.com/phoenixframework/phoenix_live_reload/blob/master/CHANGELOG.md)
- [Commits](https://github.com/phoenixframework/phoenix_live_reload/compare/v1.4.0...v1.4.1)

---
updated-dependencies:
- dependency-name: phoenix_live_reload
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-12-05 22:06:39 -08:00
Jamil
f4cc03454e Wrap magic link with url() (#1170)
This broke when I introduced ~p across the codebase.
2022-12-03 08:19:21 -08:00
Jason G
73de8c3f33 docs: fix setup instruction (#1168) 2022-12-02 11:49:48 -08:00
Jamil
25145bba47 Update Docker migration script to match install improvements (#1166) 2022-12-02 07:34:21 -08:00
Philipp Bammes
47dd620d55 fix typo "MacOS" in user documentation (#1161)
Signed-off-by: Philipp Bammes <8144115+tyrann0us@users.noreply.github.com>

Signed-off-by: Philipp Bammes <8144115+tyrann0us@users.noreply.github.com>
2022-12-01 07:36:03 -08:00
Jamil
6d1010c21b Use complete Firezone URL for post_logout_uri (#1160) 2022-11-30 22:27:21 -08:00
Jamil
e32df103c9 Add missing cd step
Signed-off-by: Jamil <jamilbk@users.noreply.github.com>
2022-11-30 21:29:45 -08:00
Jamil
7a1ffd8c4f Fix build cache
Signed-off-by: Jamil <jamilbk@users.noreply.github.com>
2022-11-28 21:20:24 -08:00
dependabot[bot]
e99532232d Bump excoveralls from 0.15.0 to 0.15.1 (#1154)
Bumps [excoveralls](https://github.com/parroty/excoveralls) from 0.15.0 to 0.15.1.
- [Release notes](https://github.com/parroty/excoveralls/releases)
- [Changelog](https://github.com/parroty/excoveralls/blob/master/CHANGELOG.md)
- [Commits](https://github.com/parroty/excoveralls/compare/v0.15.0...v0.15.1)

---
updated-dependencies:
- dependency-name: excoveralls
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-11-28 13:15:47 -08:00
dependabot[bot]
7f4dd93038 Bump guardian from 2.3.0 to 2.3.1 (#1153)
Bumps [guardian](https://github.com/ueberauth/guardian) from 2.3.0 to 2.3.1.
- [Release notes](https://github.com/ueberauth/guardian/releases)
- [Changelog](https://github.com/ueberauth/guardian/blob/master/CHANGELOG.md)
- [Commits](https://github.com/ueberauth/guardian/compare/v2.3.0...v2.3.1)

---
updated-dependencies:
- dependency-name: guardian
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-11-28 10:17:50 -08:00
dependabot[bot]
990b36fa5f Bump akhilerm/tag-push-action from 2.0.0 to 2.1.0 (#1152)
Bumps [akhilerm/tag-push-action](https://github.com/akhilerm/tag-push-action) from 2.0.0 to 2.1.0.
- [Release notes](https://github.com/akhilerm/tag-push-action/releases)
- [Commits](https://github.com/akhilerm/tag-push-action/compare/v2.0.0...v2.1.0)

---
updated-dependencies:
- dependency-name: akhilerm/tag-push-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-11-28 08:27:51 -08:00
Jamil
157ac0bb38 run checks on master too (#1143) 2022-11-23 23:14:36 -08:00
Gabi
116de06bf4 Disallow netmasks in devices' ip to prevent overlaps in firewall (#1140)
* fix: disallow netmasks in devices' ip to prevent overlaps in firewall

/32 is still allowed for ipv4 and /128 is still allowed for ipv6.
No migration is needed since netmasks for devices ips were broken
before-hand.

* chore: rename `validate_single_ip` function and reword its error message

* Update pre-commit to allow slash

* fix restore cache

* Refactor a bit

* Fix clobbered restore-keys

* Break cache

Co-authored-by: Jamil Bou Kheir <jamilbk@users.noreply.github.com>
2022-11-23 22:56:22 -08:00
Jamil
7e552ab06e Add codespell (#1142)
* Add codespell

* Try codespell like this

* Use codespell config, not pre-commit

* ignore vendor
2022-11-23 22:31:32 -08:00
Kian-Meng Ang
ec5f0e24ae Fix typos (#1141)
Found via `codespell -S omnibus,*.json,yarn.lock,seeds.exs -L keypair,keypairs,iif,statics,wee`
2022-11-23 21:42:54 -08:00
Jamil
11b24866ef unless-stopped
Signed-off-by: Jamil <jamilbk@users.noreply.github.com>
2022-11-23 21:22:16 -08:00
Jamil
71fa282274 unless-stopped
Signed-off-by: Jamil <jamilbk@users.noreply.github.com>
2022-11-23 21:21:49 -08:00
Jamil
b13ece1e1c Revert to on-failure
Signed-off-by: Jamil <jamilbk@users.noreply.github.com>
2022-11-23 20:58:16 -08:00
Jamil
e0e9baf7bc Revert to on-failure
Signed-off-by: Jamil <jamilbk@users.noreply.github.com>
2022-11-23 20:57:47 -08:00
Jamil
1988cbe1de Change restart policy to unless-stopped (#1138)
* restart: unless-stopped

* Use updated ruby action
2022-11-23 16:13:37 -08:00
Jamil
ddcbc4dbd5 Remove nodejs from test workflow (#1131) 2022-11-18 11:18:34 -08:00
Jamil
50b2ab83a0 Only test when view is mounted (#1130) 2022-11-18 11:18:17 -08:00
Jamil
5be9b2003b Bump Elixir to 1.14.2, OTP to 25.1.2 (#1129)
* Bump Elixir to 1.14.2, OTP to 25.1.2

* bump tool versions
2022-11-18 09:55:54 -08:00