Commit Graph

159 Commits

Author SHA1 Message Date
Thomas Eizinger
e47c1766bf ci: move tests to bash scripts (#3648)
This improves maintenance because we can now use a regular matrix for
the integration tests and one can locally use tools like shellcheck or a
`bash-lsp` during development.

---------

Signed-off-by: Jamil <jamilbk@users.noreply.github.com>
Co-authored-by: Jamil <jamilbk@users.noreply.github.com>
2024-02-14 13:55:28 +00:00
Reactor Scram
b42f623ad6 ci(linux): add CI setup script for NetworkManager (#3641)
No user-facing changes. Just making sure I can install NM in the runner.
2024-02-14 02:54:42 +00:00
Jamil
16f5401a73 fix(gateway): Remove /dev/net/tun requirement and clean up upgrade script (#3392)
* Clean up gateway upgrade script
* Fixes #3226 to remove another place where things can go wrong when
upgrading gateways
2024-01-29 04:19:59 +00:00
Jamil
eeaa65812e fix(gateway): Use new prod Docker registry for upgrades (#3386) 2024-01-24 10:48:18 -08:00
Jamil
3c2b32c215 revert(devops): Revert healthcommands (#3280) 2024-01-17 03:35:45 -08:00
Jamil
36209c7d2d fix(rust): Check /proc for health checks (#3250)
Debian slim is slimmer than we could ever have imagined.
2024-01-16 16:46:44 +00:00
Jamil
34ab093dbc security(gateway): Don't run systemd gateways as root (#2943)
Docker-based gateways won't have working IPv6 (good point @AndrewDryga),
so I started testing the systemd gateways more and found some issues I
fixed.

* Update default tab order for Deploy gateways page to prefer systemd
* Update unit file to run gateway as unprivileged user
* Remove dependency on `wget` in unit file
* Fix iptables logic so rules as re-created on reboot
* Use `/var/lib/firezone` instead of `/etc/firezone` for writing runtime
files (`/etc/` is often mounted read-only on hardened systems)

---------

Signed-off-by: Jamil <jamilbk@users.noreply.github.com>
Co-authored-by: Andrew Dryga <andrew@dryga.com>
2023-12-21 18:29:10 +00:00
Jamil
54e2258264 Gateway upgrade docs (#2914)
Realized we need a small script to upgrade Docker-based gateways
reliably.
2023-12-14 21:20:30 -08:00
Andrew Dryga
37a2d7b7f5 Move elixir code to a subfolder (#1631) 2023-05-24 15:46:51 -06:00
Andrew Dryga
6a9012c964 Remove omnibus install scripts 2023-04-04 09:53:21 -06:00
Andrew Dryga
6eba82499a Use DEFAULT_ADMIN_EMAIL everywhere to prevent legacy key usage warnings on fresh installs (#1509) 2023-03-13 14:33:53 -07:00
Jamil
49d4040b60 Add version tag to migrate script (#1400)
* Add new `VERSION` to `docker_migrate.sh` script
* Add missing `SAML_KEYFILE_PATH` and `SAML_CERTFILE_PATH` env vars to
migrate script
* Add missing `PHOENIX_PORT` var
* Bump Elixir to 1.14.3
* Bump Erlang to 25.2.1
* Update docs to document new VERSION var in docker-compose.yml upgrade
mechanism

Fixes #1395
2023-02-01 19:38:55 -08:00
Andrew Dryga
8033d618c1 Expose phoenix and Wireguard ports specified in configuration (#1372) 2023-02-01 16:23:46 -08:00
Jamil
e4854902cd Revert to old Project API key (#1379)
Also update ping event timer to 1 day, with a 1 minute delay on boot.

Waiting on PostHog to confirm old API key is set.
2023-01-26 12:49:11 -08:00
Jamil
394008c008 Chore/update project api key (#1348)
Refs firezone/marketing#109
2023-01-19 19:46:01 -08:00
Jamil
3514bbfce4 Omit ownership statements from Postgres DB dump (#1334)
Fixes #1302
2023-01-18 11:54:58 -08:00
Jamil
bff52590e1 Migrate DB before using for the first time (#1310) 2023-01-13 17:43:44 -08:00
Jamil
5320596cec Add missing env var (#1309)
Makes the telem vars more robust
2023-01-13 17:30:09 -08:00
Jamil
330cafbbe5 Boot minimal app for DB changes (#1305)
Adds a minimal supervision tree for making DB changes from the
`FzHttp.Release` module. This allows the `bin/create-or-reset-admin` and
`bin/create-api-token` commands to be with `docker compose exec` or
`docker compose run --rm` indiscriminately.

Starting the FzHttp.Repo directly is more involved it's not compiled
into the release as an OTP app.
2023-01-13 13:45:18 -08:00
Jamil
ed23d9f346 Use eval for create-or-reset-admin; expose with RESET_ADMIN_ON_BOOT (#1287)
Fixes #1285
2023-01-11 19:55:18 -08:00
Jamil
1de24ff77e REST API (#1155)
### TODO

- [x] "/v0"
- [x] Double-check migration order; re-timestamp if necessary
- [x] Move `sites` fields to `configurations` so they can be updated
from API
- [x] #1240 -- it introduces possible race conditions for API requests
- [x] #1249 
- [ ] #1008 
- [ ] Final review

Signed-off-by: Jamil <jamilbk@users.noreply.github.com>
Co-authored-by: Andrew Dryga <andrew@dryga.com>
2022-12-31 12:58:11 -06:00
Jamil
de3919fb69 Add SupportOptions component and utm_source for links (#1219)
This PR also moves to `yarn` for docs package management for improved
speed, security, and developer experience. Docusaurus prefers yarn.

Refs firezone/marketing#126
2022-12-24 16:16:55 -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
1cbd96be6d Fix double-quotes in docker migrate
Signed-off-by: Jamil <jamilbk@users.noreply.github.com>
2022-12-11 14:09:28 -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
Jamil
25145bba47 Update Docker migration script to match install improvements (#1166) 2022-12-02 07:34:21 -08:00
Jamil
5d545da398 double-quote (#1095) 2022-11-05 15:01:05 -07:00
Jamil
4f4556d1c8 tlsOpts (#1094) 2022-11-05 14:51:34 -07:00
Jamil
5f14b1ab30 use tls opts (#1093) 2022-11-05 11:56:22 -07:00
Gabi
029891c69e Build/fix no prefix (#1089)
* fix: use caddy in host network_mode and make sure urls have a scheme

* fix: remove unnecesary exposed ports

* fix: remove support for hostnames begining with // since caddy doesn't support it

* Fix schemeless external URLs; error on invalid ones (#1090)

* Fix schemeless external URLs; error on invalid ones

* use different dockerfile for linux vs non-linux

* Use conditional EXTERNAL_URL defaults

* suppress empty warning

* postgres volume location

* Use inline Caddyfile

Co-authored-by: Jamil <jamilbk@users.noreply.github.com>
2022-11-03 19:36:37 -07:00
Jamil
b77eb394b3 check for docker compose before docker-compose (#1084)
* check for docker compose before docker-compose

* fix docker compose check

* formatting
2022-11-01 11:35:59 -07:00
Jamil
5ad4c8ccd5 Minor docs fixes (#1071)
* sudo for migrate

* Use sudo for cat

* docker-compose version 2 or higher
2022-10-27 16:28:26 -07:00
Jamil
73393daf49 don't swallow errors (#1070) 2022-10-27 16:04:57 -07:00
Jamil
e585228dd5 Fix CADDY_OPTS (#1065)
* Fix CADDY_OPTS

* bootstrapDB no matter what
2022-10-27 13:58:14 -07:00
Jamil
39d48aadb5 Don't accidentally swallow script errors (#1052)
* Don't accidentally swallow script errors

* add docs
2022-10-22 08:27:02 -07:00
Jamil
dd9841cd94 Polish install, migration script, docs (#1050)
* Checkpoint

* Checkpoint

* checkpoint

* fix typo

* Update migrate with changes

* UID and GID

* fix perms

* Remove custom user

* Fix migrate script typos

* fix grep

* remove cleverness

* migrate final fixes
2022-10-20 13:43:31 -07:00
Jamil
6bd6d99019 Update docker_migrate.sh
Signed-off-by: Jamil <jamilbk@users.noreply.github.com>
2022-10-19 23:02:06 -07:00
Jamil
d1c54a4c47 Update docker_migrate.sh
Signed-off-by: Jamil <jamilbk@users.noreply.github.com>
2022-10-19 23:00:10 -07:00
Jamil
67c58a41c6 Postgres install (#1047)
* tweak sleep

* Show postgres log output
2022-10-19 07:18:50 -07:00
Jamil
27e6ddc293 Fix configure bug for admins (#1045)
* Allow admins to configure devices

* Disable SSL certs

* Update scripts/install.sh

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

Signed-off-by: Jamil <jamilbk@users.noreply.github.com>
2022-10-18 22:20:16 -07:00
Jamil
12274e9863 Make install script work on macOS (#1044) 2022-10-18 18:53:22 -07:00
Jamil
febbe806d6 use hostname, not public ip (#1041) 2022-10-18 14:23:30 -07:00
Jamil
b20b1336c4 docker_install -> install (#1040)
* Use install.sh

* rename docker_install -> install
2022-10-18 12:03:52 -07:00
Jamil
f0df5899c7 Don't kernelCheck and wireguardCheck for docker
Signed-off-by: Jamil <jamilbk@users.noreply.github.com>
2022-10-18 11:58:11 -07:00
Jamil
eb5a401f2a Rename docker install script (#1036)
* docker install

* Remove Linux enforcement from auto install
2022-10-17 15:20:48 -07:00
Jamil
4e3d8dcb62 Sleep in docker install script (#1031) 2022-10-17 08:42:55 -07:00
Jamil
d963929c07 0.6.0 (#1004)
* 0.6.0

* Make OIDC and SAML user provisioning configurable per-provider (#1015)

* Got ugly migration to work

* Move auto_create_users to per-provider config

* Update deps to bust cache

* Update Process sleep

* Update docs with Auto create users

* working migration script (#1013)

* Add telem for Docker and SAML (#1020)

* Add telem for Docker and SAML

* Omit unneeded format
2022-10-13 15:22:53 -07:00
Jamil
701c36868e revert script name for now (#988) 2022-09-29 08:23:32 -05:00