Giter Site home page Giter Site logo

kristophjunge / docker-mediawiki Goto Github PK

View Code? Open in Web Editor NEW
62.0 62.0 41.0 126 KB

Dockerized MediaWiki running under Nginx and PHP-FPM. Based on the official PHP7 image. Packaged with VisualEditor plugin and Parsoid service.

License: MIT License

PHP 71.36% Shell 22.35% Python 6.29%

docker-mediawiki's People

Contributors

sepastian avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

docker-mediawiki's Issues

mime.types not included

$ 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.

Container doesnt start

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)

Specifying ExtraLocalSettings.php results in displaying contents of extralocalsettings.php

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?

Error building with docker-compose

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

How to use different context url ?

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.

Failed to start Container

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?

"images" needs chmod 777

Uploads don't work if /images is not chmod 777.

Also the /data folder looks useless, what is it used for?

Dockerfile incompatible with MacOS > 10.7

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".

Error during install

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?

Support for composer.local.json

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! :)

VisualEditor doesn't work in special usecase

Hey all,

I have a working instance of this Docker Image but the VisualEditor Extension doesn't work in my case.

Basic Situation

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.

The problem

In my wiki the Edit button doesn't appear. Only the Edit Source button appears. VisualEditor is listed on Special:Versions as extension.

What I found out

  1. VisualEditor needs Parsoid. Parsoid is running in my Docker Container at (I think so) TCP port 9000.
  2. Parsoid needs a working MediaWiki API URL to communicate to MediaWiki. Parsoid does the conversion between HTML and WikiText.
  3. The config file of Parsoid is /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.
  4. It seems that the port 9000 isn't reachable. When I try to curl it to let Parsoid parse I get a connection refused.
  5. My Certificate is self signed. This could be a problem due to the fact that I don't know how Parsoid handels this.

What I think the problem is

  1. The not reachable port 9000
  2. The fact that the API URL in config.yaml doesn't exist.

Question

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

Build problems

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

Memory usage

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?

cache sessions in DB

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! ๐Ÿ‘

Install Problems: Cannot access the database

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

MEDIAWIKI_FILE_EXTENSIONS issue: Cannot upload PDF file

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?

image

Documentation incomplete for -e variables

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.

A few thoughts...

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.

  • Include in the README how to override the default docker-composer file by using docker-compose.override.yml
  • Adding to the previous thought, add the ability to add or override the existing Dockerfile
  • Add ${DB_HOST} as an environment variable that can be changed easily
  • Separate/Remove all variables that are in LocalSettings.php that are not relevant to the build and place in ExtraLocalSettings.php
    • For example, $wgGroupPermissions['*']['createaccount'] = false; and etc...

Thank you for your time,

Rev

/images not writable for webserver process

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?

$wgDBprefix not used during install an in wiki

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?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.