Skip to content

Commit

Permalink
Merge branch 'b/restore-upload-urls' into 'flake'
Browse files Browse the repository at this point in the history
Restore upload URLS

See merge request haskell/haskell-wiki-configuration!2
  • Loading branch information
davean committed Dec 4, 2024
2 parents 389d9d0 + f6c6c5b commit 5c39e40
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,11 @@
};
};

config = { config, pkgs, lib, ... }: {
config = { config, pkgs, lib, ... }:
let
# Shared between wikimedia config and nginx config
uploadPath = "/wikiupload";
in {
system.stateVersion = "24.05";

networking.useDHCP = false;
Expand Down Expand Up @@ -115,6 +119,12 @@
# The createaccount group, for users who can always create accounts
$wgAvailableRights[] = 'createaccount';
$wgGroupPermissions['createaccount']['createaccount'] = true;
## Uploads
# This is used to render URLs to uploaded files.
$wgUploadPath = '${uploadPath}';
'';

extensions = {
Expand Down Expand Up @@ -185,9 +195,9 @@
fastcgi_index index.php;
fastcgi_pass unix:${config.services.phpfpm.pools.mediawiki.socket};
'';
"/images/".alias = withTrailingSlash config.services.mediawiki.uploadsDir;
"${uploadPath}/".alias = withTrailingSlash config.services.mediawiki.uploadsDir;
# Deny access to deleted images folder
"/images/deleted".extraConfig = ''
"${uploadPath}/deleted".extraConfig = ''
deny all;
'';
# MediaWiki assets (usually images)
Expand Down

0 comments on commit 5c39e40

Please sign in to comment.