Fediversity/infra/vm02187/wiki.nix

81 lines
2.4 KiB
Nix
Raw Normal View History

2024-11-22 17:40:26 +01:00
{ config, ... }:
{
services.phpfpm.pools.mediawiki.phpOptions = ''
upload_max_filesize = 1024M;
post_max_size = 1024M;
'';
services.mediawiki = {
enable = true;
name = "Fediversity Wiki";
webserver = "nginx";
nginx.hostName = "wiki.fediversity.eu";
2024-11-22 17:40:26 +01:00
passwordFile = config.age.secrets.wiki-password.path;
extraConfig = ''
# Disable anonymous editing
$wgGroupPermissions['*']['edit'] = false;
$wgEnableUploads = true;
$wgFileExtensions = array('png', 'jpg', 'jpeg', 'svg', 'pdf', 'odt', 'ods', 'brd', 'sch', 'JPG', 'PNG', 'JPEG', 'SVG', 'json', 'mkv', 'mp4', 'gif');
$wgUseImageMagick = true;
$wgMaxShellMemory = 524288;
$wgSVGMetadataCutoff = 1024*1024;
$wgAllowExternalImages = false;
## Permissions
$wgGroupPermissions['*']['edit'] = false;
2024-11-22 17:40:26 +01:00
$wgGroupPermissions['*']['createaccount'] = true;
$wgGroupPermissions['*']['autocreateaccount'] = true;
$wgGroupPermissions['user']['edit'] = true;
$wgGroupPermissions['user']['createaccount'] = true;
$wgGroupPermissions['user']['editmyprivateinfo'] = true;
$wgGroupPermissions['sysop']['interwiki'] = true;
$wgGroupPermissions['sysop']['editwidgets'] = true;
# 1 GB ought to be enough for everyone
$wgUploadSizeWarning = 1024*1024*512;
$wgMaxUploadSize = 1024*1024*1024;
2024-11-22 17:40:26 +01:00
$wgEnableEmail = true;
$wgPasswordSender = "wiki@fediversity.eu";
$wgEmergencyContact = "wiki@fediversity.eu";
$wgSMTP = [
'host' => 'mail.protagio.nl',
'IDHost' => 'fediversity.eu',
'localhost' => 'fediversity.eu',
'port' => 587,
'auth' => true,
'username' => 'wiki@fediversity.eu',
];
require_once("${config.age.secrets.wiki-smtp-password.path}");
$wgHeadScriptCode = <<<'END'
<link rel=me href="https://mastodon.fediversity.eu/@fediversity">
END;
'';
extensions = {
VisualEditor = null;
};
};
2024-11-22 17:40:26 +01:00
age.secrets.wiki-smtp-password.owner = "mediawiki";
services.nginx = {
enable = true;
virtualHosts."wiki.fediversity.eu" = {
2024-11-22 17:40:26 +01:00
basicAuthFile = config.age.secrets.wiki-basicauth-htpasswd.path;
forceSSL = true;
enableACME = true;
};
};
2024-11-22 17:40:26 +01:00
age.secrets.wiki-basicauth-htpasswd.owner = "nginx";
security.acme = {
acceptTerms = true;
defaults.email = "systeemmail@procolix.com";
};
users.users.nginx.extraGroups = [ "acme" ];
}