kristophjunge / docker-mediawiki Goto Github PK
View Code? Open in Web Editor NEWDockerized MediaWiki running under Nginx and PHP-FPM. Based on the official PHP7 image. Packaged with VisualEditor plugin and Parsoid service.
License: MIT License
Dockerized MediaWiki running under Nginx and PHP-FPM. Based on the official PHP7 image. Packaged with VisualEditor plugin and Parsoid service.
License: MIT License
Hi. Just pointing out the readme says app should be availble on localhost8080 but was changed to port 80. e424da2#diff-4ac32a78649ca5bdd8e0ba38b7006a1eR6
$ grep -i mime ./config/nginx/nginx-http.conf ./config/nginx/nginx-details.conf ./config/nginx/nginx-https.conf
$
The nginx conf doesn't, as far as I can tell, load /etc/nginx/mime.types at all. This leads to things like uploaded PDFs being returned as text/plain.
In the logs i see :
[emerg] 12#12: socket() [::]:80 failed (97: Address family not supported by protocol)
nginx: [emerg] socket() [::]:80 failed (97: Address family not supported by protocol)
Hi,
First off great image, and thanks for making this available for all of us. I did run into an issue when I tried defining some custom settings in my ExtraLocalSettings.php
. I'm loading a custom skin "Timeless" by following your directions and mounting the following 2:
-v /var/mediawiki/skins/Timeless:/var/www/mediawiki/skins/Timeless:ro
-v /var/mediawiki/ExtraLocalSettings.php:/var/www/mediawiki/ExtraLocalSettings.php:ro
My ExtraLocalSettings.php is very simple and looks like this (I also tried copying the ExtraLocalSettings.php form inside the container).
wfLoadSkin( 'Timeless' );
But when I launch the container and browse to the site, I get a blank page that displays the contents of ExtraLocalSettings.php. Any ideas?
Cloned master to a clean directory and ran docker-compose -f docker-compose.yml up
and received the following error:
E: Unable to locate package libicu52
ERROR: Service 'mediawiki_wiki' failed to build: The command '/bin/sh -c apt-get update && apt-get install -y libicu-dev g++ --no-install-recommends && docker-php-ext-install intl && apt-get install -y --auto-remove libicu52 g++ && rm -rf /var/lib/apt/lists/*' returned a non-zero code: 100
Docker engine: Docker version 18.06.1-ce, build e68fc7a
Docker compose: docker-compose version 1.22.0, build f46880fe
Thank you very munch for this project that is really easy to setup.
But in my case, I have an issue because I 'm replacing an existing instance of mediawiki and this one was accessible with an url of kind http://www.domain.com/wiki
I installed it on a server who give access to many application so I have an nginx reverse proxy in front of your project with configuration like :
location /wiki/ {
proxy_pass http://mediawiki-wiki:8080/;
}
But it does not work because with the nginx from your mediawiki setup. I get many redirection.
I tried many things by changing MEDIAWIKI_SERVER value or adding $wgArticlePath = '/wiki/$1';
but none works.
How to solve my issue and be able to use your project behind an nginx proxy with a context url : /wiki ?
Thanks a lot.
Hi,
it is not possible to start this Container, the Message gives:
Error response from daemon: containerd: container not started
Error: failed to start containers: mediawiki
journalctl -f -u docker.service gives:
May 11 18:01:11 xxxxx.com dockerd[1422]: time="2017-05-11T18:01:11.130133084+02:00" level=error msg="Handler for POST /v1.24/containers/mediawiki/start returned error: containerd: container not started"
According to another Thread (moby/moby#31437) the reason could be the Fact, that the Entrypoint Script has no Executable Bit set?
Uploads don't work if /images
is not chmod 777.
Also the /data
folder looks useless, what is it used for?
In the Dockerfile there is an issue with curl. It can sometimes timeout when getting info from https://extdist.wmflabs.org/dist/extensions/. Workaround is to add an timeout option to the curl command "-m 5" worked for me.
The Dockerfile uses a grep command with attribute "-P". this was removed from MacOS higher then 10.7. Workaround for me was to install another version of grep then the default. "brew install grep --with-default-names".
Thanks for this container!
When trying to install, I get the following error:
docker exec -i -t mediawiki /script/install.sh sebastian <password>
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/local/lib/php/extensions/no-debug-non-zts-20160303/imagick.so' - /usr/local/lib/php/extensions/no-debug-non-zts-20160303/imagick.so: cannot open shared object file: No such file or directory in Unknown on line 0
PHP 7.1.0 is installed.
Found ImageMagick: /usr/bin/convert.
Image thumbnailing will be enabled if you enable uploads.
Found the Git version control software: /usr/bin/git.
Using server URL "/".
/usr/bin/locale: Cannot set LC_CTYPE to default locale: No such file or directory
Warning: Your default directory for uploads (/var/www/mediawiki/images/) is not checked for vulnerability
to arbitrary script execution during the CLI install.
Using the intl PECL extension for Unicode normalization.
The environment has been checked.
You can install MediaWiki.
Setting up database
done
Creating tables
done
Creating database user
[c92a15dca702094194ea7e14] [no req] Error from line 560 of /var/www/mediawiki/includes/installer/MysqlInstaller.php: Call to undefined method DBQueryError::getText()
Backtrace:
#0 /var/www/mediawiki/includes/installer/Installer.php(1515): MysqlInstaller->setupUser(MysqlInstaller)
#1 /var/www/mediawiki/includes/installer/CliInstaller.php(135): Installer->performInstallation(array, array)
#2 /var/www/mediawiki/maintenance/install.php(142): CliInstaller->execute()
#3 /var/www/mediawiki/maintenance/doMaintenance.php(111): CommandLineInstaller->execute()
#4 /var/www/mediawiki/maintenance/install.php(156): require_once(string)
#5 {main}
grep: LocalSettings.php: No such file or directory
From what I can tell, install.php
fails here; as a consequence, LocalSettings.php
never gets moved back from /tmp/
to /var/www/mediawiki/
, which is why grep
fails.
I noticed that script/install.sh
passes Wiki to install.php
; shouldn't this be $MEDIAWIKI_SITENAME
instead?
I'm using the following commands to start docker containers:
#!/bin/bash
docker run --name mediawiki-mysql \
-e MYSQL_DATABASE=mediawiki \
-e MYSQL_USER=mediawiki \
-e MYSQL_PASSWORD=mediawiki \
-e MYSQL_RANDOM_ROOT_PASSWORD=1 \
-v /data/mediawiki/mysql:/var/lib/mysql \
-d mysql:5.7
docker run --name mediawiki \
--link mediawiki-mysql:mysql \
-p 8085:80 \
-e MEDIAWIKI_SERVER=http://my.server.com:8085 \
-e MEDIAWIKI_SITENAME=NameOfWiki \
-e MEDIAWIKI_LANGUAGE_CODE=de \
-e MEDIAWIKI_DB_TYPE=mysql \
-e MEDIAWIKI_DB_HOST=mediawiki-mysql \
-e MEDIAWIKI_DB_PORT=3306 \
-e MEDIAWIKI_DB_NAME=mediawiki \
-e MEDIAWIKI_DB_USER=mediawiki \
-e MEDIAWIKI_DB_PASSWORD=mediawiki \
-e MEDIAWIKI_ENABLE_UPLOADS=1 \
-v /data/mediawiki/images:/images \
-v /data/mediawiki/logo.png:/var/www/mediawiki/resources/assets/wiki.png:ro \
-d kristophjunge/mediawiki
Do you know what's going on here?
Hey, awesome container, thank you for creating this!
One thing I noticed is that many modern MediaWiki plugins and themes require the use of Composer (which is a good thing). Sadly it seems like the container does not support that.
It would be awesome if you could include some kind of mechanism to automatically install plugins specified in composer.local.json
, as this would mean that we are able to define and update dependencies externally.
Thank you! :)
Hey all,
I have a working instance of this Docker Image but the VisualEditor Extension doesn't work in my case.
I have a working Debian Stretch box with Docker CE. The box is headless so I'm using the Wiki not from localhost. Also HTTPS is enabled on the box. My DNS server provides the domain mywiki.int which is used by the wiki. The network get's accessed trough a VPN.
In my wiki the Edit button doesn't appear. Only the Edit Source button appears. VisualEditor is listed on Special:Versions as extension.
/etc/mediawiki/parsoid/config.yaml
. The API URL in this file http://localhost/w/api.php is invalid. It can't be found. When I try to curl this it doesn't exist. Also a redirection to HTTPS is done.How can I solve this problem when my wiki is reachable at https://mywiki.int and not used form localhost when HTTPS is enabled?
I would try to change the API URL in config.yaml to the correct one and try to figure out what's wrong with the port.
Does someone has a solution for this?
Best Regards
When I build your dockerfile I get an error :
Package php-pear is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
E: Package 'php-pear' has no installation candidate
Short question: How much memory does the the container use in average.
I extended the image with composer und the chameloen skin and now it uses about 380 MB of RAM.
Have you encountered similar numbers?
Known issues
- Sessions are stored in memory via APC and will be lost after container stop.
What about using $wgSessionCacheType = CACHE_DB;
in LocalSettings.php
? According to the docs, this should save session tokens in Database and database should be persistent and survive a reboot.
I tested it with ExtraLocalSettings.php
and it seems to work. I couldn't verify it by 100% (it's 3am).
FB to your image: Keep up the good work! This docker image is absolutely high quality! ๐
Thanks
Hi,
when i follow your documentation on DockerHub, i get an issue when i run the install script.
I get the error: "Cannot access the database: Access denied for user 'wikiuser'@'172.17.0.6' (using password: YES) (mysql-server). Check the host, username and password and try again."
What can i do to solve the issue?
Many thanks for your answers
I installed this image/docker on my Synology NAS. It's working and I even managed to upload an image to a wiki page using drag & drop.
Then I tried to upload PDF files, too, and failed.
According to MediaWiki manual, the default list of allowed extensions is 'png', 'gif', 'jpg', 'jpeg', 'webp' and all others are blocked. To add more extensions, this container provides the environment variable MEDIAWIKI_FILE_EXTENSIONS.
Although I set the environment variable
MEDIAWIKI_FILE_EXTENSIONS=png,gif,jpg,jpeg,doc,xls,mpp,pdf,ppt,tiff,bmp,docx,xlsx,pptx,ps,odt,ods,odp,odg
I get an error when uploading a PDF file (see screenshot). Why is this and is this a image/container issue or rather a MediaWiki issue?
The documentation is incomplete and does not finish with a working Docker based MediaWiki install.
The trouble starts with the way the environment variables are presented. It is step by step with editable commands then ends into -e for this and -e for that with no presentation on how to use these. This should be corrected to show methods on how to incorporate the various additional -e variables. This should be made plain for newer Docker users who are not veterans of the system.
The strategy appears to be to take multiple attempts at docker -run, delete if you get it wrong, and there is no way to edit the -e after the first docker -run.
Hey, thanks for posting this code on github! I am hoping to use it to update an older wiki that we use for a game. When I was going through your implementation, I came across a few things that I might recommend.
docker-compose.override.yml
Dockerfile
${DB_HOST}
as an environment variable that can be changed easilyLocalSettings.php
that are not relevant to the build and place in ExtraLocalSettings.php
$wgGroupPermissions['*']['createaccount'] = false;
and etc...Thank you for your time,
Rev
Hi there,
I'm new to Docker. Additionally, I'm running Docker on a Synology NAS. This might be a different flavour as on regular Linux systems. So please beware.
After following the instructions, I got the container up and running. The visual editor works like a charm. Awesome!
However, when I tried to upload an image, I got a strange error message: "Could not store upload in the stash (UploadStashFileException): "Error storing file in '/tmp/phpxQt4k1': Could not create directory"
I opened a shell on the running container and indeed, /images
was not accessible for user www-data
:
drwxr-xr-x 1 1024 users 0 Jan 18 12:07 images
According to /etc/passwd
, there's no user with id 1024 (www-data
is 999).
To resolve this issue in a quick&dirty manner, I set the permission of the folder to 777:
chmod 777 /images
Now uploading images works.
Any idea why the permissions might be wrong in my container?
I think I found a bug or the documentation is not correct.
It's said the default value of MEDIAWIKI_DB_TYPE is 'mysql', but thats not true. The default value in LocalSettings.php is ''. For that reason the wiki does not look for the MEDIAWIKI_DB_PREFIX envirevent variable.
# MySQL specific settings
if (getenv('MEDIAWIKI_DB_TYPE') == 'mysql') {
// Cache sessions in database
$wgSessionCacheType = CACHE_DB;
if (getenv('MEDIAWIKI_DB_PREFIX') != '') {
$wgDBprefix = getenv('MEDIAWIKI_DB_PREFIX');
}
if (getenv('MEDIAWIKI_DB_TABLE_OPTIONS') != '') {
$wgDBTableOptions = getenv('MEDIAWIKI_DB_TABLE_OPTIONS');
}
}
This is solvable by using the MEDIAWIKI_DB_TYPE variable.
The next problem I don't understand.
The installer seems to ignore the MEDIAWIKI_DB_PREFIX as well, even with MEDIAWIKI_DB_TYPE set to mysql.
I cant find the sourcecode for this. Can anybody help?
You do not update variable into nginx (client_max_body_size) when to set up environment.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.