Discord - Webhook Image Issues from Local Servers #6824

Closed
opened 2025-11-02 07:07:35 -06:00 by GiteaMirror · 1 comment
Owner

Originally created by @lukeawyatt on GitHub (Feb 7, 2021).

  • Gitea version (or commit ref): 1.13.2
  • Operating system: Ubuntu / Docker
  • Database (use [x]):
    • PostgreSQL
    • MySQL
    • MSSQL
    • SQLite

Description

I saw this case opened in the past but marked stale, however, it is still relevant (reference). Webhook pushes to discord work from local Gitea servers, however, the user image does not get populated since it's referencing an internal address. Discord is likely filtering this out upon receiving the request. The same problem happens for the Avatar URL (Icon URL as it's labeled), but this one can be removed or set differently in the Webhook settings.

I'd suggest another field in the webhook options - User Icon Override URL. If set, all user images can be populated from the specified value rather than their derived value. It's possible this can be populated from Gravitar, alternatively if available. I've highlighted the problematic values in the logs below.

Screenshots

Screen Shot 2021-02-07 at 11 56 15 AM

Webhook Request

Request URL: https://discordapp.com/api/webhooks/REDACTED
Request method: POST
Content-Type: application/json
X-GitHub-Delivery: REDACTED
X-GitHub-Event: push
X-Gitea-Delivery: REDACTED
X-Gitea-Event: push
X-Gitea-Signature:
X-Gogs-Delivery: REDACTED
X-Gogs-Event: push
X-Gogs-Signature:

{
"wait": false,
"content": "",
"username": "Bender",
"avatar_url": "",
"tts": false,
"embeds": [
{
"title": "[Clients/REDACTED:master] 1 new commit",
"description": "36c1ee8 Readme update - Luke Wyatt",
"url": "http://10.10.10.100:3000/Clients/REDACTED/commit/REDACTED",
"color": 1754624,
"footer": {
"text": ""
},
"author": {
"name": "lwyatt",
"url": "http://10.10.10.100:3000/lwyatt",
"icon_url": "http://10.10.10.100:3000/user/avatar/lwyatt/-1"
},
"fields": null
}
]
}

Webhook Response

Alt-Svc: h3-27=":443"; ma=86400, h3-28=":443"; ma=86400, h3-29=":443"; ma=86400
Cf-Cache-Status: DYNAMIC
Cf-Ray: REDACTED-ATL
Cf-Request-Id: REDACTED
Connection: keep-alive
Content-Length: 0
Content-Type: text/html; charset=utf-8
Date: Fri, 05 Feb 2021 14:31:35 GMT
Expect-Ct: max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct"
Nel: {"max_age":604800,"report_to":"cf-nel"}
Report-To: {"endpoints":[{"url":"https://a.nel.cloudflare.com/report?s=REDACTED"}],"group":"cf-nel","max_age":604800}
Server: cloudflare
Set-Cookie: __cfduid=REDACTED; expires=Sun, 07-Mar-21 14:31:35 GMT; path=/; domain=.discordapp.com; HttpOnly; SameSite=Lax
Strict-Transport-Security: max-age=31536000; includeSubDomains
Via: 1.1 google
X-Envoy-Upstream-Service-Time: 40
X-Ratelimit-Bucket: REDACTED
X-Ratelimit-Limit: 5
X-Ratelimit-Remaining: 4
X-Ratelimit-Reset: 1612535498
X-Ratelimit-Reset-After: 2

Originally created by @lukeawyatt on GitHub (Feb 7, 2021). - Gitea version (or commit ref): 1.13.2 - Operating system: Ubuntu / Docker - Database (use `[x]`): - [ ] PostgreSQL - [ ] MySQL - [ ] MSSQL - [x] SQLite ## Description I saw this case opened in the past but marked stale, however, it is still relevant ([reference](https://github.com/go-gitea/gitea/issues/6263)). Webhook pushes to discord work from local Gitea servers, however, the user image does not get populated since it's referencing an internal address. Discord is likely filtering this out upon receiving the request. The same problem happens for the **Avatar URL (Icon URL as it's labeled)**, but this one can be removed or set differently in the Webhook settings. I'd suggest another field in the webhook options - **User Icon Override URL**. If set, all user images can be populated from the specified value rather than their derived value. It's possible this can be populated from Gravitar, alternatively if available. I've highlighted the problematic values in the logs below. ## Screenshots ![Screen Shot 2021-02-07 at 11 56 15 AM](https://user-images.githubusercontent.com/4325168/107153787-4f57ae80-693d-11eb-9671-7be7453a0cdc.png) ## Webhook Request Request URL: https://discordapp.com/api/webhooks/REDACTED Request method: POST Content-Type: application/json X-GitHub-Delivery: REDACTED X-GitHub-Event: push X-Gitea-Delivery: REDACTED X-Gitea-Event: push X-Gitea-Signature: X-Gogs-Delivery: REDACTED X-Gogs-Event: push X-Gogs-Signature: { "wait": false, "content": "", "username": "Bender", **"avatar_url": "",** "tts": false, "embeds": [ { "title": "[Clients/REDACTED:master] 1 new commit", "description": "[36c1ee8](http://10.10.10.100:3000/Clients/REDACTED/commit/REDACTED) Readme update - Luke Wyatt", "url": "http://10.10.10.100:3000/Clients/REDACTED/commit/REDACTED", "color": 1754624, "footer": { "text": "" }, "author": { "name": "lwyatt", "url": "http://10.10.10.100:3000/lwyatt", **"icon_url": "http://10.10.10.100:3000/user/avatar/lwyatt/-1"** }, "fields": null } ] } ## Webhook Response Alt-Svc: h3-27=":443"; ma=86400, h3-28=":443"; ma=86400, h3-29=":443"; ma=86400 Cf-Cache-Status: DYNAMIC Cf-Ray: REDACTED-ATL Cf-Request-Id: REDACTED Connection: keep-alive Content-Length: 0 Content-Type: text/html; charset=utf-8 Date: Fri, 05 Feb 2021 14:31:35 GMT Expect-Ct: max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct" Nel: {"max_age":604800,"report_to":"cf-nel"} Report-To: {"endpoints":[{"url":"https:\/\/a.nel.cloudflare.com\/report?s=REDACTED"}],"group":"cf-nel","max_age":604800} Server: cloudflare Set-Cookie: __cfduid=REDACTED; expires=Sun, 07-Mar-21 14:31:35 GMT; path=/; domain=.discordapp.com; HttpOnly; SameSite=Lax Strict-Transport-Security: max-age=31536000; includeSubDomains Via: 1.1 google X-Envoy-Upstream-Service-Time: 40 X-Ratelimit-Bucket: REDACTED X-Ratelimit-Limit: 5 X-Ratelimit-Remaining: 4 X-Ratelimit-Reset: 1612535498 X-Ratelimit-Reset-After: 2
GiteaMirror added the issue/duplicate label 2025-11-02 07:07:35 -06:00
Author
Owner

@techknowlogick commented on GitHub (Feb 7, 2021):

There are many possible combinations of possible webhook modifications. We are looking into plugins/webhook templates, as this would be a better case for that. Until then I recommend using something like openfaas/faasd to use as a webhook modifier. I recently wrote a blog post on how to configure Gitea & OpenFaaS/faasd.

@techknowlogick commented on GitHub (Feb 7, 2021): There are many possible combinations of possible webhook modifications. We are looking into plugins/webhook templates, as this would be a better case for that. Until then I recommend using something like openfaas/faasd to use as a webhook modifier. I recently wrote a blog post on how to configure Gitea & OpenFaaS/faasd.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#6824