Commit Graph

137 Commits

Author SHA1 Message Date
Jamil
210940221e feat(apple/iOS): Show errors related to granting notifications (#7857)
On iOS, it's possible for the notification granting process to throw
errors, though not very likely. This PR updates updates the plumbing for
how we request user notifications on iOS and respond to the result,
allowing for errors to be propagated back to the user in case something
goes wrong.

Note that unlike installing system extensions and VPN configurations,
disallowing notifications _does not_ result in an error being thrown.
Instead, we receive `false`, and we now track this Bool instead of the
entire `UNAuthorizationStatus` for updating the UI with.

By keeping that Bool `nil` until we load the authorization status, we
fix #7617 as a bonus.

Related: #7714 
Fixes: #7617
2025-01-26 05:40:08 +00:00
Jamil
3c6210e0b1 feat(apple): Show sysex & VPN install errors (#7849)
When installing the System Extension or VPN configuration, certain
errors can occur.

Some of these are due to user error and we should further advise the
user how to remedy.

For others, they aren't really actionable, and we silently ignore or
quietly log them.

Resolves: #7714
2025-01-25 13:29:47 +00:00
Jamil
7f70aa1003 fix(apple): Ensure beginUpdatingResources doesn't block (#7864)
`fetchResources` is an IPC call. As such, it could potentially take a
long time to execute since the system may need to launch the XPC process
to handle the call.

Since this is called within a 1-second Timer whenever the user has the
MenuBar open (macOS) or is viewing the ResourcesList (iOS), we need to
run these IPC calls in a `Task.detached`.

The resources themselves must be updated on the main thread because
they're an `ObservableObject`, so a bit of refactoring is added to clean
this up a bit.
2025-01-25 13:29:23 +00:00
Jamil
ae3354402f fix(apple): Fix retain cycle in Log.swift (#7861)
The previous developer introduced a retain cycle in Log.swift by
strongly capturing `self` inside an async closure.
2025-01-25 13:27:08 +00:00
Jamil
b4a54d9244 fix(apple): Initialize NSAlert on the main thread (#7862)
All UI operations must take place on the main thread. Swift doesn't
protect us from this unfortunately for Cocoa APIs like `NSAlert`.
2025-01-25 13:26:33 +00:00
Jamil
ae8e59fb34 refactor(apple): Downgrade update check transient errors (#7847)
These can fail sporadically and we don't need to capture them. However,
for users who may be experiencing consistent failures or otherwise
wondering why their client isn't able to check for updates, we leave
them as `warning`.
2025-01-24 11:39:36 +00:00
Jamil
f779fe9667 feat(apple): Show UI alerts for sign in failures (#7838)
On Apple, we will silently fail if the tunnel fails to start. This adds
a simple `NSAlert` modal (macOS) or `Alert` popup (iOS) that must be
dismissed before continuing if the tunnel fails to come up, so that the
user has a chance of understanding why.

The vast majority of the time this fails due to DNS lookup errors while
starting connlib.

Related: #7004
Supersedes: #7814
2025-01-24 06:06:33 +00:00
Jamil
0dcb14d9a2 refactor(apple): Downgrade error for repeated sysex enabling (#7816)
If the user again clicks `Enable System Extension` without having
actually enabled it in system settings, this error will be reported. We
don't necessarily need to act on it.
2025-01-22 05:32:10 +00:00
Jamil
d898884ddb refactor(apple): Downgrade noIPCData to warning for logs (#7813)
If the system extension has not been enabled by the user, opening the
`Settings -> Diagnostic Logs` pane will trigger this error. There's
nothing we can do until they enable the system extension, so don't
capture this particular case in Sentry.
2025-01-22 05:31:21 +00:00
Jamil
787eac86ac fix(apple): Use Task.detached when loading sysex and vpn config (#7815)
When the app starts, we perform various checks in the
`AppViewModel.init` which read and write to disk, which can potentially
be slow (a few seconds), especially for busy rotational hard drives.

These were performed inside a regular `Task` closure, but since
AppViewModel is annotated `@MainActor`, that meant this Task blocked the
main UI thread until the operations completed.

In practice this wasn't an issue because it simply manifested as the app
taking a couple seconds to launch under these conditions.

We fix this by simply using a `Task.detached` which will run the
operations on another thread. Now, the first window will pop up sooner
and immediately show the `ProgressView()` (i.e. a loading spinner icon)
until these operations complete.

A few minor reorganizing of the `os()` macro was also performed because
some of the variables now need to be `await`ed because they live on the
main thread.

refs #7798
2025-01-21 03:33:22 +00:00
Jamil
4c5f72d53f fix(apple): Use Task.detached to open URLs (#7798)
Opening URLs using `NSWorkspace.shared.open(url)` (which potentially
launches the browser) is a blocking operation on Apple platforms. This
will cause the UI to hang if called from a UI thread, so we need to
avoid that with a Task.
2025-01-18 09:36:10 -08:00
Jamil
10847fd549 fix(apple): Use Task.detached when starting from MainActor (#7766)
When starting a Task, by default it's launched with the same priority as
the calling code.

In the UI these are run on the `MainActor` with highest priority by
default. If the worker thread running the Task closure gets blocked, it
will cause the UI to hang.

To fix this, we use `Task.detached` which runs the closure without a
specific priority, which is lower than the UI thread.

Furthermore, `weak self` is used to prevent retain cycles if the parent
thread `deinit`s.

This was causing an issue primarily when making IPC calls because those
will sometimes hang until the XPC service is launched for the first
time.

---------

Signed-off-by: Jamil <jamilbk@users.noreply.github.com>
2025-01-16 15:26:03 +00:00
Jamil
81615dfef8 Revert "refactor(apple): Use kSecUseDataProtectionKeychain for token" (#7765)
After reading through this [Apple technical
note](https://developer.apple.com/documentation/technotes/tn3137-on-mac-keychains),
it's clear that we want to actually omit this key from our keychain
queries.

The reason is because:

- on iOS, this will be already set (there is no other option)
- on macOS, the data protection keychain is *unavailable* from system
extensions

After testing, it appears that the original issue that PR sought to fix
was actually fixed by always installing the correct system extension
version: #7759.

Reverts firezone/firezone#7756
2025-01-15 12:27:23 -08:00
Jamil
854436b1a0 fix(apple): Don't log certain security errors in debug (#7764)
When building / testing the Apple clients locally, OS code signing and
security requirements can cause certain types of errors to throw.

We still want to see these in the console, but not necessary capture
them to Sentry.
2025-01-15 18:39:11 +00:00
Jamil
55485c71e6 fix(apple/macOS): Don't log notificationsNotAllowed (#7762)
This can happen if the user hasn't granted notifications and isn't worth
reporting.
2025-01-15 16:34:55 +00:00
Jamil
3722c81eca fix(apple/macOS): Handle outdated system extensions (#7759)
When a user launches the macOS app, we check if the system extension is
installed. If it was, we assumed it would function properly.

However, an older version of the extension can be installed from our
current app version, so we would erroneously consider the extension as
"installed" even though it needed to be updated.

To fix this, we introduced an enum for tracking the system extension
state with `installed`, `needsReplacement`, and `needsInstall` states.
These track whether the extension is up-to-date, needs upgrade (or
downgrade), or needs to be approved and enabled by the user altogether
respectively.

Importantly, this also gracefully handles downgrades, not just upgrades
since we already return a `.replace` action in our request callback that
the system calls when installing an extension with the same bundle ID as
one that exists.
2025-01-15 00:13:34 +00:00
Jamil
ed6350d34a refactor(apple): Rename VPN "Profile" to VPN "Configuration" (#7755)
Apple actually calls these `VPN Configuration`s throughout the OS, so I
thought it would be good to be consistent.

Draft because stacked.
2025-01-14 17:51:35 +00:00
Jamil
c349353600 refactor(apple): Use kSecUseDataProtectionKeychain for token (#7756)
This will force the macOS Keychain to behave like the iOS Keychain. To
be honest, Apple's documentation is very much lacking in this regard,
but some research suggests this is both heavily recommended by Apple and
that it enables the Keychain operation to benefit from Apple's security
hardware in their Macs.

In my local testing, it also seems to make keychain operations more
reliable when SIP is disabled, but that could be a fluke given the
number of variables at play.


https://developer.apple.com/documentation/security/ksecusedataprotectionkeychain

Draft because stacked.
2025-01-14 17:49:05 +00:00
Jamil
64876fffa3 fix(apple): Don't rely on Keychain for critical functions (#7752)
The Keychain on Apple platforms, while secure, is not always available.
It can be unavailable if the user has changed its permissions
accidentally, the keychain database is corrupt, there is an issue with
the secure enclave, or any number of other system-related or Apple
account-related reasons.

There are only two things we use the Keychain for:

- Storing the `firezone-id`. This is actually not a secret.
- Persisting the `token` upon sign in so that:
  - the iOS system can keep the tunnel alive without the GUI running
- the macOS app can relaunch after `Disconnect & Quit` without having to
sign in again

For the first case, we move back to persisting this to a file (see
#7464).

For the second case, we simply don't care too much if the Keychain can't
be saved to. We simply move on with activating the tunnel and logging
the error so we know how often these edge cases occur.
2025-01-14 14:14:51 +00:00
Jamil
6413a45589 fix(apple): Explicitly check if system extension is installed (#7691)
In #7680, I stated that a VPN profile's status goes to `.invalid` when
its associated system extension is yanked. That's not always true. I
observed cases where the profile was still in the `.disconnected` state
with the system extension disabled or removed.

So, now we explicitly check on startup for two distinct states:

- whether the system extension is installed
- whether the VPN profile is valid

Based on this, we show an improved GrantVPNView for macOS only with
clear steps the user must perform to get set up.

If the user accidentally closes this window, they can open the Menubar
and click "Allow VPN permission to sign in" which will both (re)install
the extension and allow the profile.

<img width="1012" alt="Screenshot 2025-01-07 at 5 23 19 PM"
src="https://github.com/user-attachments/assets/c36b078e-835b-4c6e-a186-bc2e5fef7799"
/>
 
<img width="1012" alt="Screenshot 2025-01-07 at 5 24 06 PM"
src="https://github.com/user-attachments/assets/23d84af4-4fdb-4f03-b8f9-07a1e09da891"
/>

<img width="1012" alt="Screenshot 2025-01-07 at 5 31 41 PM"
src="https://github.com/user-attachments/assets/5b88dfa4-1725-45f2-bd6e-1939b5639cf4"
/>
2025-01-08 14:34:22 +00:00
Jamil
5ec9973b1f fix(apple): Improve handling of VPN lifecycle events (#7680)
On macOS, there are two steps the user needs to allow for the VPN
profile to be active: enable the system extension and allow the VPN
profile.

The system extension must be installed before the VPN profile can be
allowed. This PR updates the flow so that the user is prompted to handle
both of those serially. Before, we tried to install the system extension
on launch and prompt the user to allow the profile at the same time.

This PR includes fixes to handle the edge cases where the user removes
the profile and/or extension while the tunnel is connected. When that
happens, the `NEVPNStatus` becomes `.invalid` and we replace the `Sign
In` link in the Menubar with a prompt to restart the grant permissions
flow. On iOS, the behavior is similar -- we move the view back to the
GrantPermissionsView.

Lastly, some refactoring is included to use consistent naming for
`VPNProfile` instead of `TunnelManager` to more closely match what Apple
calls these things.
2025-01-07 19:19:19 +00:00
Jamil
70a88b7091 fix(apple): Move status observer setup to init() (#7673)
This is a very minor regression caused by #7555. We didn't bind the
status update observer until after the VPN profile was created. In
practice this didn't cause an issue because the status never changes
until a VPN profile is created, but still thought it's good to fix.

The JSON encoder is now configured in the `init()` as well like any
other instance variable should be.
2025-01-06 08:13:48 +00:00
Jamil
59a390320a refactor(apple): Make Keychain interaction synchronous (#7608)
Although interacting with the Keychain typically involves I/O, there
wasn't a good reason to make all of its functions `async` as this
infects the caller hierarchy. Instead, the calling code should decide
how to wrap the synchronous calls directly with their own preferred
mechanism for dealing with blocking operations.

In practice, it turns out that nearly all of the places we were
interacting with the Keychain was _already_ within some sort of
non-critical Task or equivalent, especially the important parts like the
UI thread. So this complexity is not required.

The Keychain was moved from an `actor` class to a regular enum because
we don't need the serialization guarantees here -- since the calls are
blocking, there is no risk of Keychain operations happening out of
order.

Tested on macOS 15.
2025-01-06 00:32:07 +00:00
Jamil
8e221904e9 fix(apple): don't pass completionHandler to IPC if we're not going to call it (#7671)
If we pass a `completionHandler` to `sendProviderMessage`, the Network
Extension framework will expect that completion handler to be called.

Probably doesn't cause any issue as-is, but it would be better to be
correct here.
2025-01-05 23:05:48 +00:00
Jamil
67caf73fb1 fix(apple): Use standardized Sentry release name and set dist to package type (#7668)
- Updates the Sentry release name to follow `component@version` format
- Uses the Sentry `dist` field to set the distribution type,
`appstore|standalone`
2025-01-05 18:26:55 +00:00
Jamil
709037bce5 chore(apple): Make update download URL compatible with upcoming standalone macOS release (#7666)
- Updates Apple download URL to point to app store or website depending
on package type
- Refactors `AppInfoPlistConstants` to `BundleHelper` to better name
what it does
2025-01-05 07:52:32 +00:00
Jamil
b6aed36c2c feat(apple): Set account slug from Swift -> Rust to hydrate Sentry with (#7662)
- Refactor Telemetry module to expose firezoneId and accountSlug for
easier access in the Adapter module
- Set accountSlug to WrappedSession.connect for hydrating the Rust
sentry context
2025-01-04 02:48:06 +00:00
Jamil
525c1b502b feat(apple): Add Sentry reporting to Swift codebase (#7620)
Adds Sentry SDK to the Swift codebase. Currently error captures are
implemented and happen during `Log.error` calls.

Fixes #7560
2025-01-04 00:59:59 +00:00
Jamil
dcf8df6980 refactor(apple): Clean up use of DispatchQueue.main (#7612)
In several places we were unnecessarily wrapping code in either a `Task`
or `DispatchQueue.main.async` block.

The former is only needed if the API we're calling itself exposes an
`async` function or we're running some long-running task.

The latter is typically used for UI updates.

At all other times it is preferable to simply use blocking functions and
let the caller of these best determine how to execute them.
2025-01-01 19:47:44 +00:00
Jamil
635b0f37cc refactor(apple): Determine logging context based on bundle ID (#7618)
This simplifies the logging API and prevents accidentally writing to the
app or tunnel log file from the wrong process.

Tested on macOS and iOS

Fixes #7616 

Draft because stacked
2024-12-31 20:59:22 +00:00
Jamil
b5eccf095a refactor(apple): Remove redundant category key from log files (#7614)
This is redundant and makes logs unnecessarily more noisy / larger.

Fixes #7613
2024-12-31 19:44:00 +00:00
Jamil
1ddc2f5de6 fix(apple): Don't crash if tunnel manager session is unexpectedly nil (#7594)
In certain weird edge cases such as:

- The user removes the VPN profile while Firezone is signed in, causing
the `NETunnelProviderSession` to go invalid immediately
- The user approves the system extension to load before the VPN profile
access is granted

then the TunnelManager will not be able to obtain a valid reference to a
NETunnelProviderSession object.

In these cases, for now, it makes more sense to fail silently than to
crash, effectively making these operations a no-op until the user
remedies the VPN profile. Currently the user is prompted to re-grant VPN
profile whenever its status goes to `invalid`, so these cases don't
technically fail without prompting the user.

Draft because it's stacked on #7593 


Fixes #7579 
Fixes #7591

---------

Signed-off-by: Jamil <jamilbk@users.noreply.github.com>
Co-authored-by: Thomas Eizinger <thomas@eizinger.io>
2024-12-30 20:14:56 +00:00
Jamil
a1337d011c fix(apple): Load tunnel manager after creating it (#7593)
When launching Firezone for the first time, the VPN profile doesn't
exist. We prompt the user to create it with "Grant VPN Permission", but
then we fail to reload it, which initializes the tunnelManager instance
variables properly and binds observers.

The result of this was that we failed to react to VPN status changes on
the first launch of Firezone.

This can (and should be) refactored to be cleaner, but that is out of
scope for this PR and will be saved for #6554.


Refs #7579
2024-12-30 19:08:40 +00:00
Jamil
086dd5188c chore(apple): Resolve all Swift compile warnings (#7602)
Fixes various warnings Xcode that have cropped up in the 1.4.0 refactor
and recent feature additions.
2024-12-30 17:12:05 +00:00
Jamil
e9c0721674 fix(apple/macOS): Fetch providerStopReason over IPC on macOS (#7570)
Since we no longer have access to the tunnel's group container from the
app process, we need to move reading the last VPN stop reason to an IPC
call. This call is used to show an alert to the user when their connlib
session has been disconnected due to 401: Unauthorized.

Fixes #7468
2024-12-23 11:55:36 +00:00
Jamil
be21889165 fix(apple): Make log export work over IPC for macOS (#7535)
Exporting logs on macOS in >= 1.4.0 presents a challenge because the app
process and tunnel process now write to different directories. They do
this because the network extension is now packaged as a system
extension, which means it runs as root.

Since the Apple App Store requires apps to be sandboxed, and we don't
wish to break App Store compatibility just yet, the tunnel process and
app process can't read or write to a common shared directory anymore.

This leaves IPC as the only reliable means for app <-> tunnel
communication. We already use the provided `sendProviderMessage`
function exposed by Network Extension for other operations, so we add
another message type to handle log export.

The log archive from the tunnel needs to be sent in chunks to reduce the
amount of total memory the export process consumes. To facilitate this,
a custom TunnelLogArchive class is used which handles the business logic
of keeping a pointer into the file we're chunking over.

As each chunk is read from the tunnel log archive, we send it using the
`sendProviderMessage`'s completionHandler callback. If the number of
sent bytes is less than our maximum chunk size, we know we're done.

On the app side, we read each chunk of data from the tunnel process
until a `done` boolean is signaled, at which point we close the archive
file we're writing to and complete the export.

Lastly, we need to compress the app and tunnel archives separately, then
compress the final result into a final archive path set by the user.
This is because it's impossible to compress two decoupled directories at
once.

Very little to any noticeable delay is added when performing this over
the previous approach. Exporting multiple GB of log data from the tunnel
took only a second or two on my M1. Presumably, having to read
uncompressed chunks and doing the compression on the app-side would
result in a couple orders of magnitude more IPC calls.

Refs #7071
2024-12-20 20:02:51 +00:00
Jamil
e6f5d6ef72 refactor(apple): Use static reference for TunnelManager instance (#7555)
Since we need to react to state on this instance changing, we need an
instance of TunnelManager to last the lifetime of the app process.

Thus, it makes more sense to use the `.shared` public static pattern to
maintain an instance of it we can use from anywhere instead of having to
store it in various other classes.
2024-12-20 16:35:05 +00:00
Jamil
56c592a27b fix(apple): Make clear logs and log size functions work across the IPC boundary (#7467)
The macOS client starting in 1.4.0 uses a system extension for its
network extension package type. This process runs as root and does not
have access to the app's Group Container folder for reading / writing
log files directly, and vice-versa. This means the tunnel now writes its
logs to a separate directory as the GUI app process.

Since the logging functions of clearing logs, calculating their size,
and exporting them assume all the logs are in the same directory, we
need to introduce IPC handlers to ensure the GUI app can conveniently
still perform these functions when initiated by the user.

We already use the Network Extension API `sendProviderMessage` as our
IPC mechanism for adhoc, bi-directional communication through the
tunnel, so we add more handlers to this mechanism to support the logging
functions summarized above.

In this PR we only fix the log size calculation and clear log
functionality. Exporting logs is more involved and will be implemented
in another dedicated PR.
2024-12-18 20:36:02 +00:00
Jamil
ac608d560a refactor(apple): Migrate firezone-id file to keychain (#7464)
Unlike the App extension which runs as the user, the system extension
introduced in macOS client 1.4.0 runs as `root` and thus cannot read the
App Group container directory for the GUI process. However, both
processes can read and write to the shared Keychain, which is how we
pass the token between the two processes already.

This PR does two things:

1. Tries to read an existing `firezone-id` from the pre-1.4.0 App Group
container upon app launch. This needs to be done from the GUI process.
If found, it stores it in the Keychain.
1. Refactors the `firezone-id` to be stored in the Keychain instead of a
plaintext file going forward.

The Keychain API is also cleaned up and abstracted to be more ergonomic
to use for both Token and Firezone ID storage purposes.
2024-12-09 03:17:46 +00:00
Jamil
0cdfd1fd4f fix(apple/macos): Install system extension on app launch (#7459)
- Installs the system extension on app launch instead of each time we
start the tunnel, as [recommended by
Apple](https://developer.apple.com/documentation/systemextensions/installing-system-extensions-and-drivers).
This will typically happen when the app is installed for the first time,
or upgraded / downgraded.
- Changes the completion handler functionality for observing the system
extension status to an observed property on the class. This allows us to
update the MenuBar based on the status of the installation, preventing
the user from attempting to sign in unless the system extension has been
installed.

~~This PR exposes a new, subtle issue - since we don't reinstall the
system extension on each startTunnel, the process stays running. This is
expected. However, now the logging handle needs to be maintained across
connlib sessions, similar to the Android tunnel lifetime.~~ Fixed in
#7460

Expect one or two more PRs to handle further edge cases with improved UX
as more testing with the release build and upgrade/downgrade workflows
are attempted.
2024-12-06 05:51:22 +00:00
Jamil
bd3f912542 refactor(apple/macos): Use System Extension packaging mode for macOS Network Extension (#7344)
To allow macOS users to rollback, it would be helpful to distribute a
standalone macOS app, similar to how we distribute the GUI client.

The first step in this process is to refactor the macOS client to use a
System Extension -based Network Extension rather than an App Extension
based one. This offers us the flexibility to distribute the macOS client
outside the Mac App Store in addition to via the store.

For this PR I focused on making the minimal set of changes necessary to
support this change. This PR intentionally doesn't update the CI
pipeline to notarize and attach a standalone bundle that will run ad-hoc
on other Macs. That will come in a subsequent PR.

One thing to note about System Extensions is that they're slightly more
finicky when it comes to getting the signing and packaging right. Thus,
the README.md is updated to account for the gotchas involved in
developing System Extensions locally.

Related: #7071.
2024-12-04 05:34:25 +00:00
Thomas Eizinger
05e895525b chore: set simpler default log filters (#7028)
Follow-up from #6985 to simplify our log filters everywhere. If any of
this doesn't fit, we should adjust the things here:


17ea827c03/rust/logging/src/lib.rs (L32-L40)
2024-10-14 18:54:36 +00:00
Gabi
3501d5b287 feat(clients): use hardware id for device verification (#6857)
We want to associate additional device information for the device
verification, these are all parameters that tries to uniquely identify
the hardware.

For that reason we read system information and send it as part of the
query params to the portal, that way the portal can store this when
device is verified and match against that later on.

These are the parameters according to each platform:

|Platform|Query Field|Field Meaning|
|-----|----|-----|
|MacOS|`device_serial`|Hardware's Serial|
|MacOS| `device_uuid`|Hardware's UUID|
|iOS|`identifier_for_vendor`| Identifier for vendor, resets only on
uninstall/install|
|Android|`firebase_installation_id`| Firebase installation ID, resets
only on uninstall/install|
|Windows|`device_serial`|Motherboard's Serial|
|Linux|`device_serial`|Motherboard's Serial|


Fixes #6837
2024-10-02 08:44:26 +00:00
Gabi
9979f5a4e4 feat(macos): show notification updates (#6679)
This patch adds a notification for updates for macos clients when they
are on an old version.

This is how it looks:

<img width="497" alt="image"
src="https://github.com/user-attachments/assets/829044fd-e8bc-4b47-b64d-67b8ef72adb0">

The orange dot is shown regardless of the notification being dismissed.

If the notification is dismissed by the "Dismiss this version" button,
until there's no new version there won't be notifications.

Updates are check at the start of firezone and every 6 hours after. This
is saved in `UserDefaults`.

Permissions for notifications needs to be allowed so that it's show,
this should be done by the `requestAuthorization`

Also, when an update is available a new `Update available...` option
appears in the menu

<img width="230" alt="image"
src="https://github.com/user-attachments/assets/16d7fea8-3cf5-4711-9d42-5c49faffe6c8">

This option, same as the notification takes you to the appstore.

---------

Signed-off-by: Jamil <jamilbk@users.noreply.github.com>
Co-authored-by: Jamil <jamilbk@users.noreply.github.com>
2024-09-17 01:31:27 +00:00
Jamil
947db254cc fix(apple): Don't bold addressDescription in macOS Menubar (#6632)
When the addressDescription looks like a URI, we highlight it with
markdown and set its click handler to open the URL when clicked. We were
also making it bold, which seems to break macOS's menubar width
calculation, causing the field to truncate (typically after `https://`)
instead of expanding the container to contain it.

By removing the bold formatting, the container is properly sized, fixing
the display issue.


# Before
<img width="553" alt="Screenshot 2024-09-07 at 10 44 37 AM"
src="https://github.com/user-attachments/assets/4596bf54-918d-4a59-81d6-a18e436da5ad">

# After
<img width="569" alt="Screenshot 2024-09-07 at 10 45 38 AM"
src="https://github.com/user-attachments/assets/0400731f-e189-4416-a670-d5c3b314d71b">
2024-09-07 18:40:06 +00:00
Gabi
700b056cd2 fix(ui): make internet resource off by default (#6518)
With this PR we made internet resource disabled by default.

Since no other resource is disalable and internet resource behavior is
particular we remove all client code to make non internet resource
disalable.

Also, since the portal never makes the internet resource that can't be
disabled we remove the whole code path to handle that.

Additionally, some other smaller refactors across the UI wrt internet
resource

Fix #6509

---------

Signed-off-by: conectado <gabrielalejandro7@gmail.com>
Co-authored-by: conectado <conectado@conectados-MacBook-Air.local>
Co-authored-by: Thomas Eizinger <thomas@eizinger.io>
2024-09-04 19:16:50 +00:00
Gabi
14b7652e0c chore(ui): move disable resource into resources details (#6463)
To homogenize the UI in mobile and non-mobile, we re-enable the sub-menu
for the internet resource, where it shows all resource

## New UI for android


![image](https://github.com/user-attachments/assets/3b9ce82f-1dbd-4ace-b7ba-873a34fd9dec)



![image](https://github.com/user-attachments/assets/16e9b128-532c-467e-b663-ae83195b2730)

## New UI for apple


![98579](https://github.com/user-attachments/assets/8bbda871-1d16-4d99-b873-a26d480821cf)


![99694](https://github.com/user-attachments/assets/f2924a08-8996-4882-867d-7446f7cfbafd)
2024-08-29 00:26:30 +00:00
Gabi
63c73e5bb6 feat: Internet Resource UI (#6434)
Fixes #6047

On mobile platforms the internet resource is rendered with all
non-favorite resources, since it was weird to see within the favorite
tab, for the system tray platforms it's rendered as part of favorites if
there is any favorite so that it's always visible to the user.

For mobile platforms the resource is non-clickeable, since the menu
shouldn't be of interest(maybe I should add it only for the sites?).

For non-mobile there is a sub menu where you can find the sites and the
enable/disable.

The current label for the resource is a place holder for the
screenshots, and can be set by the portal, if the portal doesn't set any
name it will just show "Internet Resource".

### Android screenshot


![image](https://github.com/user-attachments/assets/63deb25f-1cd1-4b49-be80-77570e612aa5)


### Linux Screenshot


![image](https://github.com/user-attachments/assets/7b67033d-71ee-4bac-98c8-4c5810bf43a3)


![image](https://github.com/user-attachments/assets/5bdbced5-bacd-4a09-a59c-aa853bb3baa0)

### Windows Screenshot


![image](https://github.com/user-attachments/assets/a3bbebb3-9a18-4b75-9e18-f58b1b61a7a3)

### MacOS screenshot

<img width="417" alt="image"
src="https://github.com/user-attachments/assets/5488d6e4-1cd2-42be-bcd7-3c51ec295590">

### iOS screenshot


![17044](https://github.com/user-attachments/assets/5321c363-5b43-4b1e-ac37-4fd7bdc68e28)
2024-08-27 04:08:19 +00:00
Jamil
0994bd145a feat(apple): Build GITHUB_SHA into Apple clients (#6406)
Closes #6401 

<img width="1012" alt="Screenshot 2024-08-21 at 11 52 31 PM"
src="https://github.com/user-attachments/assets/3012d088-97cb-4a82-8a8f-b2a398865755">

![Screenshot 2024-08-22 at 12 05
44 AM](https://github.com/user-attachments/assets/5e1209f9-e8fa-4453-9bdd-9f40339649b4)
2024-08-22 20:49:57 +00:00
Reactor Scram
0c0cd7b514 fix(macos): menu bar (#6376)
Closes #6370 

Tested with Jamil's patch. The bug is fixed on #6370 and no apparent
regressions on iOS

---------

Signed-off-by: Reactor Scram <ReactorScram@users.noreply.github.com>
Co-authored-by: Thomas Eizinger <thomas@eizinger.io>
Co-authored-by: Jamil <jamilbk@users.noreply.github.com>
2024-08-21 22:22:37 +00:00