2024-11-22 17:40:26 +01:00
|
|
|
{ config, ... }:
|
2024-11-18 10:48:16 +01:00
|
|
|
|
|
|
|
{
|
|
|
|
services.phpfpm.pools.mediawiki.phpOptions = ''
|
|
|
|
upload_max_filesize = 1024M;
|
|
|
|
post_max_size = 1024M;
|
|
|
|
'';
|
|
|
|
|
|
|
|
services.mediawiki = {
|
|
|
|
enable = true;
|
2024-11-18 11:30:00 +01:00
|
|
|
name = "Fediversity Wiki";
|
2024-11-18 10:48:16 +01:00
|
|
|
webserver = "nginx";
|
|
|
|
nginx.hostName = "wiki.fediversity.eu";
|
2024-11-22 17:40:26 +01:00
|
|
|
passwordFile = config.age.secrets.wiki-password.path;
|
2024-11-18 10:48:16 +01:00
|
|
|
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;
|
2024-11-20 13:07:03 +01:00
|
|
|
$wgAllowExternalImages = false;
|
2024-11-18 11:30:00 +01:00
|
|
|
|
2024-11-18 10:48:16 +01:00
|
|
|
## Permissions
|
|
|
|
$wgGroupPermissions['*']['edit'] = false;
|
2024-11-22 17:40:26 +01:00
|
|
|
$wgGroupPermissions['*']['createaccount'] = true;
|
2024-11-18 10:48:16 +01:00
|
|
|
$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-18 11:30:00 +01:00
|
|
|
|
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}");
|
|
|
|
|
2024-11-18 10:48:16 +01:00
|
|
|
$wgHeadScriptCode = <<<'END'
|
|
|
|
<link rel=me href="https://mastodon.fediversity.eu/@fediversity">
|
|
|
|
END;
|
2024-11-18 11:30:00 +01:00
|
|
|
'';
|
2024-11-18 10:48:16 +01:00
|
|
|
|
2024-11-18 11:30:00 +01:00
|
|
|
extensions = {
|
|
|
|
VisualEditor = null;
|
|
|
|
};
|
2024-11-18 10:48:16 +01:00
|
|
|
};
|
|
|
|
|
2024-11-22 17:40:26 +01:00
|
|
|
age.secrets.wiki-smtp-password.owner = "mediawiki";
|
|
|
|
|
2024-11-18 10:48:16 +01:00
|
|
|
services.nginx = {
|
|
|
|
enable = true;
|
|
|
|
virtualHosts."wiki.fediversity.eu" = {
|
2024-11-22 17:40:26 +01:00
|
|
|
basicAuthFile = config.age.secrets.wiki-basicauth-htpasswd.path;
|
2024-11-18 10:48:16 +01:00
|
|
|
forceSSL = true;
|
|
|
|
enableACME = true;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2024-11-22 17:40:26 +01:00
|
|
|
age.secrets.wiki-basicauth-htpasswd.owner = "nginx";
|
|
|
|
|
2024-11-18 10:48:16 +01:00
|
|
|
security.acme = {
|
|
|
|
acceptTerms = true;
|
|
|
|
defaults.email = "systeemmail@procolix.com";
|
|
|
|
};
|
|
|
|
|
|
|
|
users.users.nginx.extraGroups = [ "acme" ];
|
|
|
|
}
|