Commit Graph

2229 Commits

Author SHA1 Message Date
Andrew Dryga
7dd512e372 Run pre-commit CI step on all PRs 2023-06-07 09:12:53 -06:00
Andrew Dryga
81c5fe9aef Fix typos 2023-06-07 09:11:51 -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
9083ab79aa Set correct outbound email in local env 2023-06-06 17:13:54 -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
Thomas Eizinger
d27856a8f1 refactor(relay): introduce type-safe Server APIs (#1630)
We introduce dedicated types for each message that the `Server` can
handle. This allows us to make the functions public because the
type-system now guarantees that those are either parsed from bytes or
constructed with the correct data.

The latter will be useful to write tests against a richer API.
2023-05-31 15:18:20 +01:00
Andrew Dryga
37a2d7b7f5 Move elixir code to a subfolder (#1631) 2023-05-24 15:46:51 -06:00
Andrew Dryga
9e1669c333 Fix some of TODOs left from IAM PR (#1627) 2023-05-24 12:18:52 -06:00
Jamil
c30f571d73 Fix minor bugs and tidy up existing work on new views (#1628)
Just fixing some bugs and inconsistencies I found while going through
the new views.
2023-05-23 09:10:28 -07: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
0647eeebca 1.0 views (part 1) (#1599)
# Todo
- [x] Users
- [x] Groups
- [x] Devices
- [x] Gateways
2023-05-22 17:09:41 -07:00
Thomas Eizinger
9c120fb35a fix(relay): use correct variable (#1617)
We had a semantic conflict here that resulted in a broken build. This PR
fixes that.

Co-authored-by: Jamil <jamilbk@users.noreply.github.com>
2023-05-17 09:36:32 -07:00
Jamil
5be87b97c2 Fix PR-labeler config (#1623)
Fix PR labeler config 🤞
2023-05-17 09:11:54 -07:00
Andrew Dryga
e992863ae5 IAM context (#1577)
Things I've left for later to IAM:
1. Subject session expiration (to prevent session extension attacks);
2. UserPass adapter;
3. Token adapter and removal of APITokens in favor of `api_client` actor
with a Token provider;
4. Cleanup of Configurations schema and table
5. SCIM
6. Groups and Actor Profile (name, email) Sync
7. Email delivery once Web app is done with the templates
8. We might also want to persist sessions to database, to then show list
of active sessions to the user and allow to terminate some of them from
UI
9. SAML?
10. Rename `unprivileged` role name to `end_user`
11. Add `first_` and `last_name`, and sync/edit blocking logic around
it.
12. Rename Clients to Devices?
2023-05-16 19:42:36 -06:00
Jamil
d5cfd6365d Update workflows for cloud chaos (#1615)
Updating workflows to skip on PR and run on merges to `cloud`.
2023-05-16 13:50:17 -07:00
Thomas Eizinger
0d6e5986ae ci: remove broken workflows (#1614)
These workflows are all red which is expected as far as I understand.
I'd suggest we remove them to reduce the noise when reviewing PRs.

In case we ever wanted to bring parts of it back, Git is our best
friend.

Feel free to close if you think differently.
2023-05-16 13:35:39 -07:00
Thomas Eizinger
52df0cbfb4 relay: remember allocations by port (#1613)
Instead of remembering the used ports separately, we store a reference
to each allocation by port.
2023-05-16 09:05:51 +02:00
Thomas Eizinger
5e74143ede relay: don't repeat magic numbers througout the code (#1612)
A small refactoring to keep magic numbers only in one place.
2023-05-16 09:05:13 +02:00
Thomas Eizinger
675cb2dd54 relay: refresh allocations (#1610) 2023-05-16 07:21:02 +10:00
Thomas Eizinger
01f33ed4a0 relay: add basic README (#1611) 2023-05-16 05:39:28 +10:00
Thomas Eizinger
c0774523a8 relay: Parse and respond to allocation requests (#1604)
With this patch, the relay can parse and respond to allocation requests. I
ran some basics tests against https://icetest.info/ and implemented a
regression test as a result of the logged data.

In writing this, I also had to slightly change the design of `Server`
(as expected). Event handlers for incoming data now do not return a
message directly. Instead, the caller is responsible to drain `Command`s
from it.

When creating an allocation, we need to start listening on a new port.
This needs to happen outside the `Server` as I am going for a sans-IO
style. We emit a `Command` that instructs the main event loop to listen
on a new port. Any incoming data on that port will be forwarded to the
`Server`.

At the moment, this incoming data is just dropped. This is actually
standards-compliant because we cannot handle binding requests yet which
would allow this data to be forwarded to the client.

In some areas, the code is still a bit rough but I expect to iron those
things out as we go along.
2023-05-16 04:58:33 +10:00
Thomas Eizinger
24e4a1c052 Enforce no warnings in docs (#1605) 2023-05-12 11:28:21 -07:00
Thomas Eizinger
b090557e3d Install Rust before computing cache keys (#1606) 2023-05-12 11:27:49 -07:00
Thomas Eizinger
70e6982e45 Implement basic STUN server (#1603)
This is an alternative to https://github.com/firezone/firezone/pull/1602
that implements the server using a library I've found called
`stun_codec`.

It already has support for parsing a variety of attributes.

The following is a nice website to test some of the functionality:
https://icetest.info/

The server is still listening on:
`ec2-3-89-112-240.compute-1.amazonaws.com:3478`.
2023-05-10 07:58:32 -07:00
Thomas Eizinger
0be094124b Update .github/workflows/rust.yml
Signed-off-by: Thomas Eizinger <thomas@eizinger.io>
2023-05-08 19:06:34 -03:00
Thomas Eizinger
d7fab6b803 Add caching to CI 2023-05-08 19:06:34 -03:00
Thomas Eizinger
718e4da41a Move rust-toolchain to workspace root 2023-05-08 19:06:34 -03:00
Thomas Eizinger
8db82445ba Move gitignore and lockfile to workspace root 2023-05-08 19:06:34 -03:00
Thomas Eizinger
f9b6e96b5e Move everything to a workspace 2023-05-08 19:06:34 -03:00
Thomas Eizinger
8e5c3bc225 Avoid concurrent jobs 2023-05-08 19:06:34 -03:00
Thomas Eizinger
8257108872 Install necessary components for toolchain 2023-05-08 19:06:34 -03:00
Thomas Eizinger
3446bf1981 Add minimal scaffholding for relay 2023-05-08 19:06:34 -03:00
Andrew Dryga
2027e09a3e Remove unused docker-compose file 2023-04-27 14:19:25 -06:00
Andrew Dryga
3760c44522 Remove unused import 2023-04-27 14:19:25 -06:00
Andrew Dryga
92a7c505e3 Bring back browser/config.xml 2023-04-27 14:19:25 -06:00
Andrew Dryga
bcdeae3f9e Re-enable SQL sandboxing for Phoenix apps 2023-04-27 14:19:25 -06:00
Andrew Dryga
a4022fcc42 Replace web app with a new one based on Tailwind and esbuild (#1568) 2023-04-20 17:31:37 -07:00
Andrew Dryga
58b8d5212f Control channels for Clients, Relays and Gateways (#1551) 2023-04-20 11:34:56 -07:00
Andrew Dryga
0740d0fdba Add primitive tests and more structure for API app 2023-04-04 14:52:19 -06:00
Andrew Dryga
d4e4d702ab Drop REST API boilerplate for now 2023-04-04 11:50:07 -06:00
Andrew Dryga
9ffb741e96 Add client, gateway, relay boilerplate code 2023-04-04 11:49:21 -06:00
Andrew Dryga
6c75c1a5f6 Add skeleton of API app 2023-04-04 10:40:47 -06:00
Andrew Dryga
f5a23aab40 Fix priv/repo path 2023-04-04 10:07:53 -06:00
Andrew Dryga
b6a6382f45 Bring ecto.* helpers back to life 2023-04-04 10:01:31 -06:00
Andrew Dryga
6a9012c964 Remove omnibus install scripts 2023-04-04 09:53:21 -06:00
Andrew Dryga
9603aef011 Make sure that container can be built and run in PR CI step 2023-04-04 09:50:05 -06:00