Commit Graph

2283 Commits

Author SHA1 Message Date
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
Francesca Lovebloom
a4810986c7 connlib: Improve FFI bridges for Apple and Android (#1691)
This makes it possible to build the Apple/Android FFI bridges and
integrate them with their respective client apps.

---------

Signed-off-by: Francesca Lovebloom <franlovebloom@gmail.com>
Co-authored-by: Roopesh Chander <roop@roopc.net>
2023-06-28 11:29:59 -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
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
Gabi
b9bd34b5f1 docker: fix building for macos (#1700)
There are problems building the docker images in macos using musl due to
ring's problems therefore we started using slim-debian with glibc for
development.
2023-06-26 22:50:14 +00:00
Andrew Dryga
61dc71523b Return changeset on name suffix constraint error 2023-06-26 14:12:57 -06:00
Gabi
1d50883dbd rust: fix dockerfile for building multiple images in parallel (#1699)
When using `docker compose build` or any other way of building docker
images in parallel the way the cache was working with the rust's
Dockerfile made the caches between images overlap and corrupt each
other. We add a `locked` which prevents multiple writers to the same
cache to fix this behaviour.
2023-06-26 13:46:20 -06:00
Andrew Dryga
18fddee6d9 Remove outdated env files 2023-06-26 13:39:09 -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
Andrew Dryga
da9d120713 Do not expire encoded Gateway/Relay tokens 2023-06-26 13:21:06 -06:00
Gabi
e9be4b9ef5 connlib: moves it to the main firezone library
This brindgs connlib from its own separated repo to firezone's monorepo.
    
 On top of bringing connlib we also add and unify the Dockerfile for all
 rust binaries and add a docker-compose that can run a headless client, a
 relay and a gateway which eventually will test the whole flow between a
 client and a resource. For this to work we also incorporated some elixir
 scripts to generate portal tokens for those components.
2023-06-23 16:39:58 -06:00
Andrew Dryga
e039f1919d Hotifx seeds and references (#1689) 2023-06-23 15:09:52 -06:00
Jamil
0faf8d906c Add pnpm to runners (#1683)
Found another place where pnpm needs to be added.
2023-06-23 12:42:35 -05:00
Jamil
82edbb5835 Use pnpm for asset setup too (#1681) 2023-06-22 12:47:45 -07:00
Jamil
8d8687224b Use pnpm over yarn (#1678)
Did some research when picking a package manager for the website and
settled on `pnpm` for the following reasons:

- CLI-compatible with `npm`
- Typically faster than even `yarn` especially on Apple silicon
- Security: Pnpm uses a different dependency resolution algorithm and
different folder structure of node_modules that prevents illegal access
to packages by other packages.

I think I caught all the places, but I may be missing something, so if
this isn't a good idea we can revert back.

This PR also cleans up the actions workflows to remove dead code.
2023-06-22 10:40:32 -07:00
Jamil
8fa12b8492 jamilbk%feat/stub website in cloud (#1675)
* Remove `www/`
* Stub empty `website/` to silence Vercel. This shouldn't cause
conflicts when we merge `cloud` to `master`. Perhaps we want to start
working off `master` soon, and move the current tip of master to
`legacy`?
2023-06-22 11:08:28 -06:00
Thomas Eizinger
247633ed33 feat(relay): connect to portal on startup (#1643)
With this PR, the relay can be configured with a WebSocket URL on startup. If given, it will attempt to connect to it and join the `relay` room with its `stamp_secret`. Once the `init` message is received, regular relay operation will begin.
2023-06-21 16:10:39 -03:00
Thomas Eizinger
0f594f44bc ci: install musl target via rust-toolchain.toml file (#1664)
Targets specified in the `rust-toolchain.toml` file are automatically installed by `rustup`. This avoid setup steps for other devs and also simplifies the CI setup.

To be able to compile native code to musl, we do need `musl-gcc` which comes with the `musl-tools` package on ubuntu.
2023-06-19 18:51:54 -03:00
Thomas Eizinger
533b12c99e ci: specify workspace directory for cache action correctly (#1663) 2023-06-18 10:37:34 -07:00
Thomas Eizinger
b2fe02c2d5 fix(relay): treat stamp_secret as string (#1660)
Previously, the relay would treat the `stamp_secret` internally as bytes and share it with the outside world as hex-string. The portal however treats it as an opaque string and uses the UTF-8 bytes to create username and password.

This patch aligns the relay's functionality with the portal and stores the `stamp_secret` internally as a string.
2023-06-16 09:25:15 +02:00
Thomas Eizinger
a491521ef7 feat(relay): add Dockerfile (#1661)
This adds a basic Dockerfile for the relay so users and devs can easily
start it.
2023-06-15 19:59:53 +02:00
Thomas Eizinger
6491ad13c9 feat(relay): provide a commandline interface using clap (#1658)
This saves us several lines of code and allows usage of the relay via
commandline arguments in addition to env variables. Note that because of
`#[arg(env)]`, all of these can still be configured via environment
variables too.
2023-06-15 18:17:02 +02:00
Thomas Eizinger
5090d207c2 feat(relay): implement nonces for authentication (#1654)
To complete the authentication scheme for the relay, we need to prompt
the client with a nonce when they send an unauthenticated request. The
semantic meaning of a nonce is opaque to the client. As a starting
point, we implement a count-based scheme. Each nonce is valid for 10
requests. After that, a request will be rejected with a 401 and the
client has to authenticate with a new nonce.

This scheme provides a basic form of replay-protection.
2023-06-15 09:11:08 -07:00
Andrew Dryga
89b7e3b474 Fix assets pipeline, add Elixir deps audit, add Android applink manifest (#1659) 2023-06-14 17:15:38 -06:00
Andrew Dryga
67482857b6 Add double quotes to the var itself 2023-06-12 15:52:25 -06:00
Andrew Dryga
36c8fa3beb Try to wrap tf vars in backticks 2023-06-12 15:49:47 -06:00
Andrew Dryga
17b18444a7 Add missing env for terraform workflow 2023-06-12 15:42:12 -06:00
Andrew Dryga
5cfd3867c8 Do not attempt to persist tag versions back to the repo 2023-06-12 15:31:26 -06:00
Andrew Dryga
a845c2999d Fix github branch name 2023-06-12 15:03:17 -06:00
Andrew Dryga
571e861f62 Try pushing update using GH API 2023-06-12 14:52:50 -06:00
Andrew Dryga
54d19f50a9 Bump checkout action vsn in rust workflow 2023-06-12 14:29:00 -06:00
Andrew Dryga
c7f0a463ae Rename pre-commit step 2023-06-12 14:26:28 -06:00
Andrew Dryga
9b3468d4f7 Fix path to versions file 2023-06-12 14:26:12 -06:00
Andrew Dryga
01f428fd35 Inherit secrets to child workflows 2023-06-12 14:13:30 -06:00
Andrew Dryga
d8c9cf1a89 Fix races for concurrency control 2023-06-12 14:11:15 -06:00
Andrew Dryga
7c883a0ba0 Remove copy-pasted required inputs 2023-06-12 14:08:41 -06:00
Andrew Dryga
bf61b7964a Add missing on_workflow call 2023-06-12 14:03:42 -06:00
Andrew Dryga
32ebd7cae3 Try a different CI setup 2023-06-12 14:00:47 -06:00
Andrew Dryga
9dbffee560 Experiment with condition
Workflow is not picked up by GitHub for some reason
2023-06-12 12:42:04 -06:00
Andrew Dryga
ecb016f03c Lave a note on workflow_run feature and fix checkout feature 2023-06-12 12:33:31 -06:00
Andrew Dryga
aa4ed0efe1 Add terraform code owners 2023-06-12 12:29:35 -06:00
Andrew Dryga
a7274fa671 Continuous delivery to staging (#1655) 2023-06-12 12:15:55 -06:00
Thomas Eizinger
ec453a2d9c feat(rust): bump to new stable release 1.70.0 (#1648) 2023-06-09 14:32:52 -07:00