Commit Graph

42 Commits

Author SHA1 Message Date
Jamil
de0a0b911b Use more informative log filepath (#2910)
* Sort clients list by `last_seen_at` desc. This handles the `online?`
case too. Before, they were sorted by `asc` which made it hard to see
which recent clients were connected
* Scope the client log filename by account slug and actor name so it's
easier to find.
2023-12-14 19:45:50 +00:00
Gabi
8e34457340 Add support for DNS sudomains (#2735)
This PR changes the protocol and adds support for DNS subdomains, now
when a DNS resource is added all its subdomains are automatically
tunneled too. Later we will add support for `*.domain` or `?.domain` but
currently there is an Apple split tunnel implementation limitation which
is too labor-intensive to fix right away.

Fixes #2661 

Co-authored-by: Andrew Dryga <andrew@dryga.com>
2023-12-08 00:16:42 -05:00
Andrew Dryga
3b94152edd Do not log a crash when client token is expired 2023-12-07 19:06:41 -05:00
Andrew Dryga
af5cc38f9e Pick latest-versioned gateways (#2739)
Closes #2733
2023-11-30 11:52:24 -06:00
bmanifold
ef480e1acd Add routing option for sites (#2610)
Why:

* As sites are created, the default behavior right now is to route
traffic through whichever path is easiest/fastest. This commit adds the
ability to allow the admin to choose a routing policy for a given site.
2023-11-22 19:59:54 +00:00
Andrew Dryga
33ab23b636 Cleanup UX and fix a bunch of TODOs (#2641)
This PR cleans up a lot of TODO and some issues I've discovered while
fixing them, there are _a few_ UI changes.

We show `(you)` next to your name on the actor view page, where
`Profile` link goes from the dropdown menu:
<img width="1728" alt="Screenshot 2023-11-13 at 19 05 35"
src="https://github.com/firezone/firezone/assets/1877644/f52b2531-e3be-4d3a-a587-4f9f54ca2c49">

Relays were way behind Gateways in terms of view code, so I changed them
to be exactly the same:
<img width="1728" alt="Screenshot 2023-11-13 at 18 54 39"
src="https://github.com/firezone/firezone/assets/1877644/a9f0905d-80d2-4e91-a744-c4baf7ad4a7c">

We also show authorizations on the Actor page because previously to find
"what this user did" you had to go through all user clients
individually:
<img width="1728" alt="Screenshot 2023-11-13 at 18 54 27"
src="https://github.com/firezone/firezone/assets/1877644/02ada445-e175-427e-99de-f9fa5bdd5aab">

I've noticed there is some confusion around sign-in slugs so I added a
home page where you can use ID or slug to get the in link (not all the
clients will know you need to put that in the URL) and recently used
accounts:
<img width="1728" alt="Screenshot 2023-11-13 at 18 54 06"
src="https://github.com/firezone/firezone/assets/1877644/ccfb9198-ed1f-4b3e-a26f-b76bab24243c">

Buttons to copy the code are more visible now, I've used our accent
color but am open to better ideas:
<img width="1728" alt="Screenshot 2023-11-13 at 19 10 29"
src="https://github.com/firezone/firezone/assets/1877644/a2c0658e-1003-409b-b5ad-d5d3ade60a10">

When code is copied it's also more visible:
<img width="699" alt="Screenshot 2023-11-13 at 19 11 41"
src="https://github.com/firezone/firezone/assets/1877644/62e793d2-d760-4aa7-9a42-92a6bbfcbf52">

We also do not redirect from that page automatically, but the large
button becomes green with the text changed:
<img width="660" alt="Screenshot 2023-11-13 at 19 12 11"
src="https://github.com/firezone/firezone/assets/1877644/780dcde3-8018-4405-91e5-984288431ec1">
2023-11-14 13:02:21 -06:00
Andrew Dryga
8f1d76dde2 Add optional name field to relays (#2544)
The idea is to allow users to explicitly name them so they are easier to
identify in the UI.

@thomaseizinger we will need to add an optional `FIREZONE_NAME`
environment variable for the relays and send it along with other
attributes when you connect to a WebSocket.
2023-11-09 16:34:39 +00:00
Andrew Dryga
4deb5797ff Try to resolve country coordinates from LB-provided country code and use US as default 2023-10-31 18:50:20 -06:00
Andrew Dryga
ad26e508ff GeoIP routing and load-balancing for traffic (#2517) 2023-10-31 15:01:37 -06:00
bmanifold
01f7839d0f Update API Upstream DNS address encoding (#2534)
Why:

* The portal was not able to properly JSON encode the Clients Upstream
DNS struct.
2023-10-31 06:37:07 +00:00
bmanifold
043cd555aa Update DNS portal config (#2432)
Why:

* After further discussion around the Client DNS settings, it was
decided that keeping both `type` and `address` would be easier to help
with validation and parsing. At the moment, only IP DNS servers are
accepted, but placeholders for `DNS over TLS` and `DNS over HTTPS` have
been created.
2023-10-20 21:16:45 +00:00
Andrew Dryga
e5fff809c0 Streamline apps versioning for Elixir and Terraform (#2257) 2023-10-05 20:29:25 -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
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
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
Andrew Dryga
58e9c42bb6 Broadcast new ICE candidates (#2149)
Closes #2118
2023-09-25 16:40:26 -06: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
Andrew Dryga
9281b7fede Allow client logs and messages instrumentation (#2086)
Closes #2019
2023-09-18 15:03: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
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
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
8398e3013b Protect the magic links from account spoofing (#1990)
Closes https://github.com/firezone/product/issues/644
2023-09-07 18:23:33 -06:00
Andrew Dryga
e290f26298 Complete Actors, Devices and Groups UIs (#1885)
This will be done once the remaining UI code is covered with tests.
2023-09-02 05:35:52 +00:00
Andrew Dryga
bbff335233 Fix return value for a new socket message 2023-08-11 01:45:42 -05:00
Andrew Dryga
3a5877eaa3 Update protocol to reuse gateway connections (#1825)
This is a result of our discussion with @conectado, this PR will add a
new message type which will allow reusing existing connections to the
gateway to access a new resource. We will also change the LB strategy to
be aware of the current device connection so that we will not pick a
different one if we have a connected gateway that can serve a new
resource.

---------

Co-authored-by: conectado <gabrielalejandro7@gmail.com>
2023-08-10 12:41:06 -05:00
Andrew Dryga
6f3df57df1 Resolve real client ips 2023-08-09 01:22:47 -05:00
Andrew Dryga
30800ddb75 Fix flaky test 2023-07-11 14:19:24 -06:00
Andrew Dryga
2a731ba25c Explicitly subscribe to id channels
Looks like for some reason the id/1 callback doesn't subscribe the channel process any more (only the socket itself), so we are doing that explicitly now.
2023-06-29 14:09:12 -06:00
Andrew Dryga
874db45f45 Fix formatting issue
My editor failed here due to a bug: https://github.com/elixir-lsp/vscode-elixir-ls/issues/345
2023-06-27 20:19:00 -06:00
Andrew Dryga
f10d298556 Do not render ipv6 relay address if it's nil 2023-06-27 17:59:57 -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
Andrew Dryga
fd72272203 Fix API error rendering 2023-06-26 13:21:15 -06:00
Andrew Dryga
e039f1919d Hotifx seeds and references (#1689) 2023-06-23 15:09:52 -06:00
Andrew Dryga
79a44ad0e8 Add resource type and expose it in WS API along with name (#1649)
Additionally:
1. Fixed ipv6 formatting for stun/turn addresses
2. Fixed a tests that check for race conditions concurrently
2023-06-07 15:48:00 -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