Commit Graph

139 Commits

Author SHA1 Message Date
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
Jamil
dd67baf629 Build docker image in build workflow; Update automatic install to use Docker (#983)
* Test docker prod build in CI

* Need uses

* Set build-args

* Split builds

* Fix build-args format

* wtf

* hmmm

* Jeebus

* build version based on drafted release

* Build multi-platform images

* Only build for supported platforms

* Use newer OTP fingers crossed

* Use OTP 24 for arm64

* Finalize test build of Docker image

* Update comment

* Bump to OTP 25.1

* Use proper ver

* D'oh proper sha

* Use OTP 24 and install python for node build

* Use new Docker base

* Use python3

* Use newly-built base images with other platform support

* Don't build for ppc64le and s390x

* Build only for amd64/arm64

* Don't rebuild on publish; simply copy

* See where the image is being pushed

* Remove echo

* Add docker updates

* Match platforms from base image

* Use docker-compose over docker compose

* Use our own base

* we need python3

* use consistent service name

* trim trailing slash from external_url

* Build for latest tag in staging
2022-09-29 08:20:32 -05:00
Andrew
be565a6897 Install script UX: ask to load wireguard mod & install missing deps for Debian repo (#907) 2022-08-09 14:23:29 -07:00
Andrew
c14c8463e0 Remove sudo from install script (#852) 2022-07-26 11:38:37 -07:00
Jamil
76ab472b87 Telemetry timeouts (#836) 2022-07-25 11:47:58 -07:00
Andrew
ef7ee0eebe Guard tput calls for errors from CI (#827) 2022-07-25 11:47:58 -07:00
Andrew
2f11771d59 Update install script and docs for Cloudsmith package repo (#809)
* Update install script to setup and install firezone from cloudsmith repo

* silence source repo file not found when removing

* Update docs with cloudsmith repo instructions, add feedback message to uninstall

* Fix supported platforms link

* add upgrade note to post install pkg script & only grep config file for check if it exists

* Clean up install server doc links

* use apt-get instead of apt, add RHEL 7,8,9 & OLS 7,8,9

* Use more cross platform compatible terminal text styles
2022-07-25 11:47:58 -07:00
Jamil
2de119a49e Docker dev polish (#803)
* checkpoint

* Docker dev environment final root cause analysis

* Update CONTRIBUTING.md

* Update apps/fz_common/lib/fz_net.ex

Co-authored-by: Po Chen <chenpaul914@gmail.com>

Co-authored-by: Po Chen <chenpaul914@gmail.com>
2022-07-25 11:47:58 -07:00
Po Chen
bfbb671d32 Docker DEV (#737) 2022-07-25 11:47:58 -07:00
Jamil
4687220684 Acme support (#779)
* Bump nodejs to 16 lts (#772)

* Move docs to Docusaurus (#726)

* wait 10

Co-authored-by: Andrew <andrew@firezone.dev>
Co-authored-by: Chetan Verma <chetan61verma@gmail.com>
2022-07-25 11:47:58 -07:00
Jamil
97a7089194 Detect Fedora 36 2022-06-28 16:59:11 -07:00
Jamil
fb5d242330 Dont error for failed capture calls (#735) 2022-06-19 15:56:49 -04:00
Jamil
f84df97c86 Update install script to support Ubuntu 22.04 (#733) 2022-06-18 10:52:46 -04:00
Jamil
38072974a8 Update install.sh
More descriptive distro check
2022-06-01 11:10:28 -07:00
Jamil
500faf813a Bump all runtimes; use simpler version function for app version (#634) 2022-05-19 07:38:16 -07:00
Jamil
0d7939527d Fix kernelCheck order (#555) 2022-04-26 10:39:25 -07:00
Jamil
3d9f970b86 Add support for CentOS derivatives (#552)
Fixes #550
2022-04-22 09:18:24 -07:00
Jamil
2c5078e63f Add WireGuard preshared-keys to devices (#542)
* Add PSK support

* Add HTTP registered application name

* Better kernel check message

* Does order matter\?
2022-04-15 09:56:56 -07:00
Jamil
0c26b75825 Fix minor issues in install script (#536)
* Fix minor issues in install script

* Check for Linux
2022-04-11 14:24:08 -07:00
Jamil
923b6bd015 Match on Ubuntu 20.04 or 21.04 (#531)
Fixes #523
2022-04-08 14:02:31 -07:00
hieultan
d07386d7e3 Fix escape character error (#526) 2022-04-07 05:23:18 -07:00