Skip to content

Add Cloudflare Pages Functions for firmware upgrade check#559

Open
paxx12 wants to merge 1 commit into
developfrom
docs
Open

Add Cloudflare Pages Functions for firmware upgrade check#559
paxx12 wants to merge 1 commit into
developfrom
docs

Conversation

@paxx12

@paxx12 paxx12 commented Jul 5, 2026

Copy link
Copy Markdown
Contributor

Adds docs/functions/api/device/firmware/latest and .../upgrade_desc, deployed alongside the Jekyll docs site to snapmakeru1-extended-firmware.pages.dev (cloudflare_pages.yaml now runs wrangler with workingDirectory: docs so its functions/ auto-detection picks up docs/functions/, deploying ../_site for the static assets).

  • latest mirrors unisrv's real /api/device/firmware/latest path and shape (ApiDeviceFirmwareLatest, minus authDevices). ?channel=stable resolves the latest GitHub release; ?channel=beta resolves the latest of either a release or pre-release, whichever is newer. Resolves against GITHUB_REPO via the GitHub API, cached at Cloudflare's edge for 5 minutes.
  • upgrade_desc builds the descriptor its note field points to on the fly from the same release's metadata: real size/sha256 from the asset's GitHub digest, release_notes.en-GB scraped from the release body's "New Features and Key Changes" section, and a dummy md5 (deadbeef...) since GitHub doesn't expose one and hashing the ~300MB asset per request isn't implemented — auto-upgrade through this endpoint isn't end-to-end functional yet.
  • GitHub API errors pass through their real status (e.g. 403 on rate-limit) instead of a fixed 404, falling back to 502 for network errors; error responses are sent with Cache-Control: no-store and never cached.
  • Anchors the firmware/ .gitignore rule to the repo root so it stops swallowing the new nested docs/functions/.../firmware/ directory.

See docs/functions/README.md for the full endpoint reference.

@paxx12
paxx12 temporarily deployed to github-pages July 5, 2026 19:25 — with GitHub Actions Inactive
@github-actions

github-actions Bot commented Jul 5, 2026

Copy link
Copy Markdown

✅ Build Artifacts

Version: 1.5.1-paxx12-test-pr-559
Build: 9162fe2 (merge of b218b38 into develop)
Duration: 5m 1s

Artifact Size
extended-devel-build 253.10 MB
extended-build 254.37 MB

View workflow run

@github-actions

github-actions Bot commented Jul 5, 2026

Copy link
Copy Markdown

✅ Build Artifacts

Version: 1.5.1-paxx12-test-pr-559
Build: 2631ba4 (merge of 2fb92cf into develop)
Duration: 4m 52s

Artifact Size
extended-devel-build 253.10 MB
extended-build 254.37 MB

View workflow run

@paxx12
paxx12 temporarily deployed to github-pages July 5, 2026 19:33 — with GitHub Actions Inactive
@github-actions

github-actions Bot commented Jul 5, 2026

Copy link
Copy Markdown

✅ Build Artifacts

Version: 1.5.1-paxx12-test-pr-559
Build: a85b62a (merge of 43bdda7 into develop)
Duration: 4m 31s

Artifact Size
extended-devel-build 253.10 MB
extended-build 254.37 MB

View workflow run

@github-actions

github-actions Bot commented Jul 5, 2026

Copy link
Copy Markdown

✅ Build Artifacts

Version: 1.5.1-paxx12-test-pr-559
Build: 8b934e2 (merge of 1317a6b into develop)
Duration: 4m 35s

Artifact Size
extended-devel-build 253.10 MB
extended-build 254.37 MB

View workflow run

@github-actions

github-actions Bot commented Jul 5, 2026

Copy link
Copy Markdown

✅ Build Artifacts

Version: 1.5.1-paxx12-test-pr-559
Build: 070c79a (merge of 66aff41 into develop)
Duration: 4m 21s

Artifact Size
extended-devel-build 253.10 MB
extended-build 254.38 MB

View workflow run

Adds docs/functions/api/device/firmware/latest and .../upgrade_desc,
deployed alongside the Jekyll docs site (wrangler runs with
workingDirectory: docs so its functions/ auto-detection finds them).

- latest: mirrors unisrv's real /api/device/firmware/latest shape,
  ?channel=stable|beta resolves the newest matching GitHub release,
  cached at the edge for 5 minutes.
- upgrade_desc: builds the descriptor its `note` field points to from
  the same release (size/sha256 from the asset digest, release_notes
  scraped from the "New Features and Key Changes" section); md5 is a
  dummy deadbeef value since GitHub doesn't expose one.
- GitHub API errors pass through their real status instead of a fixed
  404, and error responses are sent with Cache-Control: no-store.
- Anchors the `firmware/` .gitignore rule so it stops swallowing the
  new nested docs/functions/.../firmware/ directory.
@github-actions

github-actions Bot commented Jul 5, 2026

Copy link
Copy Markdown

✅ Build Artifacts

Version: 1.5.1-paxx12-test-pr-559
Build: 897832e (merge of 1ba51db into develop)
Duration: 4m 32s

Artifact Size
extended-devel-build 253.10 MB
extended-build 254.37 MB

View workflow run

@paxx12 paxx12 changed the title Add Cloudflare Pages Functions backing the firmware-upgrade imposter Add Cloudflare Pages Functions for firmware upgrade check Jul 5, 2026
@github-actions

github-actions Bot commented Jul 5, 2026

Copy link
Copy Markdown

✅ Build Artifacts

Version: 1.5.1-paxx12-test-pr-559
Build: ee39608 (merge of fb926c8 into develop)
Duration: 4m 8s

Artifact Size
extended-devel-build 253.10 MB
extended-build 254.37 MB

View workflow run

@justinh-rahb

Copy link
Copy Markdown
Contributor

Any new updates on using this to provide OTA updates for Paxx firmware?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants