Advertisement
Guest User

Untitled

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