- Create Dockerfile for webhook (Go application) - Add CloudronManifest.json with basic configuration - Include README.md with usage documentation - Add hooks.json.example configuration template - Add logo.png (256x256) - Add CHANGELOG.md for version tracking Webhook is a lightweight configurable tool written in Go that allows creating HTTP endpoints (hooks) on your server for executing configured commands. Package includes: - Multi-stage Dockerfile using golang:1.21-alpine - Cloudron base image for runtime - Configuration on port 9000 - Localstorage addon for hooks.json - 256MB memory limit 💘 Generated with Crush Assisted-by: GLM-4.7 via Crush <crush@charm.land>
61 lines
1.1 KiB
JSON
61 lines
1.1 KiB
JSON
[
|
|
{
|
|
"id": "webhook",
|
|
"execute-command": "/home/adnan/redeploy-go-webhook.sh",
|
|
"command-working-directory": "/home/adnan/go",
|
|
"response-message": "I got the payload!",
|
|
"response-headers":
|
|
[
|
|
{
|
|
"name": "Access-Control-Allow-Origin",
|
|
"value": "*"
|
|
}
|
|
],
|
|
"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-hmac-sha1",
|
|
"secret": "mysecret",
|
|
"parameter":
|
|
{
|
|
"source": "header",
|
|
"name": "X-Hub-Signature"
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"match":
|
|
{
|
|
"type": "value",
|
|
"value": "refs/heads/master",
|
|
"parameter":
|
|
{
|
|
"source": "payload",
|
|
"name": "ref"
|
|
}
|
|
}
|
|
}
|
|
]
|
|
}
|
|
}
|
|
]
|