Public Access
Give the desktop a macOS head, signed from the first release
The same application, the same Velopack and the same two-phase person-run release as Windows, with four things forced to differ. Signing is a precondition rather than an improvement: Gatekeeper refuses an un-notarized download outright instead of warning about it, so there was never the "unsigned for now" that ADR 0013 decision 8 argues for on Windows, and release-macos.sh refuses to start without the identities. The packaging split is narrower than it first looked, and the old claim at the foot of ci.yml is why it was worth checking rather than assuming. vpk cross-compiles when told to: 'vpk [osx] bundle' builds a real .app on any platform, and CI now publishes osx-arm64 and bundles it on every main and tag build, which is what catches a restore graph with no macOS native asset. There is no '[osx] pack' off a Mac, and that part is correct — pack drives codesign, notarytool and stapler, which exist nowhere else. The dylib signing loop in the script looks redundant beside vpk's own pass and is not. vpk signs with 'codesign --deep', which is the shape Apple documents as wrong for nested code, and platform-flags has recorded a notarization rejection that names no file since before any of this existed. Signing each native binary inside-out first leaves that pass nothing to get wrong. MacDeviceKeyStore reaches ADR 0007's conclusion through different hardware: a P-256 key in the Secure Enclave under an access control requiring user presence, so the platform enforces the gate rather than this process — which is the whole point of that ADR's amendment. The enclave holds no other kind of key, hence ECIES where Windows uses RSA-OAEP, and the shape that falls out is better than the Windows one: sealing needs only the public half and is silent, so only unlock prompts. IsSupported probes rather than infers, because three ordinary Macs answer no — an Intel machine without a T2, one with no login password, and every unsigned development build, since enclave keys need a signing identity. Two decisions worth stating because they are reversible. arm64 only: a second channel is small work and nobody here has an Intel Mac to walk Phase 18 on, and an x64 package would be the only artefact in this repository reaching users unverified. And the pack id stays DodoSSH.Desktop even though vpk names the bundle after it, so /Applications holds DodoSSH.Desktop.app: decision 2's reasoning binds harder here, because a pack id of DodoSSH would put Velopack's install root on top of ClientPaths.DataDirectory and let an uninstall take the user's un-synced outbox with it. CFBundleDisplayName puts the product name back in front of a person. Measured rather than assumed, since none of it is obvious: the publish and the bundle were both run, LSMinimumSystemVersion is 12.0 because that is the minos in the apphost's own LC_BUILD_VERSION, and vpk copies a custom Info.plist verbatim with no substitution at all — which is why the plist is a template the script renders and not a committed file. What is not done is the half that needs the hardware. There is no macOS runner, so nothing past "it bundles" has ever run. Phase 18 is the whole of the verification, and the two checks most likely to fail are the terminal against WKWebView and the enclave interop, neither of which has executed once.
This commit is contained in:
@@ -31,7 +31,12 @@ internal static class UpdateChannels
|
||||
/// </remarks>
|
||||
internal static IUpdateChannel ForThisMachine()
|
||||
{
|
||||
if (!OperatingSystem.IsWindows())
|
||||
// Two platforms now, and the check is a list rather than a negation for a reason: Linux reaches
|
||||
// this too. Velopack has a Linux path — AppImage — but this repository does not build one, so a
|
||||
// Linux build is a checkout somebody ran, and handing it an UpdateManager would have it poll a
|
||||
// feed carrying nothing it could apply. Naming the platforms that are packaged keeps a future
|
||||
// AppImage an addition here rather than a thing that silently already half-happened.
|
||||
if (!OperatingSystem.IsWindows() && !OperatingSystem.IsMacOS())
|
||||
{
|
||||
return new UnavailableUpdateChannel();
|
||||
}
|
||||
@@ -55,14 +60,21 @@ internal static class UpdateChannels
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// The Windows update channel, backed by Velopack against the project's own forge.
|
||||
/// The desktop update channel, backed by Velopack against the project's own forge.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// <para>
|
||||
/// The one file in the repository that names Velopack. It lives beside <c>WindowsDeviceKeyStore</c>
|
||||
/// rather than in a project of its own because it is the same kind of thing — a Windows-only
|
||||
/// implementation of an interface declared in <c>DodoSSH.Client.Session</c> — and because
|
||||
/// <c>DodoSSH.Client.Shell</c> is shared with the Android head, which must never acquire an updater.
|
||||
/// The one file in the repository that names Velopack. It lives beside the platform key stores rather
|
||||
/// than in a project of its own because it is the same kind of thing — a desktop-only implementation of
|
||||
/// an interface declared in <c>DodoSSH.Client.Session</c> — and because <c>DodoSSH.Client.Shell</c> is
|
||||
/// shared with the Android head, which must never acquire an updater.
|
||||
/// </para>
|
||||
/// <para>
|
||||
/// <b>One class for both desktop platforms, where the key stores are one class each.</b> The difference
|
||||
/// is where the platform knowledge sits. A key store is platform knowledge from top to bottom: different
|
||||
/// hardware, different API, different failure modes. Velopack's <c>UpdateManager</c> has already absorbed
|
||||
/// all of that, and what is left over — check, download, apply, restart — is identical on the two. The
|
||||
/// only thing that differs is which string names the feed, and that is <see cref="ChannelFor"/>.
|
||||
/// </para>
|
||||
/// <para>
|
||||
/// See <c>docs/adr/0013-desktop-distribution-and-updates.md</c>.
|
||||
@@ -103,7 +115,7 @@ internal sealed class VelopackUpdateChannel : IUpdateChannel
|
||||
/// but unsaid on one side and stated on the other is how a feed goes quiet with no error anywhere:
|
||||
/// the check succeeds, finds nothing, and reports that the client is up to date forever.
|
||||
/// </remarks>
|
||||
private const string ReleaseChannel = "win";
|
||||
private const string WindowsReleaseChannel = "win";
|
||||
|
||||
/// <summary>
|
||||
/// The nightly channel, which is a different name rather than the same one on a different tag.
|
||||
@@ -122,7 +134,26 @@ internal sealed class VelopackUpdateChannel : IUpdateChannel
|
||||
/// a download somebody watched. A channel each means neither ever sees the other's releases at all.
|
||||
/// </para>
|
||||
/// </remarks>
|
||||
private const string NightlyChannel = "win-nightly";
|
||||
private const string WindowsNightlyChannel = "win-nightly";
|
||||
|
||||
/// <summary>The macOS release channel, and Velopack's own default there.</summary>
|
||||
/// <remarks>
|
||||
/// A contract with <c>scripts/release-macos.sh</c>, exactly as the Windows pair is one with the
|
||||
/// PowerShell script. Stated for the same reason, which applies with more force here: the four
|
||||
/// channels all publish to one repository, so the only thing keeping a Mac from being offered a
|
||||
/// <c>win</c> package is that it never reads that index.
|
||||
/// </remarks>
|
||||
private const string MacReleaseChannel = "osx";
|
||||
|
||||
/// <summary>The macOS nightly channel.</summary>
|
||||
/// <remarks>
|
||||
/// Named here and not yet published by anything. The CI job for the macOS head builds and bundles
|
||||
/// and deliberately uploads nothing — see the packaging step in <c>ci.yml</c> — so a nightly macOS
|
||||
/// build checking this feed finds an empty channel and reports itself up to date, which is the
|
||||
/// correct behaviour for a channel with no publisher. The name exists so that turning the publisher
|
||||
/// on later is one job rather than a job plus a rename that has to reach every installed client.
|
||||
/// </remarks>
|
||||
private const string MacNightlyChannel = "osx-nightly";
|
||||
|
||||
private readonly UpdateManager manager;
|
||||
|
||||
@@ -141,10 +172,13 @@ internal sealed class VelopackUpdateChannel : IUpdateChannel
|
||||
/// <inheritdoc />
|
||||
public bool IsSupported => true;
|
||||
|
||||
/// <summary>Always, on this head.</summary>
|
||||
/// <summary>Always, on this head, on either platform.</summary>
|
||||
/// <remarks>
|
||||
/// Velopack's apply runs <c>Update.exe</c> over this installation and restarts it, so the process is
|
||||
/// gone by the time anything could have asked a question. The phone's is the other answer; see
|
||||
/// Velopack's apply hands off to a separate updater process — <c>Update.exe</c> on Windows, the
|
||||
/// <c>UpdateMac</c> helper inside the bundle on macOS — which replaces this installation and
|
||||
/// relaunches it, so the process is gone by the time anything could have asked a question. The
|
||||
/// mechanism differs and the answer does not, which is why this is a constant rather than another
|
||||
/// thing <see cref="ChannelFor"/> would have to decide. The phone's is the other answer; see
|
||||
/// <see cref="IUpdateChannel.ApplyingEndsTheProcess"/> for what the caller does differently.
|
||||
/// </remarks>
|
||||
public bool ApplyingEndsTheProcess => true;
|
||||
@@ -183,7 +217,36 @@ internal sealed class VelopackUpdateChannel : IUpdateChannel
|
||||
|
||||
return new UpdateManager(
|
||||
new GiteaSource(RepositoryUrl, accessToken: null, prerelease: nightly),
|
||||
new UpdateOptions { ExplicitChannel = nightly ? NightlyChannel : ReleaseChannel });
|
||||
new UpdateOptions { ExplicitChannel = ChannelFor(nightly) });
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// The one of the four channel names this build belongs to.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// <para>
|
||||
/// Two independent axes — which platform, and which of that platform's two channels — and they are
|
||||
/// resolved in one place so that neither can be answered differently somewhere else. The platform
|
||||
/// half is the running OS rather than anything recorded in the build, because a package can only
|
||||
/// ever be applied on the platform it was built for; the channel half comes from assembly metadata,
|
||||
/// because a release build and a nightly are the same bytes on the same OS and only the metadata
|
||||
/// tells them apart.
|
||||
/// </para>
|
||||
/// <para>
|
||||
/// Windows is the fallback rather than a third branch. Only Windows and macOS reach here at all —
|
||||
/// <see cref="UpdateChannels.ForThisMachine"/> is the gate — so the alternative would be an
|
||||
/// unreachable throw, and an unreachable throw in the middle of the updater is a thing somebody
|
||||
/// later has to reason about to discover it cannot happen.
|
||||
/// </para>
|
||||
/// </remarks>
|
||||
private static string ChannelFor(bool nightly)
|
||||
{
|
||||
if (OperatingSystem.IsMacOS())
|
||||
{
|
||||
return nightly ? MacNightlyChannel : MacReleaseChannel;
|
||||
}
|
||||
|
||||
return nightly ? WindowsNightlyChannel : WindowsReleaseChannel;
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
|
||||
Reference in New Issue
Block a user