diff options
author | Ismaël Bouya <ismael.bouya@normalesup.org> | 2023-10-04 01:35:06 +0200 |
---|---|---|
committer | Ismaël Bouya <ismael.bouya@normalesup.org> | 2023-10-04 02:11:48 +0200 |
commit | 1a64deeb894dc95e2645a75771732c6cc53a79ad (patch) | |
tree | 1b9df4838f894577a09b9b260151756272efeb53 /flakes/mypackages/pkgs/webapps/ttrss | |
parent | fa25ffd4583cc362075cd5e1b4130f33306103f0 (diff) | |
download | Nix-1a64deeb894dc95e2645a75771732c6cc53a79ad.tar.gz Nix-1a64deeb894dc95e2645a75771732c6cc53a79ad.tar.zst Nix-1a64deeb894dc95e2645a75771732c6cc53a79ad.zip |
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
Diffstat (limited to 'flakes/mypackages/pkgs/webapps/ttrss')
8 files changed, 154 insertions, 0 deletions
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 @@ | |||
1 | { ttrss_config ? "/etc/ttrss/config.php" | ||
2 | , varDir ? "/var/lib/ttrss" | ||
3 | , stdenv, lib, callPackage, sources }: | ||
4 | let | ||
5 | pluginNames = [ "auth_ldap" "af_feedmod" "feediron" "ff_instagram" "tumblr_gdpr_ua" ]; | ||
6 | allPlugins = lib.attrsets.genAttrs pluginNames | ||
7 | (name: callPackage (./plugins + "/${name}") {}); | ||
8 | toPassthru = pkg: plugins: { | ||
9 | inherit plugins allPlugins; | ||
10 | withPlugins = withPlugins pkg; | ||
11 | }; | ||
12 | withPlugins = pkg: toPlugins: | ||
13 | let | ||
14 | plugins = toPlugins allPlugins; | ||
15 | toInstallPlugin = n: | ||
16 | "ln -sf ${n} $out/plugins/${n.pluginName}"; | ||
17 | newTtrss = pkg.overrideAttrs(old: { | ||
18 | installPhase = old.installPhase + "\n" + builtins.concatStringsSep "\n" (map toInstallPlugin plugins); | ||
19 | passthru = toPassthru newTtrss (pkg.plugins ++ plugins); | ||
20 | }); | ||
21 | in newTtrss; | ||
22 | package = stdenv.mkDerivation rec { | ||
23 | pname = "tt-rss"; | ||
24 | version = "${sources.tools.ttrss.shortRev}-master"; | ||
25 | name = "${pname}-${version}"; | ||
26 | src = sources.tools.ttrss; | ||
27 | buildPhase = '' | ||
28 | rm -rf lock feed-icons cache | ||
29 | ln -sf ${varDir}/{lock,feed-icons,cache} . | ||
30 | ''; | ||
31 | installPhase = '' | ||
32 | cp -a . $out | ||
33 | ln -s ${ttrss_config} $out/config.php | ||
34 | ''; | ||
35 | passthru = toPassthru package []; | ||
36 | }; | ||
37 | 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 @@ | |||
1 | { patched ? false, stdenv, fetchFromGitHub, lib }: | ||
2 | stdenv.mkDerivation ({ | ||
3 | pname = "ttrss-af_feedmod"; | ||
4 | version = "0ea2092-master"; | ||
5 | src = fetchFromGitHub { | ||
6 | owner = "mbirth"; | ||
7 | repo = "ttrss_plugin-af_feedmod"; | ||
8 | rev = "0ea2092dd34067ecd898802cfca3570023d1ecfe"; | ||
9 | sha256 = "02ibf47zcrsc2rr45wsix8gxyyf371davj8n8i0gj1zdq95klvnv"; | ||
10 | fetchSubmodules = true; | ||
11 | }; | ||
12 | patches = lib.optionals patched [ ./type_replace.patch ]; | ||
13 | installPhase = '' | ||
14 | mkdir $out | ||
15 | cp init.php $out | ||
16 | ''; | ||
17 | passthru.pluginName = "af_feedmod"; | ||
18 | }) | ||
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 @@ | |||
1 | --- a/init.php 2014-06-16 14:21:06.995480038 +0200 | ||
2 | +++ b/init.php 2014-06-16 14:22:00.151027654 +0200 | ||
3 | @@ -147,6 +147,9 @@ | ||
4 | } | ||
5 | } | ||
6 | break; | ||
7 | + case 'replace': | ||
8 | + $article['content'] = preg_replace("/".$config['pattern']."/",$config['replacement'],$article['content']); | ||
9 | + break; | ||
10 | |||
11 | default: | ||
12 | // 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 @@ | |||
1 | { stdenv, fetchFromGitHub }: | ||
2 | stdenv.mkDerivation ({ | ||
3 | pname = "ttrss-auth-ldap"; | ||
4 | version = "4d751b0-master"; | ||
5 | src = fetchFromGitHub { | ||
6 | owner = "hydrian"; | ||
7 | repo = "TTRSS-Auth-LDAP"; | ||
8 | rev = "4d751b095c29a8dbe2dc7bb07777742956136e94"; | ||
9 | sha256 = "0b9fl86acrzpcv41r7pj3bl8b3n72hpkdywzx9zjyfqv5pskxyim"; | ||
10 | fetchSubmodules = true; | ||
11 | }; | ||
12 | installPhase = '' | ||
13 | mkdir $out | ||
14 | cp plugins/auth_ldap/init.php $out | ||
15 | ''; | ||
16 | passthru.pluginName = "auth_ldap"; | ||
17 | }) | ||
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 @@ | |||
1 | { patched ? false, stdenv, fetchFromGitHub, lib }: | ||
2 | stdenv.mkDerivation ({ | ||
3 | pname = "ttrss-feediron"; | ||
4 | version = "407168c-master"; | ||
5 | src = fetchFromGitHub { | ||
6 | owner = "m42e"; | ||
7 | repo = "ttrss_plugin-feediron"; | ||
8 | rev = "407168c628880b5ced572cc549db6d50e866d3c8"; | ||
9 | sha256 = "17b95ifpcph6m03hjd1mhi8gi1hw9yd3fnffmw66fqr5c9l3zd9r"; | ||
10 | fetchSubmodules = true; | ||
11 | }; | ||
12 | patches = lib.optionals patched [ ./json_reformat.patch ]; | ||
13 | installPhase = '' | ||
14 | mkdir $out | ||
15 | cp -a . $out | ||
16 | ''; | ||
17 | passthru.pluginName = "feediron"; | ||
18 | }) | ||
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 @@ | |||
1 | diff --git a/init.php b/init.php | ||
2 | index 3c0f2f9..1aad146 100644 | ||
3 | --- a/init.php | ||
4 | +++ b/init.php | ||
5 | @@ -600,10 +600,11 @@ class Feediron extends Plugin implements IHandler | ||
6 | return false; | ||
7 | } | ||
8 | |||
9 | - $this->host->set($this, 'json_conf', Feediron_Json::format($json_conf)); | ||
10 | + $new_conf = json_encode(json_decode($json_conf), JSON_PRETTY_PRINT); | ||
11 | + $this->host->set($this, 'json_conf', $new_conf); | ||
12 | $json_reply['success'] = true; | ||
13 | $json_reply['message'] = __('Configuration saved.'); | ||
14 | - $json_reply['json_conf'] = Feediron_Json::format($json_conf); | ||
15 | + $json_reply['json_conf'] = $new_conf; | ||
16 | echo json_encode($json_reply); | ||
17 | } | ||
18 | |||
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 @@ | |||
1 | { stdenv, fetchFromGitHub }: | ||
2 | stdenv.mkDerivation ({ | ||
3 | pname = "ttrss-ff_instagram"; | ||
4 | version = "0366ffb-master"; | ||
5 | src = fetchFromGitHub { | ||
6 | owner = "wltb"; | ||
7 | repo = "ff_instagram"; | ||
8 | rev = "0366ffb18c4d490c8fbfba2f5f3367a5af23cfe8"; | ||
9 | sha256 = "0vvzl6wi6jmrqknsfddvckjgsgfizz1d923d1nyrpzjfn6bda1vk"; | ||
10 | fetchSubmodules = true; | ||
11 | }; | ||
12 | installPhase = '' | ||
13 | mkdir $out | ||
14 | cp -a . $out | ||
15 | ''; | ||
16 | passthru.pluginName = "ff_instagram"; | ||
17 | }) | ||
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 @@ | |||
1 | { stdenv, fetchFromGitHub }: | ||
2 | stdenv.mkDerivation ({ | ||
3 | pname = "ttrss-tumblr_gdpr_ua"; | ||
4 | version = "287c584-master"; | ||
5 | src = fetchFromGitHub { | ||
6 | owner = "hkockerbeck"; | ||
7 | repo = "ttrss-tumblr-gdpr-ua"; | ||
8 | rev = "287c584e68845d524f920156bff0b2eaa6f65117"; | ||
9 | sha256 = "1fviawgcclqky4k4xv1sqzvpb8i74w9f0pclm09m78s8l85wh9py"; | ||
10 | fetchSubmodules = true; | ||
11 | }; | ||
12 | installPhase = '' | ||
13 | mkdir $out | ||
14 | cp -a . $out | ||
15 | ''; | ||
16 | passthru.pluginName = "tumblr_gdpr_ua"; | ||
17 | }) | ||