]> git.immae.eu Git - perso/Immae/Config/Nix.git/commitdiff
Update roundcube
authorIsmaël Bouya <ismael.bouya@normalesup.org>
Wed, 10 Apr 2019 22:06:53 +0000 (00:06 +0200)
committerIsmaël Bouya <ismael.bouya@normalesup.org>
Wed, 10 Apr 2019 22:06:53 +0000 (00:06 +0200)
nixops/modules/websites/default.nix
nixops/modules/websites/tools/tools/default.nix
nixops/modules/websites/tools/tools/roundcubemail.nix

index 49dc5f7d0e55a338dff8ea102bb2fe9b79720bbd..ad97d7f8a0782db67b0f03e6f1a2efeac2dd84d3 100644 (file)
@@ -170,6 +170,7 @@ in
     networking.firewall.allowedTCPPorts = [ 80 443 ];
 
     nixpkgs.overlays = [ (self: super: rec {
+      #openssl = self.openssl_1_1;
       php = php72;
       php72 = (super.php72.override {
         mysql.connector-c = self.mariadb;
index 8edbdd9aa13b56a38350737ac8892d16d4f6bcc3..aa59e280d6c254c930b9c3ebf54f2b894acdfdf8 100644 (file)
@@ -129,6 +129,7 @@ in {
       ];
     };
 
+    services.myPhpfpm.poolPhpConfigs.roundcubemail = roundcubemail.phpFpm.phpConfig;
     services.myPhpfpm.poolConfigs = {
       adminer = adminer.phpFpm.pool;
       ttrss = ttrss.phpFpm.pool;
index 58a1be51e49ec254f892f41871fc303742515230..abd0387d5432cf847621bbcaa3e38cfd83f496e8 100644 (file)
@@ -1,7 +1,72 @@
-{ lib, env, writeText, stdenv, fetchurl, fetchedGithub }:
+{ lib, env, writeText, stdenv, fetchurl, fetchedGithub, phpPackages, apacheHttpd }:
 let
   roundcubemail = let
-    plugins = {};
+    defaultInstall = ''
+      mkdir -p $out
+      cp -R . $out/
+      cd $out
+      if [ -d skins -a -d skins/larry -a ! -d skins/elastic ]; then
+        ln -s larry skins/elastic
+      fi
+      '';
+    buildPlugin = { appName, version, url, sha256, installPhase ? defaultInstall }:
+      stdenv.mkDerivation rec {
+        name = "roundcube-${appName}-${version}";
+        inherit version;
+        phases = "unpackPhase installPhase";
+        inherit installPhase;
+        src = fetchurl { inherit url sha256; };
+      };
+    plugins = {
+      carddav = buildPlugin rec {
+        appName = "carddav";
+        version = "3.0.3";
+        url = "https://github.com/blind-coder/rcmcarddav/releases/download/v${version}/${appName}-${version}.tar.bz2";
+        sha256 = "0cf5rnqkhhag2vdy808zfpr4l5586fn43nvcia8ac1ha58azrxal";
+      };
+      contextmenu = buildPlugin rec {
+        appName = "contextmenu";
+        version = "2.3";
+        url = "https://github.com/johndoh/roundcube-${appName}/archive/${version}.tar.gz";
+        sha256 = "1rb8n821ylfniiiccfskc534vd6rczhk3g82455ks3m09q6l8hif";
+      };
+      contextmenu_folder = buildPlugin rec {
+        appName = "contextmenu_folder";
+        version = "1.3.3";
+        url = "https://github.com/random-cuber/${appName}/archive/${version}.tar.gz";
+        sha256 = "1ngfws1v8qrpa52rjh7kirc98alchk2vbqwra86h00agyjjlcc57";
+      };
+      automatic_addressbook = buildPlugin rec {
+        appName = "automatic_addressbook";
+        version = "0.4.3";
+        url = "https://github.com/sblaisot/${appName}/archive/${version}.tar.gz";
+        sha256 = "0bx5qjzp3a3wc72fr295bvgsy5n15949c041hq76n6c7sqdn7inc";
+      };
+      message_highlight = buildPlugin rec {
+        appName = "message_highlight";
+        version = "4.4";
+        url = "https://github.com/corbosman/${appName}/archive/${version}.tar.gz";
+        sha256 = "12c4x47y70xdl5pgm8csh5i4yiyhpi232lvjbixmca6di4lkhh9j";
+      };
+      thunderbird_labels = buildPlugin rec {
+        appName = "thunderbird_labels";
+        version = "v1.3.2";
+        url = "https://github.com/mike-kfed/roundcube-${appName}/archive/${version}.tar.gz";
+        sha256 = "1q4x30w66m02v3lw2n8020g0158rmyfzs6gydfk89pa1hs28k9bg";
+      };
+      html5_notifier = buildPlugin rec {
+        appName = "html5_notifier";
+        version = "v0.6.2";
+        url = "https://github.com/stremlau/${appName}/archive/${version}.tar.gz";
+        sha256 = "0s1wq9ira4bcd8jvhn93nhxiqzpp92i0za2kw37kf7ksyhr0xslq";
+      };
+      ident_switch = buildPlugin rec {
+        appName = "ident_switch";
+        version = "4.0.1";
+        url = "https://bitbucket.org/BoresExpress/${appName}/get/${version}.tar.gz";
+        sha256 = "1zyy40lfq2kn7hkghbl8lgp18fb634zr4fxmmxvb1wqyvqdpdpyk";
+      };
+    };
     skins = {};
   in rec {
     varDir = "/var/lib/roundcubemail";
@@ -9,7 +74,7 @@ let
       deps = [ "wrappers" ];
       text = ''
         install -m 0755 -o ${apache.user} -g ${apache.group} -d ${varDir} \
-          ${varDir}/cache
+          ${varDir}/cache ${varDir}/logs
         install -m 0750 -o ${apache.user} -g ${apache.group} -d ${varDir}/phpSessions
       '';
     };
@@ -27,7 +92,51 @@ let
 
         $config['des_key'] = '${env.secret}';
 
-        $config['plugins'] = array();
+        $config['skin'] = 'elastic';
+        $config['plugins'] = array(
+          // 'acl',
+          // 'additional_message_headers',
+          // 'archive',
+          'attachment_reminder',
+          // 'autologon',
+          // 'database_attachments',
+          // 'debug_logger',
+          // 'emoticons',
+          // 'enigma',
+          // 'example_addressbook',
+          // 'filesystem_attachments',
+          // 'help',
+          // 'hide_blockquote',
+          // 'http_authentication',
+          // 'identicon',
+          // 'identity_select',
+          // 'jqueryui',
+          // 'krb_authentication',
+          // 'managesieve',
+          // 'markasjunk',
+          // 'new_user_dialog',
+          // 'new_user_identity',
+          // 'newmail_notifier',
+          // 'password',
+          // 'redundant_attachments',
+          // 'show_additional_headers',
+          // 'squirrelmail_usercopy',
+          // 'subscriptions_option',
+          // 'userinfo',
+          // 'vcard_attachments',
+          // 'virtuser_file',
+          // 'virtuser_query',
+          // 'zipdownload',
+
+          // 'automatic_addressbook',
+          // 'carddav',
+          // 'contextmenu',
+          // 'contextmenu_folder',
+          // 'html5_notifier',
+          // 'ident_switch',
+          // 'message_highlight',
+          // 'thunderbird_labels',
+        );
 
         $config['language'] = 'fr_FR';
 
@@ -40,19 +149,22 @@ let
         $config['enable_installer'] = false;
         $config['log_driver'] = 'stdout';
         $config['temp_dir'] = '${varDir}/cache';
-        $config['debug_level'] = 1;
+        $config['mime_types'] = '${apacheHttpd}/conf/mime.types';
       '';
     webRoot = stdenv.mkDerivation rec {
-      version = "1.3.8";
+      version = "1.4-rc1";
       name = "roundcubemail-${version}";
       src= fetchurl {
         url = "https://github.com/roundcube/roundcubemail/releases/download/${version}/${name}-complete.tar.gz";
-        sha256 = "018djad7ygfl9c9f2l2j42qkg31ml3hs2f01f0dk361zckwk77n4";
+        sha256 = "0p18wffwi2prh6vxhx1bc69qd1vwybggm8gvg3shahfdknxci9i4";
       };
       buildPhase = ''
         sed -i \
           -e "s|RCUBE_INSTALL_PATH . 'temp.*|'${varDir}/cache';|" \
           config/defaults.inc.php
+        sed -i \
+          -e "s|RCUBE_INSTALL_PATH . 'logs.*|'${varDir}/logs';|" \
+          config/defaults.inc.php
       '';
       installPhase = ''
         cp -a . $out
@@ -90,6 +202,10 @@ let
         [ webRoot config varDir ]
         ++ lib.attrsets.mapAttrsToList (name: value: value) plugins
         ++ lib.attrsets.mapAttrsToList (name: value: value) skins);
+      phpConfig = ''
+        date.timezone = 'CET'
+        extension=${phpPackages.imagick}/lib/php/extensions/imagick.so
+        '';
       socket = "/var/run/phpfpm/roundcubemail.sock";
       pool = ''
         listen = ${socket}
@@ -103,7 +219,9 @@ let
 
         ; Needed to avoid clashes in browser cookies (same domain)
         php_value[session.name] = RoundcubemailPHPSESSID
-        php_admin_value[open_basedir] = "${basedir}:/tmp"
+        php_admin_value[upload_max_filesize] = 200M
+        php_admin_value[post_max_size] = 200M
+        php_admin_value[open_basedir] = "${basedir}:${apacheHttpd}/conf/mime.types:/tmp"
         php_admin_value[session.save_path] = "${varDir}/phpSessions"
         '';
     };