Advertisement
Guest User

Untitled

a guest
Feb 27th, 2019
128
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 8.67 KB | None | 0 0
  1. # MediaWiki with MariaDB
  2. #
  3. # Access via "http://localhost:8080"
  4. # (or "http://$(docker-machine ip):8080" if using docker-machine)
  5. version: '3'
  6. services:
  7. mediawiki:
  8. image: test/mediawiki:1.32.2
  9. restart: always
  10. ports:
  11. - 8085:80
  12. links:
  13. - db
  14. external_links:
  15. - openldap
  16. volumes:
  17. - /var/www/html/images
  18. # After initial setup, download LocalSettings.php to the same directory as
  19. # this yaml and uncomment the following line and use compose to restart
  20. # the mediawiki service
  21. - ./LocalSettings.php:/var/www/html/LocalSettings.php
  22. #- ./PluggableAuth.php:/var/www/html/extensions/LDAPAuthentication2/src/PluggableAuth.php
  23. networks:
  24. - default
  25. - media_wiki_ldap
  26. db:
  27. image: mariadb
  28. restart: always
  29. volumes:
  30. - db_data:/var/lib/mysql/
  31. environment:
  32. # @see https://phabricator.wikimedia.org/source/mediawiki/browse/master/includes/DefaultSettings.php
  33. MYSQL_DATABASE: my_wiki
  34. MYSQL_USER: wikiuser
  35. MYSQL_PASSWORD: example
  36. MYSQL_RANDOM_ROOT_PASSWORD: 'yes'
  37. volumes:
  38. db_data:
  39.  
  40. networks:
  41. media_wiki_ldap:
  42. external: true
  43.  
  44.  
  45.  
  46.  
  47. FROM mediawiki:1.32
  48. MAINTAINER Ts <me@iambelmin.com>
  49.  
  50. # LDAP requirements
  51. RUN set -x; \
  52. apt-get update && \
  53. apt-get install -y libldap2-dev && \
  54. rm -rf /var/lib/apt/lists/*
  55.  
  56. # Install php ldap
  57. RUN docker-php-ext-configure ldap --with-libdir=lib/x86_64-linux-gnu/ && \
  58. docker-php-ext-install ldap
  59.  
  60. # Install LDAPAuthentication2 extension
  61. RUN EXT_DL_URL="https://extdist.wmflabs.org/dist/extensions/LDAPAuthentication2-REL1_31-8334e47.tar.gz"; \
  62. EXT_TARBALL="LDAPAuthentication2_ext.tar.gz"; \
  63. set -x; \
  64. curl -fSL "$EXT_DL_URL" -o "$EXT_TARBALL" && \
  65. tar -xf "$EXT_TARBALL" -C /var/www/html/extensions && \
  66. rm "$EXT_TARBALL"
  67.  
  68. # Install PluggableAuth extension
  69. RUN EXT_DL_URL="https://extdist.wmflabs.org/dist/extensions/PluggableAuth-REL1_32-cdeff81.tar.gz"; \
  70. EXT_TARBALL="PluggableAuth_ext.tar.gz"; \
  71. set -x; \
  72. curl -fSL "$EXT_DL_URL" -o "$EXT_TARBALL" && \
  73. tar -xf "$EXT_TARBALL" -C /var/www/html/extensions && \
  74. rm "$EXT_TARBALL"
  75.  
  76. # Install LDAPProvider extension
  77. RUN EXT_DL_URL="https://extdist.wmflabs.org/dist/extensions/LDAPProvider-REL1_31-3a30ef0.tar.gz"; \
  78. EXT_TARBALL="LDAPProvider_ext.tar.gz"; \
  79. set -x; \
  80. curl -fSL "$EXT_DL_URL" -o "$EXT_TARBALL" && \
  81. tar -xf "$EXT_TARBALL" -C /var/www/html/extensions && \
  82. rm "$EXT_TARBALL"
  83.  
  84. # Be permissive about SSL certs
  85. RUN set -x; \
  86. echo "TLS_REQCERT never" >> /etc/ldap/ldap.conf
  87.  
  88. # Be permissive about SSL certs
  89. RUN set -x; \
  90. apt-get update && \
  91. apt-get -y install iputils-ping
  92.  
  93.  
  94.  
  95.  
  96.  
  97.  
  98.  
  99.  
  100.  
  101. <?php
  102. # This file was automatically generated by the MediaWiki 1.32.0
  103. # installer. If you make manual changes, please keep track in case you
  104. # need to recreate them later.
  105. #
  106. # See includes/DefaultSettings.php for all configurable settings
  107. # and their default values, but don't forget to make changes in _this_
  108. # file, not there.
  109. #
  110. # Further documentation for configuration settings may be found at:
  111. # https://www.mediawiki.org/wiki/Manual:Configuration_settings
  112.  
  113. # Protect against web entry
  114. if ( !defined( 'MEDIAWIKI' ) ) {
  115. exit;
  116. }
  117.  
  118.  
  119. ## Uncomment this to disable output compression
  120. # $wgDisableOutputCompression = true;
  121.  
  122. $wgSitename = "EXAMPLEWIKI";
  123.  
  124. ## The URL base path to the directory containing the wiki;
  125. ## defaults for all runtime URL paths are based off of this.
  126. ## For more information on customizing the URLs
  127. ## (like /w/index.php/Page_title to /wiki/Page_title) please see:
  128. ## https://www.mediawiki.org/wiki/Manual:Short_URL
  129. $wgScriptPath = "";
  130.  
  131. ## The protocol and server name to use in fully-qualified URLs
  132. $wgServer = "http://localhost:8085";
  133.  
  134. ## The URL path to static resources (images, scripts, etc.)
  135. $wgResourceBasePath = $wgScriptPath;
  136.  
  137. ## The URL path to the logo. Make sure you change this from the default,
  138. ## or else you'll overwrite your logo when you upgrade!
  139. $wgLogo = "$wgResourceBasePath/resources/assets/wiki.png";
  140.  
  141. ## UPO means: this is also a user preference option
  142.  
  143. $wgEnableEmail = true;
  144. $wgEnableUserEmail = true; # UPO
  145.  
  146. $wgEmergencyContact = "apache@localhost";
  147. $wgPasswordSender = "apache@localhost";
  148.  
  149. $wgEnotifUserTalk = false; # UPO
  150. $wgEnotifWatchlist = false; # UPO
  151. $wgEmailAuthentication = true;
  152.  
  153. ## Database settings
  154. $wgDBtype = "mysql";
  155. $wgDBserver = "db://localhost";
  156. $wgDBname = "my_wiki";
  157. $wgDBuser = "wikiuser";
  158. $wgDBpassword = "example";
  159.  
  160. # MySQL specific settings
  161. $wgDBprefix = "";
  162.  
  163. # MySQL table options to use during installation or update
  164. $wgDBTableOptions = "ENGINE=InnoDB, DEFAULT CHARSET=binary";
  165.  
  166. ## Shared memory settings
  167. $wgMainCacheType = CACHE_ACCEL;
  168. $wgMemCachedServers = [];
  169.  
  170. ## To enable image uploads, make sure the 'images' directory
  171. ## is writable, then set this to true:
  172. $wgEnableUploads = false;
  173. $wgUseImageMagick = true;
  174. $wgImageMagickConvertCommand = "/usr/bin/convert";
  175.  
  176. # InstantCommons allows wiki to use images from https://commons.wikimedia.org
  177. $wgUseInstantCommons = false;
  178.  
  179. # Periodically send a pingback to https://www.mediawiki.org/ with basic data
  180. # about this MediaWiki instance. The Wikimedia Foundation shares this data
  181. # with MediaWiki developers to help guide future development efforts.
  182. $wgPingback = true;
  183.  
  184. ## If you use ImageMagick (or any other shell command) on a
  185. ## Linux server, this will need to be set to the name of an
  186. ## available UTF-8 locale
  187. $wgShellLocale = "C.UTF-8";
  188.  
  189. ## Set $wgCacheDirectory to a writable directory on the web server
  190. ## to make your wiki go slightly faster. The directory should not
  191. ## be publically accessible from the web.
  192. #$wgCacheDirectory = "$IP/cache";
  193.  
  194. # Site language code, should be one of the list in ./languages/data/Names.php
  195. $wgLanguageCode = "en-gb";
  196.  
  197. $wgSecretKey = "c9f0f8f76f5dfffdff8d3019ffdc03fc781f867088bd05702fccdd4850c3204b";
  198.  
  199. # Changing this will log out all existing sessions.
  200. $wgAuthenticationTokenVersion = "1";
  201.  
  202. # Site upgrade key. Must be set to a string (default provided) to turn on the
  203. # web installer while LocalSettings.php is in place
  204. $wgUpgradeKey = "908d230a976cf44c";
  205.  
  206. ## For attaching licensing metadata to pages, and displaying an
  207. ## appropriate copyright notice / icon. GNU Free Documentation
  208. ## License and Creative Commons licenses are supported so far.
  209. $wgRightsPage = ""; # Set to the title of a wiki page that describes your license/copyright
  210. $wgRightsUrl = "";
  211. $wgRightsText = "";
  212. $wgRightsIcon = "";
  213.  
  214. # Path to the GNU diff3 utility. Used for conflict resolution.
  215. $wgDiff3 = "/usr/bin/diff3";
  216.  
  217. ## Default skin: you can change the default skin. Use the internal symbolic
  218. ## names, ie 'vector', 'monobook':
  219. $wgDefaultSkin = "vector";
  220.  
  221. # Enabled skins.
  222. # The following skins were automatically enabled:
  223. wfLoadSkin( 'MonoBook' );
  224. wfLoadSkin( 'Timeless' );
  225. wfLoadSkin( 'Vector' );
  226.  
  227.  
  228. # Enabled extensions. Most of the extensions are enabled by adding
  229. # wfLoadExtensions('ExtensionName');
  230. # to LocalSettings.php. Check specific extension documentation for more details.
  231. # The following extensions were automatically enabled:
  232. wfLoadExtension( 'CiteThisPage' );
  233. wfLoadExtension( 'CodeEditor' );
  234. wfLoadExtension( 'LDAPAuthentication2' );
  235. wfLoadExtension( 'LDAPProvider' );
  236. wfLoadExtension( 'Nuke' );
  237. wfLoadExtension( 'PluggableAuth' );
  238. wfLoadExtension( 'ReplaceText' );
  239. wfLoadExtension( 'WikiEditor' );
  240.  
  241. $LDAPAuthentication2AllowLocalLogin = true;
  242. #$wgPluggableAuth_EnableLocalLogin = true;
  243.  
  244. $LDAPProviderDomainConfigProvider = function() {
  245. $config = [
  246. 'LDAP' => [
  247. 'connection' => [
  248. "server" => "openldap",
  249. "user" => "cn=admin,dc=example,dc=org",
  250. "pass" => 'ert456',
  251. "options" => [
  252. "LDAP_OPT_DEREF" => 1
  253. ],
  254. "basedn" => "dc=example,dc=org",
  255. "groupbasedn" => "dc=example,dc=org",
  256. "userbasedn" => "dc=example,dc=org",
  257. "searchattribute" => "uid",
  258. "searchstring" => "uid=USER-NAME,ou=People,dc=example,dc=org",
  259. "usernameattribute" => "uid",
  260. "realnameattribute" => "cn",
  261. "emailattribute" => "mail"
  262. ]
  263. ]
  264. ];
  265.  
  266. return new \MediaWiki\Extension\LDAPProvider\DomainConfigProvider\InlinePHPArray( $config );
  267. };
  268.  
  269. $wgGroupPermissions['*']['createaccount'] = false;
  270. $wgGroupPermissions['*']['autocreateaccount'] = true;
  271.  
  272. #$wgShowExceptionDetails = true;
  273. #$wgShowDebug = true;
  274. # End of automatically generated settings.
  275. # Add more configuration options below.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement