Skip to content

Open-Source API Development Ecosystem • https://hoppscotch.io • Offline, On-Prem & Cloud • Web, Desktop & CLI • Open-Source Alternative to Postman, Insomnia

chore: update agent updater config

Andrew Bastin025a8fc0cbcc
diff --git a/packages/hoppscotch-agent/src-tauri/src/lib.rs b/packages/hoppscotch-agent/src-tauri/src/lib.rs
index 42bd1c7ea..579b5aa0f 100644
--- a/packages/hoppscotch-agent/src-tauri/src/lib.rs
+++ b/packages/hoppscotch-agent/src-tauri/src/lib.rs
@@ -11,7 +11,7 @@ pub mod util;
use state::AppState;
use std::sync::Arc;
-use tauri::{Listener, Manager, Url, WebviewWindowBuilder};
+use tauri::{Listener, Manager, WebviewWindowBuilder};
use tauri_plugin_updater::UpdaterExt;
use tokio_util::sync::CancellationToken;
@@ -54,35 +54,23 @@ pub fn run() {
#[cfg(desktop)]
{
- // We use env variables to define the pubkey for installer to check
- let updater_pub_key = option_env!("UPDATER_PUB_KEY");
- let updater_url = option_env!("UPDATER_URL");
-
- if let (Some(pub_key), Some(updater_url)) = (updater_pub_key, updater_url) {
- let _ = app.handle()
- .plugin(tauri_plugin_updater::Builder::new() .build());
-
- let _ = app.handle()
- .plugin(tauri_plugin_dialog::init());
-
- let updater_url: Url = updater_url.parse().unwrap();
-
- let updater = app.updater_builder()
- .pubkey(pub_key)
- .endpoints(
- vec![updater_url]
- )
- .build()
- .unwrap();
-
- let app_handle_ref = app_handle.clone();
-
- tauri::async_runtime::spawn_blocking(|| {
- tauri::async_runtime::block_on(async {
- updater::check_and_install_updates(app_handle_ref, updater).await;
- })
- });
- }
+ let _ = app.handle()
+ .plugin(tauri_plugin_updater::Builder::new() .build());
+
+ let _ = app.handle()
+ .plugin(tauri_plugin_dialog::init());
+
+ let updater = app.updater_builder()
+ .build()
+ .unwrap();
+
+ let app_handle_ref = app_handle.clone();
+
+ tauri::async_runtime::spawn_blocking(|| {
+ tauri::async_runtime::block_on(async {
+ updater::check_and_install_updates(app_handle_ref, updater).await;
+ })
+ });
};
let app_state = Arc::new(AppState::new(app_handle.clone()));
diff --git a/packages/hoppscotch-agent/src-tauri/tauri.conf.json b/packages/hoppscotch-agent/src-tauri/tauri.conf.json
index dba3c5891..3aa3ac9d8 100644
--- a/packages/hoppscotch-agent/src-tauri/tauri.conf.json
+++ b/packages/hoppscotch-agent/src-tauri/tauri.conf.json
@@ -28,7 +28,7 @@
"csp": null
}
},
- "bundle": {
+ "bundle": {
"active": true,
"targets": "all",
"icon": [
@@ -39,5 +39,13 @@
"icons/icon.ico"
],
"createUpdaterArtifacts": true
+ },
+ "plugins" : {
+ "updater": {
+ "pubkey": "dW50cnVzdGVkIGNvbW1lbnQ6IG1pbmlzaWduIHB1YmxpYyBrZXk6IDI1MjZGQTNFRjA1NEFFMDEKUldRQnJsVHdQdm9tSlNMLzNxKzJOM24wdC9SYUZHckFpeUZoWW1xb1dtdVpSa2dWMkRGdkV2WmsK",
+ "endpoints": [
+ "https://releases.hoppscotch.com/hoppscotch-agent.json"
+ ]
+ }
}
}