correct config value for GITHUB_WEBHOOK, log every request for debugging purposes

This commit is contained in:
Ulf Gebhardt 2022-01-12 08:05:47 +01:00
parent 1e39f5049b
commit e378136106
Signed by: ulfgebhardt
GPG Key ID: DA6B843E748679C9
2 changed files with 8 additions and 1 deletions

View File

@ -59,7 +59,7 @@ const webhook = {
// Elopage
WEBHOOK_ELOPAGE_SECRET: process.env.WEBHOOK_ELOPAGE_SECRET || 'secret',
// Github
WEBHOOK_GITHUB: process.env.WEBHOOK_GITHUB || false,
WEBHOOK_GITHUB: process.env.WEBHOOK_GITHUB === 'true' || false,
WEBHOOK_GITHUB_SECRET: process.env.WEBHOOK_GITHUB_SECRET || '',
WEBHOOK_GITHUB_PAYLOAD_LIMIT: process.env.WEBHOOK_GITHUB_PAYLOAD_LIMIT || '1mb',
WEBHOOK_GITHUB_BRANCH: process.env.WEBHOOK_GITHUB_BRANCH || 'master',

View File

@ -65,6 +65,13 @@ const createServer = async (context: any = serverContext): Promise<any> => {
// bodyparser text for elopage
app.use(express.text())
// Log every request
app.use((req, res, next) => {
// eslint-disable-next-line no-console
console.log(req)
next()
})
// Elopage Webhook
app.post('/hook/elopage/' + CONFIG.WEBHOOK_ELOPAGE_SECRET, elopageWebhook)
// Github Webhook