From ecb8726a7bed96dc2071f99f0308b8d8114c2980 Mon Sep 17 00:00:00 2001 From: Hugh Rundle Date: Sat, 10 Aug 2024 08:19:09 +1000 Subject: [PATCH] update docs and comments --- README.md | 6 +++++- webhooks.js | 5 +++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 688fa31..c8c5209 100644 --- a/README.md +++ b/README.md @@ -10,4 +10,8 @@ See [the instructions](docs.md) for installing on a server. ## Testing -There isn't a test suite, but you can use the `curl_test.sh` script to manually test that your app is working correctly. \ No newline at end of file +There isn't a test suite, but you can use the `curl_test.sh` script to manually test that your app is working correctly. + +## Notes for Hugh + +Remember that you adjusted this on the server to run `process.js` to merge csv changes into the topojson file! diff --git a/webhooks.js b/webhooks.js index e71067d..c7726ee 100644 --- a/webhooks.js +++ b/webhooks.js @@ -51,7 +51,8 @@ async function gitPull(local_repo, res) { app.post(`/${process.env.APP_PATH}`, (req, res) => { const hmac = createHmac('sha256', process.env.SECRET) const local_repo = process.env.LOCAL_REPO - hmac.update(JSON.stringify(req.body)) + // Use spacing of 2 for Forgejo, or none for GitHub + hmac.update(JSON.stringify(req.body, null, 2)) // check has signature header and the decrypted signature matches if (req.get('X-Hub-Signature-256')) { @@ -96,4 +97,4 @@ app.listen(port, () => { } console.log(`Webhooks app listening on port ${port}`) -}) \ No newline at end of file +}) -- 2.39.5