46 lines
1.6 KiB
Nix
46 lines
1.6 KiB
Nix
{ config, pkgs, lib, ... }:
|
|
{
|
|
services.mediawiki.extraConfig = lib.mkAfter ''
|
|
# ----- Read-only mode -----
|
|
$wgReadOnly = "This is a read-only mirror of the Noisebridge wiki.";
|
|
$wgEnableUploads = false;
|
|
$wgEnableEmail = false;
|
|
|
|
# ----- File cache (still useful for read-only serving) -----
|
|
$wgUseFileCache = true;
|
|
$wgFileCacheDirectory = "/var/cache/mediawiki";
|
|
$wgShowIPinHeader = false;
|
|
|
|
# ----- No account creation on replica -----
|
|
$wgGroupPermissions['*']['createaccount'] = false;
|
|
'';
|
|
|
|
# Smaller PHP-FPM pool for replica
|
|
# Use individual mkForce to override defaults without clobbering
|
|
# required settings (listen, user, group) set by the mediawiki module
|
|
services.phpfpm.pools.mediawiki.settings = {
|
|
"pm" = lib.mkForce "dynamic";
|
|
"pm.max_children" = lib.mkForce 8;
|
|
"pm.start_servers" = lib.mkForce 2;
|
|
"pm.min_spare_servers" = lib.mkForce 1;
|
|
"pm.max_spare_servers" = lib.mkForce 4;
|
|
"pm.max_requests" = lib.mkForce 500;
|
|
"request_terminate_timeout" = lib.mkForce "30s";
|
|
"pm.status_path" = "/fpm-status";
|
|
|
|
# OPcache
|
|
"php_admin_value[opcache.enable]" = 1;
|
|
"php_admin_value[opcache.memory_consumption]" = 128;
|
|
"php_admin_value[opcache.max_accelerated_files]" = 10000;
|
|
"php_admin_value[opcache.revalidate_freq]" = 60;
|
|
"php_admin_value[opcache.jit]" = 1255;
|
|
"php_admin_value[opcache.jit_buffer_size]" = "32M";
|
|
|
|
"php_admin_value[memory_limit]" = "128M";
|
|
"php_admin_value[max_execution_time]" = 30;
|
|
};
|
|
|
|
systemd.tmpfiles.rules = [
|
|
"d /var/cache/mediawiki 0755 mediawiki mediawiki -"
|
|
];
|
|
}
|