Commit Graph

460 Commits

Author SHA1 Message Date
Jamil
06e3956317 create-or-reset-admin resets admin role to :admin (#922) 2022-08-17 19:53:29 -07:00
Jamil
5d113ba251 Fix rules form (#917) 2022-08-11 17:18:50 -07:00
Jamil
a4340be61e Fix endpoint placeholder & security overflow (#916)
* Use consistent placeholders

* Remove redundant text and overflow-x
2022-08-11 16:25:59 -07:00
Jamil
db785d7ba2 Allow disabling the configuration of devices by unprivileged users (#909)
* Add all the config options, test should fail

* Don't show fields that can't be edited

* Remove unneeded leading match

* use str not ~r

* Choose Conf.get or @allow

* Add Docker env vars
2022-08-10 15:56:15 -07:00
Jamil
5e60d2b442 Bump Wireguardex (#912) 2022-08-10 14:50:47 -07:00
Jamil
ebb3d383d7 remove beta program (#908) 2022-08-09 11:37:54 -07:00
Jamil
0a7c16af17 Bump Wireguardex (#906) 2022-08-09 11:09:44 -07:00
Jamil
5617a72910 Clarify when UI config is overriding ENV config (#872)
* Some minor clarification and UI polish

* Pull overrides from changeset
2022-08-08 21:14:06 -07:00
Gabi
f03617b07f nft rules match wireguard interface name (#901) 2022-08-08 12:56:33 -07:00
Gabi
038f025220 Re-add port-based rules and gate them behind kernel version (#890)
* Revert "Revert "Add initial rough version of port based rules (#874)" (#888)"

This reverts commit 58e48457ad.

* gate port rule depending on kernel version

* fix version comparision

* allow for no port-related values when creating rule event

* Fix struct accessor

* fix getting port type in rule list component

* small fix

* oops

* hide port-related display on disabled port-rules

* Gate table headers

* update port-based rule for boot-up only and update ui

* fix tests

* fix disable button

* Minor UI and wording update

* Add firewall functional tests

* fix functional testing

* add debug log for functional debugging

* fix

* Fix functional testing by preventing overlap

* remove sudo from functional firewall tests

* fix error message

* fix firewall ci

* re-adding sudo to functional test

* fix expected results in functional test

* Apply suggestions

* Update apps/fz_http/lib/fz_http_web/live/rule_live/rule_list_component.html.heex

Signed-off-by: Jamil <jamilbk@users.noreply.github.com>

Co-authored-by: Jamil <jamilbk@users.noreply.github.com>
2022-08-05 16:11:33 -07:00
Po Chen
4a2ab72eec target blank (#893) 2022-08-05 08:53:53 -07:00
Jamil
d821ce8bf4 Move page subheaders under titles; minor cleanup (#892) 2022-08-04 09:30:42 -07:00
Jamil
58e48457ad Revert "Add initial rough version of port based rules (#874)" (#888)
This reverts commit 55a311adec.
2022-08-03 12:34:30 -07:00
Andrew
4ef461a7d0 Add notifications live view. (#867)
* Remove events module from UI and trigger events on DB notifies

* Add tests and take out error flash from ui for now.

* Use FzHttp.Devices.decode in devices/rules tests and remove commented line

* address PR feedback & fix race condition in interface test

* Clean up events & notifier based on PR feedback

* Add notifications live view, broadcast them through the notification channel

* Notification improvements (#869)

* Flatten Notifications to make it more general and add timestamp

* Remove wildcard from notification channel in UserSocket

* Implement clear button for clearing notifications. Add icon helper

* Add broadcast helper

* UI fixes for notifications badge

* Add notifications live view tests

* Fix tests

* fix docs link, deleted wrong one in the merge!

* clean up tests based on pr feedback

Co-authored-by: Po Chen <chenpaul914@gmail.com>
2022-08-01 21:16:31 -07:00
Gabi
55a311adec Add initial rough version of port based rules (#874)
* Add initial rough version of port based rules

* fix tests

* nftables refactor

* UI/database improvements

* UI and Int4Range improvements

* Multiple improvements

* Add tests for port rules

* minor refactor and update error message

* Fix error message for tests

* int4range refactor
2022-08-01 20:57:55 -07:00
Andrew
2c88653c9a Trigger events on device/rule/user insert and delete instead of from UI actions. (#835)
* Remove events module from UI and trigger events on DB notifies

* Add tests and take out error flash from ui for now.

* Use FzHttp.Devices.decode in devices/rules tests and remove commented line

* address PR feedback & fix race condition in interface test

* Clean up events & notifier based on PR feedback

* Reduce wait time for pg notifies

* Test Notifier event handling instead of using unboxed sandbox runs
2022-08-01 15:02:46 -07:00
Jamil
e0e780b7fa Go easy on the x-forwarded-for header (#877) 2022-07-29 17:17:00 -07:00
Po Chen
30876da922 Reduce cast coverage (#851)
* remove cast role in create

* remove cast in update

this will fail

* Revert "remove cast role in create"

This reverts commit 217c62170f1f09987c6adbf7a5b3f467dd84034c.

* remove role in generic cast

* separate role and sign in token out from generic update

* handle empty value in put_password_hash

* separate last signed in at

* remove usage of removed changeset function

* fix clear sign in token

* improve tests

* fix tests

* split update user

* require password change

* fix test

* remove unused env var
2022-07-29 08:44:25 -07:00
Po Chen
4ba93bdce2 Fix config ui out of sync (#875)
* fix config ui out of sync

* fix and add more tests

* simplify tests
2022-07-29 08:22:27 -07:00
Gabi
493709858d fixes parsing for ipv6 (#871) 2022-07-28 14:38:13 -07:00
Jamil
0c50ac677d Fix new docs links (#865) 2022-07-27 20:48:39 -07:00
Jamil
c81650a49f Add uid (#861) 2022-07-27 17:28:14 -07:00
Jamil
3e765139ca Fix customization typo (#857) 2022-07-26 23:59:09 -07:00
Jamil
3c69a28d16 Add release 0.5.0 announcement (#856) 2022-07-26 23:58:57 -07:00
Andrew
61c9ea5e98 fix server tests (#854) 2022-07-26 13:12:27 -07:00
Jamil
f590364ecd Fix empty OIDC config prevents fresh application from starting (#846)
* Fix master build

* use JSON for openid_connect_providers

* (hopefully) print errors to STDOUT

* set TERMINFO

* Upload built artifact before functional testing

* D'oh

* Revert logging change
2022-07-25 19:21:41 -07:00
Po Chen
5218bd0404 Remove no longer needed compilers declaration (#848) 2022-07-25 16:29:01 -07:00
Jamil
99867ce3b1 revert removing the x-forwarded-for header (#837)
* revert removing the x-forwarded-for header

* Clean up remote_ip headers
2022-07-25 11:47:58 -07:00
Gabi
23db81fae5 Build/729/different reverse proxy (#795)
* Removes disabling SSL and adds remote_ip lib

* Fix to use remote_ip when not proxy

* Add trusted_proxy to config

* Add proxy_forwarded prameter to config and improve logging

* Fix trusted_proxy list parsing

* Fix ip formatting

* Expect JSON array for trusted_proxy

* fix proxied-related plug loading runtime

* fix typo

* checkpoint

* add traefik draft

* add logging

* woops

* adding logging for debug

* rollback debugging logs

* docs refinement

* Fix markdown lints

* remove disabling proxy_forwarded option for prod

* rename, improve docs and add clients config

* change dev_secure to secure_cookies

* Set proxy_forwarded as true by default

* remove proxy_forwarded in favor of nil trusted_proxies

* renaming and doc improvement

* build fix

* jamilbk changes

Co-authored-by: Jamil Bou Kheir <jamilbk@users.noreply.github.com>
2022-07-25 11:47:58 -07:00
Jamil
76ab472b87 Telemetry timeouts (#836) 2022-07-25 11:47:58 -07:00
Po Chen
1ad0428f32 Move auth configs into app (#812)
* move configs into app

* fix typo

* add moduledoc

* move oidc parsing

* fix oidc configs

* implement toggle updates

* shush

* handle binary and map

* start cache for test

* save site

* add dashboard

* implement editing oidc configs

* remove io inspect

* selective fallback

* fix tests

* update toggles

* test toggles

* test oidc config

* fix click behavior

* update doc

* Update apps/fz_http/lib/fz_http_web/live/setting_live/security.html.heex

Co-authored-by: Jamil <jamilbk@users.noreply.github.com>

Co-authored-by: Jamil <jamilbk@users.noreply.github.com>
2022-07-25 11:47:58 -07:00
Andrew
df969bdb23 Fix nil device error for stats push service and use live WireGuard adapter in dev. (#825)
* Conditionally start WireGuard sandbox adapter if set in app env

* Use Live wg adapter module in dev, sandbox in test. fz_vpn supervised children from app env
2022-07-25 11:47:58 -07:00
Po Chen
f86e080471 Fix handling invalid client reason (#828)
* Catch different reasons

* redirect
2022-07-25 11:47:58 -07:00
Gabi
76f6e53cfd NFTables fixes (#804) 2022-07-25 11:47:58 -07:00
Po Chen
6bd66dc711 Logo Customization (#800) 2022-07-25 11:47:58 -07:00
Jamil Bou Kheir
4b8b0c39ce Fix endpoint typo 2022-07-25 11:47:58 -07:00
Jamil
2de119a49e Docker dev polish (#803)
* checkpoint

* Docker dev environment final root cause analysis

* Update CONTRIBUTING.md

* Update apps/fz_common/lib/fz_net.ex

Co-authored-by: Po Chen <chenpaul914@gmail.com>

Co-authored-by: Po Chen <chenpaul914@gmail.com>
2022-07-25 11:47:58 -07:00
Andrew
7a14f178a4 Add telemetry data to the ping event (#801)
* Add telemetry data for feature configs and other useful stats

* use conf helper in more places & unit tests for ping_data

* include db url setting, improve unit tests
2022-07-25 11:47:58 -07:00
Jamil
9925f43f16 Add sample users/devices (#802) 2022-07-25 11:47:58 -07:00
Po Chen
bfbb671d32 Docker DEV (#737) 2022-07-25 11:47:58 -07:00
Andrew
69a4412d75 Remove pre-configured Okta & Google OAuth providers (#793)
* Remove pre-configured Okta & Google OAuth providers, update docs

* Upgrade docs clarifications & remove unused auth code for pre-configured providers (google/okta)

* Fix docs url for upgrade note
2022-07-25 11:47:58 -07:00
Po Chen
48d8ea75a9 Implement PKCE (#789)
* use to_existing_atom

* implement pkce

* fix and add tests

* Update apps/fz_http/lib/fz_http_web/controllers/auth_controller.ex

Co-authored-by: Jamil <jamilbk@users.noreply.github.com>

Co-authored-by: Jamil <jamilbk@users.noreply.github.com>
2022-07-25 11:47:58 -07:00
Po Chen
90c63f1db5 use x-forwarded-for in addition to x-real-ip (#785) 2022-07-25 11:47:58 -07:00
Andrew
0a4f08665d Use toggle for vpn connection permission (#787)
* Add ui refresh of danger zone section for user view

* Use large switch style

* Go back to medium style for toggle
2022-07-25 11:47:58 -07:00
Andrew
3e39339643 Improve user vpn connection status ui (#784)
* Update VPN Connection column with status tag, update docs explaining tags under authenticate section

* Fix events test warning

* Fix formatting

* Fix docs lint

* Move vpn status doc to fix doc lint

* Use div instead of label for tag root, update oidc language

* Refactor vpn status component for pr feedback

* use a component instead of a live one
2022-07-25 11:47:58 -07:00
Andrew
6dbd5cc59d Update egress rules user guide with user scope ui (#782)
* Update egress rules user guide with user scope ui

* Fix user scope description

* Update egress rules view with correct user scope text & corresponding doc img

* Revert previous doc text
2022-07-25 11:47:58 -07:00
Jamil Bou Kheir
f1af5ddf2f wait 10 2022-07-25 11:47:58 -07:00
Po Chen
abd5085ab8 fix build (#778) 2022-07-25 11:47:58 -07:00
Andrew
a75dfa3073 Add redirect routes for oidc signin links by provider (#770)
* Add redirect routes for oidc signin links by provider

* whitespace fix

* restore comment

* Add oidc redirect route helper to auth template for sign-in buttons

* Update docs to mention pretty URLs.

* Fix docs
2022-07-25 11:47:58 -07:00
Gabi
f5806a2d8a Replaces nftables rule management to use sets (#766)
* Replaces nftables rule management to use sets

Fixes firezone/product#398

* Fix fz_wall not existing function

* Minor tidy up

* Refactor tests and projections

* Refactor fz_wall state to use map instead of tuple

* Minor fix
2022-07-25 11:47:58 -07:00