summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorDavid Lönnhager <david.l@mullvad.net>2025-02-26 15:22:02 +0100
committerDavid Lönnhager <david.l@mullvad.net>2025-03-05 23:32:23 +0100
commit04065696aa21baedf4cb9db4410798d1ed8b6b15 (patch)
tree30d16bad2928ad24033cb3964739bc83218c04fe
parent46f2b1f15989d545c65f36871611be6122d1abe9 (diff)
downloadmullvadvpn-04065696aa21baedf4cb9db4410798d1ed8b6b15.tar.xz
mullvadvpn-04065696aa21baedf4cb9db4410798d1ed8b6b15.zip
Use stagemole to retrieve metadata in installer-downloader
-rw-r--r--installer-downloader/src/controller.rs18
-rw-r--r--installer-downloader/tests/controller.rs3
-rw-r--r--mullvad-update/stagemole-pubkey1
3 files changed, 18 insertions, 4 deletions
diff --git a/installer-downloader/src/controller.rs b/installer-downloader/src/controller.rs
index b392ad0942..dbbcbcf2aa 100644
--- a/installer-downloader/src/controller.rs
+++ b/installer-downloader/src/controller.rs
@@ -36,11 +36,11 @@ pub fn initialize_controller<T: AppDelegate + 'static>(delegate: &mut T) {
type DirProvider = crate::temp::TempDirProvider;
// Version info provider to use
- const TEST_PUBKEY: &str = include_str!("../../mullvad-update/test-pubkey");
+ const STAGEMOLE_PUBKEY: &str = include_str!("../../mullvad-update/stagemole-pubkey");
let verifying_key =
- mullvad_update::format::key::VerifyingKey::from_hex(TEST_PUBKEY).expect("valid key");
+ mullvad_update::format::key::VerifyingKey::from_hex(STAGEMOLE_PUBKEY).expect("valid key");
let version_provider = HttpVersionInfoProvider {
- url: "https://releases.mullvad.net/thing".to_owned(),
+ url: get_metadata_url(),
pinned_certificate: None,
verifying_key,
};
@@ -48,6 +48,18 @@ pub fn initialize_controller<T: AppDelegate + 'static>(delegate: &mut T) {
AppController::initialize::<_, Downloader<T>, _, DirProvider>(delegate, version_provider)
}
+/// JSON files should be stored at `<base url>/updates-<platform>.json`.
+fn get_metadata_url() -> String {
+ const PLATFORM: &str = if cfg!(target_os = "windows") {
+ "windows"
+ } else if cfg!(target_os = "macos") {
+ "macos"
+ } else {
+ panic!("Unsupported platform")
+ };
+ format!("https://releases.stagemole.eu/desktop/metadata/updates-{PLATFORM}.json")
+}
+
impl AppController {
/// Initialize [AppController] using the provided delegate.
///
diff --git a/installer-downloader/tests/controller.rs b/installer-downloader/tests/controller.rs
index 0128746a42..aa74c308b8 100644
--- a/installer-downloader/tests/controller.rs
+++ b/installer-downloader/tests/controller.rs
@@ -7,8 +7,9 @@
//! changes to, and update, snapshots are by running `cargo insta review`.
use insta::assert_yaml_snapshot;
-use installer_downloader::controller::{AppController, DirectoryProvider};
+use installer_downloader::controller::AppController;
use installer_downloader::delegate::{AppDelegate, AppDelegateQueue, ErrorMessage};
+use installer_downloader::temp::DirectoryProvider;
use installer_downloader::ui_downloader::UiAppDownloaderParameters;
use mullvad_update::api::VersionInfoProvider;
use mullvad_update::app::{AppDownloader, DownloadError};
diff --git a/mullvad-update/stagemole-pubkey b/mullvad-update/stagemole-pubkey
new file mode 100644
index 0000000000..256a77bafc
--- /dev/null
+++ b/mullvad-update/stagemole-pubkey
@@ -0,0 +1 @@
+a0cd8f582e3147d57f7c01ec0fd306c8315290cea55725c7d5c76f835b78b363 \ No newline at end of file