krz/moonrise

Night-sky companion for iPhone, Apple Watch and Vision Pro: what's up tonight, the Moon, planets, launches and missions, and a Library of the solar system. SwiftUI app with a Cloudflare Workers backend. astronomy cloudflare-workers ios night-sky space swiftui visionos watchos

Commit 81afc1b9eb

81afc1b9eb78d2e243523c40180b1a3688aaa7b7

parent: 471e78f395

Unsigned

cmc <hello@cleberg.net> · 2026-10-21 17:35 UTC

Privacy policy on krz.sh (!85)

The app links to https://krz.sh/privacy/moonrise/ (krz/krz.sh!15). The Worker's /privacy answers 301 to it for older builds; its embedded copy (server/src/privacy.ts) is removed. App Store doc and PLAN.org updated. Full suite passes (server 58).

Layout: unified · split

App/Sources/SettingsScreen.swift +1 −1
@@ -61,7 +61,7 @@ struct City: Hashable, Identifiable {
6161}
6262
6363/// Privacy policy served by the backend.
64let privacyPolicyURL = URL(string: "https://moonrise.krz.sh/privacy")!
64let privacyPolicyURL = URL(string: "https://krz.sh/privacy/moonrise/")!
6565
6666struct SettingsScreen: View {
6767 @AppStorage(SettingsKey.locationMode) private var locationMode = "current"
PLAN.org +1 −1
@@ -470,7 +470,7 @@ Sky, System, Sun, Launches, Library core (above).
470470 device and add one-object alignment with a gyroscope heading.
471471
472472* before publishing
473- App Store Connect: privacy policy URL https://moonrise.krz.sh/privacy.
473- App Store Connect: privacy policy URL https://krz.sh/privacy/moonrise/.
474474- Decide on the Astronomical League lists (Herschel 400, Double Star, Lunar,
475475 Binocular Messier) and Lunar 100 (Charles Wood, Sky & Telescope): ask for
476476 permission or leave them to user program files.
docs/app-store.org +1 −1
@@ -8,7 +8,7 @@
88| Bundle ID | =sh.krz.moonrise= (widgets: =sh.krz.moonrise.widgets=) |
99| Team | ZCNAX3VL9D |
1010| Category | Education (secondary: Weather) |
11| Privacy policy URL | https://moonrise.krz.sh/privacy |
11| Privacy policy URL | https://krz.sh/privacy/moonrise/ |
1212
1313* App Privacy ("nutrition label")
1414Aurora alerts (opt-in) send the push token, a 5° geomagnetic latitude
server/src/index.ts +4 −3
@@ -5,7 +5,6 @@ import { compose, fetchGroups, fetchSupGP, fitsLaunch, retryDue, retryTick, supg
55import { activeEvent, fetchTrajectory, STEP_MINUTES } from "./live";
66import { fetchLaunch, fetchLaunches, PREVIOUS_URL, UPCOMING_URL, type Launch } from "./ll2";
77import { digestPayload, dueOffsets, fetchLatest, localDate, pickHeadlines } from "./news";
8import { PRIVACY_HTML } from "./privacy";
98import { fetchSpaceWeather, next24h, type SpaceWeather } from "./swpc";
109
1110interface Env {
@@ -46,6 +45,8 @@ const PUSH_CONCURRENCY = 6;
4645const json = (body: unknown, status = 200, maxAge?: number) =>
4746 Response.json(body, { status, headers: maxAge && status === 200 ? { "cache-control": `public, max-age=${maxAge}` } : {} });
4847
48const PRIVACY_URL = "https://krz.sh/privacy/moonrise/";
49
4950/** Read-only endpoints whose responses are the same for everyone. */
5051const API = new Set(["/v1/today", "/v1/launches", "/v1/live", "/v1/satellites"]);
5152
@@ -112,8 +113,8 @@ export default {
112113 const rows = await env.DB.prepare("SELECT feed, fetched_at, ok FROM feed_snapshots").all();
113114 return json({ ok: true, feeds: rows.results });
114115 }
115 if (request.method === "GET" && url.pathname === "/privacy")
116 return new Response(PRIVACY_HTML, { headers: { "content-type": "text/html; charset=utf-8", "cache-control": "public, max-age=3600" } });
116 // The policy lives on krz.sh; older builds link here.
117 if (request.method === "GET" && url.pathname === "/privacy") return Response.redirect(PRIVACY_URL, 301);
117118
118119 if (request.method === "POST" && url.pathname === "/v1/devices") {
119120 const d = (await request.json().catch(() => ({}))) as Partial<DeviceRequest>;
server/src/privacy.ts deleted −59
@@ -1,59 +0,0 @@
1// Privacy policy for the Moonrise app, linked from its settings and App Store listing.
2
3export const PRIVACY_HTML = `<!doctype html>
4<html lang="en">
5<head>
6<meta charset="utf-8">
7<meta name="viewport" content="width=device-width, initial-scale=1">
8<title>Moonrise privacy policy</title>
9<style>
10body { font: 17px/1.55 -apple-system, "Helvetica Neue", Helvetica, Arial, sans-serif; max-width: 40em; margin: 2em auto; padding: 0 1em; color: #111; background: #fafaf7; }
11h1 { font-weight: 500; margin-bottom: 0.2em; }
12h2 { font-weight: 500; font-size: 1.1em; margin-top: 1.8em; border-top: 1px solid #111; padding-top: 0.6em; }
13.rule { width: 48px; height: 5px; background: #e03c31; margin-bottom: 1.5em; }
14@media (prefers-color-scheme: dark) { body { color: #f2f2ee; background: #0b1424; } h2 { border-color: #f2f2ee; } }
15</style>
16</head>
17<body>
18<h1>Moonrise privacy policy</h1>
19<div class="rule"></div>
20<p>Last updated 21 October 2026.</p>
21
22<h2>Summary</h2>
23<p>Moonrise has no accounts, no advertising, no analytics and no tracking. Your location is never sent to our server. If you turn on aurora alerts or news alerts, it sends our server four things needed to deliver them, described below. If you turn on cloud forecasts, it sends a rounded location to Apple's weather service. Nothing else is collected.</p>
24
25<h2>Location</h2>
26<p>If you allow it, Moonrise uses your location to work out where the Sun, Moon, planets and stars are in your sky. This happens on your device. Your location is never sent to us. You can choose a city instead in Settings.</p>
27
28<h2 id="cloud-forecasts">Cloud forecasts</h2>
29<p>Cloud forecasts are off until you turn them on in Settings. When they are on, the app asks Apple's weather service (WeatherKit) for an hourly forecast, sending your location or chosen city rounded to 0.1° of latitude and longitude, about 10 km. It asks at most once every three hours for each place, and only while the app is open. The request goes from your device to Apple, not through our server. Apple states that this location is used only to provide the forecast, is not associated with personally identifiable information and is not tracked between requests. The forecast is kept on your device. Turning cloud forecasts off deletes it.</p>
30
31<h2>Network requests</h2>
32<p>To show live data, the app requests:</p>
33<ul>
34<li>space weather and launch schedules from our server, moonrise.krz.sh, which runs on Cloudflare Workers;</li>
35<li>space weather and aurora data directly from NOAA's Space Weather Prediction Center;</li>
36<li>images of the Sun from NASA's Solar Dynamics Observatory;</li>
37<li>images in the Library from NASA, ESA, ESO, NOIRLab and the Library of Congress;</li>
38<li>Deep Space Network status and Mars rover raw images from NASA/JPL;</li>
39<li>space news headlines from the Spaceflight News API, run by The Space Devs.</li>
40</ul>
41<p>These requests contain no identifiers. As with any internet request, the servers receive your IP address. Cloudflare may keep short-lived logs; see Cloudflare's privacy policy.</p>
42
43<h2>Aurora and news alerts</h2>
44<p>Aurora alerts and news alerts are off until you turn them on in Settings. When they are on, the app sends our server:</p>
45<ul>
46<li>this device's push notification token, which Apple issues so a server can send it notifications;</li>
47<li>a 5° band of geomagnetic latitude worked out from your location on the device (for example "50° to 55° north"), not your location itself;</li>
48<li>your time zone offset from UTC, so aurora alerts arrive at night and the news digest at 9 a.m.;</li>
49<li>which of the two alerts you turned on.</li>
50</ul>
51<p>These are stored with the time the device last checked in, and used only to send those alerts. They are not linked to your identity or shared. Turning both alerts off deletes them from the server. A token that Apple reports as no longer valid is deleted automatically.</p>
52
53<h2>Live Activities</h2>
54<p>A launch countdown you add to the Lock Screen runs on your device and sends nothing to our server.</p>
55
56<h2>Changes</h2>
57<p>If this policy changes, the new version will be posted here with a new date.</p>
58</body>
59</html>`;
server/test/worker.test.ts +7
@@ -320,6 +320,13 @@ test("GET API responses are served from the edge cache until they expire", async
320320 }
321321});
322322
323test("/privacy redirects to the policy on krz.sh", async () => {
324 const { env } = await setup();
325 const res = await worker.fetch(new Request("https://moonrise.test/privacy"), env as never);
326 assert.equal(res.status, 301);
327 assert.equal(res.headers.get("location"), "https://krz.sh/privacy/moonrise/");
328});
329
323330test("GET API responses work without an edge cache", async () => {
324331 const { env } = await setup();
325332 const res = await worker.fetch(new Request("https://moonrise.test/v1/today"), env as never);