windows: updates from the app, and a dark theme
The service looks at the project's releases (windows-v* tags; pre-releases for a pre-release), fetches the newer setup program, checks its SHA-256 against the one published beside it, and runs it silently, detached, out of any job: the setup stops the service, replaces it, and starts it again. Run by the service (session 0), the setup's install starts the app in each signed-in user's session with their token rather than through Explorer. A failed copy during an upgrade starts the old service and app again. Request::UpdateCheck (anyone), UpdateInstall (services scope); proxy-ctl update [check|install]; the app's Overview card. The app's own preferences (%APPDATA%\ProxySuite\app.json): the theme (light, dark, or as Windows, followed as it changes; the title bar too) and whether to look for updates at start and daily. Settings > This app, and a sun/moon toggle in the sidebar. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
ed9275250b
commit
5bd47f7676
32 files changed
+911
-26
No files matched your search
@@ -134,7 +134,8 @@ fn scope_of(req: &Request) -> Option<Scope> {
|
||||
Request::Disable { .. } | Request::SubsUpdate { .. } | Request::Test { .. } => Some(Scope::Outbounds),
|
||||
// Backend logs name the sites visited (at info), and errors may quote what was dialled.
|
||||
Request::RenderedConfig | Request::Logs { .. } | Request::TgLinks => Some(Scope::Secrets),
|
||||
Request::Restart { .. } | Request::Start { .. } | Request::Stop { .. } => Some(Scope::Services),
|
||||
// An update runs only the project's own setup program, checked: no more than a restart.
|
||||
Request::Restart { .. } | Request::Start { .. } | Request::Stop { .. } | Request::UpdateInstall => Some(Scope::Services),
|
||||
Request::WlList | Request::WlLink { .. } | Request::WlAuth { .. } | Request::WlJoin { .. } | Request::WlNew { .. } => Some(Scope::WhitelistBypass),
|
||||
Request::AutoList | Request::AutoProbe { .. } | Request::AutoLearn { .. } | Request::AutoForget { .. } => Some(Scope::AutoProxy),
|
||||
Request::AwgList | Request::AwgSet { .. } => Some(Scope::AmneziaWg),
|
||||
@@ -673,6 +674,25 @@ pub async fn handle(req: Request, peer: &Peer, shared: &Shared) -> Response {
|
||||
Response::ok(json!({ "lines": crate::awgvpn::log_tail(s.paths(), &vpn.iface, lines.min(2000)) }))
|
||||
}
|
||||
|
||||
Request::UpdateCheck => {
|
||||
let routes = shared.lock().await.fetch_routes(true);
|
||||
match crate::update::check(&routes).await {
|
||||
Ok(r) => Response::ok(json!({ "current": env!("CARGO_PKG_VERSION"), "available": r.map(|r| r.to_json()) })),
|
||||
Err(e) => Response::err(format!("{e:#}")),
|
||||
}
|
||||
}
|
||||
|
||||
Request::UpdateInstall => {
|
||||
let (routes, dir) = {
|
||||
let s = shared.lock().await;
|
||||
(s.fetch_routes(true), s.paths().updates())
|
||||
};
|
||||
match crate::update::install(&routes, &dir).await {
|
||||
Ok(r) => Response::ok(r.to_json()),
|
||||
Err(e) => Response::err(format!("{e:#}")),
|
||||
}
|
||||
}
|
||||
|
||||
Request::ComponentsInstall { names } => {
|
||||
// Programs the service runs as SYSTEM: an administrator's call, whatever the scopes.
|
||||
if !peer.admin {
|
||||
|
||||
Reference in new issue
Block a user