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:
parent
0887471e4e
commit
ec16a59845
1 changed files with 26 additions and 0 deletions
|
@ -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 =
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue