Talk:MediaWiki

From NixOS Wiki
Latest comment: 26 May 2021 by Makefu

Now that there is `services.mediawiki` i think this article needs to be revised. I am somewhat struggling to get the whole setup running, there are just so many configuration options and it is not clear what actually needs to be done I was looking for a nixos container setup which gets requests forwarded from the host system but maybe it is enough to have mediawiki listen on the a port != 80 --Makefu (talk) 07:28, 26 May 2021 (UTC)Reply

configuration examples

minimal configuration

tested on NixOS 21.11
with a working setup for networking

touch /run/keys/mediawiki-password
$EDITOR /run/keys/mediawiki-password
cat /run/keys/mediawiki-password
this-is-an-initial-password-for-mediawiki
$EDITOR /etc/nixos/configuration.nix
{ config, pkgs, ... }:

{
  services.mediawiki.enable = true;
  services.mediawiki.virtualHost.hostName = "mediawiki.example.org";
  services.mediawiki.virtualHost.adminAddr = "admin@example.org";
  services.mediawiki.passwordFile = "/run/keys/mediawiki-password";
  networking.firewall.allowedTCPPorts = [ 80 ];
}
nixos-rebuild switch

fails


cp --preserve=all /var/lib/mediawiki/secret.key /var/lib/mediawiki/passwordFile
cat /run/keys/mediawiki-password > /var/lib/mediawiki/passwordFile
$EDITOR /etc/nixos/configuration.nix
#  services.mediawiki.passwordFile = "/run/keys/mediawiki-password";
#  services.mediawiki.passwordFile = "/tmp/configuration.nix_services_mediawiki_passwordFile";
  services.mediawiki.passwordFile = "/var/lib/mediawiki/passwordFile";
nixos-rebuild switch

works