supprimé
[cyclowiki.git] / ikiwiki.setup
index 2c8f770..e6ef777 100644 (file)
@@ -5,36 +5,85 @@ BEGIN {
        use File::Basename;
        use File::Spec::Functions;
        my $srcdir = dirname($IkiWiki::config{'setupfile'});
+       my ($wiki, $wikiname, $git_repo, $destdir
+        , $global_sidebars, $search_db, $userdir,
+        , $only_committed_changes);
+       if (-x "$srcdir/Public") {
+               $wiki = '3615';
+               $wikiname = '3615';
+               $git_repo = '3615cyclo';
+               $destdir = $srcdir.'-www';
+               $global_sidebars =
+                [
+                ];
+               $search_db = # db, auth required, page having the search, pages indexed
+                [ '3615', 1
+                , '*'
+                , '*
+                               and !recentchanges/*
+                               and !templates
+                               and !templates/*
+                               and !Public/recentchanges/*
+                               and !Public/templates
+                               and !Public/templates/*'
+                ];
+               $userdir = '/Camarade';
+        }
+       else {
+               $wiki = 'wiki';
+               $wikiname = 'CycloWiki';
+               $git_repo = 'cyclowiki';
+               $destdir = $srcdir.'-www';
+               $global_sidebars =
+                [ #"PREVISION_DU_BENEVOLAT", "/Savoir-faire/Autogestion/Bénévolat/Prévision", "index"
+                ];
+               $search_db = # db, auth required, page having the search, pages indexed
+                [ 'wiki', 0
+                , '*'
+                , '*
+                               and !recentchanges/*
+                               and !templates
+                               and !templates/*'
+                ];
+               $userdir = '/Camarade';
+        }
        my $sharedir = $ENV{IKIWIKI_SHARE} ? $ENV{IKIWIKI_SHARE} : '/usr/share/ikiwiki';
-       print "srcdir=$srcdir\n";
        my ($account_creation_password);
-       my ($destdir, $sslcookie, $umask, $url, $urls, @wrappers);
-       if (-x '/home/www/data/cyclo-wiki') {
-               $destdir   = '/home/www/data/cyclo-wiki';
-               $srcdir    = '/home/cyclo/var/ikiwiki/cyclo-wiki/src';
+       my ($sslcookie, $umask, $url, $urls, @wrappers);
+       if (-x "/home/www/data/cyclo-$wiki") {
+               $account_creation_password = IkiWiki::readfile(catdir(dirname($srcdir), 'etc', 'account_creation_password'));
+               $destdir   = "/home/www/data/cyclo-$wiki";
+               $srcdir = ((-x "$srcdir/Public")
+                ? "/home/cyclo/var/ikiwiki/cyclo-$wiki/src"
+                : "/home/cyclo/var/ikiwiki/cyclo-3615/src/Public"
+                );
                $sslcookie = 1;
                $umask     = 002;
                $url       = '/';
-               $urls      = 'https://wiki.cyclocoop.org/';
+               $urls      = "https://$wiki.cyclocoop.org/";
+               $only_committed_changes = 1;
                @wrappers  =
                 ( { cgi => 1
                         , wrapper => $destdir."/cgi/ikiwiki.cgi"
                         , wrappermode => "00750"
                         }
+               # , { cgi => 1
+               #        , wrapper => $destdir."/3615/cgi/ikiwiki.cgi"
+               #        , wrappermode => "00750"
+               #        }
                 , { post_commit => 1
-                        , wrapper => "/home/git/hooks/cyclo/cyclo-wiki/post-update.ikiwiki"
+                        , wrapper => "/home/git/hooks/cyclo/cyclo-$wiki/post-update.ikiwiki"
                         , wrappermode => "06751"
                         , wrapper_background_command => ""
                         }
                 );
-               $account_creation_password = IkiWiki::readfile(catdir(dirname($srcdir), 'etc', 'account_creation_password'));
         }
        else {
-               $destdir   = catdir(dirname($srcdir).'/www');
                $sslcookie = 0;
                $umask     = 002;
                $url       = '/';
                $urls      = '/';
+               $only_committed_changes = 0;
                @wrappers  =
                 ( { cgi => 1
                         , wrapper => $destdir."/cgi/ikiwiki.cgi"
@@ -43,30 +92,39 @@ BEGIN {
                 );
                $account_creation_password = '';
         }
+       print "srcdir=$srcdir\n";
+       print "destdir=$destdir\n";
        %setup_args =
         ( ENV => {}
         , account_creation_password => $account_creation_password
+        , default_plugins => []
         , add_plugins => [qw{
                 404
                 action
+                anonok
                 attachment
                 brokenlinks
-                calendar
                 comments
+                conditional
+                createpage
                 cutpaste
                 editdiff
+                editpage
+                events
                 favicon
-                htmlscrubber
                 img
                 inline
                 link
                 linkmap
-                lockedit
                 map
-                newevent
+                mdwn
+                meta
+                moderatedcomments
                 orphans
                 pagecount
                 pagestats
+                pagetemplate
+                parentlinks_fixed
                 passwordauth
                 poll
                 progress
@@ -77,18 +135,63 @@ BEGIN {
                 repolist
                 search
                 sidebar2
+                signinedit
+                signinedit
                 table
                 tag
                 template
                 theme
                 toc
+                toggle
                 trail
                 userlist
                 }]
         #, add_underlays => []
-        , adminemail => 'admin+wiki@cyclocoop.org'
+        , adminemail => 'admin+'."$wiki".'@cyclocoop.org'
         , adminuser => [qw{
+                       Aline
+                       Amélie
+                       Andréas
+                       anne-lise
+                       Arnaud
+                       Carmel
+                       Cecile
+                       Corentin
+                       David
+                       Galileo
+                       Giampiero
+                       giampiero
+                       Giulia
+                       Giuso
+                       Greg
+                       Java
+                       Julien
                        julm
+                       Louan
+                       Marie
+                       marie
+                       Martin
+                       Mathilde
+                       Nico13
+                       Nicolas
+                       Pedro
+                       Romain
+                       Severine
+                       Séverine
+                       simoarrivo
+                       Shems
+                       Stef
+                       Stéphane
+                       stéphane
+                       Tania
+                       tania
+                       Thai
+                       Thomas
+                       Thong
+                       Tilman
+                       tilman
+                       Una
+                       Valérie
                 }]
         #, aggregate_webtrigger => 0
         #, aggregateinternal => 1
@@ -98,7 +201,7 @@ BEGIN {
         # '(mimetype(image/*) and maxsize(100kb)) or
         #  (mimetype(application/pdf) and maxsize(2mb))'
         #, allowrss => 0
-        #, anonok_pagespec => '*/Discussion or SandBox'
+        , anonok_pagespec => 'postcomment(*)'
         #, archive_pagespec => 'posts/* and !*/Discussion'
         , archive_pagespec => '!*'
         , archivebase => undef
@@ -123,32 +226,34 @@ BEGIN {
         #, camelcase_ignore => []
         #, cgi_wrapper => 'cgi/ikiwiki.cgi'
         #, cgi_wrappermode => '02750'
-        , cgiauthurl => $urls.'cgi/ikiwiki.cgi'
+        , cgiauthurl => $urls.'/cgi/ikiwiki.cgi'
         , cgiurl => $url.'cgi/ikiwiki.cgi'
-        , comments_allowauthor => 0
+        , comments_allowauthor => 1
         , comments_allowdirectives => 0
-        , comments_closed_pagespec => 'blog/controversial or blog/flamewar'
+        , comments_closed_pagespec => 'index or blog/controversial or blog/flamewar'
         , comments_commit => 1
         , comments_pagename => 'comment_'
-        , comments_pagespec => 'blog/* and !*/Discussion'
+        , comments_pagespec => '(Agenda/*/*/* or Document/*/*/* or Presse/*/*/* or vélo/*) and !*/Discussion'
         , default_file => 'default.mdwn'
         , default_pageext => 'mdwn'
         , destdir => $destdir
-        , diffurl => "/gitweb/?p=cyclowiki.git;a=blobdiff;f=[[file]];h=[[sha1_to]];hp=[[sha1_from]];hb=[[sha1_commit]];hpb=[[sha1_parent]]"
+        , diffurl => "/gitweb/?p=$git_repo.git;a=blobdiff;f=[[file]];h=[[sha1_to]];hp=[[sha1_from]];hb=[[sha1_commit]];hpb=[[sha1_parent]]"
         #, directive_description_dir => 'ikiwiki/directive'
         , disable_plugins => [qw{
-                anonok
                 headinganchors
+                htmlbalance
+                htmlscrubber
+                htmltidy
                 httpauth
+                lockedit
                 more
                 openid
+                parentlinks
                 po
                 prettydate
                 shortcut
-                signinedit
-                toggle
                 }]
-        , discussion => 1
+        , discussion => 0
         , discussionpage => 'Discussion'
         , edit =>
                 { cancel   => 'Annuler'
@@ -161,7 +266,7 @@ BEGIN {
                 , title    => 'édition'
                 , type     => 'Type'
                 }
-        , exclude => '^/etc$'
+        , exclude => qr{^(\.git|\.ikiwiki|static|Public/\.ikiwiki(|/.*)|Public/recentchanges(|/.*)|Public-www(|/.*))$}
         , external_links => qr{^(git)(/.*|$)}
         , getsource_mimetype => 'text/plain; charset=utf-8'
         , gitmaster_branch => "master"
@@ -170,12 +275,15 @@ BEGIN {
         , global_sidebars =>
                 [ "TOC", "toc", "/None"
                 , "IMAGE", "image", "/None"
+                , "STATS", "stats", "/None"
+                , "AGENDA", "agenda", "/None"
+                , @$global_sidebars
                 ]
         , hardlink => 0
-        , historyurl => "/gitweb/?p=cyclowiki.git;a=history;f=[[file]]"
+        , historyurl => "/gitweb/?p=$git_repo.git;a=history;f=[[file]]"
         , html5 => 1
         , htmlext => 'html'
-        , htmlscrubber_skip => '!*/Discussion or /Ivry or /Pantin or /Paris',
+        , htmlscrubber_skip => '!*/Discussion',
         , httpauth_pagespec => '!*/Discussion and !SandBox'
         #, include => '^\\.htaccess$'
         , indexpages => 0
@@ -184,10 +292,11 @@ BEGIN {
         , locked_pages => '!*/Discussion and !/SandBox',
         #, mirrorlist => {}
         #, moderate_pagespec => 'user(http://*)'
-        #, multimarkdown => 0
+        , multimarkdown => 1
         , newevent_base => 'Agenda'
         , numbacklinks => 1000
         , omega_cgi => '/usr/lib/cgi-bin/omega/omega'
+        , only_committed_changes => $only_committed_changes
         #, openid_cgiurl => ''
         #, openid_realm => ''
         #, openidsignup => 'http://myopenid.com/'
@@ -210,11 +319,11 @@ BEGIN {
         , recentchangesnum => 100
         , recentchangespage => 'recentchanges'
         , repositories =>
-                [ "git://git.cyclocoop.org/cyclowiki"
-                , "git\@git.cyclocoop.org:cyclowiki" ]
+                [ "git://git.cyclocoop.org/$git_repo"
+                , "git\@git.cyclocoop.org:$git_repo" ]
         , rss => 0
         #, rsync_command => 'rsync -qa --delete . user@host:/path/to/docroot/'
-        , search_pagespec => '* and !recentchanges/* and !templates/* and !templates'
+        , search_db => $search_db
         , srcdir => $srcdir
         , sslcookie => $sslcookie
         #, syslog => 1
@@ -248,18 +357,18 @@ BEGIN {
         #, untrusted_committers => undef
         , url => $url
         , usedirs => 1
-        , userdir => 'Camarade'
+        , userdir => $userdir
         , verbose => 1
         #, virus_checker => 'clamdscan -'
         #, websetup_force_plugins => []
         #, websetup_show_unsafe => 1
         #, websetup_unsafe => []
         , week_start_day => 1
-        , wiki_file_chars => "-[:alnum:]+/.:_'’,()«»"
-        , wiki_file_regexp => qr/(^[-[:alnum:]+\/.:_'’,()«»]+$)/
+        , wiki_file_chars => "-[:alnum:]+/.:_—'’,«»\@°!"
+        , wiki_file_regexp => qr/(^[-[:alnum:]+\/.:_—'’,«»\@°!]+$)/
         #, wiki_file_chars => '-[:alnum:]+/.:_@’()&'
         #, wrappergroup => 'ikiwiki'
-        , wikiname => 'CycloWiki'
+        , wikiname => $wikiname
         , wrappers => \@wrappers
         );
  }