From 1a64deeb894dc95e2645a75771732c6cc53a79ad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Isma=C3=ABl=20Bouya?= Date: Wed, 4 Oct 2023 01:35:06 +0200 Subject: Squash changes containing private information There were a lot of changes since the previous commit, but a lot of them contained personnal information about users. All thos changes got stashed into a single commit (history is kept in a different place) and private information was moved in a separate private repository --- flakes/mypackages/pkgs/webapps/ttrss/default.nix | 37 ++++++++++++++++++++++ .../webapps/ttrss/plugins/af_feedmod/default.nix | 18 +++++++++++ .../ttrss/plugins/af_feedmod/type_replace.patch | 12 +++++++ .../webapps/ttrss/plugins/auth_ldap/default.nix | 17 ++++++++++ .../webapps/ttrss/plugins/feediron/default.nix | 18 +++++++++++ .../ttrss/plugins/feediron/json_reformat.patch | 18 +++++++++++ .../webapps/ttrss/plugins/ff_instagram/default.nix | 17 ++++++++++ .../ttrss/plugins/tumblr_gdpr_ua/default.nix | 17 ++++++++++ 8 files changed, 154 insertions(+) create mode 100644 flakes/mypackages/pkgs/webapps/ttrss/default.nix create mode 100644 flakes/mypackages/pkgs/webapps/ttrss/plugins/af_feedmod/default.nix create mode 100644 flakes/mypackages/pkgs/webapps/ttrss/plugins/af_feedmod/type_replace.patch create mode 100644 flakes/mypackages/pkgs/webapps/ttrss/plugins/auth_ldap/default.nix create mode 100644 flakes/mypackages/pkgs/webapps/ttrss/plugins/feediron/default.nix create mode 100644 flakes/mypackages/pkgs/webapps/ttrss/plugins/feediron/json_reformat.patch create mode 100644 flakes/mypackages/pkgs/webapps/ttrss/plugins/ff_instagram/default.nix create mode 100644 flakes/mypackages/pkgs/webapps/ttrss/plugins/tumblr_gdpr_ua/default.nix (limited to 'flakes/mypackages/pkgs/webapps/ttrss') diff --git a/flakes/mypackages/pkgs/webapps/ttrss/default.nix b/flakes/mypackages/pkgs/webapps/ttrss/default.nix new file mode 100644 index 0000000..fa2453e --- /dev/null +++ b/flakes/mypackages/pkgs/webapps/ttrss/default.nix @@ -0,0 +1,37 @@ +{ ttrss_config ? "/etc/ttrss/config.php" +, varDir ? "/var/lib/ttrss" +, stdenv, lib, callPackage, sources }: +let + pluginNames = [ "auth_ldap" "af_feedmod" "feediron" "ff_instagram" "tumblr_gdpr_ua" ]; + allPlugins = lib.attrsets.genAttrs pluginNames + (name: callPackage (./plugins + "/${name}") {}); + toPassthru = pkg: plugins: { + inherit plugins allPlugins; + withPlugins = withPlugins pkg; + }; + withPlugins = pkg: toPlugins: + let + plugins = toPlugins allPlugins; + toInstallPlugin = n: + "ln -sf ${n} $out/plugins/${n.pluginName}"; + newTtrss = pkg.overrideAttrs(old: { + installPhase = old.installPhase + "\n" + builtins.concatStringsSep "\n" (map toInstallPlugin plugins); + passthru = toPassthru newTtrss (pkg.plugins ++ plugins); + }); + in newTtrss; + package = stdenv.mkDerivation rec { + pname = "tt-rss"; + version = "${sources.tools.ttrss.shortRev}-master"; + name = "${pname}-${version}"; + src = sources.tools.ttrss; + buildPhase = '' + rm -rf lock feed-icons cache + ln -sf ${varDir}/{lock,feed-icons,cache} . + ''; + installPhase = '' + cp -a . $out + ln -s ${ttrss_config} $out/config.php + ''; + passthru = toPassthru package []; + }; +in package diff --git a/flakes/mypackages/pkgs/webapps/ttrss/plugins/af_feedmod/default.nix b/flakes/mypackages/pkgs/webapps/ttrss/plugins/af_feedmod/default.nix new file mode 100644 index 0000000..39f9e0e --- /dev/null +++ b/flakes/mypackages/pkgs/webapps/ttrss/plugins/af_feedmod/default.nix @@ -0,0 +1,18 @@ +{ patched ? false, stdenv, fetchFromGitHub, lib }: +stdenv.mkDerivation ({ + pname = "ttrss-af_feedmod"; + version = "0ea2092-master"; + src = fetchFromGitHub { + owner = "mbirth"; + repo = "ttrss_plugin-af_feedmod"; + rev = "0ea2092dd34067ecd898802cfca3570023d1ecfe"; + sha256 = "02ibf47zcrsc2rr45wsix8gxyyf371davj8n8i0gj1zdq95klvnv"; + fetchSubmodules = true; + }; + patches = lib.optionals patched [ ./type_replace.patch ]; + installPhase = '' + mkdir $out + cp init.php $out + ''; + passthru.pluginName = "af_feedmod"; +}) diff --git a/flakes/mypackages/pkgs/webapps/ttrss/plugins/af_feedmod/type_replace.patch b/flakes/mypackages/pkgs/webapps/ttrss/plugins/af_feedmod/type_replace.patch new file mode 100644 index 0000000..d622577 --- /dev/null +++ b/flakes/mypackages/pkgs/webapps/ttrss/plugins/af_feedmod/type_replace.patch @@ -0,0 +1,12 @@ +--- a/init.php 2014-06-16 14:21:06.995480038 +0200 ++++ b/init.php 2014-06-16 14:22:00.151027654 +0200 +@@ -147,6 +147,9 @@ + } + } + break; ++ case 'replace': ++ $article['content'] = preg_replace("/".$config['pattern']."/",$config['replacement'],$article['content']); ++ break; + + default: + // unknown type or invalid config diff --git a/flakes/mypackages/pkgs/webapps/ttrss/plugins/auth_ldap/default.nix b/flakes/mypackages/pkgs/webapps/ttrss/plugins/auth_ldap/default.nix new file mode 100644 index 0000000..d283160 --- /dev/null +++ b/flakes/mypackages/pkgs/webapps/ttrss/plugins/auth_ldap/default.nix @@ -0,0 +1,17 @@ +{ stdenv, fetchFromGitHub }: +stdenv.mkDerivation ({ + pname = "ttrss-auth-ldap"; + version = "4d751b0-master"; + src = fetchFromGitHub { + owner = "hydrian"; + repo = "TTRSS-Auth-LDAP"; + rev = "4d751b095c29a8dbe2dc7bb07777742956136e94"; + sha256 = "0b9fl86acrzpcv41r7pj3bl8b3n72hpkdywzx9zjyfqv5pskxyim"; + fetchSubmodules = true; + }; + installPhase = '' + mkdir $out + cp plugins/auth_ldap/init.php $out + ''; + passthru.pluginName = "auth_ldap"; +}) diff --git a/flakes/mypackages/pkgs/webapps/ttrss/plugins/feediron/default.nix b/flakes/mypackages/pkgs/webapps/ttrss/plugins/feediron/default.nix new file mode 100644 index 0000000..2f86416 --- /dev/null +++ b/flakes/mypackages/pkgs/webapps/ttrss/plugins/feediron/default.nix @@ -0,0 +1,18 @@ +{ patched ? false, stdenv, fetchFromGitHub, lib }: +stdenv.mkDerivation ({ + pname = "ttrss-feediron"; + version = "407168c-master"; + src = fetchFromGitHub { + owner = "m42e"; + repo = "ttrss_plugin-feediron"; + rev = "407168c628880b5ced572cc549db6d50e866d3c8"; + sha256 = "17b95ifpcph6m03hjd1mhi8gi1hw9yd3fnffmw66fqr5c9l3zd9r"; + fetchSubmodules = true; + }; + patches = lib.optionals patched [ ./json_reformat.patch ]; + installPhase = '' + mkdir $out + cp -a . $out + ''; + passthru.pluginName = "feediron"; +}) diff --git a/flakes/mypackages/pkgs/webapps/ttrss/plugins/feediron/json_reformat.patch b/flakes/mypackages/pkgs/webapps/ttrss/plugins/feediron/json_reformat.patch new file mode 100644 index 0000000..e1c44d9 --- /dev/null +++ b/flakes/mypackages/pkgs/webapps/ttrss/plugins/feediron/json_reformat.patch @@ -0,0 +1,18 @@ +diff --git a/init.php b/init.php +index 3c0f2f9..1aad146 100644 +--- a/init.php ++++ b/init.php +@@ -600,10 +600,11 @@ class Feediron extends Plugin implements IHandler + return false; + } + +- $this->host->set($this, 'json_conf', Feediron_Json::format($json_conf)); ++ $new_conf = json_encode(json_decode($json_conf), JSON_PRETTY_PRINT); ++ $this->host->set($this, 'json_conf', $new_conf); + $json_reply['success'] = true; + $json_reply['message'] = __('Configuration saved.'); +- $json_reply['json_conf'] = Feediron_Json::format($json_conf); ++ $json_reply['json_conf'] = $new_conf; + echo json_encode($json_reply); + } + diff --git a/flakes/mypackages/pkgs/webapps/ttrss/plugins/ff_instagram/default.nix b/flakes/mypackages/pkgs/webapps/ttrss/plugins/ff_instagram/default.nix new file mode 100644 index 0000000..f0df588 --- /dev/null +++ b/flakes/mypackages/pkgs/webapps/ttrss/plugins/ff_instagram/default.nix @@ -0,0 +1,17 @@ +{ stdenv, fetchFromGitHub }: +stdenv.mkDerivation ({ + pname = "ttrss-ff_instagram"; + version = "0366ffb-master"; + src = fetchFromGitHub { + owner = "wltb"; + repo = "ff_instagram"; + rev = "0366ffb18c4d490c8fbfba2f5f3367a5af23cfe8"; + sha256 = "0vvzl6wi6jmrqknsfddvckjgsgfizz1d923d1nyrpzjfn6bda1vk"; + fetchSubmodules = true; + }; + installPhase = '' + mkdir $out + cp -a . $out + ''; + passthru.pluginName = "ff_instagram"; +}) diff --git a/flakes/mypackages/pkgs/webapps/ttrss/plugins/tumblr_gdpr_ua/default.nix b/flakes/mypackages/pkgs/webapps/ttrss/plugins/tumblr_gdpr_ua/default.nix new file mode 100644 index 0000000..072b6c3 --- /dev/null +++ b/flakes/mypackages/pkgs/webapps/ttrss/plugins/tumblr_gdpr_ua/default.nix @@ -0,0 +1,17 @@ +{ stdenv, fetchFromGitHub }: +stdenv.mkDerivation ({ + pname = "ttrss-tumblr_gdpr_ua"; + version = "287c584-master"; + src = fetchFromGitHub { + owner = "hkockerbeck"; + repo = "ttrss-tumblr-gdpr-ua"; + rev = "287c584e68845d524f920156bff0b2eaa6f65117"; + sha256 = "1fviawgcclqky4k4xv1sqzvpb8i74w9f0pclm09m78s8l85wh9py"; + fetchSubmodules = true; + }; + installPhase = '' + mkdir $out + cp -a . $out + ''; + passthru.pluginName = "tumblr_gdpr_ua"; +}) -- cgit v1.2.3