Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -179,8 +179,10 @@ jobs:
draft: false
make_latest: true

# Point the public in-app update feeds at this release: appcast.xml (Sparkle,
# SUFeedURL) and appcast.json (the old updater in copies up to 0.18.5). Done inline
# Legacy feeds for installed copies up to 0.19.10, which read them from
# stroke-app/ewiz-releases: appcast.xml (Sparkle) and appcast.json (the old updater
# in copies up to 0.18.5). Newer builds read https://ewiz.app/appcast.xml, which
# serves this release's own asset. Remove this step once old copies have updated. Done inline
# here rather than in a separate `release: published` workflow because releases
# published by the default GITHUB_TOKEN do NOT emit an event that can
# trigger another workflow — so that feed workflow never fired on its own.
Expand Down
6 changes: 5 additions & 1 deletion apps/macos/DISTRIBUTION.md
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,11 @@ for Updates…" and the menu's Update banner. Sparkle's window shows the check,
the download's progress and the install, then relaunches the new version.

- The app reads `SUFeedURL` from Info.plist (written by `scripts/package-app.sh`):
`raw.githubusercontent.com/stroke-app/ewiz-releases/main/appcast.xml`.
`https://ewiz.app/appcast.xml`. The website (`apps/web/src/routes/appcast[.]xml.ts`)
proxies the `appcast.xml` attached to the latest GitHub release, so publishing the
release is all it takes. Copies up to 0.19.10 still read
`raw.githubusercontent.com/stroke-app/ewiz-releases/main/appcast.xml`, which the
release workflow keeps updating until those copies have moved on.
- **Trust** is the EdDSA key, not a Developer ID: `SUPublicEDKey` in Info.plist is
`UpdateSignature.publicKeyBase64`, and every DMG in the feed carries that key's
`sparkle:edSignature`, made by `licensetool sign-update` from the
Expand Down
2 changes: 1 addition & 1 deletion apps/macos/scripts/package-app.sh
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ strip -x "$CONTENTS/MacOS/ewiz-mcp"
# the proof Sparkle relies on; with it valid, Sparkle also accepts a change of code-signing
# identity, which is what carries ad-hoc installs over to the self-signed certificate.
BUILD_NUMBER="$("$REPO_DIR/scripts/build-number.sh" "$VERSION")"
SPARKLE_FEED="https://raw.githubusercontent.com/stroke-app/ewiz-releases/main/appcast.xml"
SPARKLE_FEED="https://ewiz.app/appcast.xml"
# Read from the source so the key the app trusts and the key licensetool checks its
# signatures against are one constant.
SPARKLE_PUBLIC_KEY="$(sed -n 's/.*publicKeyBase64 = "\([A-Za-z0-9+\/=]*\)".*/\1/p' "$REPO_DIR/Sources/EWizKit/UpdateSignature.swift")"
Expand Down
42 changes: 42 additions & 0 deletions apps/web/src/routeTree.gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ import { Route as DownloadRouteImport } from './routes/download'
import { Route as DonateRouteImport } from './routes/donate'
import { Route as ChangelogRouteImport } from './routes/changelog'
import { Route as BuyRouteImport } from './routes/buy'
import { Route as AppcastDotxmlRouteImport } from './routes/appcast[.]xml'
import { Route as AppcastDotjsonRouteImport } from './routes/appcast[.]json'
import { Route as LegalRouteRouteImport } from './routes/legal/route'
import { Route as BlogRouteRouteImport } from './routes/blog/route'
import { Route as GuestRouteRouteImport } from './routes/_guest/route'
Expand Down Expand Up @@ -96,6 +98,16 @@ const BuyRoute = BuyRouteImport.update({
path: '/buy',
getParentRoute: () => rootRouteImport,
} as any)
const AppcastDotxmlRoute = AppcastDotxmlRouteImport.update({
id: '/appcast.xml',
path: '/appcast.xml',
getParentRoute: () => rootRouteImport,
} as any)
const AppcastDotjsonRoute = AppcastDotjsonRouteImport.update({
id: '/appcast.json',
path: '/appcast.json',
getParentRoute: () => rootRouteImport,
} as any)
const LegalRouteRoute = LegalRouteRouteImport.update({
id: '/legal',
path: '/legal',
Expand Down Expand Up @@ -169,6 +181,8 @@ export interface FileRoutesByFullPath {
'/': typeof IndexRoute
'/blog': typeof BlogRouteRouteWithChildren
'/legal': typeof LegalRouteRouteWithChildren
'/appcast.json': typeof AppcastDotjsonRoute
'/appcast.xml': typeof AppcastDotxmlRoute
'/buy': typeof BuyRoute
'/changelog': typeof ChangelogRoute
'/donate': typeof DonateRoute
Expand All @@ -194,6 +208,8 @@ export interface FileRoutesByFullPath {
export interface FileRoutesByTo {
'/': typeof IndexRoute
'/legal': typeof LegalRouteRouteWithChildren
'/appcast.json': typeof AppcastDotjsonRoute
'/appcast.xml': typeof AppcastDotxmlRoute
'/buy': typeof BuyRoute
'/changelog': typeof ChangelogRoute
'/donate': typeof DonateRoute
Expand Down Expand Up @@ -222,6 +238,8 @@ export interface FileRoutesById {
'/_guest': typeof GuestRouteRouteWithChildren
'/blog': typeof BlogRouteRouteWithChildren
'/legal': typeof LegalRouteRouteWithChildren
'/appcast.json': typeof AppcastDotjsonRoute
'/appcast.xml': typeof AppcastDotxmlRoute
'/buy': typeof BuyRoute
'/changelog': typeof ChangelogRoute
'/donate': typeof DonateRoute
Expand Down Expand Up @@ -250,6 +268,8 @@ export interface FileRouteTypes {
| '/'
| '/blog'
| '/legal'
| '/appcast.json'
| '/appcast.xml'
| '/buy'
| '/changelog'
| '/donate'
Expand All @@ -275,6 +295,8 @@ export interface FileRouteTypes {
to:
| '/'
| '/legal'
| '/appcast.json'
| '/appcast.xml'
| '/buy'
| '/changelog'
| '/donate'
Expand Down Expand Up @@ -302,6 +324,8 @@ export interface FileRouteTypes {
| '/_guest'
| '/blog'
| '/legal'
| '/appcast.json'
| '/appcast.xml'
| '/buy'
| '/changelog'
| '/donate'
Expand Down Expand Up @@ -331,6 +355,8 @@ export interface RootRouteChildren {
GuestRouteRoute: typeof GuestRouteRouteWithChildren
BlogRouteRoute: typeof BlogRouteRouteWithChildren
LegalRouteRoute: typeof LegalRouteRouteWithChildren
AppcastDotjsonRoute: typeof AppcastDotjsonRoute
AppcastDotxmlRoute: typeof AppcastDotxmlRoute
BuyRoute: typeof BuyRoute
ChangelogRoute: typeof ChangelogRoute
DonateRoute: typeof DonateRoute
Expand Down Expand Up @@ -432,6 +458,20 @@ declare module '@tanstack/react-router' {
preLoaderRoute: typeof BuyRouteImport
parentRoute: typeof rootRouteImport
}
'/appcast.xml': {
id: '/appcast.xml'
path: '/appcast.xml'
fullPath: '/appcast.xml'
preLoaderRoute: typeof AppcastDotxmlRouteImport
parentRoute: typeof rootRouteImport
}
'/appcast.json': {
id: '/appcast.json'
path: '/appcast.json'
fullPath: '/appcast.json'
preLoaderRoute: typeof AppcastDotjsonRouteImport
parentRoute: typeof rootRouteImport
}
'/legal': {
id: '/legal'
path: '/legal'
Expand Down Expand Up @@ -605,6 +645,8 @@ const rootRouteChildren: RootRouteChildren = {
GuestRouteRoute: GuestRouteRouteWithChildren,
BlogRouteRoute: BlogRouteRouteWithChildren,
LegalRouteRoute: LegalRouteRouteWithChildren,
AppcastDotjsonRoute: AppcastDotjsonRoute,
AppcastDotxmlRoute: AppcastDotxmlRoute,
BuyRoute: BuyRoute,
ChangelogRoute: ChangelogRoute,
DonateRoute: DonateRoute,
Expand Down
31 changes: 31 additions & 0 deletions apps/web/src/routes/appcast[.]json.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
import { createFileRoute } from "@tanstack/react-router";

/**
* The in-app update feed, served from ewiz.app so the app never depends on where
* releases are hosted. Every release attaches appcast.xml (Sparkle, the app's
* SUFeedURL) and appcast.json (the old updater) to its GitHub release; this
* proxies the latest one, cached at the edge for five minutes.
*/
const SOURCE = "https://github.com/stroke-app/ewiz/releases/latest/download/appcast.json";

export const Route = createFileRoute("/appcast.json")({
server: {
handlers: {
GET: async () => {
const upstream = await fetch(SOURCE, {
redirect: "follow",
cf: { cacheTtl: 300, cacheEverything: true },
} as RequestInit);
if (!upstream.ok) {
return new Response("Update feed unavailable", { status: 502 });
}
return new Response(upstream.body, {
headers: {
"content-type": "application/json; charset=utf-8",
"cache-control": "public, max-age=300",
},
});
},
},
},
});
31 changes: 31 additions & 0 deletions apps/web/src/routes/appcast[.]xml.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
import { createFileRoute } from "@tanstack/react-router";

/**
* The in-app update feed, served from ewiz.app so the app never depends on where
* releases are hosted. Every release attaches appcast.xml (Sparkle, the app's
* SUFeedURL) and appcast.json (the old updater) to its GitHub release; this
* proxies the latest one, cached at the edge for five minutes.
*/
const SOURCE = "https://github.com/stroke-app/ewiz/releases/latest/download/appcast.xml";

export const Route = createFileRoute("/appcast.xml")({
server: {
handlers: {
GET: async () => {
const upstream = await fetch(SOURCE, {
redirect: "follow",
cf: { cacheTtl: 300, cacheEverything: true },
} as RequestInit);
if (!upstream.ok) {
return new Response("Update feed unavailable", { status: 502 });
}
return new Response(upstream.body, {
headers: {
"content-type": "application/xml; charset=utf-8",
"cache-control": "public, max-age=300",
},
});
},
},
},
});
Loading