Commit Graph

65 Commits

Author SHA1 Message Date
Andrew Dryga
a6c28be0e8 Persist client auth params during magic link redirects 2023-08-11 17:43:01 -05:00
Andrew Dryga
b63440dcbe Fix another relays status issue 2023-08-11 10:04:48 -05:00
Andrew Dryga
2e38db090d Show connection status for global relays 2023-08-11 02:30:21 -05:00
Andrew Dryga
bbff335233 Fix return value for a new socket message 2023-08-11 01:45:42 -05:00
Andrew Dryga
37fc1b549d Do not bind device/client session to the IP address or User Agent
Clients use WebView to authorize so binding to UA doesn't make sense, IP's can change while roaming between cell towers.
2023-08-11 01:38:24 -05:00
Andrew Dryga
a26dab8087 Fix global relays indexes 2023-08-11 01:01:33 -05:00
Andrew Dryga
47c14d2f19 Add statuspage.io to CSP policy 2023-08-10 19:14:52 -05:00
Andrew Dryga
057e5be34c Add name query param during client auth redirect 2023-08-10 16:00:09 -05:00
Andrew Dryga
15887a27ea Fix portal redirect url 2023-08-10 13:11:18 -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
dbc572a8ef Remove legacy config env keys 2023-08-09 01:22:56 -05:00
Andrew Dryga
6f3df57df1 Resolve real client ips 2023-08-09 01:22:47 -05:00
Andrew Dryga
9e17352fd6 Deploy relays (#1706)
Will finish once #1705 is merged and stable.

cc @thomaseizinger
2023-08-08 17:15:33 -05:00
bmanifold
06394ab3c9 Add policies (#1850)
Why:

* Policies are needed to make sure devices are allowed to connect to a
      given resource.

---------

Signed-off-by: bmanifold <bmanifold@users.noreply.github.com>
Co-authored-by: Andrew Dryga <andrew@dryga.com>
2023-08-08 14:55:53 -05:00
Andrew Dryga
a7a05af2d2 Fix failing test 2023-08-08 13:18:06 -05:00
Andrew Dryga
7b07e91ea3 Fix crash 2023-08-08 12:55:15 -05:00
Andrew Dryga
4970ac489e Add fingerprint to assetlinks 2023-08-08 12:34:08 -05:00
Andrew Dryga
b9c11007a4 Add client auth flow (#1868)
Related to
[#588](https://github.com/firezone/product/issues/588#issuecomment-1591730203)
2023-08-07 17:15:35 -05:00
Andrew Dryga
acb4a0475b Fix a typo in a migration 2023-08-07 12:27:24 -05:00
Andrew Dryga
108097882d Add support for account slugs 2023-08-07 12:16:22 -05:00
bmanifold
11a31ae088 Refactor Actor and Device Liveviews (#1824)
Why:

* The previous Actor and Device Liveviews had used static views and data
as a starting point for fleshing out the web UI. This commit builds on
that and replaces (most) of the static data with data from the database,
as well as updating the static Liveview templates to use components
where possible.
2023-08-04 19:17:11 +00:00
Andrew Dryga
fe06d2e42d Actor groups and group sync helpers (#1727) 2023-07-31 16:22:40 -06:00
bmanifold
1c93c376ce Refactor Resource Liveviews to use real data (#1817)
Why:

* The previous Resource Liveviews had used static views and data as a
starting point for fleshing out the web UI. This commit builds on that
and replaces (most) of the static data with data from the database, as
well as updating the static Liveview templates to use components where
possible.

Note: These changes are only meant to involve the Resource views
(index/new/show/edit). More changes to other resources will follow(i.e.
Users, Devices, etc...)
2023-07-25 17:39:30 +00:00
Gabi
7ad2fb623a connlib: add client dns interception support (#1807) 2023-07-24 21:41:42 +00:00
Jamil
be99babf70 Update LICENSE to include component license clarification for subcomponents (#1806)
This updates the license for the admin portal (`elixir/`) to the Elastic
License v2, keeping other components Apache 2.0 licensed.

What does this mean for 1.0 going forward?

[Elastic's FAQ](https://www.elastic.co/licensing/elastic-license/faq) is
broadly applicable to Firezone as well. Most notably, MSPs may still use
Firezone to provide general remote access services for third party
users, just not to the Firezone admin portal itself (and REST API).

### Why?
We would lose a little bit of business, though one could argue that the
tradeoff is worth it due to increased market exposure/distribution.

The main, tangible reasons for us today involve the negative impact this
has on our ability to reach product-market fit:
1. We lose the direct feedback channel with paying customers, isolating
them (and us) from our roadmap.
2. Reseller licenses should be offered as part of a proper partner
alliance / reseller program when we have the resources to support it,
which will result in a much better experience for all parties involved
(and restore the lost feedback channel).
3. Having outdated, unpatched, and potentially buggy Firezone instances
running in the wild that we have no visibility or insight into is a
major liability to our brand and reputation and may even result in a
legal liability depending on the jurisdiction and severity of the issue.
See [this
example](https://aws.amazon.com/marketplace/pp/prodview-xgj7kkar35gus)
and [this
one](https://aws.amazon.com/marketplace/pp/prodview-jyd73dot3zrnw).
2023-07-20 21:14:38 +00:00
bmanifold
b41c4ed9e4 Create vertical table component for show pages (#1805)
Why:

* The `show` pages for all of the Firezone resources (i.e. Gateways,
Resources, Devices, etc...) were all very similar but were explicitly
defined in individual tables with their styling also explicitly defined
in each table. This commit creates a `vertical_table` component and a
`vertical_table_row` component to allow the styling to be defined once
and then consistently applied to each `show` page.
2023-07-19 18:56:49 +00:00
bmanifold
9a06a9bb14 Refactor Gateway Liveviews to use real data (#1760)
Why:

* The previous Gateway Liveviews had used static views and data as a
starting point for fleshing out the web UI. This commit builds on that
and replaces (most) of the static data with data from the database, as
well as updating the static Liveview templates to use components where
possible.

Note: These changes are only meant to involve the Gateway views
(index/show/edit). More changes to other resources will follow(i.e.
Resource, Users, Devices, etc...)

---------

Signed-off-by: bmanifold <bmanifold@users.noreply.github.com>
Co-authored-by: Andrew Dryga <andrew@dryga.com>
2023-07-18 21:15:59 +00:00
Andrew Dryga
3ae4c709a8 Remove Swoosh compilation dependency (#1771)
I also enabled check for email config before enabling email provider.
2023-07-13 12:09:56 -06:00
Andrew Dryga
30800ddb75 Fix flaky test 2023-07-11 14:19:24 -06:00
Jamil
1ffd08f2db Move NoopAdapter to Domain app (#1756)
Workaround for this:

https://github.com/elixir-lang/elixir/issues/12777
2023-07-10 15:00:29 -07: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
3f5b614ce7 portal: Stub out Settings views (#1702)
Adds Setting UI views based on the Balsamiq Wireframes. This should be
merged **after** #1679
<img width="1469" alt="Screenshot 2023-06-26 at 4 48 55 PM"
src="https://github.com/firezone/firezone/assets/167144/0994b12b-5d8d-48a6-bc8d-c9ba07d2403c">

<img width="1469" alt="Screenshot 2023-06-26 at 4 49 01 PM"
src="https://github.com/firezone/firezone/assets/167144/1d69a54d-2740-4ab0-819b-75a50a976285">
<img width="1616" alt="Screenshot 2023-06-29 at 12 29 26 AM"
src="https://github.com/firezone/firezone/assets/167144/94a8913f-93be-4502-b30e-c70f147dbe62">

<img width="1616" alt="Screenshot 2023-06-29 at 12 29 14 AM"
src="https://github.com/firezone/firezone/assets/167144/16dfc709-65b9-44fd-adad-c412dc1d44e6">

<img width="1616" alt="Screenshot 2023-06-29 at 2 36 43 PM"
src="https://github.com/firezone/firezone/assets/167144/3cddc4b3-7494-4710-953e-4d60108b9aa8">
<img width="1616" alt="Screenshot 2023-06-29 at 2 36 56 PM"
src="https://github.com/firezone/firezone/assets/167144/1f433239-1023-471d-916c-76c43f47835e">
<img width="1616" alt="Screenshot 2023-06-29 at 2 37 05 PM"
src="https://github.com/firezone/firezone/assets/167144/9cd4be23-02eb-4adf-902b-00c02cecd744">
2023-07-06 22:20:41 +00:00
Andrew Dryga
fe44a18d95 Fix flaky tests 2023-07-04 10:05:40 -06:00
Andrew Dryga
0528c6fc18 Bump versions in Dockerfile 2023-07-04 10:01:15 -06:00
Andrew Dryga
8539543d3d Bump Elixir/OTP versions (#1730) 2023-07-03 23:11:47 +00: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
4bebccb6a0 Add docs section to see if everything is connected to the panel 2023-06-29 14:09:12 -06:00
Andrew Dryga
4154523b1c Add more websocat examples for connecting to a resource 2023-06-29 14:09:11 -06:00
Gabi
720b2f8cd9 Fix/docker compose up (#1705)
This PR fixes `docker compose up` but it doesn't have the test client ->
resource flow working but it prevent anything from erroring at startup.

This fixes:
* tokens (use the correct token for the client user agent we are using)
* randomize `name_suffix` at start up for connlib (we will eventually
allow options to set it manually)
* remove port ranges for relay (see firezone/product#613)
2023-06-28 18:48:33 +00: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
bmanifold
d5d39b9c35 CONTRIBUTING.md updates (#1704)
**Update CONTRIBUTING.md**

Why:

* The CONTRIBUTING.md doc seems to have fallen slightly out of date with
      how Firezone now works.  This commit updates the doc to provide a
quick start guide for getting all of the various Firezone components
up and running as quick as possible. The doc then links to the more
      specific `Elixir` and `Rust` README.md files in the respective
      directories to help developers who would like to contribute.
      
**Update docker-compose vault health check**

 Why:

* The current Vault health check listed in the docker-compose file does
not seem to be working when using `localhost` in the `wget` command.
      Updating the URL to use `127.0.0.1` seems to have fixed it.

---------

Signed-off-by: bmanifold <bmanifold@users.noreply.github.com>
Co-authored-by: Jamil <jamilbk@users.noreply.github.com>
2023-06-27 19:10:12 -07:00
Andrew Dryga
f10d298556 Do not render ipv6 relay address if it's nil 2023-06-27 17:59:57 -06:00
Andrew Dryga
138c70a73d Fix compilation warnings that are not fixed in merged PRs 2023-06-27 15:38:29 -06:00
Jamil
b50f6559d3 portal: Status indicator badge (#1703)
Did some research on status page providers to manage incidents.
statuspage.io seems to be easy to use and cost-effective, fairly popular
and provides a good amount of flexibility to customize emails,
notifications, etc.

Super easy to set up and use but am not married to it if anyone feels
strongly about using another incident management service.

https://firezone.statuspage.io

## Demo:

<img width="235" alt="Screenshot 2023-06-27 at 8 07 29 AM"
src="https://github.com/firezone/firezone/assets/167144/8ad12b9b-7345-4a5d-bf43-c8af798d85f9">
2023-06-27 14:19:31 -07:00
Jamil
242d5d6975 portal: Policies CRUD views (#1692)
@AndrewDryga ~~Was still hitting some redirect issues so I'll wait for
those to be resolved before continuing on building more views.~~ Edit:
After some sleep and coffee, I figured it out. Nice work on the sign in
form!

I went ahead and scoped existing dashboard links with `@account` and
fixed a dark mode issue -- you may want to cherry-pick those commits.
I'll add these to authenticated routes and integrate into what you have
so far.

As I was going through last night exploring your route approach I
thought of some edge cases; can discuss next week. I think the main one
that came to mind was that we probably want to differentiate between
login flows initiated directly in the browser (this is an admin logging
into the dashboard) vs login flows initiated from a client app (these
will terminate with a final redirect to respective `dest` whitelisted
URL). Maybe it makes sense to segregate these flows?

If a regular user tries login directly from the browser maybe we want to
show them something like "Please login from your Firezone application
instead" as they should only be able to initiate logins from a client
application. Or maybe there's simply no possibility to end up at the
final Android App Link or `firezone://` URI with a login initiated
directly from the browser?
2023-06-27 15:03: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
61dc71523b Return changeset on name suffix constraint error 2023-06-26 14:12:57 -06:00
Andrew Dryga
dcb817167d Fix stub module name 2023-06-26 13:37:33 -06:00
Andrew Dryga
19b892f719 Render error when public key is reused 2023-06-26 13:28:22 -06:00
Andrew Dryga
fd72272203 Fix API error rendering 2023-06-26 13:21:15 -06:00