caddy-git icon indicating copy to clipboard operation
caddy-git copied to clipboard

Problems with setting up github hook

Open chanux opened this issue 7 years ago • 7 comments

caddy-git seems really cool but I am at the third unsuccessful attempt at setting it up. This time I decided to ask for help before giving up.

Following is my git block in my Caddyfile.

    git {
        repo https://github.com/repo/path.git
        key /etc/caddy/keys/my_id_rsa
        hook /publish "my_key"
        path /opt/build-dir
        then hugo --destination=/var/www/blog
    }

I suspect following errors in my log are from caddy-git

mkdir: cannot create directory '/var/www/.ssh': Permission denied
touch: cannot touch '/var/www/.ssh/known_hosts': No such file or directory
/tmp/caddy839530012: line 5: /var/www/.ssh/tmp_hosts: No such file or directory
/tmp/caddy839530012: line 6: /var/www/.ssh/known_hosts: No such file or directory

Anyhow, the push endpoint gives 404. Any help?

chanux avatar Jan 13 '18 11:01 chanux

What operating system or linux distro are you using ?

abiosoft avatar Jan 13 '18 13:01 abiosoft

Ubuntu 16.04

chanux avatar Jan 14 '18 02:01 chanux

Were you able to solve this?

griffins avatar Jan 31 '18 18:01 griffins

I'm having issues with that one too. Although I have the hook set up in my caddy config file, every time either GitHub or myself tries to hit it it results in a 404 error... Did any of you solve this since then?

babolivier avatar Apr 28 '18 10:04 babolivier

My main issue is finding time to reproduce this. I'll see if I can do that this weekend. And if I am able to reproduce it, I will issue a fix straight away.

abiosoft avatar Apr 28 '18 10:04 abiosoft

I recently moved my Caddy server to a new host, with the exact same configuration, and now the webhook works... Weird... FWIW the only difference I can think of between the two hosts is that the first one was running Archlinux and the second one Ubuntu.

babolivier avatar Jun 08 '18 14:06 babolivier

You should check if the user www-data have the w permission of the directory /var/www/

wwyf avatar Nov 23 '19 08:11 wwyf