Initial Commit, working wiki with VisualEditor

This commit is contained in:
Adam Goldsmith 2019-08-16 13:55:44 -04:00
commit 9157bcc9bd
5 changed files with 275 additions and 0 deletions

3
.gitignore vendored Normal file
View File

@ -0,0 +1,3 @@
/images/
/secrets.php
/.env

38
Dockerfile Normal file
View File

@ -0,0 +1,38 @@
FROM mediawiki:latest
RUN apt-get update \
&& apt-get install -y libldap2-dev git zip \
&& rm -rf /var/lib/apt/lists/* \
&& docker-php-ext-install -j$(nproc) ldap
RUN git clone --depth 1 -b $MEDIAWIKI_BRANCH \
https://gerrit.wikimedia.org/r/mediawiki/extensions/Scribunto \
/var/www/html/extensions/Scribunto \
&& chmod a+x /var/www/html/extensions/Scribunto/includes/engines/LuaStandalone/binaries/lua*_linux_*/lua
RUN git clone --depth 1 -b $MEDIAWIKI_BRANCH \
https://gerrit.wikimedia.org/r/mediawiki/extensions/LdapAuthentication \
/var/www/html/extensions/LdapAuthentication
RUN git clone --depth 1 -b $MEDIAWIKI_BRANCH \
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor.git \
/var/www/html/extensions/VisualEditor \
&& cd /var/www/html/extensions/VisualEditor \
&& git submodule update --depth 1 --init
RUN git clone --depth 1 -b $MEDIAWIKI_BRANCH \
https://gerrit.wikimedia.org/r/mediawiki/extensions/MobileFrontend \
/var/www/html/extensions/MobileFrontend
RUN git clone --depth 1 \
https://github.com/p12tic/NativeSvgHandler.git \
/var/www/html/extensions/NativeSvgHandler
RUN git clone --depth 1 -b $MEDIAWIKI_BRANCH \
https://gerrit.wikimedia.org/r/mediawiki/extensions/CodeMirror \
/var/www/html/extensions/CodeMirror
COPY composer.local.json /var/www/html/
COPY --from=composer:latest /usr/bin/composer /usr/bin/composer
RUN cd /var/www/html/ && composer update --no-dev

199
LocalSettings.php Normal file
View File

@ -0,0 +1,199 @@
<?php
# This file was automatically generated by the MediaWiki 1.30.0
# installer. If you make manual changes, please keep track in case you
# need to recreate them later.
#
# See includes/DefaultSettings.php for all configurable settings
# and their default values, but don't forget to make changes in _this_
# file, not there.
#
# Further documentation for configuration settings may be found at:
# https://www.mediawiki.org/wiki/Manual:Configuration_settings
# Protect against web entry
if ( !defined( 'MEDIAWIKI' ) ) {
exit;
}
# store passwords/sensitive data here
$secrets = require('secrets.php');
## Uncomment this to disable output compression
# $wgDisableOutputCompression = true;
$wgSitename = "Claremont MakerSpace";
$wgMetaNamespace = "Claremont_MakerSpace";
## 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 = "";
$wgScriptExtension = ".php";
$wgArticlePath = "/wiki/$1";
$wgUsePathInfo = true;
## The protocol and server name to use in fully-qualified URLs
$wgServer = "http://localhost:8080";
## 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 = "images/CMS-Logo-BY-v4_alt-small.png";
## UPO means: this is also a user preference option
$wgEnableEmail = true;
$wgEnableUserEmail = true; # UPO
$wgEmergencyContact = "apache@claremontmakerspace.org";
$wgPasswordSender = "apache@claremontmakerspace.org";
$wgEnotifUserTalk = true; # UPO
$wgEnotifWatchlist = false; # UPO
$wgEmailAuthentication = true;
## Database settings
$wgDBtype = "mysql";
$wgDBserver = "database";
$wgDBname = "mediawiki";
$wgDBuser = "mediawiki";
$wgDBpassword = $secrets['wgDBpassword'];
# MySQL specific settings
$wgDBprefix = "";
# MySQL table options to use during installation or update
$wgDBTableOptions = "ENGINE=InnoDB, DEFAULT CHARSET=binary";
# Experimental charset support for MySQL 5.0.
$wgDBmysql5 = false;
## Shared memory settings
$wgMainCacheType = CACHE_NONE;
$wgMemCachedServers = [];
## To enable image uploads, make sure the 'images' directory
## is writable, then set this to true:
$wgEnableUploads = true;
$wgFileExtensions = array_merge( $wgFileExtensions, array( 'pdf', 'svg' ));
$wgUseImageMagick = true;
$wgImageMagickConvertCommand = "/usr/bin/convert";
$wgGenerateThumbnailOnParse = false;
# InstantCommons allows wiki to use images from https://commons.wikimedia.org
$wgUseInstantCommons = false;
# Periodically send a pingback to https://www.mediawiki.org/ with basic data
# about this MediaWiki instance. The Wikimedia Foundation shares this data
# with MediaWiki developers to help guide future development efforts.
$wgPingback = false;
## 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 = $secrets['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 = $secrets['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/licenses/by-sa/4.0/";
$wgRightsText = "Creative Commons Attribution-ShareAlike";
$wgRightsIcon = "$wgResourceBasePath/resources/assets/licenses/cc-by-sa.png";
# Path to the GNU diff3 utility. Used for conflict resolution.
$wgDiff3 = "/usr/bin/diff3";
# Global Permissions
$wgGroupPermissions['*']['createaccount'] = false;
$wgGroupPermissions['*']['autocreateaccount'] = true;
$wgGroupPermissions['*']['edit'] = false;
## Default skin: you can change the default skin. Use the internal symbolic
## names, ie 'vector', 'monobook':
$wgDefaultSkin = "Timeless";
# Enabled skins.
# The following skins were automatically enabled:
wfLoadSkin( 'MonoBook' );
wfLoadSkin( 'Vector' );
wfLoadSkin( 'Timeless' );
# End of automatically generated settings.
# Add more configuration options below.
# Semantic MediaWiki Extension
# require_once "$IP/extensions/SemanticMediaWiki/SemanticMediaWiki.php";
enableSemantics( 'claremontmakerspace.org' );
$smwgPDefaultType = '_txt';
$smwgEnabledQueryDependencyLinksStore = true;
wfLoadExtension( 'WikiEditor' );
wfLoadExtension( 'CodeEditor' );
$wgDefaultUserOptions['usebetatoolbar'] = 1; // user option provided by WikiEditor extension
wfLoadExtension( 'CodeMirror' );
wfLoadExtension( 'ReplaceText' );
#wfLoadExtension( 'UserMerge' );
#$wgGroupPermissions['bureaucrat']['usermerge'] = true;
require_once "$IP/extensions/NativeSvgHandler/NativeSvgHandler.php";
wfLoadExtension( 'Scribunto' );
$wgScribuntoDefaultEngine = 'luastandalone';
$wgScribuntoUseCodeEditor = "true";
# LDAP
require_once ('extensions/LdapAuthentication/LdapAuthentication.php');
$wgAuth = new LdapAuthenticationPlugin();
$wgLDAPDomainNames = array( 'CMS' );
$wgLDAPServerNames = array( 'CMS' => 'self-service.claremontmakerspace.org' );
$wgLDAPPort = array( 'CMS' => 7389 );
$wgLDAPEncryptionType = array( 'CMS' => 'clear' );
$wgLDAPSearchStrings = array(
'CMS' => 'uid=USER-NAME,cn=users,dc=sawtooth,dc=claremontmakerspace,dc=org' );
# LDAP proxy bind
// $wgLDAPProxyAgent = array( 'CMS' => 'cn=LDAPSearch,cn=users,dc=sawtooth,dc=claremontmakerspace,dc=org' );
// $wgLDAPProxyAgentPassword = array( 'CMS' => '' );
// $wgLDAPSearchAttributes = array( 'CMS' => 'uid' );
// $wgLDAPBaseDNs = array( 'CMS' => 'dc=claremontmakerspace,dc=org' );
# To pull e-mail address from LDAP
$wgLDAPPreferences = array( 'CMS' => array( 'email' => 'mail'));
$wgShowExceptionDetails = true;
wfLoadExtension( 'VisualEditor' );
$wgDefaultUserOptions['visualeditor-enable'] = 1;
$wgDefaultUserOptions['visualeditor-editor'] = "visualeditor";
# Don't allow users to disable it
//$wgHiddenPrefs[] = 'visualeditor-enable';
# OPTIONAL: Enable VisualEditor's experimental code features
#$wgDefaultUserOptions['visualeditor-enable-experimental'] = 1;
$wgVirtualRestConfig['modules']['parsoid'] = array(
'url' => 'http://parsoid:8000',
'domain' => 'claremontmakerspace',
);

8
composer.local.json Normal file
View File

@ -0,0 +1,8 @@
{
"require": {
"mediawiki/semantic-media-wiki": "^3.0",
"mediawiki/semantic-scribunto": "^2.0",
"mediawiki/semantic-result-formats": "^3.0",
"mediawiki/data-transfer": "^1.0"
}
}

27
stack.yml Normal file
View File

@ -0,0 +1,27 @@
version: '3'
services:
mediawiki:
build: .
depends_on:
- database
restart: always
ports:
- 8080:80
volumes:
- ./images:/var/www/html/images
- ./LocalSettings.php:/var/www/html/LocalSettings.php:ro
- ./secrets.php:/var/www/html/secrets.php:ro
database:
image: mariadb
restart: always
env_file: .env
environment:
MYSQL_DATABASE: mediawiki
#MYSQL_USER and MYSQL_PASSWORD in .env
MYSQL_RANDOM_ROOT_PASSWORD: 'yes'
parsoid:
image: thenets/parsoid
restart: always
environment:
PARSOID_DOMAIN_claremontmakerspace: http://mediawiki/api.php
PARSOID_STRICT_SSL: 'false'