Last active
April 26, 2017 16:16
-
-
Save toke/1f4ee47ca0d69971419c2182620bf2d3 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[ | |
{ | |
"id": "github", | |
"execute-command": "/home/toke/webhooks/hooks/github.sh", | |
"command-working-directory": "/home/toke/go", | |
"pass-arguments-to-command": | |
[ | |
{ | |
"source": "payload", | |
"name": "head_commit.id" | |
}, | |
{ | |
"source": "payload", | |
"name": "pusher.name" | |
}, | |
{ | |
"source": "payload", | |
"name": "pusher.email" | |
} | |
], | |
"trigger-rule": | |
{ | |
"and": | |
[ | |
{ | |
"match": | |
{ | |
"type": "payload-hash-sha1", | |
"secret": "SECRETSECRETSECRET", | |
"parameter": | |
{ | |
"source": "header", | |
"name": "X-Hub-Signature" | |
} | |
} | |
}, | |
{ | |
"match": | |
{ | |
"type": "value", | |
"value": "refs/heads/master", | |
"parameter": | |
{ | |
"source": "payload", | |
"name": "ref" | |
} | |
} | |
} | |
] | |
} | |
} | |
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
server { | |
# … | |
location /hooks { | |
proxy_pass http://127.0.0.1:9000; | |
proxy_set_header Host $host; | |
proxy_buffering off; | |
tcp_nodelay on; | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[program:webhooks] | |
command=/home/toke/go/bin/webhook -ip 127.0.0.1 -port 9000 | |
directory=/home/toke/webhooks/ | |
environment=HOME="/home/toke",USER="toke" | |
user=toke | |
autostart=True | |
autorestart=True | |
redirect_stderr=True | |
priority=90 | |
startsecs=10 | |
startretries=5 | |
stopwaitsecs=20 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[Unit] | |
Description=Webhook | |
[Service] | |
User=toke | |
Group=www-data | |
Restart=on-failure | |
WorkingDirectory=/home/toke/webhooks | |
ExecStart=/home/toke/go/bin/webhook -ip 127.0.0.1 -port 9000 | |
[Install] | |
WantedBy=multi-user.target |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment