Updated the Media Wiki with the capabilitiy to upload PDFs and to shwo them inline on a page with PDFHandler and dependencies

This commit is contained in:
conradschulz 2021-04-22 14:15:13 +02:00
parent fb46ac0de5
commit c1fdacd636
3 changed files with 50 additions and 2 deletions

View file

@ -5,7 +5,7 @@
version: '3' version: '3'
services: services:
mediawiki: mediawiki:
image: mediawiki:lts build: .
restart: always restart: always
ports: ports:
- 8090:80 - 8090:80

14
dockerfile Normal file
View file

@ -0,0 +1,14 @@
FROM mediawiki:lts
RUN apt update && apt install -y xpdf
# Eventually you need tu build ghostscript from source
RUN apt install -y ghostscript
# Eventually you need tu build Imagick from source
RUN apt install -y imagemagick
# Start from the webserver neccessary or not? Test from 23.04.2021 -> not needed
#CMD ["apache2-foreground"]

View file

@ -109,10 +109,16 @@ $wgMemCachedServers = [];
## To enable image uploads, make sure the 'images' directory ## To enable image uploads, make sure the 'images' directory
## is writable, then set this to true: ## is writable, then set this to true:
$wgEnableWriteAPI = true; // Enable the API
$wgEnableUploads = true; $wgEnableUploads = true;
$wgUseImageMagick = true; $wgUseImageMagick = true;
$wgImageMagickConvertCommand = "/usr/bin/convert"; $wgImageMagickConvertCommand = "/usr/bin/convert";
$wgAllowJavaUploads = true; // Solves problem with Office 2007 and newer files (docx, xlsx, etc.)
$wgGroupPermissions['user']['upload'] = true; // Allow regular users to upload files
// Make sure that the file types you want to upload are allowed:
$wgFileExtensions = [ 'png','gif','jpg','jpeg','doc','xls','pdf','ppt','tiff','bmp','docx','xlsx','pptx' ];
# InstantCommons allows wiki to use images from https://commons.wikimedia.org # InstantCommons allows wiki to use images from https://commons.wikimedia.org
$wgUseInstantCommons = true; $wgUseInstantCommons = true;
@ -207,10 +213,38 @@ wfLoadExtension( 'WikiEditor' );
# End of automatically generated settings. # End of automatically generated settings.
# Add more configuration options below. # Add more configuration options below.
#######################################
#wfLoadExtension( 'ClipUpload' ); #wfLoadExtension( 'ClipUpload' );
require_once "$IP/extensions/ClipUpload/ClipUpload.php"; require_once "$IP/extensions/ClipUpload/ClipUpload.php";
$wgClipUP_Comment = "Discription goes here..."; $wgClipUP_Comment = "Discription goes here...";
$wgClipUP_MaxFileSize = "10000"; $wgClipUP_MaxFileSize = "10000";
# MSUpload Extension
####################
wfLoadExtension( 'MsUpload' );
# Options
$wgMSU_useDragDrop = true; // Should the drag & drop area be shown? (Not set by default)
$wgMSU_showAutoCat = true; // Files uploaded while editing a category page will be added to that category
$wgMSU_checkAutoCat = true; // Whether the checkbox for adding a category to a page is checked by default
$wgMSU_useMsLinks = false; // Insert links in Extension:MsLinks style?
$wgMSU_confirmReplace = true; // Show the "Replace file?" checkbox
$wgMSU_imgParams = 'thumb|none'; // Any image parameter(s), delimited by pipes, e.g., {width}px, left, right, center, none, border, frameless, frame, thumb etc.
# PdfHandler Extension
######################
wfLoadExtension( 'PdfHandler' );
# Options
$wgPdfProcessor = '/usr/bin/gs';
#$wgPdfPostProcessor = $wgImageMagickConvertCommand; // if defined via ImageMagick
$wgPdfPostProcessor = '/usr/bin/convert'; // if not defined via ImageMagick
$wgPdfInfo = '/usr/bin/pdfinfo';
$wgPdftoText = '/usr/bin/pdftotext';
#$wgGenerateThumbnailOnParse = true; // Could make Thumbnail creation if there are problems
# Allow External Images from my own servers
$wgAllowExternalImages = true;
$wgAllowExternalImagesFrom = [ 'http://127.0.0.1/', 'https://cloud.rd13server.de/' ]; // MediaWiki 1.14+