supprimé
[cyclowiki.git] / ikiwiki.setup
index 26689cc..e6ef777 100644 (file)
@@ -5,17 +5,63 @@ 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"
@@ -26,19 +72,18 @@ BEGIN {
                #        , 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   = $srcdir.'-www';
                $sslcookie = 0;
                $umask     = 002;
                $url       = '/';
                $urls      = '/';
+               $only_committed_changes = 0;
                @wrappers  =
                 ( { cgi => 1
                         , wrapper => $destdir."/cgi/ikiwiki.cgi"
@@ -47,9 +92,12 @@ 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
@@ -57,8 +105,11 @@ BEGIN {
                 attachment
                 brokenlinks
                 comments
+                conditional
+                createpage
                 cutpaste
                 editdiff
+                editpage
                 events
                 favicon
                 img
@@ -66,10 +117,14 @@ BEGIN {
                 link
                 linkmap
                 map
+                mdwn
+                meta
                 moderatedcomments
                 orphans
                 pagecount
                 pagestats
+                pagetemplate
+                parentlinks_fixed
                 passwordauth
                 poll
                 progress
@@ -81,24 +136,62 @@ BEGIN {
                 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
@@ -133,33 +226,34 @@ BEGIN {
         #, camelcase_ignore => []
         #, cgi_wrapper => 'cgi/ikiwiki.cgi'
         #, cgi_wrappermode => '02750'
-        , cgiauthurl => $urls.'3615/cgi/ikiwiki.cgi'
+        , cgiauthurl => $urls.'/cgi/ikiwiki.cgi'
         , cgiurl => $url.'cgi/ikiwiki.cgi'
         , comments_allowauthor => 1
         , comments_allowdirectives => 0
         , comments_closed_pagespec => 'index or blog/controversial or blog/flamewar'
         , comments_commit => 1
         , comments_pagename => 'comment_'
-        , comments_pagespec => '(Agenda/*/*/* or Presse/*/*/* or vélo/*) 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{
                 headinganchors
                 htmlbalance
                 htmlscrubber
+                htmltidy
                 httpauth
                 lockedit
                 more
                 openid
+                parentlinks
                 po
                 prettydate
                 shortcut
-                toggle
                 }]
-        , discussion => 1
+        , discussion => 0
         , discussionpage => 'Discussion'
         , edit =>
                 { cancel   => 'Annuler'
@@ -172,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"
@@ -181,10 +275,12 @@ BEGIN {
         , global_sidebars =>
                 [ "TOC", "toc", "/None"
                 , "IMAGE", "image", "/None"
-                #, "METROLOGIE", "/Savoir-faire/Autogestion/Bénévolat/Métrologie", "index"
+                , "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',
@@ -200,6 +296,7 @@ BEGIN {
         , 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/'
@@ -222,28 +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_db => # db, auth required, page having the search, pages indexed
-               [ '3615', 1
-                , '3615 or 3615/*'
-                , '(3615 or 3615/*)
-                   and !3615/recentchanges/*
-                   and !3615/templates/*
-                   and !3615/templates'
-               , 'CycloWiki', 0
-                , '*
-                   and !3615
-                   and !3615/*'
-                , '*
-                   and !recentchanges/*
-                   and !templates
-                   and !templates/*
-                   and !3615
-                   and !3615/*'
-               ]
+        , search_db => $search_db
         , srcdir => $srcdir
         , sslcookie => $sslcookie
         #, syslog => 1
@@ -277,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
         );
  }