mirror of
https://github.com/MasterAcnolo/Freedom-Loader.git
synced 2026-07-29 18:25:47 +02:00
feat: support Linux. Refactor resources architecture. Create build script
Currently, themes are disabled and firefox notification too.
This commit is contained in:
@@ -25,15 +25,19 @@ function checkNativeDependencies() {
|
||||
*/
|
||||
const { binaryPaths } = require("../server/helpers/path.helpers");
|
||||
|
||||
const isWindows = process.platform === "win32";
|
||||
|
||||
const addExe = isWindows ? ".exe" : "";
|
||||
|
||||
/**
|
||||
* List of required external executables used by the application runtime.
|
||||
* Each entry defines a binary name and its resolved absolute path.
|
||||
*/
|
||||
const deps = [
|
||||
{ name: "yt-dlp.exe", path: binaryPaths.ytDlp },
|
||||
{ name: "ffmpeg.exe", path: binaryPaths.ffmpeg },
|
||||
{ name: "ffprobe.exe", path: binaryPaths.ffprobe },
|
||||
{ name: "deno.exe", path: binaryPaths.deno },
|
||||
{ name: `yt-dlp${addExe}`, path: binaryPaths.ytDlp },
|
||||
{ name: `ffmpeg${addExe}`, path: binaryPaths.ffmpeg },
|
||||
{ name: `ffprobe${addExe}`, path: binaryPaths.ffprobe },
|
||||
{ name: `deno${addExe}`, path: binaryPaths.deno },
|
||||
];
|
||||
|
||||
const missing = deps.filter(d => !fs.existsSync(d.path));
|
||||
@@ -52,7 +56,7 @@ function checkNativeDependencies() {
|
||||
app.whenReady().then(() => {
|
||||
dialog.showErrorBox(
|
||||
"Missing dependencies",
|
||||
`The following files are missing in the 'ressources' folder:\n${list}\n\nThe application will now exit. Try to reinstall.`
|
||||
`The following files are missing in the 'resources' folder:\n${list}\n\nThe application will now exit. Try to reinstall.`
|
||||
);
|
||||
app.quit();
|
||||
});
|
||||
|
||||
@@ -62,10 +62,19 @@ function validateDownloadPath(userPath) {
|
||||
* Required to prevent path traversal or alias bypass.
|
||||
*/
|
||||
const resolved = fs.realpathSync(path.resolve(userPath));
|
||||
|
||||
if (!fs.existsSync(resolved)) {
|
||||
fs.mkdirSync(resolved, { recursive: true });
|
||||
logger.info(`Download folder created: ${resolved}`);
|
||||
}
|
||||
|
||||
const real = fs.realpathSync(resolved);
|
||||
|
||||
if (!isSafePath(resolved)) {
|
||||
throw new Error("Path not allowed: system folders are blocked!");
|
||||
}
|
||||
return resolved;
|
||||
|
||||
return real;
|
||||
}
|
||||
catch (err) {
|
||||
|
||||
|
||||
Reference in New Issue
Block a user