fix: Gitea-Webhook akzeptiert HMAC-Signatur (X-Gitea-Signature)
Gitea sendet das Webhook-Secret als HMAC-SHA256-Signatur des Bodys, nicht als Klartext-Header. Bisher liefen alle per Secret konfigurierten Repo-Hooks auf 401 - Push-Deploys funktionierten nur ueber ?token= in der URL. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
@@ -24,7 +24,8 @@ assertServerConfig()
|
||||
const app = express()
|
||||
app.set('trust proxy', 1)
|
||||
app.use(sessionMiddleware())
|
||||
app.use(express.json({ limit: '2mb' }))
|
||||
// rawBody wird fuer die HMAC-Verifikation des Gitea-Webhooks benoetigt
|
||||
app.use(express.json({ limit: '2mb', verify: (req, _res, buf) => { req.rawBody = buf } }))
|
||||
|
||||
app.use((req, res, next) => {
|
||||
const origin = req.get('Origin')
|
||||
|
||||
Reference in New Issue
Block a user