X-Git-Url: http://git.vanrenterghem.biz/git.ikiwiki.info.git/blobdiff_plain/86ea8adaf3263babd401b7c2d73a1824b99ea908..3a807a87003b3176c24b3f9a3e7cacea30de4b7e:/doc/tips/untrusted_git_push.mdwn?ds=sidebyside diff --git a/doc/tips/untrusted_git_push.mdwn b/doc/tips/untrusted_git_push.mdwn index 48024566b..948a55063 100644 --- a/doc/tips/untrusted_git_push.mdwn +++ b/doc/tips/untrusted_git_push.mdwn @@ -21,12 +21,12 @@ repository's `pre-receive` hook. There it will examine every change that untrusted users push into the wiki, and reject pushes that contain changes that cannot be made using the web interface. -So, unless you have the [[ikiwiki/plugin/attachment]] plugin turned on, +So, unless you have the [[plugins/attachment]] plugin turned on, non-page files cannot be added. And if it's turned on, whatever `allowed_attachments` checks you have configured will also check files pushed into git. -And, unless you have the [[ikiwiki/plugin/remove]] plugin turned on, no +And, unless you have the [[plugins/remove]] plugin turned on, no files can be deleted. And if you have `locked_pages` configured, then it will also affect what's @@ -39,12 +39,15 @@ or manipulate tags. One thing to keep an eye on is uploading large files. It may be easier to do this via git push than using the web, and that could be abused. +Also, no checking is done that the authors of commits are right, so people +can make a commit that pretends to be done by someone else. + ## user setup Add a dedicated user who will push in untrusted commits. This user should have a locked password, and `git-shell` as its shell. - root@bluebird:/home/joey>adduser --shell=/usr/bin/git-shell--disabled-password anon + root@bluebird:/home/joey>adduser --shell=/usr/bin/git-shell --disabled-password anon Adding user `anon' ... ## ikiwiki setup @@ -65,13 +68,13 @@ untrusted changes. It should *not* include the user that ikiwiki normally runs as. Once you're done modifying the setup file, don't forget to run -`ikiwiki -setup --refresh --wrappers` on it. +`ikiwiki --setup ikiwiki.setup --refresh --wrappers` on it. ## git setup You'll need to arrange the permissions on your bare git repository so that user anon can write to it. One way to do it is to create a group, and put -both anon and your regular user in that group. Then make make the bare git +both anon and your regular user in that group. Then make the bare git repository owned and writable by the group. See [[rcs/git]] for some more tips on setting up a git repository with multiple committers. @@ -109,11 +112,3 @@ abort the push before refs are updated. However, the changeset will still be present in your repository, wasting space. Since nothing refers to it, it will be expired eventually. You can speed up the expiry by running `git prune`. - -When aborting a push, ikiwiki displays an error message about why it didn't -accept it. If using git over ssh, the user will see this error message, -which is probably useful to them. But `git-daemon` is buggy, and hides this -message from the user. This can make it hard for users to figure out why -their push was rejected. (If this happens to you, look at "'git log --stat -origin/master..`" and think about whether your changes would be accepted -over the web interface.)