Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- FROM mediawiki:1.32
- MAINTAINER T <me@iambelmin.com>
- # LDAP requirements
- RUN set -x; \
- apt-get update && \
- apt-get install -y libldap2-dev && \
- rm -rf /var/lib/apt/lists/*
- # Install php ldap
- RUN docker-php-ext-configure ldap --with-libdir=lib/x86_64-linux-gnu/ && \
- docker-php-ext-install ldap
- # Install LDAPAuthentication2 extension
- RUN EXT_DL_URL="https://extdist.wmflabs.org/dist/extensions/LDAPAuthentication2-REL1_31-8334e47.tar.gz"; \
- EXT_TARBALL="LDAPAuthentication2_ext.tar.gz"; \
- set -x; \
- curl -fSL "$EXT_DL_URL" -o "$EXT_TARBALL" && \
- tar -xf "$EXT_TARBALL" -C /var/www/html/extensions && \
- rm "$EXT_TARBALL"
- # Install PluggableAuth extension
- RUN EXT_DL_URL="https://extdist.wmflabs.org/dist/extensions/PluggableAuth-REL1_32-cdeff81.tar.gz"; \
- EXT_TARBALL="PluggableAuth_ext.tar.gz"; \
- set -x; \
- curl -fSL "$EXT_DL_URL" -o "$EXT_TARBALL" && \
- tar -xf "$EXT_TARBALL" -C /var/www/html/extensions && \
- rm "$EXT_TARBALL"
- # Install LDAPProvider extension
- RUN EXT_DL_URL="https://extdist.wmflabs.org/dist/extensions/LDAPProvider-REL1_31-3a30ef0.tar.gz"; \
- EXT_TARBALL="LDAPProvider_ext.tar.gz"; \
- set -x; \
- curl -fSL "$EXT_DL_URL" -o "$EXT_TARBALL" && \
- tar -xf "$EXT_TARBALL" -C /var/www/html/extensions && \
- rm "$EXT_TARBALL"
- # Be permissive about SSL certs
- RUN set -x; \
- echo "TLS_REQCERT never" >> /etc/ldap/ldap.conf
- # Be permissive about SSL certs
- RUN set -x; \
- apt-get update && \
- apt-get -y install iputils-ping
- # Install VisualEditor extension
- RUN EXT_DL_URL="https://extdist.wmflabs.org/dist/extensions/VisualEditor-REL1_32-21d40ce.tar.gz"; \
- EXT_TARBALL="VisualEditor_ext.tar.gz"; \
- set -x; \
- curl -fSL "$EXT_DL_URL" -o "$EXT_TARBALL" && \
- tar -xf "$EXT_TARBALL" -C /var/www/html/extensions && \
- rm "$EXT_TARBALL"
- <?php
- # This file was automatically generated by the MediaWiki 1.32.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;
- }
- ## Uncomment this to disable output compression
- # $wgDisableOutputCompression = true;
- $wgSitename = "EXAMPLEWIKI";
- ## 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 = "";
- ## The protocol and server name to use in fully-qualified URLs
- $wgServer = "http://localhost:8085";
- ## 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 = "apache@localhost";
- $wgPasswordSender = "apache@localhost";
- $wgEnotifUserTalk = false; # UPO
- $wgEnotifWatchlist = false; # UPO
- $wgEmailAuthentication = true;
- ## Database settings
- $wgDBtype = "mysql";
- $wgDBserver = "db://localhost";
- $wgDBname = "my_wiki";
- $wgDBuser = "wikiuser";
- $wgDBpassword = "example";
- # MySQL specific settings
- $wgDBprefix = "";
- # MySQL table options to use during installation or update
- $wgDBTableOptions = "ENGINE=InnoDB, DEFAULT CHARSET=binary";
- ## Shared memory settings
- $wgMainCacheType = CACHE_ACCEL;
- $wgMemCachedServers = [];
- ## To enable image uploads, make sure the 'images' directory
- ## is writable, then set this to true:
- $wgEnableUploads = false;
- $wgUseImageMagick = true;
- $wgImageMagickConvertCommand = "/usr/bin/convert";
- # 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 = 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 = "C.UTF-8";
- ## 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-gb";
- $wgSecretKey = "c9f0f8f76f5dfffdff8d3019ffdc03fc781f867088bd05702fccdd4850c3204b";
- # 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 = "908d230a976cf44c";
- ## 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 = "";
- $wgRightsText = "";
- $wgRightsIcon = "";
- # Path to the GNU diff3 utility. Used for conflict resolution.
- $wgDiff3 = "/usr/bin/diff3";
- ## 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:
- wfLoadSkin( 'MonoBook' );
- wfLoadSkin( 'Timeless' );
- wfLoadSkin( 'Vector' );
- # Enabled extensions. Most of the extensions are enabled by adding
- # wfLoadExtensions('ExtensionName');
- # to LocalSettings.php. Check specific extension documentation for more details.
- # The following extensions were automatically enabled:
- wfLoadExtension( 'CiteThisPage' );
- wfLoadExtension( 'CodeEditor' );
- wfLoadExtension( 'LDAPAuthentication2' );
- wfLoadExtension( 'LDAPProvider' );
- wfLoadExtension( 'Nuke' );
- wfLoadExtension( 'PluggableAuth' );
- wfLoadExtension( 'ReplaceText' );
- wfLoadExtension( 'WikiEditor' );
- $LDAPAuthentication2AllowLocalLogin = true;
- #$wgPluggableAuth_EnableLocalLogin = true;
- $LDAPProviderDomainConfigProvider = function() {
- $config = [
- 'LDAP' => [
- 'connection' => [
- "server" => "openldap",
- "user" => "cn=admin,dc=example,dc=org",
- "pass" => 'ert456',
- "options" => [
- "LDAP_OPT_DEREF" => 1
- ],
- "basedn" => "dc=example,dc=org",
- "groupbasedn" => "dc=example,dc=org",
- "userbasedn" => "dc=example,dc=org",
- "searchattribute" => "uid",
- "searchstring" => "uid=USER-NAME,ou=People,dc=example,dc=org",
- "usernameattribute" => "uid",
- "realnameattribute" => "cn",
- "emailattribute" => "mail"
- ]
- ]
- ];
- return new \MediaWiki\Extension\LDAPProvider\DomainConfigProvider\InlinePHPArray( $config );
- };
- $wgPluggableAuth_ButtonLabelMessage = "Login";
- $wgGroupPermissions['*']['createaccount'] = false;
- $wgGroupPermissions['*']['autocreateaccount'] = true;
- $wgGroupPermissions['*']['edit'] = false;
- wfLoadExtension( 'VisualEditor' );
- // Enable by default for everybody
- $wgDefaultUserOptions['visualeditor-enable'] = 1;
- // Optional: Set VisualEditor as the default for anonymous users
- // otherwise they will have to switch to VE
- // $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 to the Parsoid instance
- // Use port 8142 if you use the Debian package
- 'url' => 'http://parsoid:8000',
- // Parsoid "domain", see below (optional)
- 'domain' => 'localhost',
- );
- #$wgShowExceptionDetails = true;
- #$wgShowDebug = true;
- # End of automatically generated settings.
- # Add more configuration options below.
- # MediaWiki with MariaDB
- #
- # Access via "http://localhost:8080"
- # (or "http://$(docker-machine ip):8080" if using docker-machine)
- version: '3'
- services:
- mediawiki:
- image: test/mediawiki:1.32.4
- restart: always
- ports:
- - 8085:80
- links:
- - db
- - parsoid
- external_links:
- - openldap
- volumes:
- - /var/www/html/images
- # After initial setup, download LocalSettings.php to the same directory as
- # this yaml and uncomment the following line and use compose to restart
- # the mediawiki service
- - ./LocalSettings.php:/var/www/html/LocalSettings.php
- #- ./PluggableAuth.php:/var/www/html/extensions/LDAPAuthentication2/src/PluggableAuth.php
- networks:
- - default
- - media_wiki_ldap
- db:
- image: mariadb
- restart: always
- volumes:
- - db_data:/var/lib/mysql/
- environment:
- # @see https://phabricator.wikimedia.org/source/mediawiki/browse/master/includes/DefaultSettings.php
- MYSQL_DATABASE: my_wiki
- MYSQL_USER: wikiuser
- MYSQL_PASSWORD: example
- MYSQL_RANDOM_ROOT_PASSWORD: 'yes'
- parsoid:
- image: thenets/parsoid:0.10.0
- restart: always
- ports:
- - 8094:8000
- environment:
- PARSOID_DOMAIN_localhost: http://mediawiki/api.php
- PARSOID_LOGGING_LEVEL: debug
- volumes:
- db_data:
- networks:
- media_wiki_ldap:
- external: true
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement