Commit graph

71 commits

Author SHA1 Message Date
Caleb Jasik
504cc206f7
Use CupertinoButton.tinted on iOS instead of IconButton 2025-01-24 17:09:35 -06:00
Caleb Jasik
a1df22ae75
Add text wrap toggle to logs screen 2025-01-24 15:15:20 -06:00
Caleb Jasik
5afc1ef692
Add licenses page (#227)
* Add licenses page

* Use PlatformListTile

* Use platform-specific icons

* More style fixes

* Switch back to using SimplePage

* Make title widget const

* Remove unused imports
2025-01-24 13:37:28 -06:00
Ian VanSchooten
21d8265f42
Clean up enrollment screen (#234)
## Android

Blank form:
|Before|After|
|--|--|
|<img width="395" alt="image" src="https://github.com/user-attachments/assets/5c8a8e26-d030-4b14-b91a-9cbf5e1b2e50" />|<img width="393" alt="Android Studio 2025-01-24 11 34 32" src="https://github.com/user-attachments/assets/408c8003-9bc0-4e09-af58-44f5728dcb59" />|

Text entered:
|Before|After|
|--|--|
|<img width="397" alt="Arc 2025-01-24 11 47 19" src="https://github.com/user-attachments/assets/d5e8bc70-1786-488c-aa1c-c45ddf9a92de" />|<img width="393" alt="image" src="https://github.com/user-attachments/assets/5765e9c3-cf50-4913-b4d1-78780918f35d" />|

Submitted empty:
|Before|After|
|--|--|
|<img width="395" alt="image" src="https://github.com/user-attachments/assets/37b8b9c8-760f-479e-b39f-3502367567ec" />|<img width="397" alt="Android Studio 2025-01-24 11 34 47" src="https://github.com/user-attachments/assets/c381725e-f449-43de-961f-768205b60028" />|

Submitted invalid:
|Before|After|
|--|--|
|<img width="388" alt="image" src="https://github.com/user-attachments/assets/3a3859e1-eff7-4111-9dd0-15edbd3bb998" />|<img width="389" alt="image" src="https://github.com/user-attachments/assets/1ab811df-e3ff-4a1f-9d3d-a2869cbc1877" />|


Unchanged:
<img width="388" alt="image" src="https://github.com/user-attachments/assets/f2719677-a73f-435d-b3c6-a0a4fd64759b" />


## iOS


Blank form:
|Before|After|
|--|--|
|<img width="454" alt="image" src="https://github.com/user-attachments/assets/9afed9d1-c63b-4fcf-80a8-c2a9d2c18e76" />|<img width="454" alt="image" src="https://github.com/user-attachments/assets/c185b7f1-a2b3-4e9b-a49f-fb9790214c3a" />|

Text entered:
|Before|After|
|--|--|
|<img width="452" alt="image" src="https://github.com/user-attachments/assets/d3be265d-9076-4a19-865b-413dfad79ed4" />|<img width="466" alt="image" src="https://github.com/user-attachments/assets/c23e99eb-1001-4f80-b88f-62ffa8c8f7dd" />|


Submitted empty:
(note it says invalid before)
|Before|After|
|--|--|
|<img width="463" alt="image" src="https://github.com/user-attachments/assets/e26c0642-e6cc-4e97-885d-b0309e58ace6" />|<img width="455" alt="image" src="https://github.com/user-attachments/assets/95b8f975-41b5-48a0-b75a-9cb6a9acc50e" />|

Submitted invalid:
|Before|After|
|--|--|
|<img width="484" alt="image" src="https://github.com/user-attachments/assets/1daf3c2e-5fbb-477c-b0c7-66689170d97a" />|<img width="463" alt="image" src="https://github.com/user-attachments/assets/8bef248f-a607-4373-9e9e-6ff08f402b4a" />|
2025-01-24 14:22:40 -05:00
Caleb Jasik
382e2bbbf7
Add vertical padding to ConfigPageItem in case children wrap (#233) 2025-01-24 10:48:00 -06:00
Caleb Jasik
b41054920a
Migrate from colorScheme.background to colorScheme.surface (#229) 2025-01-24 09:51:21 -06:00
Ian VanSchooten
ad45cc1d78
Fix screen titles on iOS (#230)
TODO:
- [x] Address Android, which this probably breaks.

Previously the back button was taking up all the room in the title bar, this fixes it so that we can see titles again.  It also truncates site names so they stay to one line.

|Before|After|
|---|---|
|![image](https://github.com/user-attachments/assets/3e07a50d-fb40-40da-87f8-4d623019b26d)|![Simulator 2025-01-23 16 32 34](https://github.com/user-attachments/assets/ea668973-e67d-4fc5-8731-578e5f3fdd27)|


|Before|After|
|---|---|
|![image](https://github.com/user-attachments/assets/d95e1a9d-f431-42aa-a9f2-357b20c37abb)|![Simulator 2025-01-23 16 11 15](https://github.com/user-attachments/assets/ff3f664b-1983-4514-a492-cf585153e294)|

|Before|After|
|---|---|
|![image](https://github.com/user-attachments/assets/0ea3aa0d-340a-44db-8a0a-e0c8032c2450)|![image](https://github.com/user-attachments/assets/fb7e26c5-5c67-4dd7-808c-d471ca1e913e)|

|Before|After|
|---|---|
|![image](https://github.com/user-attachments/assets/bffec7e3-561d-4a43-ab8a-3bd1cc95003c)|![Simulator 2025-01-23 16 13 23](https://github.com/user-attachments/assets/288c1f7f-4d79-4b59-b693-0cbcdd2024db)|


A few other "After" screenshots:

|Logs|DN enrollment|
|---|---|
|![Simulator 2025-01-23 16 30 48](https://github.com/user-attachments/assets/4698939e-c4ad-4929-bd0b-1b72fc21c439)|![image](https://github.com/user-attachments/assets/4c738c41-af3c-4465-9907-76fce34ecdd9)|
2025-01-24 07:51:37 -05:00
Caleb Jasik
ae412cc407
Fix SimplePage background color variable (#232) 2025-01-23 16:55:28 -06:00
Caleb Jasik
91e6a4f6a2
Use platform-specific canvas color for SimplePage + platform-specific icons (#231)
* Use platform-specific canvas color for SimplePage

* Use platform-specific icon for MainScreen appbar
2025-01-23 16:25:59 -06:00
Ian VanSchooten
5a641be96f
Switch to Material 3 for Android (#224)
This exploration updates the Android app to use Google's Material 3 design, and changes up the colors a bit in the process.  
I used a source color of #5D23DD in https://material-foundation.github.io/material-theme-builder/, which generates a full set of material colors that I imported into `lib/services/theme.dart`.  It should be easy to tweak any of the colors that we want, vs previously it was somewhat more difficult because they were being generated "behind the scenes".

This doesn't necessarily need to be done now, but it does align better with more modern Android design patterns and Flutter has said at some point they will stop supporting Material 2.  

Note: this should not have any impact on iOS, since we use the default `CupertinoThemeData` there, without any custom theming.

Here are some before/after comparisons of interesting screens:

Adding a new site:
|Dark Before|Dark After|Light Before|Light After|
|---|---|---|---
|<img width="390" alt="Android Studio 2025-01-22 10 43 55" src="https://github.com/user-attachments/assets/c7954b7f-a8eb-48a5-bd47-237877f078fd" />|<img width="405" alt="Android Studio 2025-01-22 11 16 48" src="https://github.com/user-attachments/assets/b69c1e6f-3464-44af-9f9c-f6377b5ce1d1" />|<img width="389" alt="image" src="https://github.com/user-attachments/assets/40f1e40f-a1f5-42e4-909c-c07b3f82df2b" />|<img width="393" alt="image" src="https://github.com/user-attachments/assets/09f8f8ce-668e-4e69-a4a9-233fb970655f" />|


Confirmation dialog:
|Before|After|
|---|---|
|<img width="264" alt="image" src="https://github.com/user-attachments/assets/7cae1abc-621d-4c59-bf36-0ce3be0af88c" />|<img width="278" alt="Android Studio 2025-01-22 11 43 19" src="https://github.com/user-attachments/assets/d461a97f-d252-494f-8b30-49d33a5a9cda" />|

Settings page:
|Dark Before|Dark After|Light Before|Light After|
|---|---|---|---|
|<img width="394" alt="Android Studio 2025-01-22 11 46 01" src="https://github.com/user-attachments/assets/edfc6c40-ee72-4a7c-b9b7-7c3025f0cdfe" />|<img width="393" alt="Android Studio 2025-01-22 11 46 35" src="https://github.com/user-attachments/assets/d1445041-bbc0-4994-98d5-3eb149afceea" />|<img width="391" alt="Android Studio 2025-01-22 11 46 09" src="https://github.com/user-attachments/assets/295e5cc4-74e2-422a-b478-a3e0bd577b60" />|<img width="391" alt="Android Studio 2025-01-22 11 46 28" src="https://github.com/user-attachments/assets/098339de-f2df-4269-84cf-e3ae2c09a51d" />|

Site with errors:
|Dark Before|Dark After|Light Before|Light After|
|---|---|---|---|
|<img width="395" alt="Android Studio 2025-01-22 11 48 50" src="https://github.com/user-attachments/assets/4f8dd05d-ccc7-44eb-96e0-ffec63975085" />|<img width="390" alt="Android Studio 2025-01-22 11 48 06" src="https://github.com/user-attachments/assets/751f35e2-b801-4ddf-9655-15f0097e05ca" />|<img width="395" alt="image" src="https://github.com/user-attachments/assets/15ac20c9-4d40-4e51-aed6-fd69a001588b" />|<img width="388" alt="Android Studio 2025-01-22 11 48 20" src="https://github.com/user-attachments/assets/780bf849-9add-4f91-bac8-3cdd5fd89337" />|

Main page / site list:
|Light Before|Light After|Light Scrolled Before|Light Scrolled After|
|---|---|---|---|
|<img width="387" alt="Android Studio 2025-01-22 11 53 07" src="https://github.com/user-attachments/assets/ca426470-00c2-4dc3-bd22-4a336c4ec8cf" />|<img width="403" alt="Android Studio 2025-01-22 11 53 41" src="https://github.com/user-attachments/assets/abf755e3-df10-453b-a439-0aa3b21b7ef9" />|<img width="389" alt="Android Studio 2025-01-22 11 53 22" src="https://github.com/user-attachments/assets/a6cdfabf-5288-49fe-ac29-e73678d34ccb" />|<img width="396" alt="Android Studio 2025-01-22 11 53 51" src="https://github.com/user-attachments/assets/11eda1f4-cf2f-4848-9690-6093223a9e7e" />|

Certificate:
|Dark Before|Dark After|Light Before|Light After|
|---|---|---|---|
|<img width="388" alt="Android Studio 2025-01-22 11 57 25" src="https://github.com/user-attachments/assets/5a1db1ba-a560-4aa6-8649-9b41d9ba25b6" />|<img width="390" alt="Android Studio 2025-01-22 11 56 44" src="https://github.com/user-attachments/assets/5e1b9200-ea13-42e5-a55d-51a1fda4522f" />|<img width="397" alt="Android Studio 2025-01-22 11 57 01" src="https://github.com/user-attachments/assets/65c52218-3f90-40c7-bb21-e499c2e0b08c" />|<img width="392" alt="Android Studio 2025-01-22 11 56 21" src="https://github.com/user-attachments/assets/554847cd-e825-4691-ac21-1549ab5e7d21" />|
2025-01-23 10:49:32 -05:00
Caleb Jasik
f290a71b94
Remove unused imports (#223) 2025-01-22 13:50:50 -06:00
Ian VanSchooten
6ed64b7349
Do not allow starting site if there are errors (#220) 2025-01-17 12:30:34 -05:00
Ian VanSchooten
301dc6c394
Minor updates (#217)
These are a few more minor updated dependencies, mostly in go.mod. I also see that the pubspec now has an update to the flutter version, which should have happened previously along with the flutter upgrade, but it didn't for whatever reason.
2025-01-17 12:30:20 -05:00
Ian VanSchooten
a28b922494
Add PrimaryButton component (#221) 2025-01-16 10:59:21 -05:00
Ian VanSchooten
991837676a
Add DangerButton component (#219)
This pulls out a component that we can use for "dangerous" operations like deleting, and styles it in one place.

It also starts to move us slowly towards Material 3, with the rounded corners on these buttons in Android.  

Android:

|Before Light|Before Dark|After Light|After Dark|
|---|---|---|---|
|<img width="425" alt="Android Studio 2025-01-15 14 16 36" src="https://github.com/user-attachments/assets/4823e551-6a40-48dd-9bc1-3004699b90ea" />|<img width="417" alt="Android Studio 2025-01-15 14 16 47" src="https://github.com/user-attachments/assets/df5461fd-586e-47bb-99b9-0212e63f0454" />|<img width="413" alt="Android Studio 2025-01-15 14 15 59" src="https://github.com/user-attachments/assets/d88a6225-b71a-4886-8387-e35811a3a6ec" />|<img width="418" alt="Android Studio 2025-01-15 14 16 15" src="https://github.com/user-attachments/assets/d4f23b1c-7003-4a00-b865-4a123d8fe3e9" />|


iOS:

|Before Light|Before Dark|After Light|After Dark|
|---|---|---|---|
|<img width="437" alt="Simulator 2025-01-15 15 56 26" src="https://github.com/user-attachments/assets/87c4eed3-6d07-4858-8ad8-d8c011538154" />|<img width="445" alt="Simulator 2025-01-15 15 56 36" src="https://github.com/user-attachments/assets/9dc5b174-7bc7-48ec-a3c0-61633168c31a" />|<img width="439" alt="Simulator 2025-01-15 16 05 23" src="https://github.com/user-attachments/assets/31dc9ab6-8a3c-49c7-892d-627f16e2a8cd" />|<img width="444" alt="Simulator 2025-01-15 16 05 37" src="https://github.com/user-attachments/assets/979280d6-e1f4-4d57-a86a-10bb4def729a" />|
2025-01-16 08:16:23 -05:00
Ian VanSchooten
0e4dd68b84
Fix system brightness setting (#212)
* Use correct brightness when enabling system brightness

* Listen to system brightness changes if needed

* Use final instead of var
2024-12-20 15:18:07 -05:00
Ian VanSchooten
3d250f4e41
Add Sentry crash-reporting opt-out (#211)
* Add Sentry opt-out

* [chore] Remove inaccurate comment

* Prevent line-wrap in iOS
2024-12-20 12:36:51 -05:00
Ian VanSchooten
e5ca54f7f2
Fix ConfigItem font size (#210)
* Make other thing bigger

* Fix other padding

* Clean up textStyle
2024-12-19 12:19:46 -05:00
Ian VanSchooten
afc3abd633
Set ConfigItem label text style correctly (#208)
* Set ConfigItem label text style correctly

* Add right padding for chevrons
2024-12-18 16:12:24 -05:00
Ian VanSchooten
a449a650c3
Fix deep links (#207) 2024-12-18 10:26:46 -05:00
Ian VanSchooten
c97732d1be
Show CA "Needs attention" (#201)
* Do not save site if there are errors

* Show CA error correctly

* Revert "Do not save site if there are errors"

This reverts commit 3cea52a15f.
2024-12-13 10:47:15 -05:00
Ian VanSchooten
1102681704
Fix camera background opacity (#195) 2024-10-31 10:19:32 -04:00
Ian VanSchooten
88aab16b52
Fix ID used when listening to updates on new sites (#193)
This should avoid the errors we've been seeing in Sentry of:

```
MissingPluginException(No implementation found for method listen on channel net.defined.nebula/null)
```

To test, start up the mobile app in an android phone or emulator, tap the plus button to add a new site, and verify that no error log is shown.

Note: we still get a similar error when tapping the "Good Site" or "Bad Site" in debug, but I believe that is because it's being created too quickly before the EventChannel has a chance to be set up.  Adding a site manually does not trigger the error.
2024-10-30 08:05:32 -04:00
Ian VanSchooten
1ea8438a5d
Add Sentry for error tracking (#189) 2024-10-25 08:53:07 -04:00
John Maguire
470578865b
Update to support netip use in Nebula 1.9.4 (#182) 2024-10-16 17:02:28 -04:00
John Maguire
6d9bcc9ba1
Pop confirmation modal only for changed forms (#178) 2024-10-11 11:34:44 -04:00
Ian VanSchooten
cc0ee7cbc2
Flutter format is removed, now dart format (#168)
It was removed in 3.12: https://github.com/flutter/flutter/pull/129360

This updates the README and our CI job.
2024-10-07 11:38:00 -04:00
Ian VanSchooten
2b900fe982
Update Android dependencies and AGP (#165)
This updates kotlin, gson, AGP, and WorkManager to the latest versions.

It also updates the README to include the correct ndk version for our AGP, as specified here: developer.android.com/build/releases/gradle-plugin#compatibility
2024-09-26 16:27:10 -04:00
Ian VanSchooten
78640437f1
Update Gradle, replace QR code reader library (#162)
I ran the Gradle Upgrade Assistant to get us on the latest version of gradle, but two of our dependencies didn't support it.

- https://pub.dev/documentation/package_info/latest/
- https://github.com/AmolGangadhare/flutter_barcode_scanner

`pacakge_info` is officially deprecated and replaced by `package_info_plus`, which is what I've swapped to here.

A bigger change was switching to https://github.com/juliansteenbakker/mobile_scanner.  It does seem to work a bit better than the other one, and does not throw an error now when cancelling the QR code collection, as it did before.  I've tested on android in the simulator, and iOS with an actual device.  

To test adding a cert:
1. Create a CA on your computer with `nebula-cert ca -name test-mobile`.  This will create a `ca.crt` and `ca.key`
2. Tap the + button in the mobile app to add a site
3. Tap the "Certificate" row
4. Copy the public key to a file on your computer like `test.pub`
5. Create a signed cert with `nebula-cert sign -name test-mobile -ip 192.168.0.20/24 -in-pub test.pub`
6. Create a QR code for it: `nebula-cert print -out-qr "qr.png" -path ./test-mobile.crt`
7. In Android studio, in the "Running devices" tab, open the simulator's extended controls:  
<img width="509" alt="Android Studio 2024-09-23 13 08 08" src="https://github.com/user-attachments/assets/c1f8288e-374c-457c-942a-4109240102ab">

8. Choose the Camera option, and add the qr code image to the wall of the virtual scene
<img width="679" alt="image" src="https://github.com/user-attachments/assets/bafaa9af-72e4-4444-9704-9876c53c883c">

9. Back in the app, when you choose QR Code and "Scan a QR code`, the virtual scene should open.  Hold shift, then move your mouse to look around.  Turn around 180 degrees, and walk forward into the other room (can go through the walls) using the `w` key.  When you get the QR code into the white border, the scanner should close and apply the certificate settings.  If you use a nonsense QR code, or a QR code with a non-matching key, or a CA QR code, you should get an error message when it scans.

The process for scanning a CA qr code is similar.  

1. Run `nebula-cert print -out-qr "qr-ca.png" -path ./ca.crt`
2. Replace the QR in the extended controls
3. Tap CA when adding a site
4. The rest of the process is the same as above.

iOS is similar, except you'll need to use a real device, as the simulator does not include a virtual scene like Android does.
2024-09-24 07:25:09 -04:00
Ian VanSchooten
64d45f66c7
Update Flutter, target android SDK 34 (#160)
This updates flutter to 3.24.1, the latest stable version, and also updates our flutter dependencies to latest.

It targets the latest android sdk, 34, which is required if we want to publish a new version to the Google Play store.

I also needed to make a few adjustments to handle deprecations. The biggest change is that I needed to wrap the main widget in MaterialApp to avoid problems with AdaptiveSwitch in iOS.
2024-09-20 14:19:23 -04:00
John Maguire
c64577f42e
Remove cachedPackets from HostInfo (#145) 2023-12-07 15:11:50 -05:00
John Maguire
ec1af2974a
Fix encryption errors after restoring to a new phone (#143)
When a user restores to a new phone, their TPM will no longer be able to
decrypt the encrypted credentials.

We have code already in place to delete "invalid" sites, which cleans
these up by removing them.

However, when trying to save a new site, Android continues to try to use
the old keys which are no longer decryptable. So, when saving new
encrypted files, simply reset the crypto keys if we are unable to
encrypt.
2023-12-01 15:26:21 -05:00
John Maguire
fbd2759d4f
Replace 'DN' with 'Managed Nebula' (#139) 2023-10-05 14:41:40 -04:00
John Maguire
693c7b6346
Hide CA expiration errors on managed sites (#128) 2023-05-17 12:10:11 -04:00
John Maguire
f7a7093879
Fix share button on iPad (#124) 2023-05-15 16:12:24 -04:00
John Maguire
5cc41f1129
Allow IP address entry on non-US locales (#114) 2023-05-10 16:43:27 -04:00
John Maguire
b36914ef17
Update link to privacy policy (closes #108) (#115) 2023-04-14 11:14:06 -04:00
John Maguire
a5139c4335
Hide QR code scanner on devices without cameras (#101) 2022-11-22 16:50:11 -05:00
Nate Brown
6b1bbf7352 Add a defined.net indicator on manual enroll 2022-11-22 10:27:19 -06:00
Nate Brown
8fc3a40467
Add a manual enrollment flow to support chromeos (#99) 2022-11-22 10:12:38 -06:00
Nate Brown
bb457c7c83
Sometimes the list of remotes can be null (#96) 2022-11-21 13:31:58 -06:00
John Maguire
974c7a4eed
Refresh Sites when a site is saved (closes #89) (#93)
* Refresh Sites when a site is saved (closes #89)

* Update with iOS side fix
2022-11-18 16:03:52 -05:00
Nate Brown
6108bf801b
Ignore a nil message, nebula hasn't booted yet (#90) 2022-11-18 13:37:15 -06:00
John Maguire
37758d4a01
Request VPN permissions on site start (#92)
Previously VPN permissions were requested when the UI was loaded. If the
user denied the permissions it would have to be force stopped and
reopened to get another permission request grant.

Additionally, when requesting VPN permissions Android will kill any
other running VPN service. This avoids that behavior unless a site is
explicitly started.

Also disables the app from showing up in the "Always On" settings.
2022-11-18 14:34:45 -05:00
John Maguire
a5684e1978
Fix share on Android by moving to flutter share lib (#87)
Co-authored-by: Nate Brown <nbrown.us@gmail.com>
2022-11-17 15:46:06 -06:00
John Maguire
c7a53c3905
Support DN host enrollment (#86)
Co-authored-by: Nate Brown <nbrown.us@gmail.com>
2022-11-17 16:43:16 -05:00
Nate Brown
dbe67c2f81
Upgrade to flutter 3 (#70)
Co-authored-by: John Maguire <contact@johnmaguire.me>
2022-09-21 15:27:35 -05:00
Nate Brown
e3780bda1e
Show a message on android if permissions were denied (#65) 2022-08-05 16:42:31 -05:00
Nate Brown
958b15d711
Allow import of private key, make it so key material isn't removed when navigating off the add a cert page (#64) 2022-08-05 16:42:17 -05:00
Nate Brown
d37bdd9032
Cleanup (#58) 2022-07-27 11:38:02 -05:00