Ikiwiki with Git: failed to push

I am trying to use Ikiwiki with Git, but it is not working. I am assuming it is a permissions issue.

My question is: Is there a FreedomBox way (i.e., via the web interface) to set up Ikiwiki to work with Git? I explored the setup options in the Ikiwiki blog, but did not see any configuration option that seemed to address this issue. If not, what would you recommend to resolve the issue?

What I did:

In Plinth I set up an Ikiwiki blog plus blog admin account.

On my computer I cloned the Ikiwiki blog with the following command:

$ git clone FBXUSER@EXAMPLE.freedombox.rocks:/var/lib/ikiwiki/EXAMPLEBLOG.git

I type my FBXUSER credentials at the prompt and the blog is successfully cloned on my computer.

On my computer I change directory, and then I modify and save the first post:

$ nano posts/first_post.mdwn

I check the git status and then commit the changes to git.

$ git status
$ git commit -a -m 'updated first post'

Git status informs me the branch is one commit ahead of origin/master. So I push the changes.

$ git status
$ git push

When I type my credentials at the prompt, I get the following information:

FBXUSER@EXAMPLE.freedombox.rocks’s password: ********
Enumerating objects: 7, done.
Counting objects: 100% (7/7), done.
Delta compression using up to 2 threads
Compressing objects: 100% (4/4), done.
Writing objects: 100% (4/4), 385 bytes | 385.00 KiB/s, done.
Total 4 (delta 2), reused 0 (delta 0)
error: remote unpack failed: unable to create temporary object directory
To EXAMPLE.freedombox.rocks:/var/lib/ikiwiki/EXAMPLEBLOG.git
! [remote rejected] master → master (unpacker error)
error: failed to push some refs to ‘FBXUSER@EXAMPLE.freedombox.rocks:/var/lib/ikiwiki

What I would expect: Pushing to the Ikiwiki blog will update with the commit.

Additional notes

After sshing into the FreedomBox I can see that the owner and group assisgned to the relevant directory is root (same for the children directories):

$ ssh FBXUSER@EXAMPLE.freedombox.rocks

FBXUSER@EXAMPLE:/$ ls -l /var/lib/ikiwiki/

drwxr-xr-x 1 root root 188 Jul 29 13:19 EXAMPLEBLOG
drwxrwsr-x 1 root root 98 Jul 29 13:19 EXAMPLEBLOG.git
-rw-r–r-- 1 root root 13785 Jul 29 13:21 EXAMPLEBLOG.setup

FBXUSER@EXAMPLE:/$ stat /var/lib/ikiwiki/

File: /var/lib/ikiwiki/
Size: 80 Blocks: 0 IO Block: 4096 directory
Device: 15h/21d Inode: 3031707 Links: 1
Access: (0755/drwxr-xr-x) Uid: ( 0/ root) Gid: ( 0/ root)
Access: 2021-07-30 14:59:38.783204566 +0200
Modify: 2021-07-29 13:19:36.566572698 +0200
Change: 2021-07-29 13:19:36.566572698 +0200

I can confirm this issue.

In my case, I have an Ikiwiki wiki on my home FreedomBox. I have the git clone in my FreedomBox user’s home directory. I edit the remote files using emacs tramp-mode and make commits using magit. It’s a very convenient setup, but I can’t do git push.

The only way push works for me is if I ssh into the FreedomBox and do a sudo git push.

I don’t remember who I set as the admin user for this wiki, but it doesn’t matter since the remote git repository is owned by root:root.

Ideally, the wiki or admin group should have ownership of the git repository, so that my user would get write permissions.