commit 9157bcc9bd5532dc1a5593847ec9cdcb6f72844c Author: Adam Goldsmith Date: Fri Aug 16 13:55:44 2019 -0400 Initial Commit, working wiki with VisualEditor diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..baa1a8b --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +/images/ +/secrets.php +/.env \ No newline at end of file diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..8b04e6e --- /dev/null +++ b/Dockerfile @@ -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 diff --git a/LocalSettings.php b/LocalSettings.php new file mode 100644 index 0000000..7f65189 --- /dev/null +++ b/LocalSettings.php @@ -0,0 +1,199 @@ + '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', +); diff --git a/composer.local.json b/composer.local.json new file mode 100644 index 0000000..aeb7c7b --- /dev/null +++ b/composer.local.json @@ -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" + } +} diff --git a/stack.yml b/stack.yml new file mode 100644 index 0000000..3175306 --- /dev/null +++ b/stack.yml @@ -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'