Merge pull request #80364 from pacien/riot-no-phoning-home

riot-web: add config overrides for privacy
This commit is contained in:
Michele Guerini Rocco 2020-02-17 18:44:49 +01:00 committed by GitHub
commit 7429153cac
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 9 deletions

View File

@ -1,9 +1,16 @@
{ lib, stdenv, fetchurl, writeText, conf ? null }: { lib, stdenv, fetchurl, writeText, jq, conf ? {} }:
# Note for maintainers: # Note for maintainers:
# Versions of `riot-web` and `riot-desktop` should be kept in sync. # Versions of `riot-web` and `riot-desktop` should be kept in sync.
stdenv.mkDerivation rec { let
noPhoningHome = {
disable_guests = true; # disable automatic guest account registration at matrix.org
piwik = false; # disable analytics
};
configOverrides = writeText "riot-config-overrides.json" (builtins.toJSON (noPhoningHome // conf));
in stdenv.mkDerivation rec {
pname = "riot-web"; pname = "riot-web";
version = "1.5.8"; version = "1.5.8";
@ -12,16 +19,12 @@ stdenv.mkDerivation rec {
sha256 = "112zjlmxy2s8qcd227laf1lfvbbwwcipn51xb779hy2dci48kpkx"; sha256 = "112zjlmxy2s8qcd227laf1lfvbbwwcipn51xb779hy2dci48kpkx";
}; };
installPhase = let installPhase = ''
configFile = if (conf != null)
then writeText "riot-config.json" conf
else "$out/config.sample.json";
in ''
runHook preInstall runHook preInstall
mkdir -p $out/ mkdir -p $out/
cp -R . $out/ cp -R . $out/
ln -s ${configFile} $out/config.json ${jq}/bin/jq -s '.[0] * .[1]' "config.sample.json" "${configOverrides}" > "$out/config.json"
runHook postInstall runHook postInstall
''; '';

View File

@ -2119,7 +2119,7 @@ in
riot-desktop = callPackage ../applications/networking/instant-messengers/riot/riot-desktop.nix { }; riot-desktop = callPackage ../applications/networking/instant-messengers/riot/riot-desktop.nix { };
riot-web = callPackage ../applications/networking/instant-messengers/riot/riot-web.nix { riot-web = callPackage ../applications/networking/instant-messengers/riot/riot-web.nix {
conf = config.riot-web.conf or null; conf = config.riot-web.conf or {};
}; };
ripasso-cursive = callPackage ../tools/security/ripasso/cursive.nix { ripasso-cursive = callPackage ../tools/security/ripasso/cursive.nix {