Integrating gitea with gollum / local pushes

Hi,

we’re using a small gollumn wiki and now we’d like to introduce a way to push/pull the repo manually as well. As we have to authenticate our users via LDAP, more basic solutions don’t work for us and we’d like to use gitea.

For testing, I setup two docker containers, one for gollum, one for gitea. I then pointed both to the same repo. This enables working push/pull via HTTP and SSH in gitea, but the gitea web interface does not update when commits are pushed via the gollum ui. I guess this is caused by the hooks not executing when pushed from gollum. (Although even after doing a normal push to gitea and starting the “rerun all hooks” task as admin, gitea still shows the initial repo setup instructions)

Is there any recommended way to make gitea work with such external / local repos? I think I could just setup the hooks to use docker exec to execute the hooks in the gitea container (if they’re running in the gollum container). So this solves the “in another container” part of the problem.

But I guess I’d have to enable ONLY_ALLOW_PUSH_IF_GITEA_ENVIRONMENT_SET for this to work. What are the implications of setting this? If I only use the gitea container SSH server, can this still cause security issues? Alternatively, can I somehow construct the SSH_ORIGINAL_COMMAND for such local commits to make this work without enabling the setting? Basically when trying to run the hooks manually, I get this message:

remote: Gitea: Rejecting changes as Gitea environment not set.
remote: If you are pushing over SSH you must push with a key managed by
remote: Gitea or set your environment appropriately.

So what exactly has to be done to “set your environment appropriately”? Is setting SSH_ORIGINAL_COMMAND enough?

Or is there a better we to integrate gollum and gitea? I don’t really want to setup a mirror, as both ends would have to push, so it has to be a bidirectional mirror. And I really want to avoid any conflicts during mirror sychronization there.

Best regards