Commit Graph

80 Commits

Author SHA1 Message Date
bmanifold
4f3ae5f8fd Update button colors, rounded corners, and code block formatting (#2515)
Purely visual changes in this PR. No functionality is changed, aside
from the code blocks no longer containing html tags when copied using
the "copy to clipboard" icon.

* Button primary color has been updated
* Corner radius on buttons, input fields, etc... has been reduced
* Code blocks have been updated
2023-10-28 23:18:52 -04:00
Andrew Dryga
98383e8622 Introduce Sites (#2516)
Closes #2513
2023-10-27 13:10:36 -06: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
8090df3624 Add requires step to Google Workspace provisioning guide 2023-10-19 23:49:15 -06:00
Andrew Dryga
b84786546b Bump Elixir and Terraform deps (#2431) 2023-10-18 10:27:10 -07:00
dependabot[bot]
d5f76ee63b build(deps): Bump @fontsource/source-sans-pro from 4.5.11 to 5.0.8 in /elixir/apps/web/assets (#2376)
Bumps
[@fontsource/source-sans-pro](https://github.com/fontsource/font-files/tree/HEAD/fonts/google/source-sans-pro)
from 4.5.11 to 5.0.8.
<details>
<summary>Commits</summary>
<ul>
<li>See full diff in <a
href="https://github.com/fontsource/font-files/commits/HEAD/fonts/google/source-sans-pro">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=@fontsource/source-sans-pro&package-manager=npm_and_yarn&previous-version=4.5.11&new-version=5.0.8)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Jamil <jamilbk@users.noreply.github.com>
2023-10-18 00:19:17 +00:00
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
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
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
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
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
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
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
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
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
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
3e77682b94 Implement OIDC IdPs logout redirects (#2001) 2023-09-11 08:14:03 -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
ed94e41050 Unlock editing synced users (#1991) 2023-09-07 09:34:56 -06:00
Andrew Dryga
9b81e582d2 Render less ambiguous statuses for Google Workspace sync issues (#1992) 2023-09-07 09:34:39 -06:00
Andrew Dryga
10611ed21d Set default name for Google Workspace IdPs 2023-09-05 19:17:27 -06:00
Andrew Dryga
54426a7281 Additional fixes for user sync (#1985) 2023-09-05 17:49:05 -06:00
Andrew Dryga
d3e151ec38 Fix users sync (#1976) 2023-09-03 15:02:29 -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
Jamil
68b1955dd0 fix(portal): revert check_origin: :conn for the WebSocket connection on web (#1952)
Looks like it broke the staging WS connections. Getting a failure of
Liveview socket connection on `app.firez.one`:

```
insertId: 1o7nymzg12jh1k5
jsonPayload:
  cos.googleapis.com/container_id: 89b4633e81432e43dfbaa3957324fd5ead3f2362737bac84648a8f839b6eb16c
  cos.googleapis.com/container_name: klt-web-cpap
  cos.googleapis.com/stream: stdout
  message:
    domain:
    - elixir
    erl_level: error
    logging.googleapis.com/sourceLocation:
      file: lib/phoenix/socket/transport.ex
      function: Elixir.Phoenix.Socket.Transport.check_origin/5
      line: 344
    message: |+
      Could not check origin for Phoenix.Socket transport.

      Origin of the request: https://app.firez.one

      This happens when you are attempting a socket connection to
      a different host than the one configured in your config/
      files. For example, in development the host is configured
      to "localhost" but you may be trying to access it from
      "127.0.0.1". To fix this issue, you may either:

        1. update [url: [host: ...]] to your actual host in the
           config file for your current environment (recommended)

        2. pass the :check_origin option when configuring your
           endpoint or when configuring the transport in your
           UserSocket module, explicitly outlining which origins
           are allowed:

              check_origin: ["https://example.com",
                             "//another.com:888", "//other.com"]

    severity: ERROR
    time: '2023-08-26T21:24:36.002Z'
  time: '2023-08-26T21:24:36.002628434Z'
logName: projects/firezone-staging/logs/cos_containers
receiveTimestamp: '2023-08-26T21:24:36.402398476Z'
resource:
  labels:
    instance_id: '8218473336234347240'
    project_id: firezone-staging
    zone: us-east1-d
  type: gce_instance
timestamp: '2023-08-26T21:24:36.002628434Z'
```
2023-08-28 19:09:37 +00:00
bmanifold
58e0fb2032 Add Sign Up page (#1939)
The Sign Up page will allow users to create new organization accounts.
During sign-up, a randomly generated slug will be created for the
account and "magic link" will be set as the first identity provider to
allow the user to login to the newly created account.

---------

Co-authored-by: Jamil <jamilbk@users.noreply.github.com>
2023-08-28 14:43:01 +00:00
Jamil
3316d9098a fix(android): Fix auth flow and callback thread safety, and pass fd through FFI (#1930)
* Refactor sharedPreferences to only save the AccountId
* Update TeamId -> AccountId to match naming elsewhere
* Update JWT -> Token to avoid confusion; this token is **not** a valid
JWT and should be treated as an opaque token
* Update FFI `connect` to accept an optional file descriptor (int32) as
a first argument. This seemed to be the most straightforward way to pass
it to the tunnel stack. Retrieving it via callback is another option,
but retrieving return vars with the `jni` was more complex. We could
have used a similar approach that we did in the Apple client
(enumerating all fd's in the `new()` function until we found ours) but
this approach is [explicitly
documented/recommended](https://developer.android.com/reference/android/net/VpnService.Builder#establish())
by the Android docs so I figured it's not likely to break.

Additionally, there was a thread safety bug in the recent JNI callback
implementation that consistently crashed the VM with `JNI DETECTED ERROR
IN APPLICATION: use of invalid jobject...`. The fix was to use
`GlobalRef` which has the explicit purpose of outliving the `JNIEnv`
lifetime so that no `static` lifetimes need to be used.

---------

Signed-off-by: Jamil <jamilbk@users.noreply.github.com>
Co-authored-by: Pratik Velani <pratikvelani@gmail.com>
Co-authored-by: Gabi <gabrielalejandro7@gmail.com>
2023-08-23 14:13:55 -07:00
Jamil
1091c47f22 Read client_platform and client_csrf_token from params (#1919)
Fixes a small bug where `client_platform` wasn't being added to the
redirect_params in the magic link auth flow, so the token form input was
never shown.

Also adds a `hidden` type input that omits the `class=` attribute and
`div` wrapper.

Feel free to build off this or close and open a more thorough fix if
this is not the desired approach.
2023-08-17 17:34:24 +00:00
Andrew Dryga
508b803d98 Change magic link flow to require copy-pasting the magic link code on mobile platforms (#1916)
Signed-off-by: Andrew Dryga <andrew@dryga.com>
Co-authored-by: Jamil <jamilbk@users.noreply.github.com>
2023-08-16 15:40:22 -06:00
Andrew Dryga
a6c28be0e8 Persist client auth params during magic link redirects 2023-08-11 17:43:01 -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
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