]> git.plutz.net Git - shellwiki/blobdiff - index.cgi
improved UI for attachment manipulation
[shellwiki] / index.cgi
index 57398a4ff7f9aabc4879b9a2b20cfb5b3b6dcb94..091254cf76795f1fdb0342edd47d59ebce923deb 100755 (executable)
--- a/index.cgi
+++ b/index.cgi
@@ -9,6 +9,9 @@
 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
@@ -19,6 +22,21 @@ wiki_text() {
   cat -- "$mdfile"
 }
 
+if [ "$(which git)" -a ! -f "$_DATA/.gitignore" ]; then
+  cat >"$_DATA/.gitignore" <<-EOF
+       users.db
+       serverkey
+       */#attachments/
+       */#cache/
+       */#page.lock
+       */#page.*.cache
+       */#page.*.cache.*
+       EOF
+  git init "$_DATA"
+  git -C "$_DATA" add .gitignore
+  git -C "$_DATA" commit -m 'initialization' -- .gitignore
+fi 1>&2
+
 for handler in "$_EXEC"/handlers/*; do
   . "$handler" && break
 done