# Online Update Check

Craft++ defaults to `https://craftplusplus.216.128.145.79.nip.io/updateddata/version.json`. On the VPS, the Hub serves `/updateddata/{file}` from `/root/Desktop/dave-code/codelanguage/artifacts/updateddata/{file}`. Release uploads place `version.json` and its ZIP archive in that directory. Archive SHA-256 checks remain required; HTTPS overrides remain supported. The feed and archive must use the same hostname.

## Feed structure

```json
{
  "application": "Craft++",
  "version": "0.2.0",
  "minimumSupportedVersion": "0.1.0",
  "title": "Craft++ update available",
  "message": "A newer Craft++ version is available online.",
  "platforms": [ "win", "linux", "macos" ],
  "downloadUrl": "https://updates.example.com/craft-plus-plus/CraftPlusPlus-0.2.0.zip",
  "updateArchiveUrl": "https://updates.example.com/craft-plus-plus/CraftPlusPlus-0.2.0.zip",
  "updateArchiveSha256": "<64-character SHA-256 digest of the archive>",
  "releaseNotesUrl": "https://updates.example.com/craft-plus-plus/0.2.0-notes.html",
  "publishedUtc": "2026-10-24T00:00:00Z"
}
```

- `version` is required.
- `platforms` is optional. Omit it to accept all runtimes.
- `updateArchiveUrl` and its matching `updateArchiveSha256` are required to download an update. Archives must be hosted on the same update host as the feed.
- `minimumSupportedVersion` is optional and prevents offering the update when the installed version is older than the supported floor.

## Endpoint override

Set `CRAFTPLUSPLUS_UPDATE_URL` before launching the application to use a different feed.

Example:

```bash
export CRAFTPLUSPLUS_UPDATE_URL=https://example.com/craft-plus-plus/version.json
```

## Hosting update data

The Hub's `CRAFTPLUSPLUS_UPDATE_DATA` is `/root/Desktop/dave-code/codelanguage/artifacts/updateddata`. Build releases into this folder, or use `upload_update_if_newer.sh` to publish a prebuilt newer version there. The application downloads the feed and named ZIP through the HTTPS `/updateddata/` route; it does not access the VPS filesystem directly. The application compares the feed version with its installed version and only offers a newer compatible release.
