I installed ikiwiki the usual way, my rcs is git, i configure the post-update hook in the bare-repo and use the cgi script in the non-bare.

I update my wiki through git (clone the bare repo on my laptop (WORKING CLONE), make a change and push it back to origin ($REPOSITORY)). Then the post-update hook (configured in my ikiwiki.config) kicks in and updates the checked out wiki ($DESTDIR) and the cgi script there generates html. See git if something is not clear.

My problem is: every generated html/css/favicon file is only write and readable by the user (600) and no one else.

  • Edit: If i edit the wiki through the webinterface everything is fine.
  • Edit2: Set everything to chmod 0755 but when i run --setup or push to the bare repo; then pages that are generated through the post update hook still have the wrong permissions.

Your shell login to the server (presumably SSH?) is running under a restrictive umask, and by default ikiwiki doesn't overrule that. For instance, perhaps you're using the pam_umask module, or perhaps your .bashrc sets a restrictive mask. This is generally a good thing for privacy from other users of a shared server, but counterproductive when you're publishing things!

You can configure ikiwiki to set a less restrictive umask with the umask option in your setup file. 18 is probably a good value (18 decimal = 022 octal, and a umask of 022 octal corresponds to chmod 0755, because the umask is subtracted from 0777 octal to get the default permissions).

Comment by smcv Sun Nov 27 09:24:57 2011
See also octal umask setting is unintuitive for more about 18 vs. 022.
Comment by smcv Sun Nov 27 09:46:16 2011

thank you for your enlighting post! i set the umask option to 022 (octal) and the wrapper to 0755 and it worked. However i guess it is not a good thing to mix modes and i would appreciate it, if you implemented the "keyword-approach" you mentioned.

Or at least one way of defining modes would be okay for average joes like me.

Comment by ikiwikert Sun Nov 27 12:54:05 2011

Joey merged my branch, so from the next release of ikiwiki you'll be able to say umask => 'public' (or private or group for the other two potentially-useful umasks).

I'm not sure what you mean about mixing modes? The wrapper modes are something else - the wrapper modes are about who can run the CGI (or the git commit hook) and whether they're setuid (run as the user who owns the wiki) or not (run as the web server user or the git push user), whereas umask is about the permissions that ikiwiki will assign to new files it creates (like the HTML).

A typical public wiki like this one will have umask => 'public'; the wrapper modes will either be 0755 or 04755 (both octal), depending on the details of how the web server runs the CGI and how git pushes are done.

Comment by smcv Mon Nov 28 05:52:38 2011