(no commit message)
[cyclowiki.git] / ikiwiki.setup
1 #!/usr/bin/perl
2 use vars qw/%setup_args/;
3
4 BEGIN {
5 use File::Basename;
6 use File::Spec::Functions;
7 my $srcdir = dirname($IkiWiki::config{'setupfile'});
8 my ($wiki, $wikiname, $git_repo, $destdir
9 , $global_sidebars, $search_db, $userdir,
10 , $only_committed_changes);
11 if (-x "$srcdir/Public") {
12 $wiki = '3615';
13 $wikiname = '3615';
14 $git_repo = '3615cyclo';
15 $destdir = $srcdir.'-www';
16 $global_sidebars =
17 [
18 ];
19 $search_db = # db, auth required, page having the search, pages indexed
20 [ '3615', 1
21 , '*'
22 , '*
23 and !recentchanges/*
24 and !templates
25 and !templates/*
26 and !Public/recentchanges/*
27 and !Public/templates
28 and !Public/templates/*'
29 ];
30 $userdir = '/Camarade';
31 }
32 else {
33 $wiki = 'wiki';
34 $wikiname = 'CycloWiki';
35 $git_repo = 'cyclowiki';
36 $destdir = $srcdir.'-www';
37 $global_sidebars =
38 [ #"PREVISION_DU_BENEVOLAT", "/Savoir-faire/Autogestion/Bénévolat/Prévision", "index"
39 ];
40 $search_db = # db, auth required, page having the search, pages indexed
41 [ 'wiki', 0
42 , '*'
43 , '*
44 and !recentchanges/*
45 and !templates
46 and !templates/*'
47 ];
48 $userdir = '/Camarade';
49 }
50 my $sharedir = $ENV{IKIWIKI_SHARE} ? $ENV{IKIWIKI_SHARE} : '/usr/share/ikiwiki';
51 my ($account_creation_password);
52 my ($sslcookie, $umask, $url, $urls, @wrappers);
53 if (-x "/home/www/data/cyclo-$wiki") {
54 $account_creation_password = IkiWiki::readfile(catdir(dirname($srcdir), 'etc', 'account_creation_password'));
55 $destdir = "/home/www/data/cyclo-$wiki";
56 $srcdir = ((-x "$srcdir/Public")
57 ? "/home/cyclo/var/ikiwiki/cyclo-$wiki/src"
58 : "/home/cyclo/var/ikiwiki/cyclo-3615/src/Public"
59 );
60 $sslcookie = 1;
61 $umask = 002;
62 $url = '/';
63 $urls = "https://$wiki.cyclocoop.org/";
64 $only_committed_changes = 1;
65 @wrappers =
66 ( { cgi => 1
67 , wrapper => $destdir."/cgi/ikiwiki.cgi"
68 , wrappermode => "00750"
69 }
70 # , { cgi => 1
71 # , wrapper => $destdir."/3615/cgi/ikiwiki.cgi"
72 # , wrappermode => "00750"
73 # }
74 , { post_commit => 1
75 , wrapper => "/home/git/hooks/cyclo/cyclo-$wiki/post-update.ikiwiki"
76 , wrappermode => "06751"
77 , wrapper_background_command => ""
78 }
79 );
80 }
81 else {
82 $sslcookie = 0;
83 $umask = 002;
84 $url = '/';
85 $urls = '/';
86 $only_committed_changes = 0;
87 @wrappers =
88 ( { cgi => 1
89 , wrapper => $destdir."/cgi/ikiwiki.cgi"
90 , wrappermode => "00755"
91 }
92 );
93 $account_creation_password = '';
94 }
95 print "srcdir=$srcdir\n";
96 print "destdir=$destdir\n";
97 %setup_args =
98 ( ENV => {}
99 , account_creation_password => $account_creation_password
100 , default_plugins => []
101 , add_plugins => [qw{
102 404
103 action
104 anonok
105 attachment
106 brokenlinks
107 comments
108 conditional
109 createpage
110 cutpaste
111 editdiff
112 editpage
113 events
114 favicon
115 img
116 inline
117 link
118 linkmap
119 map
120 mdwn
121 meta
122 moderatedcomments
123 orphans
124 pagecount
125 pagestats
126 pagetemplate
127 parentlinks_fixed
128 passwordauth
129 poll
130 progress
131 recentchanges
132 recentchangesdiff
133 remove
134 rename
135 repolist
136 search
137 sidebar2
138 signinedit
139 signinedit
140 table
141 tag
142 template
143 theme
144 toc
145 toggle
146 trail
147 userlist
148 }]
149 #, add_underlays => []
150 , adminemail => 'admin+'."$wiki".'@cyclocoop.org'
151 , adminuser => [qw{
152 Aline
153 Amélie
154 Andréas
155 anne-lise
156 Arnaud
157 Carmel
158 Cecile
159 Corentin
160 David
161 Galileo
162 Giampiero
163 giampiero
164 Giulia
165 Giuso
166 Greg
167 Java
168 Julien
169 julm
170 Louan
171 Marie
172 marie
173 Martin
174 Mathilde
175 Nico13
176 Nicolas
177 Pedro
178 Romain
179 Severine
180 Séverine
181 simoarrivo
182 Shems
183 Stef
184 Stéphane
185 stéphane
186 Tania
187 tania
188 Thai
189 Thomas
190 Thong
191 Tilman
192 tilman
193 Una
194 Valérie
195 }]
196 #, aggregate_webtrigger => 0
197 #, aggregateinternal => 1
198 , allow_symlinks_before_srcdir => 0
199 , allowatom => 1
200 #, allowed_attachments =>
201 # '(mimetype(image/*) and maxsize(100kb)) or
202 # (mimetype(application/pdf) and maxsize(2mb))'
203 #, allowrss => 0
204 , anonok_pagespec => 'postcomment(*)'
205 #, archive_pagespec => 'posts/* and !*/Discussion'
206 , archive_pagespec => '!*'
207 , archivebase => undef
208 , atom => 1
209 , attachment =>
210 { insert => 'Lier'
211 , rename => 'Renommer'
212 , remove => 'Détacher'
213 , upload => 'Attacher'
214 }
215 , backlinks =>
216 { map_id => 'backlink'
217 , map_tmpl => 'map-doc'
218 , page => 'backlinks'
219 , title => 'rétro-liens'
220 , tmpl => 'page.tmpl'
221 }
222 , banned_users => []
223 #, blogspam_options => 'blacklist=1.2.3.4,blacklist=8.7.6.5,max-links=10'
224 #, blogspam_pagespec => 'postcomment(*)'
225 #, blogspam_server => ''
226 #, camelcase_ignore => []
227 #, cgi_wrapper => 'cgi/ikiwiki.cgi'
228 #, cgi_wrappermode => '02750'
229 , cgiauthurl => $urls.'/cgi/ikiwiki.cgi'
230 , cgiurl => $url.'cgi/ikiwiki.cgi'
231 , comments_allowauthor => 1
232 , comments_allowdirectives => 0
233 , comments_closed_pagespec => 'index or blog/controversial or blog/flamewar'
234 , comments_commit => 1
235 , comments_pagename => 'comment_'
236 , comments_pagespec => '(Agenda/*/*/* or Document/*/*/* or Presse/*/*/* or vélo/*) and !*/Discussion'
237 , default_file => 'default.mdwn'
238 , default_pageext => 'mdwn'
239 , destdir => $destdir
240 , diffurl => "/gitweb/?p=$git_repo.git;a=blobdiff;f=[[file]];h=[[sha1_to]];hp=[[sha1_from]];hb=[[sha1_commit]];hpb=[[sha1_parent]]"
241 #, directive_description_dir => 'ikiwiki/directive'
242 , disable_plugins => [qw{
243 headinganchors
244 htmlbalance
245 htmlscrubber
246 htmltidy
247 httpauth
248 lockedit
249 more
250 openid
251 parentlinks
252 po
253 prettydate
254 shortcut
255 }]
256 , discussion => 0
257 , discussionpage => 'Discussion'
258 , edit =>
259 { cancel => 'Annuler'
260 , diff => 'Comparer'
261 , location => 'Emplacement'
262 , preview => 'Apercevoir'
263 , remove => 'Supprimer'
264 , rename => 'Bouger'
265 , save => 'Sauvegarder'
266 , title => 'édition'
267 , type => 'Type'
268 }
269 , exclude => qr{^(\.git|\.ikiwiki|static|Public/\.ikiwiki(|/.*)|Public/recentchanges(|/.*)|Public-www(|/.*))$}
270 , external_links => qr{^(git)(/.*|$)}
271 , getsource_mimetype => 'text/plain; charset=utf-8'
272 , gitmaster_branch => "master"
273 , gitorigin_branch => "origin"
274 #, global_sidebars => '*'
275 , global_sidebars =>
276 [ "TOC", "toc", "/None"
277 , "IMAGE", "image", "/None"
278 , "STATS", "stats", "/None"
279 , "AGENDA", "agenda", "/None"
280 , @$global_sidebars
281 ]
282 , hardlink => 0
283 , historyurl => "/gitweb/?p=$git_repo.git;a=history;f=[[file]]"
284 , html5 => 1
285 , htmlext => 'html'
286 , htmlscrubber_skip => '!*/Discussion',
287 , httpauth_pagespec => '!*/Discussion and !SandBox'
288 #, include => '^\\.htaccess$'
289 , indexpages => 0
290 , libdir => $srcdir.'/.ikiwiki/lib'
291 , locale => 'fr_FR.UTF-8'
292 , locked_pages => '!*/Discussion and !/SandBox',
293 #, mirrorlist => {}
294 #, moderate_pagespec => 'user(http://*)'
295 , multimarkdown => 1
296 , newevent_base => 'Agenda'
297 , numbacklinks => 1000
298 , omega_cgi => '/usr/lib/cgi-bin/omega/omega'
299 , only_committed_changes => $only_committed_changes
300 #, openid_cgiurl => ''
301 #, openid_realm => ''
302 #, openidsignup => 'http://myopenid.com/'
303 , password_cost => 8
304 #, pinger_timeout => 15
305 , pingurl => []
306 , po_link_to => 'current'
307 , po_master_language => 'fr|Français'
308 , po_slave_languages =>
309 [ 'en|English'
310 , 'es|Español'
311 , 'de|Deutsch'
312 , 'it|Italiano'
313 ]
314 , po_translatable_pages => '*'
315 , prefix_directives => 1
316 #, prefsurl => "https://$ENV{site}/cgi/ikiwiki.cgi"
317 #, prettydateformat => '%X, %B %o, %Y'
318 , rcs => "git"
319 , recentchangesnum => 100
320 , recentchangespage => 'recentchanges'
321 , repositories =>
322 [ "git://git.cyclocoop.org/$git_repo"
323 , "git\@git.cyclocoop.org:$git_repo" ]
324 , rss => 0
325 #, rsync_command => 'rsync -qa --delete . user@host:/path/to/docroot/'
326 , search_db => $search_db
327 , srcdir => $srcdir
328 , sslcookie => $sslcookie
329 #, syslog => 1
330 , tag =>
331 { map_id => 'backlink'
332 , map_tmpl => 'map-doc'
333 , page => 'tag'
334 , title => 'étiquette'
335 , tmpl => 'page.tmpl'
336 }
337 #, tagbase => 'tag'
338 , templatedir => catdir($sharedir, 'templates')
339 #, teximg_dvipng => ''
340 #, teximg_postfix => '\\end{document}'
341 #, teximg_prefix => '\\documentclass{article}
342 # \\usepackage{amsmath}
343 # \\usepackage{amsfonts}
344 # \\usepackage{amssymb}
345 # \\pagestyle{empty}
346 # \\begin{document}'
347 #, theme => 'actiontabs'
348 , theme => 'actiontabs'
349 , timeformat => '%c'
350 , toc =>
351 { back => '↑ '
352 , id => 'may-be-invalid'
353 }
354 #, tohighlight => '.c .h .cpp .pl .py Makefile:make'
355 , umask => $umask
356 #, underlaydir => catdir($sharedir, '.basewiki')
357 #, untrusted_committers => undef
358 , url => $url
359 , usedirs => 1
360 , userdir => $userdir
361 , verbose => 1
362 #, virus_checker => 'clamdscan -'
363 #, websetup_force_plugins => []
364 #, websetup_show_unsafe => 1
365 #, websetup_unsafe => []
366 , week_start_day => 1
367 , wiki_file_chars => "-[:alnum:]+/.:_—'’,«»\@°!"
368 , wiki_file_regexp => qr/(^[-[:alnum:]+\/.:_—'’,«»\@°!]+$)/
369 #, wiki_file_chars => '-[:alnum:]+/.:_@’()&'
370 #, wrappergroup => 'ikiwiki'
371 , wikiname => $wikiname
372 , wrappers => \@wrappers
373 );
374 }
375 use IkiWiki::Setup::Standard \%setup_args;