Skip to content

Software update notification (#1002)#1054

Merged
untitaker merged 20 commits into
EFForg:mainfrom
recanman:recanman/update-checks
May 24, 2026
Merged

Software update notification (#1002)#1054
untitaker merged 20 commits into
EFForg:mainfrom
recanman:recanman/update-checks

Conversation

@recanman
Copy link
Copy Markdown
Contributor

@recanman recanman commented May 22, 2026

ref #1002

Pull Request Checklist

  • The Rayhunter team has recently expressed interest in reviewing a PR for this.
    • If not, this PR may be closed due our limited resources and need to prioritize how we spend them.
  • Added or updated any documentation as needed to support the changes in this PR.
  • Code has been linted and run through cargo fmt.
  • If any new functionality has been added, unit tests were also added.
  • CONTRIBUTING.md has been read.
  • Your pull request is fewer than ~400 lines of code.

You must check one of:

  • No generative AI (including LLMs) tools were used to create this PR.
  • Generative AI was used to create this PR. I certify that I have read and understand the code, and that all comments and descriptions were authored by myself and are not the product of generative AI.

I used LLMs to assist with the frontend.

Couple of questions before merging:

  1. Should this be enabled by default? It's convenient, but not preferable for privacy-conscious users
  2. When checking the update, what should the User-Agent be? Right now, it is rayhunter-update-checker. The GitHub API requires a User-Agent header

Tested on Kajeet and Moxee devices.

Frontend changes

  1. Config:
89c8342066f7bfdb9cb655b941bda999ac04875b
  1. Update notification (I purposefully returned an incorrect value in get_current_version to display this, inconsistent version in "System Information" is expected)
image

Copilot AI review requested due to automatic review settings May 22, 2026 18:28

This comment was marked as spam.

@untitaker
Copy link
Copy Markdown
Collaborator

will give this a proper review this weekend, in the meantime can you add a screenshot of the update notification to the PR description?

if you have a way to disable copilot here it'd be really apprechiated since it's really annoyign, we are currently unable to.

@untitaker untitaker self-assigned this May 22, 2026
Comment thread daemon/src/update.rs

const UPDATE_CHECK_INTERVAL: Duration = Duration::from_secs(6 * 60 * 60);
const GITHUB_LATEST_RELEASE_URL: &str =
"https://api.github.com/repos/EFForg/rayhunter/releases/latest";
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we put out a prerelease v1.0.0-beta, it seems to me this code will see that release, parse it as 1.0.0 (which is not out yet), and prompt the user to update.

So that this doesn't happen I propose the following instead:

  1. We don't hit github api, but rather https://efforg.github.io/rayhunter/updates.json
  2. We patch the version number in that file in .github/workflows/release.yml (in the same codepath where we bump version numbers in Cargo.toml etc)
  3. Any bugs related to pre-releases or otherwise (it's not a concept we currently have anyway), we're able to hotfix within the static site build, rather than in rayhunter-daemon

Another nice property of this is that the static site is not subject to rate limits.

One downside of this approach is that the SNI efforg.github.io is exposed to the network, which might be a privacy issue.

@cooperq thoughts?

Comment thread daemon/src/update.rs
Comment on lines +153 to +159
let http_client = match reqwest::Client::builder().build() {
Ok(client) => client,
Err(err) => {
error!("failed to create update check client: {err}");
return;
}
};
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is legit. we had the same issue in a bunch of different places (ntfy, webdav), might be worth extracting common helpers

Comment thread dist/config.toml.in Outdated
Comment thread daemon/web/src/routes/+page.svelte Outdated
Comment thread doc/configuration.md
Comment on lines 42 to 46
On the **Orbic**, **Moxee**, **UZ801**, **TMOHS1**, and **Wingtech**, Rayhunter can connect the device to an existing WiFi network while keeping the hotspot running. This gives the device internet access for [notifications](https://docs.ntfy.sh/) and lets you reach the web UI from any device on that network.

When the device is online, Rayhunter also checks GitHub for new releases and shows an update notice in the web UI. If you enable the *Software Updates* notification type, it can send the same notice through ntfy as well. You can disable this feature by turning off the *Automatically check for software updates* setting in the web UI.

- **Enable WiFi** turns WiFi client mode on or off. Disabling it does not erase saved credentials.
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is legit

Comment thread doc/updating-rayhunter.md Outdated
@untitaker untitaker requested a review from cooperq May 23, 2026 18:29
@untitaker
Copy link
Copy Markdown
Collaborator

untitaker commented May 23, 2026

When checking the update, what should the User-Agent be? Right now, it is rayhunter-update-checker. The GitHub API requires a User-Agent header

I think we probably want to refactor our use of reqwest a bit to set user-agent and default timeouts everywhere (ntfy, updates, webdav). i.e. single factory function for Client that is used everywhere. I think if you do the refactor in this PR it's fine and definitely apprechiated, otherwise just copy what ntfy does

@recanman
Copy link
Copy Markdown
Contributor Author

I'm going to be quite busy for the next week, so I won't have time to refactor. Let's get this PR merged, and that can be added as an issue.

@untitaker
Copy link
Copy Markdown
Collaborator

untitaker commented May 24, 2026

I'm going to be quite busy for the next week, so I won't have time to refactor. Let's get this PR merged, and that can be added as an issue.

ok, if you want to go that route then let's stick with fetching the github api. but let's dumb it down a bit: remove the pre-release parsing code entirely (like i mentioned in the code-level review, we can't treat prereleases as stable), if the latest version is a pre-release we just fail to parse and don't show an update notification.

@untitaker untitaker merged commit 517a17d into EFForg:main May 24, 2026
36 checks passed
@untitaker
Copy link
Copy Markdown
Collaborator

ty!

@recanman recanman deleted the recanman/update-checks branch May 25, 2026 05:42
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.

3 participants