1
0
Fork 0
mirror of https://github.com/NixOS/nixpkgs.git synced 2025-07-08 03:26:08 +03:00

* Support file uploads in MediaWiki.

svn path=/nixos/trunk/; revision=25145
This commit is contained in:
Eelco Dolstra 2010-12-15 13:21:21 +00:00
parent 0887471e4e
commit ec16a59845

View file

@ -57,6 +57,11 @@ let
$wgArticlePath = "${config.articleUrlPrefix}/$1";
''}
${optionalString config.enableUploads ''
$wgEnableUploads = true;
$wgUploadDirectory = "${config.uploadDir}";
''}
${config.extraConfig}
?>
'';
@ -96,6 +101,16 @@ in
extraConfig =
''
${optionalString config.enableUploads ''
Alias ${config.urlPrefix}/images ${config.uploadDir}
<Directory ${config.uploadDir}>
Order allow,deny
Allow from all
Options -Indexes
</Directory>
''}
Alias ${config.urlPrefix} ${mediawikiRoot}
<Directory ${mediawikiRoot}>
@ -205,6 +220,17 @@ in
'';
};
enableUploads = mkOption {
default = false;
description = "Whether to enable file uploads.";
};
uploadDir = mkOption {
default = throw "You must specify `uploadDir'.";
example = "/data/mediawiki-upload";
description = "The directory that stores uploaded files.";
};
extraConfig = mkOption {
default = "";
example =