Drone generate wrong webhook with gitea

I try to setup drone with gitea using docker. Docker-compose bring them up works well.

I create a repo in gitea and do push, then enable repo in drone, drone generate webhook but when I push code or do “test Delievery” it always fail.

So I think drone somehow generate wrong webhook.

This is output of “test Delievery”:

Request URL: http://drone-server/hook?access_token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ0ZXh0Ijoicm9vdC90ZXN0IiwidHlwZSI6Imhvb2sifQ.YxD4rgFL0f2Rza0dl6wjbbqry9QXJBu8mftS5KD-6nk
Request method: POST
Content-Type: application/json
X-GitHub-Delivery: f2877568-c855-4d66-b1ec-470623111627
X-GitHub-Event: push
X-Gitea-Delivery: f2877568-c855-4d66-b1ec-470623111627
X-Gitea-Event: push
X-Gitea-Signature: fe9c68eff5edc0be9f5e7b571cbf133810091ca51a3883569b93baaf34d5d315
X-Gogs-Delivery: f2877568-c855-4d66-b1ec-470623111627
X-Gogs-Event: push
X-Gogs-Signature: fe9c68eff5edc0be9f5e7b571cbf133810091ca51a3883569b93baaf34d5d315

content:

{
  "secret": "GLFSCSSJ2PF7LBR3JODNA7MRFK5JX35BQR2OMG4HT4WSZYXJND4A====",
  "ref": "refs/heads/master",
  "before": "0000000000000000000000000000000000000000",
  "after": "0000000000000000000000000000000000000000",
  "compare_url": "",
  "commits": [
    {
      "id": "0000000000000000000000000000000000000000",
      "message": "This is a fake commit",
      "url": "http://gitea-app:3000/root/test/commit/0000000000000000000000000000000000000000",
      "author": {
        "name": "Ghost",
        "email": "",
        "username": ""
      },
      "committer": {
        "name": "Ghost",
        "email": "",
        "username": ""
      },
      "verification": null,
      "timestamp": "0001-01-01T00:00:00Z",
      "added": null,
      "removed": null,
      "modified": null
    }
  ],
  "head_commit": null,
  "repository": {
    "id": 1,
    "owner": {
      "id": 1,
      "login": "root",
      "full_name": "",
      "email": "[email protected]",
      "avatar_url": "https://secure.gravatar.com/avatar/57683ed8846a9dffa9cdc2e0d96a0503?d=identicon",
      "language": "",
      "is_admin": true,
      "username": "root"
    },
    "name": "test",
    "full_name": "root/test",
    "description": "",
    "empty": true,
    "private": false,
    "fork": false,
    "parent": null,
    "mirror": false,
    "size": 0,
    "html_url": "http://gitea-app:3000/root/test",
    "ssh_url": "[email protected]:root/test.git",
    "clone_url": "http://gitea-app:3000/root/test.git",
    "website": "",
    "stars_count": 0,
    "forks_count": 0,
    "watchers_count": 1,
    "open_issues_count": 0,
    "default_branch": "master",
    "archived": false,
    "created_at": "2019-04-19T07:06:36Z",
    "updated_at": "2019-04-19T07:06:36Z",
    "permissions": {
      "admin": false,
      "push": false,
      "pull": false
    }
  },
  "pusher": {
    "id": 1,
    "login": "root",
    "full_name": "",
    "email": "[email protected]",
    "avatar_url": "https://secure.gravatar.com/avatar/57683ed8846a9dffa9cdc2e0d96a0503?d=identicon",
    "language": "",
    "is_admin": true,
    "username": "root"
  },
  "sender": {
    "id": 1,
    "login": "root",
    "full_name": "",
    "email": "[email protected]",
    "avatar_url": "https://secure.gravatar.com/avatar/57683ed8846a9dffa9cdc2e0d96a0503?d=identicon",
    "language": "",
    "is_admin": true,
    "username": "root"
  }
}

Gitea:latest
Drone:0.8

as a tip: update to drone version 1 and post your drone.yml
i also had some difficulties with v0.8
be aware that drone.yml syntax changed in v1.

Did you add the DRONE_HOST environment variable to the drone app in docker-compose.yml?

Drone 0.8 does not use DRONE_HOST for webhook generation. It uses the incoming http request to determine its own address. This approach was flawed and fixed in the latest version of Drone …

Drone 1.0 uses DRONE_SERVER_HOST and DRONE_SERVER_PROTO when creating the webhook. It is therefore recommended to use Drone 1.0 going forward instead of using the legacy 0.8 version.