]> git.openstreetmap.org Git - chef.git/blob - cookbooks/mediawiki/templates/default/LocalSettings.php.erb
Move mediawiki + wiki cookbook to public repo
[chef.git] / cookbooks / mediawiki / templates / default / LocalSettings.php.erb
1 <?php
2 # DO NOT EDIT - This file is being maintained by Chef
3
4 # Protect against web entry
5 if ( !defined( 'MEDIAWIKI' ) ) {
6         exit;
7 }
8
9 ## Uncomment this to disable output compression
10 # $wgDisableOutputCompression = true;
11
12 $wgSitename      = '<%= @mediawiki[:sitename] %>';
13 $wgMetaNamespace = '<%= @mediawiki[:metanamespace] %>';
14
15
16 ## The URL base path to the directory containing the wiki;
17 ## defaults for all runtime URL paths are based off of this.
18 ## For more information on customizing the URLs
19 ## (like /w/index.php/Page_title to /wiki/Page_title) please see:
20 ## http://www.mediawiki.org/wiki/Manual:Short_URL
21 $wgScriptPath       = "/w";
22 $wgArticlePath      = '/wiki/$1';
23 $wgUsePathInfo      = true;
24 $wgScriptExtension  = ".php";
25
26 ## The protocol and server name to use in fully-qualified URLs
27 $wgServer           = "//<%= @mediawiki[:site] %>";
28 $wgInternalServer   = 'http://<%= @mediawiki[:site] %>';
29
30 <% if @mediawiki[:enable_ssl] -%>
31 $wgSecureLogin = true;
32 $wgDefaultUserOptions['prefershttps'] = 0;
33 <% end -%>
34 $wgCookieSecure = false;
35
36 ## The relative URL path to the skins directory
37 $wgStylePath        = "$wgScriptPath/skins";
38
39 ## The relative URL path to the logo.  Make sure you change this from the default,
40 ## or else you'll overwrite your logo when you upgrade!
41 $wgLogo             = "<%= @mediawiki[:logo] %>";
42
43 ## UPO means: this is also a user preference option
44
45 $wgEnableEmail      = true;
46 $wgEnableUserEmail  = true; # UPO
47
48 $wgEmergencyContact = "<%= @mediawiki[:email_contact] %>";
49 $wgPasswordSender   = "<%= @mediawiki[:email_sender] %>";
50 $wgPasswordSenderName = "<%= @mediawiki[:email_sender_name] %>"; //Replaced by MediaWiki:Emailsender in v1.23.0
51
52 $wgEnotifUserTalk      = true; # UPO
53 $wgEnotifWatchlist     = true; # UPO
54 $wgEmailAuthentication = true;
55
56 $wgEnotifUseJobQ       = true;
57
58 ## Database settings
59 $wgDBtype           = "mysql";
60 $wgDBserver         = "<%= @database_params[:host] %>";
61 $wgDBname           = "<%= @database_params[:name] %>";
62 $wgDBuser           = "<%= @database_params[:username] %>";
63 $wgDBpassword       = "<%= @database_params[:password] %>";
64
65 # MySQL specific settings
66 $wgDBprefix         = "";
67
68 # MySQL table options to use during installation or update
69 $wgDBTableOptions   = "ENGINE=InnoDB, DEFAULT CHARSET=binary";
70
71 # Experimental charset support for MySQL 5.0.
72 $wgDBmysql5 = false;
73
74 ## Shared memory settings
75 $wgMainCacheType    = CACHE_MEMCACHED;
76 $wgMemCachedServers = array('127.0.0.1:11211');
77 $wgSessionsInObjectCache = TRUE;
78
79 ## To enable image uploads, make sure the 'images' directory
80 ## is writable, then set this to true:
81 $wgEnableUploads  = true;
82 $wgUseImageMagick = true;
83 $wgImageMagickConvertCommand = "/usr/bin/convert";
84
85 $wgGenerateThumbnailOnParse = false;
86 $wgMaxImageArea = 125000000;
87 $wgMaxShellMemory = 5524000;
88 $wgMaxShellFileSize = 819200;
89 $wgMaxShellTime = 360;
90 $wgMaxShellWallClockTime = 360;
91
92 # Allow some more upload extensions
93 $wgFileExtensions[] = 'doc';
94 $wgFileExtensions[] = 'pdf';
95 $wgFileExtensions[] = 'odt';
96 $wgFileExtensions[] = 'odp';
97 $wgFileExtensions[] = 'svg';
98
99 $wgSVGConverters = array( 'rsvg' => '/usr/bin/rsvg-convert -w $width -h $height -o $output $input');
100 $wgSVGConverter = 'rsvg';
101 $wgSVGMaxSize = 2000;
102
103 # InstantCommons allows wiki to use images from http://commons.wikimedia.org
104 <% if @mediawiki[:commons] -%>
105 $wgUseInstantCommons  = true;
106 <% else -%>
107 $wgUseInstantCommons  = false;
108 <% end -%>
109
110 ## If you use ImageMagick (or any other shell command) on a
111 ## Linux server, this will need to be set to the name of an
112 ## available UTF-8 locale
113 $wgShellLocale = "en_US.utf8";
114
115 ## If you want to use image uploads under safe mode,
116 ## create the directories images/archive, images/thumb and
117 ## images/temp, and make them all writable. Then uncomment
118 ## this, if it's not already uncommented:
119 #$wgHashedUploadDirectory = false;
120
121 ## Set $wgCacheDirectory to a writable directory on the web server
122 ## to make your wiki go slightly faster. The directory should not
123 ## be publically accessible from the web.
124 #$wgCacheDirectory = "$IP/cache";
125
126 # Site language code, should be one of the list in ./languages/Names.php
127 $wgLanguageCode = "en";
128
129 $wgSecretKey = "<%= @node[:mediawiki][:sites][@name][:wgSecretKey] %>";
130
131 # Site upgrade key. Must be set to a string (default provided) to turn on the
132 # web installer while LocalSettings.php is in place
133 #$wgUpgradeKey = "6ad907e74fc65836";
134
135 ## Default skin: you can change the default skin. Use the internal symbolic
136 ## names, ie 'standard', 'nostalgia', 'cologneblue', 'monobook', 'vector':
137 $wgDefaultSkin = "<%= @mediawiki[:skin] %>";
138
139 ## For attaching licensing metadata to pages, and displaying an
140 ## appropriate copyright notice / icon. GNU Free Documentation
141 ## License and Creative Commons licenses are supported so far.
142 $wgRightsPage = "OpenStreetMap_License"; # Set to the title of a wiki page that describes your license/copyright
143 $wgRightsUrl  = "http://creativecommons.org/licenses/by-sa/2.0/";
144 $wgRightsText = "Creative Commons Attribution-ShareAlike 2.0 license";
145 $wgRightsIcon = "/cc-wiki.png";
146
147 # Path to the GNU diff3 utility. Used for conflict resolution.
148 $wgDiff3 = "/usr/bin/diff3";
149
150 $wgExternalDiffEngine = 'wikidiff2';
151
152 # Query string length limit for ResourceLoader. You should only set this if
153 # your web server has a query string length limit (then set it to that limit),
154 # or if you have suhosin.get.max_value_length set in php.ini (then set it to
155 # that value)
156 $wgResourceLoaderMaxQueryLength = -1;
157
158 # End of automatically generated settings.
159 # Add more configuration options below.
160
161 #Only Allow Signed-in users to edit
162 $wgGroupPermissions['*']['edit'] = false;
163
164 #Allow bureaucrat group access to oversight options
165 $wgGroupPermissions['bureaucrat']['hideuser'] = true;
166 $wgGroupPermissions['bureaucrat']['deletelogentry'] = true;
167 $wgGroupPermissions['bureaucrat']['deleterevision'] = true;
168 $wgGroupPermissions['bureaucrat']['suppressrevision'] = true;
169 $wgGroupPermissions['bureaucrat']['suppressionlog'] = true;
170
171 #Allow Subpages on Main Namespace
172 $wgNamespacesWithSubpages[NS_MAIN] = true;
173
174 #DNS Blacklists to use
175 $wgEnableDnsBlacklist = true;
176 $wgDnsBlacklistUrls = array( 'proxies.dnsbl.sorbs.net.', 'opm.tornevall.org.', 'xbl.spamhaus.org.' );
177
178 #Disable Hit Counter for Performance
179 $wgDisableCounters = TRUE;
180 #Disable IP in Header to avoid cache issue
181 $wgShowIPinHeader = FALSE;
182
183 #Job Runs by cron
184 $wgJobRunRate = 0;
185
186 # Allow external images from a few sites
187 $wgAllowExternalImagesFrom = array( 'http://tile.openstreetmap.org/', 'http://svenanders.openstreetmap.de/', 'http://josm.openstreetmap.de/', 'http://trac.openstreetmap.org/', 'http://rweait.dev.openstreetmap.org/' );
188
189 $wgNoFollowDomainExceptions = array( 'www.openstreetmap.org', 'josm.openstreetmap.de', 'taginfo.openstreetmap.org', 'blog.openstreetmap.org', 'wiki.osmfoundation.org' );
190
191 #FIXME - move to specific
192 $wgForceUIMsgAsContentMsg = array( 'mainpage-url', 'portal-url', 'mapfeatures-url', 'helppage' );
193
194 #FIXME - move to specific
195 $wgAllowUserJs = TRUE;
196 $wgAllowUserCss = TRUE;
197
198 #FIXME - move to specific
199 #DE
200 define('NS_LANG_DE', 200);
201 $wgExtraNamespaces[NS_LANG_DE] = 'DE';
202 $wgNamespacesWithSubpages[NS_LANG_DE] = TRUE;
203 $wgContentNamespaces[] = NS_LANG_DE;
204 define('NS_LANG_DE_TALK', 201);
205 $wgExtraNamespaces[NS_LANG_DE_TALK] = 'DE_talk';
206 $wgNamespacesWithSubpages[NS_LANG_DE_TALK] = TRUE;
207
208 #FR
209 define('NS_LANG_FR', 202);
210 $wgExtraNamespaces[NS_LANG_FR] = 'FR';
211 $wgNamespacesWithSubpages[NS_LANG_FR] = TRUE;
212 $wgContentNamespaces[] = NS_LANG_FR;
213 define('NS_LANG_FR_TALK', 203);
214 $wgExtraNamespaces[NS_LANG_FR_TALK] = 'FR_talk';
215 $wgNamespacesWithSubpages[NS_LANG_FR_TALK] = TRUE;
216
217 #ES
218 define('NS_LANG_ES', 204);
219 $wgExtraNamespaces[NS_LANG_ES] = 'ES';
220 $wgNamespacesWithSubpages[NS_LANG_ES] = TRUE;
221 $wgContentNamespaces[] = NS_LANG_ES;
222 define('NS_LANG_ES_TALK', 205);
223 $wgExtraNamespaces[NS_LANG_ES_TALK] = 'ES_talk';
224 $wgNamespacesWithSubpages[NS_LANG_ES_TALK] = TRUE;
225
226 #IT
227 define('NS_LANG_IT', 206);
228 $wgExtraNamespaces[NS_LANG_IT] = 'IT';
229 $wgNamespacesWithSubpages[NS_LANG_IT] = TRUE;
230 $wgContentNamespaces[] = NS_LANG_IT;
231 define('NS_LANG_IT_TALK', 207);
232 $wgExtraNamespaces[NS_LANG_IT_TALK] = 'IT_talk';
233 $wgNamespacesWithSubpages[NS_LANG_IT_TALK] = TRUE;
234
235 #NL
236 define('NS_LANG_NL', 208);
237 $wgExtraNamespaces[NS_LANG_NL] = 'NL';
238 $wgNamespacesWithSubpages[NS_LANG_NL] = TRUE;
239 $wgContentNamespaces[] = NS_LANG_NL;
240 define('NS_LANG_NL_TALK', 209);
241 $wgExtraNamespaces[NS_LANG_NL_TALK] = 'NL_talk';
242 $wgNamespacesWithSubpages[NS_LANG_NL_TALK] = TRUE;
243
244 #RU
245 define('NS_LANG_RU', 210);
246 $wgExtraNamespaces[NS_LANG_RU] = 'RU';
247 $wgNamespacesWithSubpages[NS_LANG_RU] = TRUE;
248 $wgContentNamespaces[] = NS_LANG_RU;
249 define('NS_LANG_RU_TALK', 211);
250 $wgExtraNamespaces[NS_LANG_RU_TALK] = 'RU_talk';
251 $wgNamespacesWithSubpages[NS_LANG_RU_TALK] = TRUE;
252
253 #JA
254 define('NS_LANG_JA', 212);
255 $wgExtraNamespaces[NS_LANG_JA] = 'JA';
256 $wgNamespacesWithSubpages[NS_LANG_JA] = TRUE;
257 $wgContentNamespaces[] = NS_LANG_JA;
258 define('NS_LANG_JA_TALK', 213);
259 $wgExtraNamespaces[NS_LANG_JA_TALK] = 'JA_talk';
260 $wgNamespacesWithSubpages[NS_LANG_JA_TALK] = TRUE;
261
262 $wgNamespacesToBeSearchedDefault[NS_LANG_DE] = TRUE;
263 $wgNamespacesToBeSearchedDefault[NS_LANG_FR] = TRUE;
264 $wgNamespacesToBeSearchedDefault[NS_LANG_ES] = TRUE;
265 $wgNamespacesToBeSearchedDefault[NS_LANG_IT] = TRUE;
266 $wgNamespacesToBeSearchedDefault[NS_LANG_NL] = TRUE;
267 $wgNamespacesToBeSearchedDefault[NS_LANG_RU] = TRUE;
268 $wgNamespacesToBeSearchedDefault[NS_LANG_JA] = TRUE;
269
270 <% if @mediawiki[:site_readonly] -%>
271 $wgReadOnly = "<%= @mediawiki[:site_readonly] %>";
272 <% end -%>
273
274 <% Dir.glob("#{@mediawiki[:directory]}/LocalSettings.d/*.php") do |file| -%>
275 <%= "require_once('#{file}');" %>
276 <% end -%>
277