Skip to content

A modern, self-hosted backup solution for secure, encrypted backups across local and cloud storage.

chore: Remove unnecessary imports and files.

towfiqiebb4ce37e0c5
diff --git a/backend/scripts/better-sqlite3-proxy.cjs b/backend/scripts/better-sqlite3-proxy.cjs
deleted file mode 100644
index 51f8e83..0000000
--- a/backend/scripts/better-sqlite3-proxy.cjs
+++ /dev/null
@@ -1,48 +0,0 @@
-const path = require('path');
-
-// This proxy allows us to load better-sqlite3 from the filesystem
-// instead of bundling it, which is required for pkg to work with
-// the native binary placed alongside the executable.
-
-let Database;
-
-// Use a dynamic variable to prevent esbuild from trying to bundle 'better-sqlite3'
-// if we were to require it directly (which would cause a circular dependency due to alias)
-const pkgName = 'better-sqlite3';
-
-if (process.pkg) {
- // When running as a packaged executable
- // Look for node_modules next to the executable
- const execDir = path.dirname(process.execPath);
-
- // The native module is located at node_modules/better-sqlite3/build/Release/better_sqlite3.node
- // We need to require this specific file because we don't have the full package.json/index.js structure
- // in the distribution folder, just the binary artifact.
- const modulePath = path.join(execDir, 'node_modules', pkgName, 'build', 'Release', 'better_sqlite3.node');
-
- try {
- Database = require(modulePath);
- } catch (error) {
- console.error(`Failed to load external ${pkgName} from ${modulePath}`);
- console.error('Ensure the node_modules folder is placed next to the executable.');
- throw error;
- }
-} else {
- // When running in development or as a plain script
- try {
- // Try to load from standard node resolution
- // We use a trick to bypass esbuild's static analysis/aliasing
- const _require = require;
- Database = _require(pkgName);
- } catch (e) {
- // Fallback: try to find it relative to project root if possible
- // This helps if running the bundle from dist/
- try {
- Database = require(path.resolve(process.cwd(), 'node_modules', pkgName));
- } catch (e2) {
- throw e;
- }
- }
-}
-
-module.exports = Database;
diff --git a/backend/src/utils/binaryPathResolver.ts b/backend/src/utils/binaryPathResolver.ts
index e483925..1b1022c 100644
--- a/backend/src/utils/binaryPathResolver.ts
+++ b/backend/src/utils/binaryPathResolver.ts
@@ -1,7 +1,6 @@
import path from 'path';
import os from 'os';
import fs from 'fs';
-import { appPaths } from './AppPaths';
/**
* Resolves the path to a bundled binary ('restic', 'rclone' or 'rear').
@@ -20,11 +19,11 @@ export function getBinaryPath(binaryName: 'restic' | 'rclone' | 'rear'): string
const platformId = `${os.platform()}-${os.arch()}`;
const execDir = path.dirname(process.execPath);
const pkgBinaryPath = path.join(execDir, 'binaries', platformId, fileName);
-
+
if (fs.existsSync(pkgBinaryPath)) {
return pkgBinaryPath;
}
-
+
console.warn(
`[binaryPathResolver] Expected binary at '${pkgBinaryPath}' but not found. Trying fallbacks...`
);