Commit Graph

568 Commits

Author SHA1 Message Date
Thomas Eizinger
35017537c7 feat(gateway): allow out-of-order allow_access requests (#6403)
Currently, the gateway requires a strict ordering of first receiving a
`request_connection` message, following by multiple `allow_access`
messages. Additionally, access can be granted as part of the initial
`request_connection` message too.

This isn't an ideal design. Setting up a new connection is infallible,
all we need to do is send our ICE credentials back to the client.
However, untangling that will require a bit more effort.

Starting with #6335, following this strict order on the client is a more
difficult. Whilst we can send them in order, it is harder to maintain
those ordering guarantees across all our systems.

To avoid this, we change the gateway to perform an upsert for its local
ACLs for a client. In case that an `allow_access` call would somehow get
to the gateway earlier, we can simply already create the `Peer` and only
set up the actual connection later.

---------

Signed-off-by: Jamil <jamilbk@users.noreply.github.com>
Co-authored-by: Jamil <jamilbk@users.noreply.github.com>
2024-08-28 13:10:06 +00:00
Andrew Dryga
2d083379c6 feat(portal): Internet resources (#6299)
They will be sent in the API for connlib 1.3 and above.

I think in future we can make a whole menu section called "Internet
Security" which will be a specialized UI for the new resource type (and
now show it in Resources list) to improve the user experience around it.

Closes #5852

---------

Signed-off-by: Andrew Dryga <andrew@dryga.com>
Co-authored-by: Jamil <jamilbk@users.noreply.github.com>
2024-08-27 23:11:17 +00:00
Brian Manifold
5d3fc7d0c4 feat(portal): Update Client index page to search all columns (#6377)
Why:

* Currently, when searching on the Client index page in the portal, the
only field being searched is the Client name. This commit adds the
ability to search either the Client name or the Actor name.

Closes: #5738
2024-08-26 21:57:41 +00:00
Andrew Dryga
43dc6c2053 fix(portal): Preload provider on pubsub events for the policy (#6444) 2024-08-26 15:32:13 -06:00
Andrew Dryga
9a3c2d714b fix(portal): Do not crash clustering process when Compute API is not available (#6443) 2024-08-26 15:32:01 -06:00
Andrew Dryga
8e4a4a7b05 feat(portal): Pre-check constraint conformation on client connect (#6431)
Closes #6216
2024-08-26 15:30:46 -06:00
Andrew Dryga
5b93860ddb fix(portal): Prevent wildcard abuse in DNS resources (#6430)
Now most common TLDs can't have `*` or `?` on the 2nd level, and TLD
can't have matching in itself either.

Closes #6357
Closes #6415
2024-08-26 15:30:09 -06:00
Jamil
c3d5a2a2d7 fix(ux/portal): conditions ux tweaks (#6417)
fixes #6367 

<img width="720" alt="Screenshot 2024-08-22 at 1 58 20 PM"
src="https://github.com/user-attachments/assets/806e4393-17a4-4bdf-9c6c-c1cfad641d78">

---------

Signed-off-by: Jamil <jamilbk@users.noreply.github.com>
2024-08-23 05:15:02 +00:00
Jamil
17c48c8b05 fix(ux/portal): Clarify note about IPv4/6 upstreams (#6407)
Closes #5115 

<img width="1155" alt="Screenshot 2024-08-22 at 1 10 56 AM"
src="https://github.com/user-attachments/assets/3138e055-28c5-47cc-a9db-9f78d36e0d40">
2024-08-22 16:18:28 +00:00
Andrew Dryga
25a22b4780 chore(portal): Test that we only render resources once in WS API (#6394) 2024-08-21 17:16:19 -06:00
Brian Manifold
95ec1871e7 feat(portal): Allow Policies to be searched by Resource/Group (#6286)
Why:

* When using the Portal UI, it can be difficult to find a given Policy
as only 10 are shown on the page at a time. It was also difficult to
determine which Resources a Group had access to and vice versa what
Groups were allowed to access a given Resource. This change allows
searching by either Resource or Group to filter what Policies are shown.

Closes: #5624
2024-08-20 21:13:22 +00:00
Andrew Dryga
a5342256c3 feat(portal): Allow bulk-deleting synced actors (#6352)
Closes #6301
Closes #6217

<img width="1728" alt="Screenshot 2024-08-19 at 12 19 16 PM"
src="https://github.com/user-attachments/assets/0c1b570d-9ea9-413a-a8b5-febcd6d37072">
2024-08-20 13:05:19 -06:00
Jamil
c67cbfad08 fix(portal): Fix helptext grammar for DNS resource (#6306)
Minor helptext fix for the DNS resource helptext.
2024-08-15 22:03:19 +00:00
Jamil
b1b9b552c2 fix(portal): Clarify how synced users count against billing (#6285)
Fixes #6155 

One question we get with almost each new customer is "if I enable sync,
won't that count towards my bill?". This PR aims to answer that question
right when they create the provider.

I will also make sure to update Enterprise accounts in Stripe with
`monthly_active_users_acount` so that they can view this metric on the
Billing page.

---------

Signed-off-by: Jamil <jamilbk@users.noreply.github.com>
2024-08-14 19:04:25 +00:00
Brian Manifold
4e9bd7334a fix(portal): Fix Resource show error on API created Resource (#6284)
Viewing a Resource created by an API client was crashing the view due to
the function creating the link to the actor not accounting for the API
client case.

Closes #6267
2024-08-13 22:07:00 +00:00
Jamil
4f4f8f83d2 revert: "feat(portal): Add 'temp account' feature for launch HN" (#6275)
Reverts firezone/firezone#6153

---------

Signed-off-by: Jamil <jamilbk@users.noreply.github.com>
2024-08-13 18:31:40 +00:00
Andrew Dryga
c922ea29e9 fix(portal): Fix DNS wildcard support for Gateways (#6270) 2024-08-12 12:54:20 -06:00
Jamil
7cc68196dd test: Fix flaky time condition unit test due to overflow (#6250)
Fixes the flaky time condition unit test by always using midnight as the
end time range so that the `flow.expires_at` is never calculated across
a day boundary into the future.

Supersedes #6244
2024-08-10 18:30:31 +00:00
Andrew Dryga
00b93f6b82 feat(portal): Wildcard dns with backwards compatibility (#6214)
If a new resource is created that will use format not supported by
previous client versions we temporarily show a warning:
<img width="683" alt="Screenshot 2024-08-07 at 2 28 57 PM"
src="https://github.com/user-attachments/assets/bbfdfc96-0c4b-4226-93c5-bc2b5fdb9d30">

It will also be excluded from `resources` list for older clients (below
1.2).

---------

Co-authored-by: Thomas Eizinger <thomas@eizinger.io>
2024-08-10 18:25:24 +00:00
Brian Manifold
0df2d34126 fix(portal): Update Resource definition in OpenAPI spec (#6234)
Update Resource definition in OpenAPI spec to include "connections" i.e.
which gateway groups/sites a new Resource would be connected to.

<img width="775" alt="Screenshot 2024-08-09 at 2 57 04 AM"
src="https://github.com/user-attachments/assets/502979b1-e928-4e36-91c0-ed7b62f7c4a8">
2024-08-09 22:45:20 +00:00
Jamil
bf7e41d6c9 chore(ux): Fix minor API beta page UX issues and add reply-to address (#6207)
Fixes help text, opens link in new page, quick polish on flash styling,
and adds `reply-to` so I can handle the email chain directly in HubSpot.

<img width="1233" alt="Screenshot 2024-08-07 at 10 44 36 AM"
src="https://github.com/user-attachments/assets/eb261ab3-9c3f-4aec-b530-fb14bbaf7c3d">
2024-08-07 20:36:36 +00:00
Brian Manifold
e78737c4c8 fix(portal): Refactor API URL config for Web app (#6202)
Why:

* The Swagger UI is currently served from the API application. This
means that the Web application does not have access to the external URL
in the API configuration during/after compilation. Without the API
external URL, we cannot generate a proper link in the portal to the
Swagger UI. This commit refactors how the API external URL is set from
the environment variables and allows the Web app to have access to the
value of the API URL.

Co-authored-by: Jamil <jamilbk@users.noreply.github.com>
2024-08-07 19:30:18 +00:00
Jamil
0c6cd4a804 fix(ci): Add http test server image specifiers to CI (#6208)
- Adds `http_test_server_image` to inputs so that it gets set properly
for CI (`debug`) and CD (`perf`)
- Updates `dev` -> `debug` in docker-compose.yml to fix pulls
- Fixes issue with seeds and relevant docs from #6205
2024-08-07 12:15:00 -07:00
Andrew Dryga
5545604ffc fix(portal): Do not allow emails with just TLD in place (#6205)
`foo@bar` was a valid domain, while it's technically possible that
somebody owns a TLD with MX records Stripe will not accept that, so we
have to adopt this validation and make sure sign ups don't results in
HTTP 500s.
2024-08-07 10:43:28 -06:00
Andrew Dryga
13c23d3b78 fix(portal): Do not fail when email identity is not found (#6187)
We were generating fake tokens when identity was not found but those had
empty ids so the code crashed. Now we fake the entire token and make
sure it's length is stable.
2024-08-07 10:25:08 -06:00
Thomas Eizinger
94527f9fa1 fix(gateway): always masquerade for docker-deployed gateways (#6169)
Without masquerading, packets sent by the gateway through the TUN
interface use the wrong source address (the TUN device's address)
instead of the gateway's actual network interface.

We set this env variable in all our uses of the gateway, thus we might
as well remove it and always perform unconditionally.

---------

Signed-off-by: Thomas Eizinger <thomas@eizinger.io>
Co-authored-by: Reactor Scram <ReactorScram@users.noreply.github.com>
2024-08-07 03:00:50 +00:00
Brian Manifold
6ed5fa3c33 fix(portal): Temporarily revert verified routes for API UI (#6185)
This temporarily reverts commit
d1703d2849.

The long term fix will be to have the API URL be set by environment
variables, but in the interest of time it will be hardcoded for now.

---------

Signed-off-by: Jamil <jamilbk@users.noreply.github.com>
Co-authored-by: Jamil <jamilbk@users.noreply.github.com>
2024-08-06 10:00:48 -07:00
Brian Manifold
023d05ece1 feat(portal): Add 'temp account' feature for launch HN (#6153)
Why:

* As part of our Launch HN, it was recommended to have a way to allow
people to try Firezone without needing to sign up. This commit adds the
changes need to create temporary accounts that are intended to be
deleted after the Launch HN is complete.

## Screenshots

#### Start Page
<img width="1459" alt="Screenshot 2024-08-02 at 11 00 15 AM"
src="https://github.com/user-attachments/assets/9b4c5dd4-52ee-43dc-8b4f-d3cc6389b698">

#### Temp Account Info Page
<img width="1461" alt="Screenshot 2024-08-02 at 11 00 28 AM"
src="https://github.com/user-attachments/assets/7e96360d-a878-4e63-b3f6-cca29d0bd79f">

#### Temp Account Sign In
<img width="1461" alt="Screenshot 2024-08-02 at 11 00 44 AM"
src="https://github.com/user-attachments/assets/f812e72a-7030-4b35-9ac3-3816a056ef55">

#### Bottom Banner
<img width="1462" alt="Screenshot 2024-08-02 at 11 01 02 AM"
src="https://github.com/user-attachments/assets/b5e9d90f-e888-46f1-9bb6-bcc59fe2c6e6">

#### Temp Account Identity Provider
<img width="1461" alt="Screenshot 2024-08-02 at 11 01 35 AM"
src="https://github.com/user-attachments/assets/79b3d7c4-fe3a-45a6-b4de-56d4f2c70f8e">
2024-08-05 15:45:22 +00:00
Jamil
83033d91ed fix(ux): Mention (Sites) on Gateway Groups section of REST API docs (#6161)
I'm thinking if we can just add `(Sites)` next the Gateway Groups title,
that will be enough for users to make the connection.
2024-08-02 19:50:30 +00:00
Jamil
d1703d2849 fix(portal): Use verified routes for OpenAPI docs (#6160)
Removes the hardcoded API link for an VerifiedRoutes version instead.
2024-08-02 19:40:10 +00:00
Jamil
c18d641991 fix(ux): Make all fields live-updated in clients/relays/gateways details pane (#6103)
Updates `Last connected` to `Last started` and makes sure the details
fields are reloaded when presence comes online.
2024-08-02 19:37:52 +00:00
Andrew Dryga
bf06534caf fix(portal): Prevent races during relay selection by only using the ones connected for more than 5 seconds ago (#6111)
Closes #6099
Should push #6109 to not being needed short term.
2024-08-02 11:10:40 -06:00
Andrew Dryga
63de0efb73 feat(portal): Time based policies (#6115)
Flows authorized by time-based policies will now expire at the latest
time permitted by the policy.
2024-08-02 01:49:44 -06:00
Andrew Dryga
8e1eb2429d fix(portal): Decrease WS timeouts for relays and gateways (#6112)
Related to #6095
2024-07-31 16:34:52 -06:00
Brian Manifold
3edbbfc8a2 fix(portal): Fix placement of 'sign-in w/ providers' heading (#6106)
Small UI/UX change. The 'Sign in with a configured provider' header was
always being shown, even if the account didn't have an OIDC provider
configured (i.e. all new accounts)

### Before
<img width="607" alt="Screenshot 2024-07-31 at 11 17 29 AM"
src="https://github.com/user-attachments/assets/e6d6d79d-509d-4d29-a051-7d836aa5b720">

### After
<img width="593" alt="Screenshot 2024-07-31 at 12 21 58 PM"
src="https://github.com/user-attachments/assets/db02979a-12b6-4620-b84c-0309931a6b52">

<img width="696" alt="Screenshot 2024-07-31 at 12 18 35 PM"
src="https://github.com/user-attachments/assets/db2b94b1-05e1-4f81-a2c5-e2befb19957e">
2024-07-31 16:42:40 +00:00
Brian Manifold
edc80129c8 feat(portal): Add REST API closed beta page (#6027)
Why:

* Before the REST API is release to all Firezone users a closed beta
program will be run. Rather than blurring out the API Clients page for
users that are not apart of the closed beta program, a 'beta' page will
be shown that will allow users to request access to the closed beta.
Once the REST API is released to all accounts, all of this can be
removed.

Closes: #5920 

### Screenshot
<img width="1445" alt="Screenshot 2024-07-24 at 6 55 36 PM"
src="https://github.com/user-attachments/assets/a09591bc-190c-4bd4-9716-9a74a0f09e0a">
2024-07-29 22:06:59 +00:00
Jamil
ff88bffc03 fix(ux): Trim whitespace from address before validation (#6061)
When a user copy-pastes an address into the `address` field that
contains a leading or trailing whitespace, it's not apparent why the
address is invalid. This is common when copy-pasting DNS names from
cloud consoles that have poor UIs, such as Azure.

Fixes #6059
2024-07-27 17:49:27 +00:00
Jamil
2b8ec89ec5 fix(ui): Center account name (#6053) 2024-07-25 13:23:52 -07:00
Jamil
6bed7ed4c1 fix(ux): Improve styling of sign in / sign up pages (#6036)
- Use consistently-sized titles and spacing for form sections
- Use larger and centered hero logo to match Welcome screen in client
apps
- If more than one action exists, use `style=info` instead of showing
multiple primary CTA buttons

Fixes #5730 
Fixes a regression that was originally fixed in #3390 
refs #5032 

## Before

<img width="1159" alt="Screenshot 2024-07-24 at 11 38 29 PM"
src="https://github.com/user-attachments/assets/a5261982-4975-4a8c-a30b-4d136a3b9b0f">
<img width="1159" alt="Screenshot 2024-07-24 at 11 38 21 PM"
src="https://github.com/user-attachments/assets/49a8d0c0-0753-4bfb-98db-c0654a3e4805">
<img width="1159" alt="Screenshot 2024-07-24 at 11 38 17 PM"
src="https://github.com/user-attachments/assets/9ef8f105-d3f6-4b36-8e9f-d05296c5b3e1">


## After

<img width="1159" alt="Screenshot 2024-07-24 at 11 32 19 PM"
src="https://github.com/user-attachments/assets/85535cdb-a2d2-4002-a742-8a99f24cd465">
<img width="1159" alt="Screenshot 2024-07-24 at 11 32 15 PM"
src="https://github.com/user-attachments/assets/3bf7bc55-fb8e-45c4-88aa-03a22f999426">
<img width="1159" alt="Screenshot 2024-07-24 at 11 32 10 PM"
src="https://github.com/user-attachments/assets/535de033-02ab-45c1-906e-180fdeabf03d">
2024-07-25 19:40:10 +00:00
Brian Manifold
97df661626 fix(api): add missing path parameter (#6039) (#6041)
Looks like I forgot one:

https://validator.swagger.io/validator/debug?url=https%3A%2F%2Fapi.firez.one%2Fopenapi

Co-authored-by: Antoine <antoinelabarussias@gmail.com>
2024-07-25 15:23:20 +00:00
Jamil
4839d8821c fix(ux): Make 'New' page title consistent (#6040)
Fixes a couple items missed from #5938
2024-07-25 08:03:03 -07:00
Jamil
881377cbe2 fix(ux): Redirect to policies/new after creating Resource (#5938)
Fixes a UX issue somewhat introduced by
https://github.com/firezone/firezone/pull/5870 where we changed behavior
to make the redirect consistent with other CRUD operations.

The behavior we had prior to
https://github.com/firezone/firezone/pull/5870 was to redirect to
Resource show, but feedback from customer (which makes sense) is that
you almost _always_ create a Policy after creating a Resource, so this
PR streamlines the hot path flow there.

This has occurred to a couple users in Discord as well, so by taking
them directly to policies/new it hopefully make clear the user needs to
create a Policy after creating a Resource.

This papercut occurred while customer was demo'ing Firezone to another
potential customer.

Fixes #5929 

cc @jameswinegar
2024-07-24 15:43:31 -07:00
Andrew Dryga
40748306ca fix(portal): Use modal for confirmation dialogs (#5833)
Still need to replace a few more `data-confirm` actions (have an issue
with HTML <dialog> positioning when it's defined inside Tailwind
tables.)

Closes https://github.com/firezone/firezone/issues/5794
Closes #5766
Closes #5887

---------

Signed-off-by: Andrew Dryga <andrew@dryga.com>
Co-authored-by: Jamil <jamilbk@users.noreply.github.com>
Co-authored-by: Reactor Scram <ReactorScram@users.noreply.github.com>
2024-07-24 16:29:53 -06:00
Jamil
bfa410f7df docs: Make it more clear that synced users have User role (#5934)
Fixes #5906
2024-07-24 17:21:46 +00:00
Brian Manifold
bdc4d85afa fix(api): fix generated openapi spec (#6008)
(External contribution)

Hi, first thanks to @bmanifold for his awesome work! I've not yet tested
the API but here is a first PR fixing various small mistakes in the
generated openapi spec:

Schema names cannot contain spaces
Add missing path parameters in the spec
Remove duplicated endpoint for creating an identity (not sure about
that, I'll let you check)
If you want to validate the generated spec you can paste it here:
https://editor.swagger.io/ (or at the bottow of your swagger ui)

Please review commit by commit

Co-authored-by: Jamil <jamilbk@users.noreply.github.com>
Co-authored-by: Antoine Labarussias <antoinelabarussias@gmail.com>
2024-07-24 15:59:15 +00:00
Jamil
b9af724944 fix(ux): Improve resource creation form and traffic filters (#5983)
- Adds `radio_button_group` to style radio buttons as big buttons
- Tweaks `inline_errors` so that `w-full` doesn't apply; this fixes the
input width from jumping when errors pop up
- Fixes #4979 
- Fixes #5239 


<img width="1616" alt="Screenshot 2024-07-23 at 5 45 12 PM"
src="https://github.com/user-attachments/assets/847c7a80-4cb6-4c4b-9095-1e7a08be479f">
2024-07-24 05:19:33 +00:00
Brian Manifold
2b93361719 refactor(portal): Temporarily remove time based policy conditions (#5981)
This PR temporarily removes the time based policy conditions. This is
only until #5861 is finished.

Closes #5979
2024-07-24 05:09:59 +00:00
Jamil
2f016a84d6 feat: add platform status link to 500 page (#5937)
Fixes #5933
2024-07-24 04:52:56 +00:00
Jamil
cf7ee18fb7 fix(portal): fix removeEventListener function call (#5942)
<img width="809" alt="Screenshot 2024-07-21 at 10 39 37 PM"
src="https://github.com/user-attachments/assets/43238940-22a6-459c-8bb6-a173352af31e">
2024-07-23 14:13:21 +00:00
Jamil
6ae494904e docs: Update 'user guides' -> 'client apps' (#5940)
- This terminology / naming makes things more clear for most
admins/users.
- Fixes layout of /kb/client-apps to align better

---------

Signed-off-by: Jamil <jamilbk@users.noreply.github.com>
Co-authored-by: Not Applicable <ReactorScram@users.noreply.github.com>
2024-07-23 14:04:07 +00:00