From c25c490677bcba2c2e9fee90db10594bd43f6982 Mon Sep 17 00:00:00 2001 From: Trygve Laugstøl Date: Mon, 5 Nov 2018 23:18:54 +0100 Subject: Importing Bitraf's mediawiki o Some improvements, reusing old backup scripts. --- ansible/templates/mw/LocalSettings.php | 180 +++++++++++++++++++++ .../templates/mw/sites-enabled/000-default.conf | 60 +++++++ 2 files changed, 240 insertions(+) create mode 100644 ansible/templates/mw/LocalSettings.php create mode 100644 ansible/templates/mw/sites-enabled/000-default.conf (limited to 'ansible/templates/mw') diff --git a/ansible/templates/mw/LocalSettings.php b/ansible/templates/mw/LocalSettings.php new file mode 100644 index 0000000..91ded62 --- /dev/null +++ b/ansible/templates/mw/LocalSettings.php @@ -0,0 +1,180 @@ + "/w/resources/assets/debian/poweredby_debian_1x.png", + "url" => "https://www.debian.org/", + "alt" => "Powered by Debian", + "srcset" => + "/w/resources/assets/debian/poweredby_debian_1_5x.png 1.5x, " . + "/w/resources/assets/debian/poweredby_debian_2x.png 2x", +]; +# End Debian specific generated settings +# Add more configuration options below. + +$wgUseCategoryBrowser = true; + +// Define constants for my additional namespaces. +define("NS_CHIP", 3000); // This MUST be even. +define("NS_CHIP_TALK", 3001); // This MUST be the following odd integer. +define("NS_BOARD", 3002); // This MUST be even. +define("NS_BOARD_TALK", 3003); // This MUST be the following odd integer. + +enableSemantics( 'https://mw.trygvis.io/wiki/', true ); + +$smwgShowFactbox = SMW_FACTBOX_NONEMPTY; + +// Add "Chip" namespace +$wgExtraNamespaces[NS_CHIP] = "Chip"; +$wgExtraNamespaces[NS_CHIP_TALK] = "Chip_talk"; // Note underscores in the namespace name. +$wgContentNamespaces[] = NS_CHIP; +$smwgNamespacesWithSemanticLinks[NS_CHIP] = true; + +$wgExtraNamespaces[NS_BOARD] = "Board"; +$wgExtraNamespaces[NS_BOARD_TALK] = "Board_talk"; // Note underscores in the namespace name. +$wgContentNamespaces[] = NS_BOARD; +$smwgNamespacesWithSemanticLinks[NS_BOARD] = true; + +# https://www.mediawiki.org/wiki/Manual:$wgSMTP +$wgSMTP = array('host' => '10.0.3.1', 'auth' => false); + +wfLoadExtension( 'Interwiki' ); +// To grant sysops permissions to edit interwiki data +$wgGroupPermissions['sysop']['interwiki'] = true; +$wgEnableScaryTranscluding = true; + +$wgShowExceptionDetails = true; +$wgShowDBErrorBacktrace = true; diff --git a/ansible/templates/mw/sites-enabled/000-default.conf b/ansible/templates/mw/sites-enabled/000-default.conf new file mode 100644 index 0000000..ceed9b9 --- /dev/null +++ b/ansible/templates/mw/sites-enabled/000-default.conf @@ -0,0 +1,60 @@ +# Based on /etc/apache2/conf-available/mediawiki.conf + + + ServerName mw.trygvis.io + + ServerAdmin webmaster@trygvis.io + DocumentRoot /var/www/mw.trygvis.io + + ErrorLog ${APACHE_LOG_DIR}/error.log + CustomLog ${APACHE_LOG_DIR}/access.log combined + + Alias /w /opt/mediawiki/mediawiki + Alias /wiki /opt/mediawiki/mediawiki/index.php + RedirectMatch permanent ^/$ /wiki/Main_Page + + + Options +FollowSymLinks + AllowOverride All + = 2.3> + Require all granted + + + order allow,deny + allow from all + + + +# some directories must be protected + + Options -FollowSymLinks + AllowOverride None + + php_admin_flag engine off + + + php_admin_flag engine off + + + + Options -FollowSymLinks + AllowOverride None + + php_admin_flag engine off + + + php_admin_flag engine off + + + + Options -FollowSymLinks + AllowOverride None + + php_admin_flag engine off + + + php_admin_flag engine off + + + +# vim: syntax=apache ts=4 sw=4 sts=4 sr noet -- cgit v1.2.3