mirror of
https://github.com/ilyakooo0/nixpkgs.git
synced 2024-12-30 23:34:12 +03:00
nixos/nextcloud: fix declarative cache configuration
It's supposed to be `memcache.distributed`, not an associative PHP array named `memcache` with a key `distributed`. This was probably never caught because the initial `grep -q` check in the test was invalid: `redis-cli` prints nothing if no keys can be found when not writing to a tty apparently.
This commit is contained in:
parent
5a2769d981
commit
3df3a89892
@ -1065,10 +1065,8 @@ in {
|
||||
services.nextcloud = lib.mkIf cfg.configureRedis {
|
||||
caching.redis = true;
|
||||
extraOptions = {
|
||||
memcache = {
|
||||
distributed = ''\OC\Memcache\Redis'';
|
||||
locking = ''\OC\Memcache\Redis'';
|
||||
};
|
||||
"memcache.distributed" = ''\OC\Memcache\Redis'';
|
||||
"memcache.locking" = ''\OC\Memcache\Redis'';
|
||||
redis = {
|
||||
host = config.services.redis.servers.nextcloud.unixSocket;
|
||||
port = 0;
|
||||
|
@ -40,16 +40,11 @@ in {
|
||||
secretFile = "/etc/nextcloud-secrets.json";
|
||||
|
||||
extraOptions.redis = {
|
||||
host = "/run/redis/redis.sock";
|
||||
port = 0;
|
||||
dbindex = 0;
|
||||
timeout = 1.5;
|
||||
# password handled via secretfile below
|
||||
};
|
||||
extraOptions.memcache = {
|
||||
local = "\OC\Memcache\Redis";
|
||||
locking = "\OC\Memcache\Redis";
|
||||
};
|
||||
configureRedis = true;
|
||||
};
|
||||
|
||||
services.redis.servers."nextcloud".enable = true;
|
||||
@ -74,7 +69,7 @@ in {
|
||||
|
||||
# This file is meant to contain secret options which should
|
||||
# not go into the nix store. Here it is just used to set the
|
||||
# databyse type to postgres.
|
||||
# redis password.
|
||||
environment.etc."nextcloud-secrets.json".text = ''
|
||||
{
|
||||
"redis": {
|
||||
@ -117,6 +112,6 @@ in {
|
||||
)
|
||||
|
||||
# redis cache should not be empty
|
||||
nextcloud.fail("redis-cli KEYS * | grep -q 'empty array'")
|
||||
nextcloud.fail('test "[]" = "$(redis-cli --json KEYS "*")"')
|
||||
'';
|
||||
})
|
||||
|
Loading…
Reference in New Issue
Block a user