mirror of
https://github.com/EFForg/rayhunter.git
synced 2026-07-23 15:58:10 -07:00
* add `auto_check_updates` config value * add `auto_check_updates` to dist config * add `Update` `NotificationType` * implement update checker and worker * add endpoint, add to documentation, add worker * clone update_status_lock Arc * fmt * add more tests * remove todo * add to docs * frontend update notice * improve name in documentation * add user-agent to update check request * add update check request timeout * openapi trait bound * do not enable `auto_check_updates` by default * remove redundant documentation * surface fetch of update status error * fail on version with pre-release for now, add additional test cases * Update configuration.md --------- Co-authored-by: Markus Unterwaditzer <markus-tarpit+git@unterwaditzer.net>
This commit is contained in:
@@ -4,6 +4,7 @@ use std::sync::Arc;
|
||||
use crate::battery::get_battery_status;
|
||||
use crate::error::RayhunterError;
|
||||
use crate::server::ServerState;
|
||||
use crate::update::UpdateStatus;
|
||||
use crate::{battery::BatteryState, qmdl_store::ManifestEntry};
|
||||
|
||||
use axum::Json;
|
||||
@@ -220,6 +221,20 @@ pub async fn get_qmdl_manifest(
|
||||
}))
|
||||
}
|
||||
|
||||
#[cfg_attr(feature = "apidocs", utoipa::path(
|
||||
get,
|
||||
path = "/api/update-status",
|
||||
tag = "Statistics",
|
||||
responses(
|
||||
(status = StatusCode::OK, description = "Success", body = UpdateStatus)
|
||||
),
|
||||
summary = "Rayhunter update status",
|
||||
description = "Check for available updates for Rayhunter."
|
||||
))]
|
||||
pub async fn get_update_status(State(state): State<Arc<ServerState>>) -> Json<UpdateStatus> {
|
||||
Json(state.update_status_lock.read().await.clone())
|
||||
}
|
||||
|
||||
#[cfg_attr(feature = "apidocs", utoipa::path(
|
||||
get,
|
||||
path = "/api/log",
|
||||
|
||||
Reference in New Issue
Block a user