gitea: Webhooks are not triggered in repositories cloned via ssh

Description

I have a repository with a webhook configured on push events.

The hook is correctly triggered if I click “Test Delivery”, and also when the repository is cloned over HTTPS. If I perform code changes from the web view the webhook is also correctly triggered.

However, if I cloned the repo over git@git.example.com:user/repo.git and I push some commits, the hook is not triggered at all. No log traces on the target webapp, no log traces on gitea, no log traces on the nginx proxy.

Am I missing some obvious configuration? Are webhooks actually supported when the events are triggered from an ssh-cloned repo, or do I have to use git hooks for this purpose? If so, is there an easy way to map git hooks to web hooks?

Gitea Version

1.16.8

Can you reproduce the bug on the Gitea demo site?

N/A

Log Gist

No response

Screenshots

No response

Git Version

2.37.0

Operating System

Arch Linux

How are you running Gitea?

Self-hosted on an Arch Linux server, installed via Arch package.

Database

PostgreSQL

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 16 (9 by maintainers)

Most upvoted comments

I may have found the culprit buried deep in my sshd_config:

Match User git
    PermitEmptyPasswords yes

It seems that in one of my previous attempts to get SSH access to work for git I added that line to the configuration. My guess is that it bypassed the PAM authentication when no password was provided, so the command was never actually called.

After removing that configuration and resetting the git shell to /bin/bash things seem to work as expected:

> ssh git@git.example.com
PTY allocation request failed on channel 0
Hi there, user! You've successfully authenticated with the key named *****, but Gitea does not provide shell access.
If this is unexpected, please log in with password and setup Gitea under another user.
Connection to git.example.com closed.