Giter Club home page Giter Club logo

mediawiki-docker's Issues

Mediawiki listening port needs to be specified on the command line

Currently, and following the doc, the nginx listen on 80 within the Docker put is rooted to 8080 outside the docker. The problem of this is that any redirection is broken, because redirection are created on the fly assuming port 80, so people get a wrong redirection. For example, it you type http://localhost:8080/ in your browser, you will be redirected to http://localhost:80/wiki/ and you should get http://localhost:8080/wiki/

www.kiwix.org need additional extensions

$ grep "LANG"  LocalSettings.*
LocalSettings.custom.php:$LANG_EXT = "$IP/extensions/";
LocalSettings.custom.php:require_once( "$LANG_EXT/Babel/Babel.php" );
LocalSettings.custom.php:require_once( "$LANG_EXT/cldr/cldr.php" );
LocalSettings.custom.php:require_once( "$LANG_EXT/CleanChanges/CleanChanges.php" );
LocalSettings.custom.php:require_once( "$LANG_EXT/LocalisationUpdate/LocalisationUpdate.php" );
LocalSettings.custom.php:require_once( "$LANG_EXT/Translate/Translate.php" );
LocalSettings.custom.php:require_once( "$LANG_EXT/UniversalLanguageSelector/UniversalLanguageSelector.php" );

Broken Special:Upload link in the sidebar

The link in the sidebar:

https://mediawiki.openzim.org/wiki/Special:Upload

fails

But:

https://mediawiki.openzim.org/index.php?title=Special:Upload

works

There is a problem I guess in the reverse proxy configuration.

A few remarks about that:

  • Using Apache is OK but quite overkill for just a reverse proxy. Nginx would be more appropriate, I think this is what was used in WikiFundi 1.0
  • To avoid collisions on the / level (for example if you want to setup something like /favicon.png, Wikipedia has moved the Mediawiki on the w/ and `wiki/ paths I would recommend to stick to that configuration. I think WikiFundi was also configured that way.
  • Doing so and reuse the Nginx configuration like in WikiFundi would avoid all these problem.

[Question] Where do I put custom skins?

Very new to this.

I want to install a custom skin and have updated the localsettings.custom.php but where do I upload the skin files to?
Do I need to mount a different volume for this?

Mysql compatible backup solution

Improve the export data script we already have to:

  • export all the data even if MySQL is used
  • Allow to put a password to the export data URL to secure it. A password which would be set as a environment variable to the docker container

Use nginx with phpfpm (instead of Apache)

Here is an example of virtualhost configuration

server {
  listen 443 ssl;
  server_name wiki.kiwix.org;

  # SSL
  ssl_certificate /etc/letsencrypt/live/wiki.kiwix.org/fullchain.pem; # managed by Certbot
  ssl_certificate_key /etc/letsencrypt/live/wiki.kiwix.org/privkey.pem; # managed by Certbot
  include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
  ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot

#  access_log off;

  proxy_buffering on;
  proxy_cache nginx_cache;
  proxy_cache_min_uses 2;

  proxy_connect_timeout 5;
  proxy_send_timeout 90;
  proxy_read_timeout 600;
  
  client_max_body_size 0;

  set_real_ip_from 127.0.0.1;
  set_real_ip_from 88.190.13.50;
  real_ip_header X-Forwarded-For;

  location /w/images/ {
    alias /var/www/www.kiwix.org/w/images/;
    expires max;
  }

  location /w/skins/ {
    alias /var/www/www.kiwix.org/w/skins/;
    expires max;
  }

  location /logo.png {
    alias /var/www/www.kiwix.org/logo.png;
    expires max;
  }

  location /favicon.ico {
    alias /var/www/www.kiwix.org/favicon.ico;
    expires max;
  }

  location /robots.txt {
    alias /var/www/www.kiwix.org/robots.txt;
    expires max;
  }

  location /library.xml {
    return 301 $scheme://download.kiwix.org/library$request_uri;
  }
  
  location / {
    proxy_set_header X-Real-IP  $remote_addr;
    proxy_set_header X-Forwarded-For $remote_addr;
    proxy_pass http://localhost:82;
    proxy_set_header Host $host;
  }
}

Restore Mailgun extension

With 1.36.1 upgrade, Mailgun extension had to be disabled because one of its dependency (Guzzle) was conflicting with Mediawiki which also depends on it.

The problem is that both MW and MailGun bundle it separately but the Mailgun version is found by MW and attempted to use. The two different versions have a different API and this crashes every webpage to be displayed.

This looks like a problem that would commonly arise so there are probably solutions for this. Needs to be looked into.

Upstream Ticket I guess: https://phabricator.wikimedia.org/T263748

Sample Error:

MediaWiki internal error.

Original exception: [65f52eb171cb6c6e697e9ed8] /wiki/Special:MyLanguage/Main_Page Error: Call to undefined method GuzzleHttp\Utils::chooseHandler()
Backtrace:
from /var/www/html/w/vendor/guzzlehttp/guzzle/src/functions.php(61)
#0 /var/www/html/w/extensions/Mailgun/vendor/guzzlehttp/guzzle/src/HandlerStack.php(42): GuzzleHttp\choose_handler()
#1 /var/www/html/w/includes/http/GuzzleHttpRequest.php(164): GuzzleHttp\HandlerStack::create(NULL)
#2 /var/www/html/w/includes/filerepo/ForeignAPIRepo.php(531): GuzzleHttpRequest->execute()
#3 /var/www/html/w/includes/filerepo/ForeignAPIRepo.php(575): ForeignAPIRepo::httpGet(string, string, array, NULL)
#4 /var/www/html/w/includes/libs/objectcache/wancache/WANObjectCache.php(1707): ForeignAPIRepo->{closure}(boolean, integer, array, NULL, array)
#5 /var/www/html/w/includes/libs/objectcache/wancache/WANObjectCache.php(1539): WANObjectCache->fetchOrRegenerate(string, integer, Closure, array, array)
#6 /var/www/html/w/includes/filerepo/ForeignAPIRepo.php(585): WANObjectCache->getWithSetCallback(string, integer, Closure, array)
#7 /var/www/html/w/includes/filerepo/ForeignAPIRepo.php(199): ForeignAPIRepo->httpGetCached(string, array)
#8 /var/www/html/w/includes/filerepo/file/ForeignAPIFile.php(65): ForeignAPIRepo->fetchImageQuery(array)
#9 /var/www/html/w/includes/filerepo/FileRepo.php(431): ForeignAPIFile::newFromTitle(Title, ForeignAPIRepo)
#10 /var/www/html/w/includes/filerepo/ForeignAPIRepo.php(115): FileRepo->newFile(Title, boolean)
#11 /var/www/html/w/includes/filerepo/FileRepo.php(471): ForeignAPIRepo->newFile(Title)
#12 /var/www/html/w/includes/filerepo/RepoGroup.php(161): FileRepo->findFile(Title, array)
#13 /var/www/html/w/includes/BadFileLookup.php(71): RepoGroup->findFile(Title)
#14 /var/www/html/w/includes/parser/Parser.php(2616): MediaWiki\BadFileLookup->isBadFile(string, Title)
#15 /var/www/html/w/includes/parser/Parser.php(2379): Parser->handleInternalLinks2(string)
#16 /var/www/html/w/includes/parser/Parser.php(1578): Parser->handleInternalLinks(string)
#17 /var/www/html/w/includes/parser/Parser.php(639): Parser->internalParse(string)
#18 /var/www/html/w/includes/content/WikitextContent.php(375): Parser->parse(string, Title, ParserOptions, boolean, boolean, integer)
#19 /var/www/html/w/includes/content/AbstractContent.php(591): WikitextContent->fillParserOutput(Title, integer, ParserOptions, boolean, ParserOutput)
#20 /var/www/html/w/includes/Revision/RenderedRevision.php(263): AbstractContent->getParserOutput(Title, integer, ParserOptions, boolean)
#21 /var/www/html/w/includes/Revision/RenderedRevision.php(235): MediaWiki\Revision\RenderedRevision->getSlotParserOutputUncached(WikitextContent, boolean)
#22 /var/www/html/w/includes/Revision/RevisionRenderer.php(217): MediaWiki\Revision\RenderedRevision->getSlotParserOutput(string, array)
#23 /var/www/html/w/includes/Revision/RevisionRenderer.php(154): MediaWiki\Revision\RevisionRenderer->combineSlotOutput(MediaWiki\Revision\RenderedRevision, array)
#24 [internal function]: MediaWiki\Revision\RevisionRenderer->MediaWiki\Revision\{closure}(MediaWiki\Revision\RenderedRevision, array)
#25 /var/www/html/w/includes/Revision/RenderedRevision.php(197): call_user_func(Closure, MediaWiki\Revision\RenderedRevision, array)
#26 /var/www/html/w/includes/poolcounter/PoolWorkArticleView.php(137): MediaWiki\Revision\RenderedRevision->getRevisionParserOutput()
#27 /var/www/html/w/includes/poolcounter/PoolCounterWork.php(162): PoolWorkArticleView->doWork()
#28 /var/www/html/w/includes/page/ParserOutputAccess.php(281): PoolCounterWork->execute()
#29 /var/www/html/w/includes/page/Article.php(746): MediaWiki\Page\ParserOutputAccess->getParserOutput(WikiPage, ParserOptions, MediaWiki\Revision\RevisionStoreRecord, integer)
#30 /var/www/html/w/includes/page/Article.php(561): Article->generateContentOutput(User, ParserOptions, integer, OutputPage, array)
#31 /var/www/html/w/includes/actions/ViewAction.php(74): Article->view()
#32 /var/www/html/w/includes/MediaWiki.php(531): ViewAction->show()
#33 /var/www/html/w/includes/MediaWiki.php(315): MediaWiki->performAction(Article, Title)
#34 /var/www/html/w/includes/MediaWiki.php(913): MediaWiki->performRequest()
#35 /var/www/html/w/includes/MediaWiki.php(546): MediaWiki->main()
#36 /var/www/html/w/index.php(53): MediaWiki->run()
#37 /var/www/html/w/index.php(46): wfIndexMain()
#38 {main}

Exception caught inside exception handler: [65f52eb171cb6c6e697e9ed8] /wiki/Special:MyLanguage/Main_Page Error: Call to undefined method GuzzleHttp\Utils::chooseHandler()
Backtrace:
from /var/www/html/w/vendor/guzzlehttp/guzzle/src/functions.php(61)
#0 /var/www/html/w/extensions/Mailgun/vendor/guzzlehttp/guzzle/src/HandlerStack.php(42): GuzzleHttp\choose_handler()
#1 /var/www/html/w/includes/http/GuzzleHttpRequest.php(164): GuzzleHttp\HandlerStack::create(NULL)
#2 /var/www/html/w/includes/filerepo/ForeignAPIRepo.php(531): GuzzleHttpRequest->execute()
#3 /var/www/html/w/includes/filerepo/ForeignAPIRepo.php(575): ForeignAPIRepo::httpGet(string, string, array, NULL)
#4 /var/www/html/w/includes/libs/objectcache/wancache/WANObjectCache.php(1707): ForeignAPIRepo->{closure}(boolean, integer, array, NULL, array)
#5 /var/www/html/w/includes/libs/objectcache/wancache/WANObjectCache.php(1539): WANObjectCache->fetchOrRegenerate(string, integer, Closure, array, array)
#6 /var/www/html/w/includes/filerepo/ForeignAPIRepo.php(585): WANObjectCache->getWithSetCallback(string, integer, Closure, array)
#7 /var/www/html/w/includes/filerepo/ForeignAPIRepo.php(199): ForeignAPIRepo->httpGetCached(string, array)
#8 /var/www/html/w/includes/filerepo/file/ForeignAPIFile.php(65): ForeignAPIRepo->fetchImageQuery(array)
#9 /var/www/html/w/includes/filerepo/FileRepo.php(431): ForeignAPIFile::newFromTitle(Title, ForeignAPIRepo)
#10 /var/www/html/w/includes/filerepo/ForeignAPIRepo.php(115): FileRepo->newFile(Title, boolean)
#11 /var/www/html/w/includes/filerepo/FileRepo.php(471): ForeignAPIRepo->newFile(Title)
#12 /var/www/html/w/includes/filerepo/RepoGroup.php(161): FileRepo->findFile(Title, array)
#13 /var/www/html/w/includes/BadFileLookup.php(71): RepoGroup->findFile(Title)
#14 /var/www/html/w/includes/parser/Parser.php(2616): MediaWiki\BadFileLookup->isBadFile(string, Title)
#15 /var/www/html/w/includes/parser/Parser.php(2379): Parser->handleInternalLinks2(string)
#16 /var/www/html/w/includes/parser/Parser.php(1578): Parser->handleInternalLinks(string)
#17 /var/www/html/w/includes/parser/Parser.php(639): Parser->internalParse(string)
#18 /var/www/html/w/includes/OutputPage.php(2115): Parser->parse(string, Title, ParserOptions, boolean, boolean, integer)
#19 /var/www/html/w/includes/OutputPage.php(2065): OutputPage->parseInternal(string, Title, boolean, boolean)
#20 /var/www/html/w/includes/skins/Skin.php(2035): OutputPage->parseAsInterface(string)
#21 /var/www/html/w/includes/libs/objectcache/wancache/WANObjectCache.php(1707): Skin->{closure}(boolean, integer, array, NULL, array)
#22 /var/www/html/w/includes/libs/objectcache/wancache/WANObjectCache.php(1539): WANObjectCache->fetchOrRegenerate(string, integer, Closure, array, array)
#23 /var/www/html/w/includes/skins/Skin.php(2036): WANObjectCache->getWithSetCallback(string, integer, Closure)
#24 /var/www/html/w/includes/skins/Skin.php(2063): Skin->getCachedNotice(string)
#25 /var/www/html/w/includes/skins/SkinMustache.php(180): Skin->getSiteNotice()
#26 /var/www/html/w/skins/Vector/includes/SkinVector.php(177): SkinMustache->getTemplateData()
#27 /var/www/html/w/includes/skins/SkinMustache.php(136): SkinVector->getTemplateData()
#28 /var/www/html/w/includes/skins/SkinTemplate.php(146): SkinMustache->generateHTML()
#29 /var/www/html/w/includes/OutputPage.php(2634): SkinTemplate->outputPage()
#30 /var/www/html/w/includes/exception/MWExceptionRenderer.php(147): OutputPage->output()
#31 /var/www/html/w/includes/exception/MWExceptionRenderer.php(66): MWExceptionRenderer::reportHTML(Error)
#32 /var/www/html/w/includes/exception/MWExceptionHandler.php(106): MWExceptionRenderer::output(Error, integer)
#33 /var/www/html/w/includes/exception/MWExceptionHandler.php(185): MWExceptionHandler::report(Error)
#34 /var/www/html/w/includes/MediaWiki.php(568): MWExceptionHandler::handleException(Error, string)
#35 /var/www/html/w/index.php(53): MediaWiki->run()
#36 /var/www/html/w/index.php(46): wfIndexMain()
#37 {main}

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.