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