Mediawiki

From Tuxmint Wiki
Jump to navigation Jump to search

Introduction

This will show you how you can run MediaWiki on Docker.

Created by the following Youtube video and instructions. Big thank you to i12bretro STILL UNDER CONSTRUCTION

Docker Compose File

version: '1.0'
services:
  mariadb:
    image: mariadb:latest
    container_name: mariadb
    environment:
      MYSQL_ROOT_PASSWORD: {SECRET1}
      MYSQL_USER: mediawiki_rw
      MYSQL_PASSWORD: {SECRET2}
      MYSQL_DATABASE: mediawiki
    volumes:
      - /home/${USER}/docker/mariadb:/var/lib/mysql
    networks:
      - containers
    restart: always

  mediawiki:
    image: mediawiki:latest
    container_name: mediawiki
    depends_on:
      - mariadb
    ports:
      -  8080:80
    environment:
      MYSQL_USER: mediawiki_rw
      MYSQL_PASSWORD: {SECRET2}
      MYSQL_DATABASE: mediawiki
    volumes:
      - /home/${USER}/docker/mediawiki/images:/var/www/html/images
      - /home/${USER}/docker/mediawiki/LocalSettings.php:/var/www/html/LocalSettings.php
      - /home/${USER}/docker/mediawiki/logo_mediawiki.png:/var/www/html/resources/assets/logo_mediawiki.png
    networks:
      - containers
    restart: always

networks:
  containers:
    driver: bridge

Configuration

Add category to sidebar

Enter MediaWiki:Sidebar in searchbox and then edit the page:

* navigation
** mainpage|mainpage-description
** recentchanges-url|recentchanges
** randompage-url|randompage
** helppage|help-mediawiki
** Category:Linux|Linux
* SEARCH
* TOOLBOX
* LANGUAGES

Mediawiki Dump

How to save Mediawiki's easily.

Media Wiki Dump Generator

#Get dependencies
dnf install git python3

#Get Poetry for Python3 (Source: https://github.com/python-poetry/install.python-poetry.org)
curl -sSL https://install.python-poetry.org | python3 -

#Clone git repo
git clone https://github.com/mediawiki-client-tools/mediawiki-dump-generator

#Change directory and install the application
cd mediawiki-dump-generator
poetry update && poetry install && poetry build
pip3 install --force-reinstall dist/*.whl

#Use the application 

##Get the engine of the Wiki
dumpgenerator https://wiki.rueti16.com --get-wiki-engine
##Get the content of the Wiki with the images
dumpgenerator https://wiki.rueti16.com --xml --images
##Get the content of the Wiki with the help of the API
dumpgenerator --api https://wiki.rueti16.com/api.php --xml --images

##More infos @ https://github.com/mediawiki-client-tools/mediawiki-dump-generator/blob/python3/USAGE.md

Convert markdown to mediawiki

pandoc -f markdown -t mediawiki test.md -o test.wiki

index.php?title=Category:Docker