Commit Graph

481 Commits

Author SHA1 Message Date
Andrew Dryga
4f16caa5ff Add slack notification for failed deployments 2023-07-11 14:19:23 -06:00
Jamil
d27da5ee3d Fix cache for Docker buildx (#1750)
~~This is an attempt to fix the CI bug
[here](https://github.com/firezone/firezone/actions/runs/5491388141/jobs/10007864417#step:4:1638)
possibly introduced in
[d9eb2d18](https://github.com/firezone/firezone/commit/d9eb2d18#diff-88bd94db0d5cfd5f0617b7c4ed48c0212597378ed7e28714c5d86c95999b4c7dR29)
and uncovered / exacerbated in Elixir 1.15~~

Edit: looks like this ended up being a couple cache issues with GitHub
actions:
1. The `elixir_api-container-build` cache would always overwrite the
`elixir_web-container-build` on subsequent builds of the same
`github.ref_name` (cache is scoped to branch name by default), leading
to the consistent error `Elixir.Web.Mailer.NoopAdapter does not exist`
whenever a branch was pushed to more than once.
2. The same thing happens with the `integration_test-basic-flow` job
because the `api` service gets built after the `web` service in
docker-compose.yml, overwriting its cache

For some reason it seems the `APPLICATION_NAME` ARG is not busting the
Docker cache properly on GitHub actions for elixir container builds, so
the fix here was to [use
`scope=`](https://docs.docker.com/build/cache/backends/gha/#scope) to
segregate the cache layers between builds of the same branch.
2023-07-10 17:30:09 +00:00
Jamil
aadf8fd866 Pass-checks workflow per subdir (#1749) 2023-07-07 16:25:21 -07:00
Jamil
35eeb9904c Pass all required checks that weren't triggered in the PR (#1748)
Fixes #1747 
Fixes #1746
2023-07-07 15:04:42 -07:00
Roopesh Chander
c9c13e1e11 Bring in apple client into monorepo (#1737)
This PR brings in the apple client into the monorepo.

---------

Co-authored-by: Jamil <jamilbk@users.noreply.github.com>
2023-07-07 10:37:24 -07:00
Gabi
eb5fc34f35 CI: add a flow that test client to resource ping (#1729)
This PR fixes a bunch of small things to allow a new flow to test
clients pinging a resource within docker compose.

Masquerade/Forwarding is enabled directly in the container for now, this
might change in the future.

Also added a README to be able to run this locally.

---------

Signed-off-by: Gabi <gabrielalejandro7@gmail.com>
Co-authored-by: Jamil <jamilbk@users.noreply.github.com>
2023-07-05 03:17:26 +00:00
Gabi
9cb024e787 Fix ubuntu 20.04 CI (#1734)
add a prefix key with host os to rust test job to prevent caching issues
2023-07-05 02:03:43 +00:00
Andrew Dryga
991759fbc2 Drop invalid cache restore keys 2023-07-04 18:23:43 -06:00
Andrew Dryga
8539543d3d Bump Elixir/OTP versions (#1730) 2023-07-03 23:11:47 +00:00
Jamil
5679d63206 Attempt to enable merge queue (#1713)
https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#merge_group
2023-07-03 11:52:35 -07:00
Thomas Eizinger
9deae3653a chore: unify and optimize Rust CI (#1710)
- Instead of having two, very similar jobs, we run our fmt, clippy and
tests steps across all crates and operating systems.
- We remove the dependency of the android and apple builds on the tests
and thus get faster feedback.
- We force clippy to fail on any warning. This one is super important
IMO. Warnings in Rust are very useful and ignoring them can lead to bugs
(think "unused Result" etc).

Resolves #1714.

---------

Signed-off-by: Thomas Eizinger <thomas@eizinger.io>
Co-authored-by: Francesca Lovebloom <franlovebloom@gmail.com>
2023-06-29 23:33:02 +00:00
Jamil
d35208bf17 Stub out client app directories in monorepo structure (#1716)
Stubs out the client app dirs and basic CI workflow for the client apps
in preparation to move them into this repository.

After this is merged @roop @pratikvelani you should be able to add the
client repos here.
2023-06-29 20:16:29 +00:00
Thomas Eizinger
d4e2624c28 fix(relay): remove smoke test CI script (#1717)
Unfortunately, this doesn't seem to be stable. I don't really understand
why. Judging from the logs, the problem is not in the relay but somehow
the final UDP packet doesn't arrive at the `gateway` binary.

To not unnecessarily block other PRs, I am removing the check for now.
2023-06-29 19:24:54 +00:00
Francesca Lovebloom
a4810986c7 connlib: Improve FFI bridges for Apple and Android (#1691)
This makes it possible to build the Apple/Android FFI bridges and
integrate them with their respective client apps.

---------

Signed-off-by: Francesca Lovebloom <franlovebloom@gmail.com>
Co-authored-by: Roopesh Chander <roop@roopc.net>
2023-06-28 11:29:59 -06:00
Andrew Dryga
e7d5d0579b Authentication for the live app (#1674)
Co-authored-by: Jamil <jamilbk@users.noreply.github.com>
2023-06-27 13:11:36 -06:00
Gabi
e9be4b9ef5 connlib: moves it to the main firezone library
This brindgs connlib from its own separated repo to firezone's monorepo.
    
 On top of bringing connlib we also add and unify the Dockerfile for all
 rust binaries and add a docker-compose that can run a headless client, a
 relay and a gateway which eventually will test the whole flow between a
 client and a resource. For this to work we also incorporated some elixir
 scripts to generate portal tokens for those components.
2023-06-23 16:39:58 -06:00
Jamil
0faf8d906c Add pnpm to runners (#1683)
Found another place where pnpm needs to be added.
2023-06-23 12:42:35 -05:00
Jamil
8d8687224b Use pnpm over yarn (#1678)
Did some research when picking a package manager for the website and
settled on `pnpm` for the following reasons:

- CLI-compatible with `npm`
- Typically faster than even `yarn` especially on Apple silicon
- Security: Pnpm uses a different dependency resolution algorithm and
different folder structure of node_modules that prevents illegal access
to packages by other packages.

I think I caught all the places, but I may be missing something, so if
this isn't a good idea we can revert back.

This PR also cleans up the actions workflows to remove dead code.
2023-06-22 10:40:32 -07:00
Jamil
8fa12b8492 jamilbk%feat/stub website in cloud (#1675)
* Remove `www/`
* Stub empty `website/` to silence Vercel. This shouldn't cause
conflicts when we merge `cloud` to `master`. Perhaps we want to start
working off `master` soon, and move the current tip of master to
`legacy`?
2023-06-22 11:08:28 -06:00
Thomas Eizinger
0f594f44bc ci: install musl target via rust-toolchain.toml file (#1664)
Targets specified in the `rust-toolchain.toml` file are automatically installed by `rustup`. This avoid setup steps for other devs and also simplifies the CI setup.

To be able to compile native code to musl, we do need `musl-gcc` which comes with the `musl-tools` package on ubuntu.
2023-06-19 18:51:54 -03:00
Thomas Eizinger
533b12c99e ci: specify workspace directory for cache action correctly (#1663) 2023-06-18 10:37:34 -07:00
Thomas Eizinger
5090d207c2 feat(relay): implement nonces for authentication (#1654)
To complete the authentication scheme for the relay, we need to prompt
the client with a nonce when they send an unauthenticated request. The
semantic meaning of a nonce is opaque to the client. As a starting
point, we implement a count-based scheme. Each nonce is valid for 10
requests. After that, a request will be rejected with a 401 and the
client has to authenticate with a new nonce.

This scheme provides a basic form of replay-protection.
2023-06-15 09:11:08 -07:00
Andrew Dryga
89b7e3b474 Fix assets pipeline, add Elixir deps audit, add Android applink manifest (#1659) 2023-06-14 17:15:38 -06:00
Andrew Dryga
67482857b6 Add double quotes to the var itself 2023-06-12 15:52:25 -06:00
Andrew Dryga
36c8fa3beb Try to wrap tf vars in backticks 2023-06-12 15:49:47 -06:00
Andrew Dryga
17b18444a7 Add missing env for terraform workflow 2023-06-12 15:42:12 -06:00
Andrew Dryga
5cfd3867c8 Do not attempt to persist tag versions back to the repo 2023-06-12 15:31:26 -06:00
Andrew Dryga
a845c2999d Fix github branch name 2023-06-12 15:03:17 -06:00
Andrew Dryga
571e861f62 Try pushing update using GH API 2023-06-12 14:52:50 -06:00
Andrew Dryga
54d19f50a9 Bump checkout action vsn in rust workflow 2023-06-12 14:29:00 -06:00
Andrew Dryga
c7f0a463ae Rename pre-commit step 2023-06-12 14:26:28 -06:00
Andrew Dryga
9b3468d4f7 Fix path to versions file 2023-06-12 14:26:12 -06:00
Andrew Dryga
01f428fd35 Inherit secrets to child workflows 2023-06-12 14:13:30 -06:00
Andrew Dryga
d8c9cf1a89 Fix races for concurrency control 2023-06-12 14:11:15 -06:00
Andrew Dryga
7c883a0ba0 Remove copy-pasted required inputs 2023-06-12 14:08:41 -06:00
Andrew Dryga
bf61b7964a Add missing on_workflow call 2023-06-12 14:03:42 -06:00
Andrew Dryga
32ebd7cae3 Try a different CI setup 2023-06-12 14:00:47 -06:00
Andrew Dryga
9dbffee560 Experiment with condition
Workflow is not picked up by GitHub for some reason
2023-06-12 12:42:04 -06:00
Andrew Dryga
ecb016f03c Lave a note on workflow_run feature and fix checkout feature 2023-06-12 12:33:31 -06:00
Andrew Dryga
a7274fa671 Continuous delivery to staging (#1655) 2023-06-12 12:15:55 -06:00
Andrew Dryga
7dd512e372 Run pre-commit CI step on all PRs 2023-06-07 09:12:53 -06:00
Andrew Dryga
27febb0775 Always run Elixir CI checks when code in main branch changed 2023-06-07 09:08:40 -06:00
Andrew Dryga
7498271ba3 Remove Elixir checks from pre-commit hook and rename CI step that runs it 2023-06-07 09:08:40 -06:00
Thomas Eizinger
16156a6448 relay: implement authentication (#1641) 2023-06-07 06:17:20 -07:00
Andrew Dryga
7857369614 Try to fix CI step 2023-06-06 17:18:45 -06:00
Andrew Dryga
d9eb2d18df Deployment for the cloud version (#1638)
TODO:
- [x] Cluster formation for all API and web nodes
- [x] Injest Docker logs to Stackdriver
- [x] Fix assets building for prod

To finish later:
- [ ] Structured logging:
https://issuetracker.google.com/issues/285950891
- [ ] Better networking policy (eg. use public postmark ranges and deny
all unwanted egress)
- [ ] OpenTelemetry collector for Google Stackdriver
- [ ] LoggerJSON.Plug integration

---------

Signed-off-by: Andrew Dryga <andrew@dryga.com>
Co-authored-by: Jamil <jamilbk@users.noreply.github.com>
2023-06-06 15:03:26 -06:00
Andrew Dryga
37a2d7b7f5 Move elixir code to a subfolder (#1631) 2023-05-24 15:46:51 -06:00
Andrew Dryga
70a03d39e6 Implementing channels logic (#1619) 2023-05-22 19:49:50 -06:00
Thomas Eizinger
f5fdd56812 relay: create channel bindings and relay data (#1618)
Here is a short demo:


[Relay](https://github.com/firezone/firezone/assets/5486389/c0199294-70ca-47b4-90ae-2c96428bdb56)

You can run this locally using the `./run_smoke_test.sh` shell-script.
It is not reliable enough yet to be used in CI but I used one if its
outputs to make a regression test.

---------

Co-authored-by: Jamil <jamilbk@users.noreply.github.com>
2023-05-22 17:25:16 -07:00
Jamil
5be87b97c2 Fix PR-labeler config (#1623)
Fix PR labeler config 🤞
2023-05-17 09:11:54 -07:00