Skip to content

YC (S26) | Open Computer History | Continuously record your company computer work, map your workflows, help you find work worth automating, and power your agents' context

feat: route updater through screenpi.pe proxy, keep CN as fallback

Louis Beaumonta3c3bd65f488
diff --git a/apps/screenpipe-app-tauri/components/update-banner.tsx b/apps/screenpipe-app-tauri/components/update-banner.tsx
index 80d5b1d95..f1881c07e 100644
--- a/apps/screenpipe-app-tauri/components/update-banner.tsx
+++ b/apps/screenpipe-app-tauri/components/update-banner.tsx
@@ -73,8 +73,10 @@ export function UpdateBanner({ className, compact = false }: UpdateBannerProps)
let update = pendingUpdate;
if (!update) {
const cpuArch = arch();
- const endpoint = `https://cdn.crabnebula.app/update/mediar/screenpipe/windows-${cpuArch}/{{current_version}}`;
- update = await check({ endpoints: [endpoint] } as any);
+ update = await check({ endpoints: [
+ `https://screenpi.pe/api/app-update/stable/windows-${cpuArch}/{{current_version}}`,
+ `https://cdn.crabnebula.app/update/mediar/screenpipe/windows-${cpuArch}/{{current_version}}`,
+ ] } as any);
}
if (update?.available) {
diff --git a/apps/screenpipe-app-tauri/components/update-notification.tsx b/apps/screenpipe-app-tauri/components/update-notification.tsx
deleted file mode 100644
index d216fbec4..000000000
--- a/apps/screenpipe-app-tauri/components/update-notification.tsx
+++ /dev/null
@@ -1,69 +0,0 @@
-import React, { useEffect, useState } from "react";
-import { sendNotification } from "@tauri-apps/plugin-notification";
-import { platform } from "@tauri-apps/plugin-os";
-
-const UpdateNotification: React.FC<{ checkIntervalHours: number }> = ({
- checkIntervalHours = 3,
-}) => {
- useEffect(() => {
- const checkForUpdates = async () => {
- let lastCheckTime: string | null = null;
- try { lastCheckTime = localStorage?.getItem("lastUpdateCheckTime"); } catch {}
- const currentTime = Date.now();
-
- if (
- !lastCheckTime ||
- currentTime - parseInt(lastCheckTime) > checkIntervalHours * 3600000
- ) {
- const os = platform();
- const releasePageUrl =
- "https://web.crabnebula.cloud/mediar/screenpipe/releases";
-
- try {
- const response = await fetch(releasePageUrl);
- const html = await response.text();
-
- // Extract download links
- const links =
- html.match(
- /https:\/\/cdn\.crabnebula\.app\/download\/mediar\/screenpipe\/latest[^\s"']*/g
- ) || [];
-
- let downloadLink = "";
- if (os === "windows") {
- downloadLink =
- links.find((link) => link.includes("nsis-x86_64")) || "";
- } else if (os === "macos") {
- // For macOS, we can't determine ARM vs Intel, so we'll provide both options
- const armLink =
- links.find((link) => link.includes("aarch64.dmg")) || "";
- const intelLink =
- links.find((link) => link.includes("x64.dmg")) || "";
- downloadLink = `ARM: ${armLink}\nIntel: ${intelLink}`;
- }
-
- if (downloadLink) {
- sendNotification({
- title: "Screenpipe Update Available",
- body: `A new version of Screenpipe is available. Click to download:\n${downloadLink}`,
- // icon: "update-icon", // Replace with your update icon
- });
- }
- } catch (error) {
- console.error("Error checking for updates:", error);
- }
-
- try { localStorage?.setItem("lastUpdateCheckTime", currentTime.toString()); } catch {}
- }
- };
-
- checkForUpdates();
- const interval = setInterval(checkForUpdates, checkIntervalHours * 3600000);
-
- return () => clearInterval(interval);
- }, [checkIntervalHours]);
-
- return null;
-};
-
-export default UpdateNotification;
diff --git a/apps/screenpipe-app-tauri/components/updater.tsx b/apps/screenpipe-app-tauri/components/updater.tsx
index ff3f7f558..b5c89fce6 100644
--- a/apps/screenpipe-app-tauri/components/updater.tsx
+++ b/apps/screenpipe-app-tauri/components/updater.tsx
@@ -5,9 +5,17 @@ import { invoke } from "@tauri-apps/api/core";
import { platform, arch } from "@tauri-apps/plugin-os";
import type { UpdateChannel } from "@/lib/hooks/use-settings";
+// Primary: proxy through screenpi.pe (we control it, can add auth later)
+// Fallback: direct CN (safety net if proxy is down)
const UPDATE_ENDPOINTS = {
- stable: "https://cdn.crabnebula.app/update/mediar/screenpipe",
- beta: "https://cdn.crabnebula.app/update/mediar/screenpipe-beta",
+ stable: [
+ "https://screenpi.pe/api/app-update/stable",
+ "https://cdn.crabnebula.app/update/mediar/screenpipe",
+ ],
+ beta: [
+ "https://screenpi.pe/api/app-update/beta",
+ "https://cdn.crabnebula.app/update/mediar/screenpipe-beta",
+ ],
} as const;
export async function checkForAppUpdates({
@@ -20,14 +28,16 @@ export async function checkForAppUpdates({
const os = platform();
const cpuArch = arch();
- // Build the endpoint URL for the selected channel
- const baseEndpoint = UPDATE_ENDPOINTS[channel];
+ // Build endpoint URLs for the selected channel (proxy primary, CN fallback)
+ const baseEndpoints = UPDATE_ENDPOINTS[channel];
const target = os === "macos" ? "darwin" : os;
- const endpoint = `${baseEndpoint}/${target}-${cpuArch}/{{current_version}}`;
+ const endpoints = baseEndpoints.map(
+ (base) => `${base}/${target}-${cpuArch}/{{current_version}}`
+ );
// @ts-ignore - endpoints option may not be in type definitions but is supported
const update = await check({
- endpoints: [endpoint],
+ endpoints,
} as any);
if (update?.available) {
diff --git a/apps/screenpipe-app-tauri/src-tauri/tauri.prod.conf.json b/apps/screenpipe-app-tauri/src-tauri/tauri.prod.conf.json
index 07ac3814a..5241df210 100644
--- a/apps/screenpipe-app-tauri/src-tauri/tauri.prod.conf.json
+++ b/apps/screenpipe-app-tauri/src-tauri/tauri.prod.conf.json
@@ -47,6 +47,7 @@
"active": true,
"dialog": false,
"endpoints": [
+ "https://screenpi.pe/api/app-update/stable/{{target}}-{{arch}}/{{current_version}}",
"https://cdn.crabnebula.app/update/mediar/screenpipe/{{target}}-{{arch}}/{{current_version}}"
],
"pubkey": "dW50cnVzdGVkIGNvbW1lbnQ6IG1pbmlzaWduIHB1YmxpYyBrZXk6IDIyQjQ2RkQzMUNBOUFDMTcKUldRWHJLa2MwMiswSWl3RlBGUW5zYUE0Zm0vNFFRRTltNUZZTUVxR2FxUDNtSWdUSHgyL3JNcmcK"