I searched both the issue tracker and the forum but did not find anything that resembles my issue.
I have a server where both my Gitea and my Drone server are behind Nginx as a reverse proxy. When I add a repo to Drone, it creates a Webhook for the repository. However, when I try to test the webhook, Gitea just fails, telling me that both the request and the response are “N/A”. If I, however, create the exact same webhook by hand, Gitea is able to fire the webhook with success.
I am able to re-create the issue without the reverse proxy which tells me that it is not the culprit.
To reproduce the issue the following compose file was used:
version: "2.0"
services:
gitea:
image: "gitea/gitea:latest"
volumes:
- gitea_data:/data
environment:
- USER_UID=9002
- USER_GID=9002
- APP_NAME=Gitea
- RUN_MODE=prod
ports:
- "3000:3000"
networks:
internal:
ipv4_address: "240.1.0.3"
drone:
image: "drone/drone:latest"
volumes:
- ./drone:/data
- /var/run/docker.sock
environment:
- DRONE_GITEA_SERVER=http://240.1.0.3:3000
- DRONE_HOST=240.1.0.4
- DRONE_PROTO=http
networks:
internal:
ipv4_address: "240.1.0.4"
volumes:
gitea_data:
driver: local
networks:
internal:
external: false
driver: bridge
ipam:
driver: default
config:
- subnet: 240.1.0.0/8
Steps to recreate:
- Create an account on the Gitea instance (240.1.0.3)
- Create a repository with a .drone.yml file. I used
kind: pipeline
name: default
steps:
- name: test
image: alpine:3.9
- sh test.sh
The test.sh file just contains echo "Hello World"
3. Log in to Drone, activate the repository
4. In Gitea, go to the repository’s webhook settings. If the URL for the webhook is http://localhost[...]
, change it to http://240.1.0.4[...]
. Try to “test deliver” the webhook.
The result should be a failed delivery with “N/A” as both request and response data.
5. Copy the URL of the webhook, create a new webhook, paste the url there and type something for the secret. “Test deliver” the webhook and it should work.