aboutsummaryrefslogtreecommitdiff
path: root/ansible/templates/mw
diff options
context:
space:
mode:
authorTrygve Laugstøl <trygvis@inamo.no>2018-11-05 23:18:54 +0100
committerTrygve Laugstøl <trygvis@inamo.no>2018-11-05 23:18:54 +0100
commitc25c490677bcba2c2e9fee90db10594bd43f6982 (patch)
tree23bde01f60bf0e4421f680bcd9912b5a12f5b42d /ansible/templates/mw
parentb5b7e21c8ba3c68eab9cd244602f27c21aa5f36b (diff)
downloadinfra-c25c490677bcba2c2e9fee90db10594bd43f6982.tar.gz
infra-c25c490677bcba2c2e9fee90db10594bd43f6982.tar.bz2
infra-c25c490677bcba2c2e9fee90db10594bd43f6982.tar.xz
infra-c25c490677bcba2c2e9fee90db10594bd43f6982.zip
Importing Bitraf's mediawiki
o Some improvements, reusing old backup scripts.
Diffstat (limited to 'ansible/templates/mw')
-rw-r--r--ansible/templates/mw/LocalSettings.php180
-rw-r--r--ansible/templates/mw/sites-enabled/000-default.conf60
2 files changed, 240 insertions, 0 deletions
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 @@
+<?php
+# This file was automatically generated by the MediaWiki 1.27.4
+# installer. If you make manual changes, please keep track in case you
+# need to recreate them later.
+
+# Protect against web entry
+if ( !defined( 'MEDIAWIKI' ) ) {
+ exit;
+}
+
+## Uncomment this to disable output compression
+# $wgDisableOutputCompression = true;
+
+$wgSitename = "Trygvis's notes to self";
+$wgMetaNamespace = "Project";
+
+## The URL base path to the directory containing the wiki;
+## defaults for all runtime URL paths are based off of this.
+## For more information on customizing the URLs
+## (like /w/index.php/Page_title to /wiki/Page_title) please see:
+## https://www.mediawiki.org/wiki/Manual:Short_URL
+$wgScriptPath = "/w";
+$wgArticlePath = "/wiki/$1";
+
+## The protocol and server name to use in fully-qualified URLs
+$wgServer = "https://mw.trygvis.io";
+
+## The URL path to static resources (images, scripts, etc.)
+$wgResourceBasePath = $wgScriptPath;
+
+## The URL path to the logo. Make sure you change this from the default,
+## or else you'll overwrite your logo when you upgrade!
+$wgLogo = "$wgResourceBasePath/resources/assets/wiki.png";
+
+## UPO means: this is also a user preference option
+
+$wgEnableEmail = true;
+$wgEnableUserEmail = true; # UPO
+
+$wgEmergencyContact = "postmaster@trygvis.io";
+$wgPasswordSender = "postmaster@trygvis.io";
+
+$wgEnotifUserTalk = true; # UPO
+$wgEnotifWatchlist = true; # UPO
+$wgEmailAuthentication = true;
+
+## Database settings
+$wgDBtype = "postgres";
+$wgDBserver = "{{ mediawiki__wgDBserver }}";
+$wgDBname = "{{ mediawiki__wgDBname }}";
+$wgDBuser = "{{ mediawiki__wgDBuser }}";
+$wgDBpassword = "{{ mediawiki__wgDBpassword }}";
+
+# Postgres specific settings
+$wgDBport = "5432";
+$wgDBmwschema = "public";
+
+## Shared memory settings
+$wgMainCacheType = CACHE_ANYTHING;
+$wgMemCachedServers = [];
+
+## To enable image uploads, make sure the 'images' directory
+## is writable, then set this to true:
+$wgEnableUploads = true;
+#$wgUseImageMagick = true;
+#$wgImageMagickConvertCommand = "/usr/bin/convert";
+$wgFileExtensions[] = 'pdf';
+
+# InstantCommons allows wiki to use images from https://commons.wikimedia.org
+$wgUseInstantCommons = true;
+
+## If you use ImageMagick (or any other shell command) on a
+## Linux server, this will need to be set to the name of an
+## available UTF-8 locale
+$wgShellLocale = "en_US.utf8";
+
+## Set $wgCacheDirectory to a writable directory on the web server
+## to make your wiki go slightly faster. The directory should not
+## be publically accessible from the web.
+#$wgCacheDirectory = "$IP/cache";
+
+# Site language code, should be one of the list in ./languages/data/Names.php
+$wgLanguageCode = "en";
+
+$wgSecretKey = "{{ mediawiki__wgSecretKey }}";
+
+# Changing this will log out all existing sessions.
+$wgAuthenticationTokenVersion = "1";
+
+# Site upgrade key. Must be set to a string (default provided) to turn on the
+# web installer while LocalSettings.php is in place
+$wgUpgradeKey = "{{ mediawiki__wgUpgradeKey }}";
+
+## For attaching licensing metadata to pages, and displaying an
+## appropriate copyright notice / icon. GNU Free Documentation
+## License and Creative Commons licenses are supported so far.
+$wgRightsPage = ""; # Set to the title of a wiki page that describes your license/copyright
+$wgRightsUrl = "https://creativecommons.org/publicdomain/zero/1.0/";
+$wgRightsText = "Creative Commons Zero (Public Domain)";
+$wgRightsIcon = "$wgResourceBasePath/resources/assets/licenses/cc-0.png";
+
+# Path to the GNU diff3 utility. Used for conflict resolution.
+$wgDiff3 = "/usr/bin/diff3";
+
+# The following permissions were set based on your choice in the installer
+$wgGroupPermissions['*']['createaccount'] = false;
+$wgGroupPermissions['*']['edit'] = false;
+
+## Default skin: you can change the default skin. Use the internal symbolic
+## names, ie 'vector', 'monobook':
+$wgDefaultSkin = "vector";
+
+# Enabled skins.
+# The following skins were automatically enabled:
+
+wfLoadExtension( 'Scribunto' );
+$wgScribuntoDefaultEngine = 'luastandalone';
+
+wfLoadSkin( 'MonoBook' );
+wfLoadSkin( 'Timeless' );
+wfLoadSkin( 'Vector' );
+
+wfLoadExtension( 'Cite' );
+wfLoadExtension( 'ParserFunctions' );
+
+# End of automatically generated settings.
+# Add more configuration options below.
+
+# Debian specific generated settings
+# Use system mimetypes
+$wgMimeTypeFile = '/etc/mime.types';
+# Load legacy extensions
+if ( is_file( "/etc/mediawiki-extensions/extensions.php" ) ) {
+ include "/etc/mediawiki-extensions/extensions.php";
+}
+# Add a "powered by Debian" footer icon
+$wgFooterIcons['poweredby']['debian'] = [
+ "src" => "/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
+
+<VirtualHost *:80>
+ 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
+
+<Directory /opt/mediawiki/mediawiki/>
+ Options +FollowSymLinks
+ AllowOverride All
+ <IfVersion >= 2.3>
+ Require all granted
+ </IfVersion>
+ <IfVersion < 2.3>
+ order allow,deny
+ allow from all
+ </IfVersion>
+</Directory>
+
+# some directories must be protected
+<Directory /opt/mediawiki/mediawiki/config>
+ Options -FollowSymLinks
+ AllowOverride None
+ <IfModule mod_php7.c>
+ php_admin_flag engine off
+ </IfModule>
+ <IfModule mod_php5.c>
+ php_admin_flag engine off
+ </IfModule>
+</Directory>
+<Directory /opt/mediawiki/mediawiki/images>
+ Options -FollowSymLinks
+ AllowOverride None
+ <IfModule mod_php7.c>
+ php_admin_flag engine off
+ </IfModule>
+ <IfModule mod_php5.c>
+ php_admin_flag engine off
+ </IfModule>
+</Directory>
+<Directory /opt/mediawiki/mediawiki/upload>
+ Options -FollowSymLinks
+ AllowOverride None
+ <IfModule mod_php7.c>
+ php_admin_flag engine off
+ </IfModule>
+ <IfModule mod_php5.c>
+ php_admin_flag engine off
+ </IfModule>
+</Directory>
+</VirtualHost>
+# vim: syntax=apache ts=4 sw=4 sts=4 sr noet