Commit graph

154 commits

Author SHA1 Message Date
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
46f029a91d
Deal with some xcode warnings (#216)
This performs the recommended setting updates from xcode, though I needed to turn off `ENABLE_USER_SCRIPT_SANDBOXING` as it does not seem to be fully compatible with flutter.

I also dealt with a warning of: "Extension declares a conformance of imported type 'String' to imported protocol 'Error'; this will not behave correctly if the owners of 'Swift' introduce this conformance in the future", by creating and using some custom error types.

Lastly, I fixed our podfile to ensure that the `IPHONEOS_DEPLOYMENT_TARGET` is at least 12, which is our project setting.
2025-01-13 12:06:57 -05:00
Ian VanSchooten
c781ac4d91
Allow saving invalid sites (#215)
Closes https://github.com/DefinedNet/mobile_nebula/issues/191

Nate would like us to be able to save an invalid site, as a way of saving partial progress and then fixing issues later on, so that's what this PR does, for both Android and iOS.  To test, add a site, give it a name, and press save.  You should be taken to a list of sites, including the newly created invalid site.
2025-01-13 09:28:52 -05:00
Ian VanSchooten
7cb1da2504
Update to flutter 3.27 (#214)
The main thing here is that it will support edge-to-edge when we target android 15, and it changes the default for deep links.

The update to mobile_scanner should improve ios simulator support, but I'm finding that the app still won't load in the simulator (even without mobile_scanner at all), so there's some other work to do there.

https://medium.com/flutter/whats-new-in-flutter-3-27-28341129570c
2025-01-10 12:13:48 -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
db1f162f1e
Fetch more commits for Sentry releases (#209) 2024-12-18 16:28:28 -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
John Maguire
f74cda8121
Support P256 managed networks (#205) 2024-12-12 16:05:16 -05:00
John Maguire
a12ff140a3
Default listen.host to IPv6 addresses (#204) 2024-12-10 15:11:42 -05:00
Ian VanSchooten
c0b856e611
Remove sentry release action (#197)
It fails on macOS, and we don't really need it.
2024-11-04 07:54:24 -05:00
Ian VanSchooten
248e6b1605
Add env vars to sentry debug upload (#196) 2024-11-01 11:36:59 -04: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
1ecd008824
Upload debug symbols for Sentry (#192) 2024-10-29 09:14:49 -04:00
Ian VanSchooten
6d23a0ca35
Create and upload universal APK during release (#190) 2024-10-25 12:20:04 -04:00
Ian VanSchooten
1a968bffb4
Update GitHub actions (#188)
We had some old GitHub actions that were using old node versions. This updates them, removes some that have been archived/deprecated, and fixes caching of go dependencies.
2024-10-25 11:55:16 -04:00
Ian VanSchooten
1ea8438a5d
Add Sentry for error tracking (#189) 2024-10-25 08:53:07 -04:00
Ian VanSchooten
9814360613
Upload debug apk (#187)
This adds steps to our android debug smoke build to upload a debug apk on merges to main, retained for 60 days. This can be used to help test and troubleshoot builds in between Android releases.
2024-10-22 14:30:59 -04:00
Ian VanSchooten
e58078fa48
Handle managed nebula updates correctly (#186)
This fixes a few issues:

1) When updates are made, we will no longer create duplicate VPN profiles, rather we will update existing ones.
2) We will correctly update an existing profile when the site is running and an update is received, rather than attempting to create a new profile, which failed due to permissions errors.  
3) We will always reload nebula, even if we can't successfully save the VPN profile.
4) The default polling interval of 15 minutes is restored (previously set to 30 seconds during testing).

So far in manual testing I've confirmed that I do not lose the tunnel to my lighthouse even after the original 30 minute expiration of a certificate.  This confirms that reloads are occurring correctly.  Additionally, duplicate sites are not created when updates occur while the site is disconnected.
2024-10-18 12:32:48 -04:00
Ian VanSchooten
fb664308ae
Add providerBundleIdentifier to avoid permissions errors (#185) 2024-10-17 11:08:34 -04:00
Ian VanSchooten
c8994e98a5
Add smoke-build CI workflow (#169)
This adds a workflow into PRs to build the iOS and Android apps, just to verify that they aren't completely broken / unable to build. They're debug builds, so it won't completely mirror the release build, but that allows us to avoid getting signing keys in the workflow.
2024-10-17 09:38:50 -04:00
John Maguire
43fad65cf7
Use correct relay key in Nebula config (#184) 2024-10-16 17:13:44 -04:00
John Maguire
470578865b
Update to support netip use in Nebula 1.9.4 (#182) 2024-10-16 17:02:28 -04:00
Ian VanSchooten
494f071ed5
Move print logs to OSLogger (#179)
This aids in debugging in console.app, since print statements from the PacketTunnelProvider are not shown in xcode's console.
2024-10-16 14:28:07 -04:00
John Maguire
2d74360bc2
Update Nebula to v1.9.4 (#180) 2024-10-15 14:56:41 -04:00
John Maguire
6d9bcc9ba1
Pop confirmation modal only for changed forms (#178) 2024-10-11 11:34:44 -04:00
Ian VanSchooten
fcf21f6f6b
Fix issues with new xcode builds (#177)
John found an issue in gomobile that seems to be the culprit of one of these issues: https://github.com/golang/go/issues/53316#issuecomment-2407626810
2024-10-11 11:21:34 -04:00
John Maguire
998d0459ad
Fix Nebula reloading on managed update (#176) 2024-10-10 09:59:00 -04:00
Ian VanSchooten
1d1a280a9c
Specify correct ndk version (#172) 2024-10-08 12:33:06 -04:00
Ian VanSchooten
667ad112d4
Update proguard rules for missing classes (#171)
Addresses the errors seen in DefinedNet/mobile_nebula/actions/runs/11221064890/job/31190581077#step:13:1260

Locally I am able to perform most of a release build after removing these proguard rules which were previously added to avoid minification stripping out flutter code. That seems to no longer be required, though.
2024-10-08 12:27:32 -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
13b75cdbb4
Update java to 17 (#167)
This updates the version of java used during release builds to 17, the minimum required by our version of AGP. https://developer.android.com/build/releases/gradle-plugin#compatibility

It also uses a java toolchain and resolver plugin to automatically download and use the desired version of java, which will hopefully simplify things for others to get spun up on mobile app dev.  Reference https://stefma.medium.com/sourcecompatibility-targetcompatibility-and-jvm-toolchains-in-gradle-explained-d2c17c8cff7c for some explanation of toolchains and compatibility targets, and https://docs.gradle.org/current/userguide/toolchains.html#sec:provisioning for notes about automatic provisioning via toolchain.
2024-10-07 08:22:21 -04:00
Ian VanSchooten
79795ffe63
Remove media and audio pickers (#170)
And target iphoneos 12, to avoid some warnings.

We only use the file picker to allow users to load in nebula certs/keys, we don't need access to pictures.
2024-10-01 13:25:31 -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
a6398d6813
Support android API 34 (#164) 2024-09-26 14:43:55 -04:00
Ian VanSchooten
6f12f5a328
Update fastlane (#163) 2024-09-24 11:38:54 -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
f576aa0c50
Update Nebula and dnapi (#158)
* Update Nebula and dnapi

* Update Go
2024-06-20 15:24:00 -04:00
John Maguire
2353eaf4e3
Update Nebula to latest upstream (#154) 2024-03-07 15:57:34 -05:00
John Maguire
76f0ba17df
Don't use Nebula tunnel for app traffic on Android (#153) 2024-03-07 15:57:26 -05:00
John Maguire
3d7bad5649
Fix Github PAT appearing in Android and iOS app builds (#151)
Also adds a regression test.
2024-01-31 15:42:45 -05:00
John Maguire
7a048d88d7
Update Nebula to v1.8.1 (#147) 2023-12-19 16:54:20 -05:00