http://67.205.187.95:8080/index.php/Wiki-militant
This project uses Docker and Docker Compose to set up a fully working Wiki based on Mediawiki.
Start by making sure you have Docker and Docker Compose installed and running on your computer or on a Linux server. This has been tested on Intel-based mac OS and on Ubuntu, not on Windows.
Run the following:
./scripts/deploy.sh
And follow instructions therein.
Once installed, you can edit and create new pages as per the MediaWiki documentation you will find online.
If you want to destroy all your data, run:
./scripts/destroy.sh
If you want to keep your data for next time, run:
docker-compose down
If you want to upload files:
This starterkit provides a single extension, EmbedVideo, but you can use its installation as a template to install your own extensions.
Extensions are installed in the Dockerfile, and you will probably need to modify that in your own fork or copy of this repo.
Custom code is stored in ./mediawiki/CustomExtension, and is loaded in ./docker-resources/load-extensions.php.
Our custom code was created based on https://www.mediawiki.org/wiki/Manual:Developing_extensions and does the following:
(https://www.mediawiki.org/wiki/Extension:CirrusSearch does the same thing but needs a connection to an ElasticSearch server, so this approach might work for simpler needs.)
Errors and notices will not be displayed on screen. To see the error logs you can run:
tail ./do-not-commit/php-log.log
If you would like to use LetsEncrypt to host your wiki on a secure HTTPS protocol:
./scripts/deploy.sh
# .env
...
VIRTUAL_HOST=example.com
LETSENCRYPT_HOST=example.com
LETSENCRYPT_EMAIL=admin@example.com
./scripts/deploy.sh
Follow the instructions in the following blog posts:
You might want to turn off OpCache during development:
docker-compose exec mediawiki /bin/bash
Once logged in run:
echo 'opcache.enable=0' >> /usr/local/etc/php/php.ini
You might also want to add these lines to the beginning of your LocalSettings.php file within your container:
apt-get update && apt-get install -y vim
vi LocalSettings.php
Then add these lines at the very beginning after the <?php
tag:
error_reporting( -1 );
ini_set( 'display_errors', 1 );
Then exit and run:
docker-compose restart mediawiki
./scripts/make-backup.sh
Backups are stored in ./do-not-commit/backups
To restore from a backup, run:
./scripts/revert-from-backup.sh
docker-compose exec database /bin/bash
...
mysql -u "$MYSQL_USER" -p"$MYSQL_PASSWORD"
...
use my_wiki
You can now perform database operations.
You are encouraged to create a backup before fiddling with the database (see above).
You must start by defining the remote environment, for example "stage", by copying the example (dummy) environment information, and putting in your real environment information. Something like:
cp ./scripts/remote/environments/example ./scripts/remote/environments/stage
Then modify the file ./scripts/remote/environments/fr/info.source.sh with the stage environment information.
Now, every time you want to fetch the data from your stage environment, you would run:
./scripts/get-database-from-remote.sh stage
You might want to delete unused backups from the ./do-not-commit/backups directory.