lukaszlach / satis-server

:whale: Private, self-hosted Composer/Satis repository with unlimited private and open-source packages and support for Git, Mercurial, and Subversion. HTTP API, HTTPs support, webhook handler, scheduled builds, Slack and HipChat integration.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Problem with push event

seSze opened this issue · comments

After push webhook from GitHub repo I receive this error:

[webhook] 2018/08/08 23:20:21 push got matched
[webhook] 2018/08/08 23:20:21 push hook triggered successfully
[webhook] 2018/08/08 23:20:21 error extracting command arguments: couldn't retrieve argument for {Source:payload Name:repository.url EnvName:}
server {
[webhook] 2018/08/08 23:20:21 executing /satis-server/bin/satis-push.sh (/satis-server/bin/satis-push.sh) with arguments ["/satis-server/bin/satis-push.sh" ""] and environment [REQUEST_PUSH_SECRET=xxxx] using /etc/satis as cwd
[webhook] 2018/08/08 23:20:21 200 | 355.357µs | 127.0.0.1:9000 | POST /api/push
172.18.0.1 - - [08/Aug/2018:23:20:21 +0000] "POST /api/push?secret=xxxx HTTP/1.1" 200 0 "-" "GitHub-Hookshot/cac83ef"
[webhook] 2018/08/08 23:20:21 command output: [ERROR] Repository URL was not passed as first parameter

[webhook] 2018/08/08 23:20:21 error occurred: exit status 1
[webhook] 2018/08/08 23:20:21 finished handling push

I suppose it's related to nginx config but I'm not sure what's wrong - I used configuration provided with this package with one small change http://127.0.0.1:9000 was changed into http://127.0.0.1:8080

    location /api/ {
        if ($request_uri ~ /api/push) {
            set $state "1";
        }
        if ($arg_secret != "$PUSH_SECRET") {
            set $state "${state}1";
        }
        if ($state = 11) {
            return 403;
        }

        proxy_pass http://127.0.0.1:8080$request_uri;
        proxy_max_temp_file_size 0k;
        proxy_http_version 1.1;
        proxy_set_header Connection "";
        proxy_set_header Proxy "";
        proxy_redirect off;
        proxy_read_timeout 600s;
        proxy_send_timeout 60s;
        proxy_connect_timeout 10s;
        proxy_buffering off;
        proxy_intercept_errors on;
        error_page 500 =500 /500.html;
    }

Do you have any idea how to solve it?

Same here. Did you solve it?

I found out the error. Gitub webhook's content type must be application/json.