ma owncloud: add caching

This commit is contained in:
makefu 2018-02-28 21:29:23 +01:00
parent cf2d31899e
commit 54c439f4f4
No known key found for this signature in database
GPG Key ID: 36F7711F3FC0F225

View File

@ -1,6 +1,18 @@
{ lib, pkgs, config, ... }: { lib, pkgs, config, ... }:
with lib; with lib;
# imperative in config.php:
# #local memcache:
# 'memcache.local' => '\\OC\\Memcache\\APCu',
# #local locking:
# 'memcache.locking' => '\\OC\\Memcache\\Redis',
# 'redis' =>
# array (
# 'host' => 'localhost',
# 'port' => 6379,
# ),
let let
# TODO: copy-paste from lass/2/websites/util.nix # TODO: copy-paste from lass/2/websites/util.nix
serveCloud = domains: serveCloud = domains:
@ -124,20 +136,48 @@ let
env[PATH] = ${lib.makeBinPath [ pkgs.php ]} env[PATH] = ${lib.makeBinPath [ pkgs.php ]}
catch_workers_output = yes catch_workers_output = yes
''; '';
services.phpfpm.phpOptions = ''
opcache.enable=1
opcache.enable_cli=1
opcache.interned_strings_buffer=8
opcache.max_accelerated_files=10000
opcache.memory_consumption=128
opcache.save_comments=1
opcache.revalidate_freq=1
display_errors = on
display_startup_errors = on
always_populate_raw_post_data = -1
error_reporting = E_ALL | E_STRICT
html_errors = On
date.timezone = "Europe/Berlin"
# extension=${pkgs.phpPackages.memcached}/lib/php/extensions/memcached.so
extension=${pkgs.phpPackages.redis}/lib/php/extensions/redis.so
extension=${pkgs.phpPackages.apcu}/lib/php/extensions/apcu.so
'';
}; };
in { in {
imports = [ imports = [
( serveCloud [ "o.euer.krebsco.de" ] ) ( serveCloud [ "o.euer.krebsco.de" ] )
]; ];
services.mysql = { # TODO: currently nextcloud uses sqlite services.redis.enable = true;
services.mysql = {
enable = false; enable = false;
package = pkgs.mariadb; package = pkgs.mariadb;
rootPassword = config.krebs.secret.files.mysql_rootPassword.path; rootPassword = config.krebs.secret.files.mysql_rootPassword.path;
}; initialDatabases = [
services.mysqlBackup = { # Or use writeText instead of literalExample?
enable = false; #{ name = "nextcloud"; schema = literalExample "./nextcloud.sql"; }
databases = [ "nextcloud" ]; {
name = "nextcloud";
schema = pkgs.writeText "nextcloud.sql"
''
create user if not exists 'nextcloud'@'localhost' identified by 'password';
grant all privileges on nextcloud.* to 'nextcloud'@'localhost' identified by 'password';
'';
}
];
}; };
# dataDir is only defined after mysql is enabled # dataDir is only defined after mysql is enabled
# krebs.secret.files.mysql_rootPassword = { # krebs.secret.files.mysql_rootPassword = {