Commit Graph

129 Commits

Author SHA1 Message Date
bmanifold
c4c1a67d12 DRY up heex templates (#2238)
This PR lays the ground work for making all the liveview pages more
uniform in how they are laid out by creating and updating some of the
liveview components.
2023-10-12 22:17:05 +00:00
Andrew Dryga
0aab4077f8 Fix auth flow state, bump COS to 109, enable fluentbit logging, auto-remove docker registry artifacts (#2315) 2023-10-11 16:19:47 -06:00
bmanifold
8dc869909a Update web signup page and add tests (#2305)
Why:

* The signup page was failing to allow signups due to a change in one of
the domain functions. This happened due to the UI not having tests for
the sign up page. The sign up page has been updated to use the new
domain function signature and has also had some tests added to hopefully
prevent regressions.

Co-authored-by: Jamil <jamilbk@users.noreply.github.com>
2023-10-11 15:16:35 -07:00
Jamil
44d14823e5 Use cached compiled deps for Elixir (#2272)
- Remove unused deps from lockfile with `mix deps.clean --unused
--unlock`
- Conditionally run `mix deps.compile` since it takes around a minute even cached
(~20s on my M1) 
- Add `mix deps.unlock --check-unused` to check for unused deps


### With `mix deps.compile`

<img width="1059" alt="Screenshot 2023-10-07 at 12 46 14 PM"
src="https://github.com/firezone/firezone/assets/167144/7a075d20-4fce-4545-b4a1-b8d57f5af06a">


```
mix deps.compile --skip-umbrella-children  2.98s user 1.83s system 27% cpu 17.252 total
```

### Without `mix deps.compile`

<img width="1046" alt="Screenshot 2023-10-07 at 3 09 23 PM"
src="https://github.com/firezone/firezone/assets/167144/060eb9d1-0e4c-42cc-9379-985a86ce383e">

---------

Co-authored-by: Andrew Dryga <andrew@dryga.com>
2023-10-10 04:17:24 +00:00
Jamil
d0d1c095c3 Fix spelling typos (#2289)
Fixes failing checks in #2284
2023-10-09 18:32:24 -07:00
Andrew Dryga
a61560701c Show flow actors (#2268)
It was hard to tell who exactly was authorized during a flow without
clicking around:
<img width="1465" alt="Screenshot 2023-10-06 at 15 53 43"
src="https://github.com/firezone/firezone/assets/1877644/26f7c865-714e-40fc-95d5-1b67e2de16cf">

Now it's possible:
<img width="1462" alt="Screenshot 2023-10-06 at 15 53 38"
src="https://github.com/firezone/firezone/assets/1877644/d4ddfd95-fa94-47a0-a73b-b3cdd31994a7">
2023-10-09 22:57:09 +00:00
Andrew Dryga
42bbafc04d Merge firezone/containers into elixir/Dockerfile for better reuse and maintainability (#2267)
Upsides:
1. We don't need to maintain a separate repo and Dockerfile just for
Elixir image (permissions, runner labels, etc)
2. No need to push intermediate images to the container registry
3. No need to copy-paste alpine/erlang/elixir version and hashes from
`firezone/containers` to `elixir/dockerfile` every time they change
4. No need to cross-compile for local dev environments, better
experience building with slow internet connection
5. One command to test if our code works on our containers but a
different alpine/erlang/elixir version

Downsides:
1. Locally devs will need to compile Erlang at least once per version,
but the whole build takes ~6 minutes on my M1 Max. It also takes only 8
minutes on the free GitHub Actions runner without any cache.
2. Worse experience on slow machines

FYI: there is no performance penalty once we have cache layers, still
takes 30 seconds on CI.
2023-10-06 15:34:47 -06:00
Andrew Dryga
c5ccef88f7 Copy entire project sooner 2023-10-06 14:17:17 -06:00
Andrew Dryga
5cd1465f85 Copy web/lib for the assets pipeline 2023-10-06 14:08:40 -06:00
Andrew Dryga
8c219c64c9 Add curl to the runtime image 2023-10-06 08:35:03 -06:00
Andrew Dryga
205f95bcfb Allow default user to write to /var/firezone 2023-10-06 08:21:36 -06:00
Andrew Dryga
e5fff809c0 Streamline apps versioning for Elixir and Terraform (#2257) 2023-10-05 20:29:25 -07:00
Jamil
80234f9c71 Github Actions cache on main and scope caches for all languages/runtimes (#2233) 2023-10-04 17:29:04 -07:00
Jamil
ff1c0b950a Add make version command to set version in components (#2215)
Fixes #2213 

This will allow us to fetch the actual Firezone version that's in use
from within the language runtimes themselves without resorting to an
external mechanism to do so. This is useful in connlib for example when
selecting the Portal API to use with `X-Firezone-API-Version`, and
useful in log printing.

Since platforms enforce semantic version, I propose the convention:

`1.20231001.34` where MAJOR is `1` for Firezone 1.0, MINOR is our API
version, and PATCH is the release of that API version that is published
on the repo.

Given this system, publishing a release would consist of:

1. Edit `Makefile` to set the patch and minor versions appropriately
depending on whether there are breaking portal API changes.
2. `make version`
3. `git add .; git commit; git push` -- this opens a PR with the new
version numbers. In this PR we can discuss whether to stop-ship or go.
4. PR merged, release is drafted and deployed to staging with the new
tag and version numbers
5. build artifacts are uploaded to drafted release, everything is tagged
and versioned appropriately without having to introduce another commit
6. If all looks good, publish release
2023-10-03 15:22:02 +11:00
bmanifold
c8090f8017 Update Account DNS settings UI (#2120)
Why:

* The previous Account DNS Settings page was only a static page. This
commit enables the form on the page to actually save and update the DNS
settings for a given account.
2023-10-02 14:19:48 -06:00
Andrew Dryga
2f78be155f Flows activity/metrics (#2176)
Charts library could be better, I did not find a way to configure
time-series min/max value or step, formatting Y axis is not trivial too,
but for an early feature this should do the job:

<img width="1728" alt="Screenshot 2023-09-27 at 20 00 10"
src="https://github.com/firezone/firezone/assets/1877644/8e4bef6b-2937-4dc2-ac31-3c61e31bffc6">
2023-09-30 16:04:33 +00:00
Jamil
64d9d0421a fix(portal): Increase assert_receive timeouts because GH is slow (#2197)
Fixes
https://github.com/firezone/firezone/actions/runs/6363610658/job/17279335896
and
https://github.com/firezone/firezone/actions/runs/6363673302/job/17279439543
2023-09-30 15:40:44 +00:00
Andrew Dryga
884022410f Fix lost client_* state on magic link resend (#2196)
Closes https://github.com/firezone/firezone/issues/2012
2023-09-30 15:11:31 +00:00
Jamil
c4c6f3e4ca refactor(portal): Don't pin session token to user_agent or remote_ip (#2195)
Removing the check to get Rust PRs to pass.

**Note**: #2182 was dependent on this one, and has since merged into
this one.
2023-09-30 07:40:57 -07:00
Andrew Dryga
38f017cdae Test a different strategy to check for ws origin 2023-09-29 16:54:58 -06:00
Jamil
72044cc065 refactor(android): Make app links more robust in the emulator (#2188)
Getting some weird behavior with AppLinks. They don't seem to work upon
first use and require a few tries to function correctly.

Edit: Found the issue: Android Studio doesn't like when the Manifest
contains variables for AppLinks. I added a note in the Manifest.

@conectado To test Applinks are working correctly, you can use the App
Link Assistant:

<img width="930" alt="Screenshot 2023-09-28 at 11 15 11 PM"
src="https://github.com/firezone/firezone/assets/167144/e4bd4674-d562-44ec-bdb8-3a5f97250b84">

Then from there you can click "Test App Links":

<img width="683" alt="Screenshot 2023-09-28 at 11 15 30 PM"
src="https://github.com/firezone/firezone/assets/167144/f3dc8e0d-f58a-4a4b-9855-62472096dc9e">
2023-09-29 18:09:04 +00:00
Andrew Dryga
37fc412ff3 Check websocket origin (#2192) 2023-09-29 12:02:54 -06:00
Andrew Dryga
3d143680b8 Show client/gateway Remote IP instead of internal IPs
Closes https://github.com/firezone/firezone/issues/2059
2023-09-29 09:25:48 -06:00
Jamil
d2c5968217 refactor(portal): Remove Dashboard, Landing pages and use sign_in for unauthenticated landing (#2175)
Fixes #2062
Fixes #2064 
Fixes #2063 


<img width="573" alt="Screenshot 2023-09-27 at 1 53 15 PM"
src="https://github.com/firezone/firezone/assets/167144/3e487475-4e63-4aa0-8614-57579bb4aa95">
2023-09-29 02:28:59 +00:00
Gabi
e446138150 add gabi key to assertlinks.json (#2183)
Signed-off-by: Gabi <gabrielalejandro7@gmail.com>
2023-09-28 13:59:19 -07:00
Andrew Dryga
5dddc1205e Change naming convention for spans for better integration with Cloud Trace 2023-09-27 15:46:00 -06:00
Andrew Dryga
1dac7d87a0 Do not show resources to clients that are not authorized to access them 2023-09-27 13:48:14 -06:00
Andrew Dryga
e92752a974 Prefix span names by socket type 2023-09-27 13:31:24 -06:00
Andrew Dryga
4f46cfd25f Remove required attribute on policy description textareas 2023-09-27 13:21:34 -06:00
Andrew Dryga
0b9dd334b4 Network flows (logs, auth) (#2166)
Closes https://github.com/firezone/firezone/issues/2095
Partially implements #949

<img width="1728" alt="Screenshot 2023-09-26 at 19 25 54"
src="https://github.com/firezone/firezone/assets/1877644/dffa8ae5-3095-4188-a1d2-3e8382e61628">
<img width="1728" alt="Screenshot 2023-09-26 at 19 26 03"
src="https://github.com/firezone/firezone/assets/1877644/853e8c90-eaae-4754-aea3-c58aba7cc97c">
<img width="1728" alt="Screenshot 2023-09-26 at 19 26 10"
src="https://github.com/firezone/firezone/assets/1877644/68aa9556-db11-4512-929a-45d1e4c3b258">
<img width="1728" alt="Screenshot 2023-09-26 at 19 26 17"
src="https://github.com/firezone/firezone/assets/1877644/020e0e98-142b-4b3b-aebf-789f2ad4e3c7">
2023-09-27 11:50:39 -06:00
Jamil
3d1921da7a feat(portal): Scrollbar improvements (#2160)
Thanks to @devsnaked for the fix. Opening this to get the changes merged
more quickly.

Supersedes #2072

---------

Signed-off-by: Maximilly Moreira Gonçalves <max.ocw@gmail.com>
Co-authored-by: Maximilly Moreira <max.ocw@gmail.com>
2023-09-27 15:24:26 +00:00
Andrew Dryga
58e9c42bb6 Broadcast new ICE candidates (#2149)
Closes #2118
2023-09-25 16:40:26 -06:00
Jamil
41bbf7e541 fix(portal): sidebar active item state (#2119)
Adds `active_path` to determine whether or not to highlight a sidebar
item.

~~Leaving as draft for now to allow @devsnaked to contribute. Edit: Will
use this PR as the base for @devsnaked's upcoming changes~~

Edit: fixes #2065
2023-09-25 21:29:56 +00:00
Jamil
0d7ff13fe3 fix(docs): Prevent adding typo single-quote to JSON examples (#2131)
Fixes #1968
2023-09-25 20:05:09 +00:00
Jamil
0342d37ef7 fix(portal): Fix sidebar item spacing (#2114)
# Before:
<img width="256" alt="Screenshot 2023-09-21 at 12 21 51 PM"
src="https://github.com/firezone/firezone/assets/167144/b39d4488-5116-46db-9a10-30fdc5ce10ca">

# After:
<img width="258" alt="Screenshot 2023-09-21 at 12 28 50 PM"
src="https://github.com/firezone/firezone/assets/167144/b8e0063e-b355-4e55-b1d3-45c553dd27fd">

Sidebar active state and collapsible will be fixed in another PR.
Fixes #2065
2023-09-22 15:50:47 +00:00
Andrew Dryga
93cb8a0699 Replace trace events with spans (#2112) 2023-09-21 11:48:01 -06:00
Andrew Dryga
e635ee3774 Properly set parent span ids for phoenix channels (#2101) 2023-09-20 22:21:34 -06:00
bmanifold
3e60079bf8 Update Account Settings page (#2092)
Why:

* The current account settings page shows the user profile info and
billing information. The billing system is not currently implemented and
can be hidden for the time being. As for the user profile information,
it was decided that it would probably be better to send the user to the
'Actors' show page for the currently logged in user.

<img width="1148" alt="new-account-settings-page"
src="https://github.com/firezone/firezone/assets/2646332/6aaabad0-038e-4b4c-8cfb-e2d669b54b53">
2023-09-20 10:22:39 -06:00
bmanifold
7608151f75 Enable Resource New/Edit forms (#1989)
Why:

* Previously the New/Edit forms for Resources were not able to actually
create or update Resources. This commit enables those forms to create
and update a Resource.

---------

Co-authored-by: Andrew Dryga <andrew@dryga.com>
2023-09-20 10:19:49 -06:00
Andrew Dryga
9281b7fede Allow client logs and messages instrumentation (#2086)
Closes #2019
2023-09-18 15:03:51 -06:00
Andrew Dryga
db7df665c4 Fix span name for background jobs 2023-09-14 01:00:51 -06:00
Andrew Dryga
86f04bff63 Trace api app and finish file renames (#2069) 2023-09-14 00:24:40 -06:00
Andrew Dryga
85b4aba9bc Rename Devices to Clients in Elixir app (#2008)
Renaming it back to clients to reflect service accounts and headless
clients use cases in the terminology. Such a rename will be very painful
on live data so better if we do it early on.

---------

Co-authored-by: Jamil Bou Kheir <jamilbk@users.noreply.github.com>
2023-09-13 12:37:27 +00:00
Andrew Dryga
7f7b214a8e Include OTEL to Elixir releases 2023-09-12 22:00:12 -06:00
Andrew Dryga
3ed9939ffd Use GRPC to report Elixir metrics 2023-09-12 21:20:07 -06:00
Andrew Dryga
782bbe9417 Add filters list to the resource view of a Gateway (#1987)
Closes https://github.com/firezone/product/issues/654
2023-09-12 18:46:27 -06:00
bmanifold
34fd5693d7 Update new/edit policy pages (#1946)
Why:

* The new and edit policy pages had previously only been pulling live
data from the DB, but had not been able to use the forms to create or
update policies. This commit allows the forms to function as intended.
2023-09-12 23:43:02 +00:00
Andrew Dryga
b911bd16dd Return HTTP 401 status code for invalid tokens (#1988)
Closes https://github.com/firezone/product/issues/651
2023-09-12 16:50:22 -06:00
Andrew Dryga
ec40af6a86 Hotfix issue with relays upsert index 2023-09-12 16:01:00 -06:00
Andrew Dryga
3e77682b94 Implement OIDC IdPs logout redirects (#2001) 2023-09-11 08:14:03 -06:00