abiosoft / caddy-git

git middleware for Caddy
http://caddyserver.com/docs/http.git
MIT License
205 stars 43 forks source link

Problems with setting up github hook #81

Open chanux opened 6 years ago

chanux commented 6 years ago

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?

abiosoft commented 6 years ago

What operating system or linux distro are you using ?

chanux commented 6 years ago

Ubuntu 16.04

griffins commented 6 years ago

Were you able to solve this?

babolivier commented 6 years ago

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?

abiosoft commented 6 years ago

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.

babolivier commented 6 years ago

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.

wwyf commented 4 years ago

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