π End-to-end encrypted cloud for everything.
Dart 2faandroidauthye2eeencryptionend-to-end-encryptionfluttergolanggoogle-photosgoogle-photos-alternativeiosopensourcephotosprivacyprivacy-toolstypescriptzero-knowledge
Housekeeping
Manav Rathi6c4adb112702
diff --git a/desktop/src/main.ts b/desktop/src/main.tsindex 4b6db7eac9..9fb9706047 100644--- a/desktop/src/main.ts+++ b/desktop/src/main.ts@@ -401,12 +401,6 @@ const main = () => {setDownloadPath(mainWindow.webContents);allowExternalLinks(mainWindow.webContents);- // TODO(MR): Remove or resurrect- // The commit that introduced this header override had the message- // "fix cors issue for uploads". Not sure what that means, so disabling- // it for now to see why exactly this is required.- // addAllowOriginHeader(mainWindow);-// Start loading the renderer.mainWindow.loadURL(rendererURL);diff --git a/desktop/src/main/init.ts b/desktop/src/main/init.tsdeleted file mode 100644index d0aee17f8f..0000000000--- a/desktop/src/main/init.ts+++ /dev/null@@ -1,21 +0,0 @@-import { BrowserWindow } from "electron";--export function addAllowOriginHeader(mainWindow: BrowserWindow) {- mainWindow.webContents.session.webRequest.onHeadersReceived(- (details, callback) => {- details.responseHeaders = lowerCaseHeaders(details.responseHeaders);- details.responseHeaders["access-control-allow-origin"] = ["*"];- callback({- responseHeaders: details.responseHeaders,- });- },- );-}--function lowerCaseHeaders(responseHeaders: Record<string, string[]>) {- const headers: Record<string, string[]> = {};- for (const key of Object.keys(responseHeaders)) {- headers[key.toLowerCase()] = responseHeaders[key];- }- return headers;-}diff --git a/desktop/src/main/services/dir.ts b/desktop/src/main/services/dir.tsindex a6917fe27c..4e2a8c65e4 100644--- a/desktop/src/main/services/dir.ts+++ b/desktop/src/main/services/dir.ts@@ -1,7 +1,7 @@import { shell } from "electron/common";import { app, dialog } from "electron/main";import path from "node:path";-import { posixPath } from "../utils/path";+import { posixPath } from "../utils/electron";export const selectDirectory = async () => {const result = await dialog.showOpenDialog({diff --git a/desktop/src/main/services/watch.ts b/desktop/src/main/services/watch.tsindex 5e57df3e5e..588279b70a 100644--- a/desktop/src/main/services/watch.ts+++ b/desktop/src/main/services/watch.ts@@ -5,7 +5,7 @@ import path from "node:path";import { FolderWatch, type CollectionMapping } from "../../types/ipc";import log from "../log";import { watchStore } from "../stores/watch";-import { posixPath } from "../utils/path";+import { posixPath } from "../utils/electron";import { fsIsDir } from "./fs";/**diff --git a/desktop/src/main/utils/electron.ts b/desktop/src/main/utils/electron.tsindex 97d05ea6d0..d627ec5c46 100644--- a/desktop/src/main/utils/electron.ts+++ b/desktop/src/main/utils/electron.ts@@ -1,12 +1,20 @@import shellescape from "any-shell-escape";import { app } from "electron/main";import { exec } from "node:child_process";+import path from "node:path";import { promisify } from "node:util";import log from "../log";/** `true` if the app is running in development mode. */export const isDev = !app.isPackaged;+/**+ * Convert a file system {@link filePath} that uses the local system specific+ * path separators into a path that uses POSIX file separators.+ */+export const posixPath = (filePath: string) =>+ filePath.split(path.sep).join(path.posix.sep);+/*** Run a shell command asynchronously.*diff --git a/desktop/src/main/utils/index.ts b/desktop/src/main/utils/index.tsindex 132859a436..1ae35d55d3 100644--- a/desktop/src/main/utils/index.ts+++ b/desktop/src/main/utils/index.ts@@ -1,5 +1,5 @@/**- * @file grab bag of utitity functions.+ * @file grab bag of utility functions.** Many of these are verbatim copies of functions from web code since there* isn't currently a common package that both of them share.diff --git a/desktop/src/main/utils/path.ts b/desktop/src/main/utils/path.tsdeleted file mode 100644index b5e358e03b..0000000000--- a/desktop/src/main/utils/path.ts+++ /dev/null@@ -1,8 +0,0 @@-import path from "node:path";--/**- * Convert a file system {@link filePath} that uses the local system specific- * path separators into a path that uses POSIX file separators.- */-export const posixPath = (filePath: string) =>- filePath.split(path.sep).join(path.posix.sep);