Modern Apps git

← MAOS.git

maos: point OTA server at ota.maproj.org

Commit
11f4ef6d4799da0141e6539dfcb30dca4d7cbaa5
Author
Vayun Mathur <[email protected]>
When
2026-10-21 23:10 UTC (1 month ago)
Parents
c916688

Diff

IMPLEMENTATION_README.md
diff --git a/IMPLEMENTATION_README.md b/IMPLEMENTATION_README.mdindex 903471d..f88ca17 100755--- a/IMPLEMENTATION_README.md+++ b/IMPLEMENTATION_README.md@@ -51,7 +51,7 @@ scripts/collect-apks.sh              # copies Modern-Apps release APKs into preb keys/generate-keys.sh                # generates the OS key set (offline; never committed) ota/                                 # build-ota.sh + publish-ota.sh (+ README) installer/                           # prepare-factory.sh + sparse_split.py for the web installer-updater/                             # how to point the Updater at ota.ma.vayunmathur.com+updater/                             # how to point the Updater at ota.maproj.org docs/BUILD_RUNBOOK.md                # end-to-end Linux build/sign/OTA/publish local_manifest.xml                    # adds this repo to the GrapheneOS tree ```@@ -119,7 +119,7 @@ local_manifest.xml                    # adds this repo to the GrapheneOS tree ## OTA  MAOS uses the standard A/B OTA flow (`update_engine`) with updates served from-**`https://ota.ma.vayunmathur.com`**, a **Cloudflare R2 bucket** exposed via a custom+**`https://ota.maproj.org`**, a **Cloudflare R2 bucket** exposed via a custom domain. The build host uploads signed OTA zips + channel metadata straight to R2 (`ota/publish-ota.sh`), and devices download directly from R2 — no GitHub Release and no server proxy, since the payloads are multi-GB. Build/publish scripts are in
build-maos.sh
diff --git a/build-maos.sh b/build-maos.shindex cb1308d..7d08c89 100755--- a/build-maos.sh+++ b/build-maos.sh@@ -90,7 +90,7 @@ fi  # ---- Hardcoded config ---- TREE="$HOME/maos"                              # AOSP checkout (ext4; never /mnt/c)-R2_BUCKET="maos"                               # R2 bucket / ota.ma.vayunmathur.com+R2_BUCKET="maos"                               # R2 bucket / ota.maproj.org # BUILD starts as the tag, but the build number for a run is pinned by pin_build_number # (today's UTC date + "00", or $MAOS_BUILD_NUMBER) and exported as BUILD_NUMBER so every # parallel build shares it; resolve_build_number recovers it for standalone release/publish.@@ -395,9 +395,9 @@ phase_overlay() {         log "MAOS inherit already present in $mk"     fi -    log "Pointing the Updater at ota.ma.vayunmathur.com"+    log "Pointing the Updater at ota.maproj.org"     local cfg="packages/apps/Updater/res/values/config.xml"-    [[ -f "$cfg" ]] && sed -i 's#https://releases.grapheneos.org#https://ota.ma.vayunmathur.com#g' "$cfg" \+    [[ -f "$cfg" ]] && sed -i 's#https://releases.grapheneos.org#https://ota.maproj.org#g' "$cfg" \         || warn "Updater config.xml not found; set the URL manually if OFFICIAL_BUILD is used." } @@ -517,7 +517,7 @@ phase_publish() {         -d "$DEVICE" -b "$BUILD" -f "$rel/$DEVICE-install-$BUILD.zip" \         || warn "prepare-factory.sh failed — see its output. For a factory-zip fallback pass -P \ plan.json mirroring flash-all (incl. flashing avb_custom_key before lock)."-    log "Done. OTA: https://ota.ma.vayunmathur.com/$DEVICE-$OTA_CHANNEL"+    log "Done. OTA: https://ota.maproj.org/$DEVICE-$OTA_CHANNEL" }  # ---- Dispatch ----
docs/BUILD_RUNBOOK.md
diff --git a/docs/BUILD_RUNBOOK.md b/docs/BUILD_RUNBOOK.mdindex 5d4e62c..67499c3 100644--- a/docs/BUILD_RUNBOOK.md+++ b/docs/BUILD_RUNBOOK.md@@ -64,7 +64,7 @@ git clone https://github.com/vayun-mathur/MAOS.git ~/MAOS   # prompts for GitHub Needed only for the `publish` phase.  1. Create an R2 bucket (e.g. `maos-ota`).-2. R2 → Settings → **Custom Domains** → attach `ota.ma.vayunmathur.com` (Cloudflare issues TLS).+2. R2 → Settings → **Custom Domains** → attach `ota.maproj.org` (Cloudflare issues TLS). 3. R2 → Manage API Tokens → create a token with **Object Read & Write** on the bucket. 4. Add a bucket **CORS policy** so the installer page (`ma.vayunmathur.com`) can fetch images:    ```json@@ -136,7 +136,7 @@ How the keys are handled each run: the encrypted keystore is decrypted **only in disk in the clear.  When `publish` finishes, the OTA is live at-`https://ota.ma.vayunmathur.com/cheetah-<channel>` and the web installer can flash the build+`https://ota.maproj.org/cheetah-<channel>` and the web installer can flash the build from `https://ma.vayunmathur.com/os/install`.  ---
installer/README.md
diff --git a/installer/README.md b/installer/README.mdindex bb51239..02d99dd 100644--- a/installer/README.md+++ b/installer/README.md@@ -12,7 +12,7 @@ flashes the MAOS factory image — no `adb`/`fastboot` tools or command line nee | `MAOS/installer/prepare-factory.sh` | Build-host script: turns a release image into a `manifest.json` + per-partition images and uploads them to R2. For the **install zip** (preferred) it translates GrapheneOS's `script.txt` verbatim; for a legacy **factory zip** it builds a best-effort/`-P` plan and splits oversized images into sparse chunks. | | `MAOS/installer/script_to_manifest.py` | Translates an install zip's `script.txt` (GrapheneOS's verified flash sequence) into ordered manifest steps. | | `MAOS/installer/sparse_split.py` | Splits a raw image into multiple Android sparse images, each under the device's max-download-size (legacy factory-zip path only). |-| R2 (`ota.ma.vayunmathur.com/factory/<device>/…`) | Hosts the manifest + images; the browser streams them directly. |+| R2 (`ota.maproj.org/factory/<device>/…`) | Hosts the manifest + images; the browser streams them directly. |  ## Flow @@ -114,7 +114,7 @@ into multiple flash steps to the same partition. ## Required: R2 CORS  The installer page is served from `ma.vayunmathur.com` but fetches the manifest + images-from `ota.ma.vayunmathur.com` (R2) — a cross-origin request. **The R2 bucket must send CORS+from `ota.maproj.org` (R2) — a cross-origin request. **The R2 bucket must send CORS headers allowing `https://ma.vayunmathur.com`**, or the browser blocks the downloads. In the R2 bucket settings, add a CORS policy like: 
installer/prepare-factory.sh
diff --git a/installer/prepare-factory.sh b/installer/prepare-factory.shindex 12e5f3a..433ab9e 100755--- a/installer/prepare-factory.sh+++ b/installer/prepare-factory.sh@@ -4,7 +4,7 @@ # a manifest.json flash plan plus per-partition images, uploaded to R2. # # The web installer (ma.vayunmathur.com/os/install) fetches-#   https://ota.ma.vayunmathur.com/factory/<device>/latest/manifest.json+#   https://ota.maproj.org/factory/<device>/latest/manifest.json # and flashes each step, streaming the referenced images from the same directory. # # ── Two input modes ────────────────────────────────────────────────────────────────────@@ -222,4 +222,4 @@ for dest in "factory/$DEVICE/$BUILD" "factory/$DEVICE/latest"; do         --cache-control "no-store, must-revalidate" --only-show-errors done -echo ">> done. Installer will read https://ota.ma.vayunmathur.com/factory/$DEVICE/latest/manifest.json"+echo ">> done. Installer will read https://ota.maproj.org/factory/$DEVICE/latest/manifest.json"
maos_branding.mk
diff --git a/maos_branding.mk b/maos_branding.mkindex 92c44ff..6bc9f48 100644--- a/maos_branding.mk+++ b/maos_branding.mk@@ -20,7 +20,7 @@ MAOS_CHANNEL ?= stable PRODUCT_PRODUCT_PROPERTIES += \     ro.maos.version=$(MAOS_VERSION) \     ro.maos.channel=$(MAOS_CHANNEL) \-    ro.maos.ota.server=https://ota.ma.vayunmathur.com+    ro.maos.ota.server=https://ota.maproj.org  # Do NOT set ro.build.tags=test-keys — we sign with our own release keys, so this must # remain release-keys (handled by the release signing step, not here).
ota/README.md
diff --git a/ota/README.md b/ota/README.mdindex 82cb11b..27fd830 100644--- a/ota/README.md+++ b/ota/README.md@@ -11,7 +11,7 @@ signed target-files ──build-ota.sh──▶ full + incremental OTA zips + ch         │                               publish-ota.sh ──▶ Cloudflare R2 bucket         │                                                          │         ▼                                                          ▼-  (kept for next                              ota.ma.vayunmathur.com  (R2 custom domain,+  (kept for next                              ota.maproj.org  (R2 custom domain,    incremental)                               serves objects directly)                                                                    │                                                                    ▼@@ -23,12 +23,12 @@ signed target-files ──build-ota.sh──▶ full + incremental OTA zips + ch   file. Signed with your `releasekey`. - **`publish-ota.sh`** uploads those to a **Cloudflare R2** bucket (S3-compatible, via the   `aws` CLI). Zips go up first; the channel-metadata pointer goes up last.-- **`ota.ma.vayunmathur.com`** is that R2 bucket exposed via a Cloudflare custom domain, so-  an object keyed `<file>` is served at `https://ota.ma.vayunmathur.com/<file>`. Devices+- **`ota.maproj.org`** is that R2 bucket exposed via a Cloudflare custom domain, so+  an object keyed `<file>` is served at `https://ota.maproj.org/<file>`. Devices   download straight from R2 — **no GitHub Release and no `location_share_server` proxy are   involved** (R2 handles the multi-GB payloads that GitHub Releases / the server's disk   can't).-- The **Updater** app polls `https://ota.ma.vayunmathur.com/<device>-<channel>` then+- The **Updater** app polls `https://ota.maproj.org/<device>-<channel>` then   downloads the referenced zip (see `../updater/README.md`).  ## Credentials (never commit)@@ -50,7 +50,7 @@ on the target bucket. ## Cloudflare setup (one-time)  1. Create the R2 bucket (e.g. `maos-ota`).-2. Attach the custom domain `ota.ma.vayunmathur.com` to it (R2 → Settings → Custom Domains).+2. Attach the custom domain `ota.maproj.org` to it (R2 → Settings → Custom Domains).    Cloudflare provisions TLS automatically. 3. The object `Cache-Control` headers set by `publish-ota.sh` (immutable zips, `no-store`    metadata) are honored by Cloudflare's cache. If you add a Cache Rule, make sure it does
ota/build-ota.sh
diff --git a/ota/build-ota.sh b/ota/build-ota.shindex d661947..c6315d6 100755--- a/ota/build-ota.sh+++ b/ota/build-ota.sh@@ -72,7 +72,7 @@ if [[ -n "$PREV_TF" ]]; then fi  # Channel metadata polled by the Updater at-#   https://ota.ma.vayunmathur.com/$DEVICE-$CHANNEL+#   https://ota.maproj.org/$DEVICE-$CHANNEL # Format: "BUILD TIMESTAMP CHANNEL". Keep this in sync with what your Updater fork # parses (see updater/README.md). META="$OUTDIR/$DEVICE-$CHANNEL"
ota/publish-ota.sh
diff --git a/ota/publish-ota.sh b/ota/publish-ota.shindex 8af7efd..071d3ec 100755--- a/ota/publish-ota.sh+++ b/ota/publish-ota.sh@@ -2,10 +2,10 @@ # # publish-ota.sh — upload OTA artifacts to Cloudflare R2. #-# `ota.ma.vayunmathur.com` is an R2 bucket served directly via a Cloudflare custom+# `ota.maproj.org` is an R2 bucket served directly via a Cloudflare custom # domain, so devices download straight from R2 — there is no GitHub Release and no # server proxy in the loop. An object stored at key `<file>` is served at-# `https://ota.ma.vayunmathur.com/<file>`, which is exactly what the Updater polls.+# `https://ota.maproj.org/<file>`, which is exactly what the Updater polls. # # Upload order matters: the signed zips go up FIRST and the channel-metadata pointer # goes up LAST, so a device polling mid-publish never sees metadata referencing a zip@@ -97,4 +97,4 @@ for m in "${METAS[@]}"; do     put "$m" "$(basename "$m")" "text/plain; charset=utf-8" "no-store, must-revalidate" done -echo ">> done. Served at https://ota.ma.vayunmathur.com/<file>"+echo ">> done. Served at https://ota.maproj.org/<file>"
overlay/packages/apps/Updater/res/values/config.xml
diff --git a/overlay/packages/apps/Updater/res/values/config.xml b/overlay/packages/apps/Updater/res/values/config.xmlindex 1b7be5f..82112bf 100644--- a/overlay/packages/apps/Updater/res/values/config.xml+++ b/overlay/packages/apps/Updater/res/values/config.xml@@ -15,5 +15,5 @@ --> <resources>     <!-- Common GrapheneOS name is "url"; adjust to match your source if different. -->-    <string name="url" translatable="false">https://ota.ma.vayunmathur.com</string>+    <string name="url" translatable="false">https://ota.maproj.org</string> </resources>
updater/README.md
diff --git a/updater/README.md b/updater/README.mdindex 0e06f5c..57ab364 100644--- a/updater/README.md+++ b/updater/README.md@@ -1,7 +1,7 @@ # Updater configuration (MAOS)  MAOS reuses the GrapheneOS Updater app but points it at our own OTA server,-`https://ota.ma.vayunmathur.com` — a **Cloudflare R2 bucket** exposed via a custom domain,+`https://ota.maproj.org` — a **Cloudflare R2 bucket** exposed via a custom domain, which serves the signed OTA zips + channel metadata directly (uploaded by `ota/publish-ota.sh`; see `../ota/README.md`). @@ -9,9 +9,9 @@ which serves the signed OTA zips + channel metadata directly (uploaded by  For device `$DEVICE` on channel `$CHANNEL` (e.g. `stable`), it requests: -- **Metadata:** `GET https://ota.ma.vayunmathur.com/$DEVICE-$CHANNEL`-- **Full OTA:** `GET https://ota.ma.vayunmathur.com/$DEVICE-ota_update-$BUILD.zip`-- **Incremental:** `GET https://ota.ma.vayunmathur.com/$DEVICE-incremental-$OLD-$NEW.zip`+- **Metadata:** `GET https://ota.maproj.org/$DEVICE-$CHANNEL`+- **Full OTA:** `GET https://ota.maproj.org/$DEVICE-ota_update-$BUILD.zip`+- **Incremental:** `GET https://ota.maproj.org/$DEVICE-incremental-$OLD-$NEW.zip`  Those filenames are produced by `ota/build-ota.sh` and uploaded to the release by `ota/publish-ota.sh`. The metadata line format is defined there and must match whatever@@ -21,7 +21,7 @@ your Updater version parses (GrapheneOS uses a short space-separated line — ## Two things to change in the Updater  1. **Server URL.** GrapheneOS hardcodes `https://releases.grapheneos.org`. Find it and-   replace it with `https://ota.ma.vayunmathur.com`:+   replace it with `https://ota.maproj.org`:     ```bash    grep -rn "releases.grapheneos.org" packages/apps/Updater/@@ -32,7 +32,7 @@ your Updater version parses (GrapheneOS uses a short space-separated line —    fork of `packages/apps/Updater` (pull it in via the local manifest; see the main    fork plan's "fallback: when a real fork is unavoidable"). -2. **Certificate pinning.** GrapheneOS pins its server's certificate. `ota.ma.vayunmathur.com`+2. **Certificate pinning.** GrapheneOS pins its server's certificate. `ota.maproj.org`    uses a Cloudflare-managed certificate (and Cloudflare may rotate it), so either remove the    pin or pin to the Cloudflare/issuer cert. Check the Updater's `network_security_config` /    any `CertificatePinner`:@@ -47,7 +47,7 @@ your Updater version parses (GrapheneOS uses a short space-separated line — URL. **Verify the string name** against your pinned Updater source before relying on it — an overlay with the wrong resource name silently does nothing (it won't fail the build). Update the name to match, then confirm the built Updater points at-`ota.ma.vayunmathur.com`.+`ota.maproj.org`.  ## Channels