From ef3a934db424f44c253f3f114590a0792eb8d73c Mon Sep 17 00:00:00 2001 From: e1mo Date: Wed, 24 Jun 2026 17:17:41 +0200 Subject: [PATCH] freescout: init at 1.8.225 --- .../0001-settings-catch-unwritable-.env.patch | 30 ++++++++++ pkgs/by-name/fr/freescout/package.nix | 60 +++++++++++++++++++ 2 files changed, 90 insertions(+) create mode 100644 pkgs/by-name/fr/freescout/0001-settings-catch-unwritable-.env.patch create mode 100644 pkgs/by-name/fr/freescout/package.nix diff --git a/pkgs/by-name/fr/freescout/0001-settings-catch-unwritable-.env.patch b/pkgs/by-name/fr/freescout/0001-settings-catch-unwritable-.env.patch new file mode 100644 index 000000000000..ff9616206f24 --- /dev/null +++ b/pkgs/by-name/fr/freescout/0001-settings-catch-unwritable-.env.patch @@ -0,0 +1,30 @@ +From 1c749a3610fb423e50260a2c807b44a94ef4c69d Mon Sep 17 00:00:00 2001 +From: Nina Fromm +Date: Thu, 25 Jun 2026 16:23:00 +0200 +Subject: [PATCH] settings: catch unwritable .env + +--- + app/Misc/Helper.php | 7 ++++++- + 1 file changed, 6 insertions(+), 1 deletion(-) + +diff --git a/app/Misc/Helper.php b/app/Misc/Helper.php +index 2d647b89..3fc2ef84 100644 +--- a/app/Misc/Helper.php ++++ b/app/Misc/Helper.php +@@ -1172,7 +1172,12 @@ class Helper + $contents = $contents."\n{$key}={$value}\n"; + } + } +- \File::put($env_path, $contents); ++ try { ++ \File::put($env_path, $contents); ++ } catch (\Exception $e) { ++ \Helper::logException($e, 'Error updating ' . $key .' in .env file: '); ++ \Session::flash('flash_error_unescaped', "Unable to write settings to $env_path: " . $e->getMessage()); ++ } + } + + /** +-- +2.53.0 + diff --git a/pkgs/by-name/fr/freescout/package.nix b/pkgs/by-name/fr/freescout/package.nix new file mode 100644 index 000000000000..5da1618a0212 --- /dev/null +++ b/pkgs/by-name/fr/freescout/package.nix @@ -0,0 +1,60 @@ +{ + lib, + stdenv, + fetchFromGitHub, +}: +stdenv.mkDerivation (finalAttrs: { + preferLocalBuild = true; + pname = "freescout"; + version = "1.8.225"; + + src = fetchFromGitHub { + owner = "freescout-help-desk"; + repo = "freescout"; + tag = finalAttrs.version; + hash = "sha256-kXZ6bjF36YO1p6q+KTugnBO+KxqQZci5O0RNM7lqecQ="; + }; + + patches = [ + ./0001-settings-catch-unwritable-.env.patch + ]; + + prePatch = '' + rm -rf storage + rm bootstrap/cache/.gitignore + rm public/{css,js}/builds/.htaccess + rm {Modules,public/modules}/.gitkeep + rmdir Modules public/modules bootstrap/cache public/{css,js}/builds + ln -rs data/.env .env + ln -rs data/storage storage + ln -rs data/bootstrap/cache bootstrap/cache + ln -rs data/storage/app/public public/storage + ln -rs data/public/css/builds public/css/builds + ln -rs data/public/js/builds public/js/builds + ln -rs data/Modules Modules + ln -rs data/public/modules public/modules + ''; + + installPhase = '' + runHook preInstall + + mkdir -p $out/share/freescout + cp -ar . $out/share/freescout + chmod +x $out/share/freescout/artisan + + runHook postInstall + ''; + + # Because freescout is searching for some folders only relative to it's own source location, we need to have the symlinks to the actual locations in here + dontCheckForBrokenSymlinks = true; + strictDeps = true; + __structuredAttrs = true; + + meta = with lib; { + description = "Free self-hosted help desk & shared mailbox"; + license = licenses.agpl3Only; + homepage = "https://freescout.net/"; + platforms = platforms.all; + maintainers = with maintainers; [ e1mo ]; + }; +})