X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=modules%2Fprivate%2Fwebsites%2Ftools%2Fcloud%2Fdefault.nix;h=44163de71d80d0fb1e9524513acf2442709acbaa;hb=fa25ffd4583cc362075cd5e1b4130f33306103f0;hp=1a422966d0864569b75851d606ecb47942db4e4c;hpb=50abe6fce134066851479a0df09a1db0a7219df2;p=perso%2FImmae%2FConfig%2FNix.git diff --git a/modules/private/websites/tools/cloud/default.nix b/modules/private/websites/tools/cloud/default.nix index 1a42296..44163de 100644 --- a/modules/private/websites/tools/cloud/default.nix +++ b/modules/private/websites/tools/cloud/default.nix @@ -8,8 +8,6 @@ let ]); env = config.myEnv.tools.nextcloud; varDir = "/var/lib/nextcloud"; - webappName = "tools_nextcloud"; - apacheRoot = "/run/current-system/webapps/${webappName}"; cfg = config.myServices.websites.tools.cloud; phpFpm = rec { basedir = builtins.concatStringsSep ":" ([ nextcloud varDir ] ++ nextcloud.apps); @@ -49,11 +47,11 @@ in { certName = "eldiron"; addToCerts = true; hosts = ["cloud.immae.eu" ]; - root = apacheRoot; + root = nextcloud; extraConfig = [ '' SetEnvIf Authorization "(.*)" HTTP_AUTHORIZATION=$1 - + AcceptPathInfo On DirectoryIndex index.php Options FollowSymlinks @@ -73,8 +71,7 @@ in { ]; }; - secrets.keys = [{ - dest = "webapps/tools-nextcloud"; + secrets.keys."webapps/tools-nextcloud" = { user = "wwwrun"; group = "wwwrun"; permissions = "0600"; @@ -133,14 +130,14 @@ in { 'has_rebuilt_cache' => true, ); ''; - }]; + }; users.users.root.packages = let occ = pkgs.writeScriptBin "nextcloud-occ" '' #! ${pkgs.stdenv.shell} cd ${nextcloud} NEXTCLOUD_CONFIG_DIR="${nextcloud}/config" \ exec \ - sudo -u wwwrun ${pkgs.php74}/bin/php \ + sudo -E -u wwwrun ${pkgs.php74}/bin/php \ -c ${pkgs.php74}/etc/php.ini \ occ $* ''; @@ -157,14 +154,9 @@ in { ${builtins.concatStringsSep "\n" (lib.attrsets.mapAttrsToList (n: v: "install -D -m 0644 -o wwwrun -g wwwrun -T ${v} ${varDir}/config/${n}.json" ) confs)} - #install -D -m 0600 -o wwwrun -g wwwrun -T /var/secrets/webapps/tools-nextcloud ${varDir}/config/config.php + #install -D -m 0600 -o wwwrun -g wwwrun -T ${config.secrets.fullPaths."webapps/tools-nextcloud"} ${varDir}/config/config.php ''; }; - # FIXME: add a warning when config.php changes - system.extraSystemBuilderCmds = '' - mkdir -p $out/webapps - ln -s ${nextcloud} $out/webapps/${webappName} - ''; services.phpfpm.pools.nextcloud = { user = "wwwrun"; @@ -180,7 +172,7 @@ in { #! ${pkgs.stdenv.shell} export LOCALE_ARCHIVE=/run/current-system/sw/lib/locale/locale-archive export PATH=/run/wrappers/bin:$PATH - ${pkgs.php74}/bin/php -d memory_limit=512M -f ${nextcloud}/cron.php + ${pkgs.php74}/bin/php -d memory_limit=2048M -f ${nextcloud}/cron.php ''; in [ ''