X-Git-Url: https://git.plutz.net/?a=blobdiff_plain;f=index.cgi;h=8479bd9dd492127e760f19865e14a659fdecef6e;hb=d75f33f647280ada400fb51f740701cdb12dd4d3;hp=2248308ddd05ce61252beb9e1edd7fe333efdfa8;hpb=818bd92b936bf3c66a4be47481be3c1fdf244523;p=shellwiki diff --git a/index.cgi b/index.cgi index 2248308..8479bd9 100755 --- a/index.cgi +++ b/index.cgi @@ -6,9 +6,13 @@ . "${_EXEC}/tools.sh" . "${_EXEC}/acl.sh" +REV_ATTACHMENTS=${REV_ATTACHMENTS:-false} WIKI_THEME="${WIKI_THEME:-default}" . "${_EXEC}/themes/${WIKI_THEME}.sh" +# Renew session cookie, only if cookie already set +[ "$(COOKIE session)" ] && SESSION_COOKIE + wiki_text() { # Print source text of a wiki page # Get page from data or underlay dir @@ -23,11 +27,13 @@ if [ "$(which git)" -a ! -f "$_DATA/.gitignore" ]; then cat >"$_DATA/.gitignore" <<-EOF users.db serverkey - */#attachments/ - */#cache/ - */#page.lock - */#page.*.cache - */#page.*.cache.* + $([ "$REV_ATTACHMENTS" = true ] || printf %s "**/#attachments/") + **/#cache/ + **/#page.lock + **/#page.*.cache + **/#page.*.cache.* + **/#page:*.*.cache + **/#page:*.*.cache.* EOF git init "$_DATA" git -C "$_DATA" add .gitignore