Merge pull request 'update docs and comments' (#1) from testing into main

Reviewed-on: #1
This commit is contained in:
Hugh Rundle 2024-08-10 08:20:06 +10:00
commit 7eb3ef7ce4
2 changed files with 8 additions and 3 deletions

View file

@ -11,3 +11,7 @@ See [the instructions](docs.md) for installing on a server.
## Testing ## 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. 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!

View file

@ -51,7 +51,8 @@ async function gitPull(local_repo, res) {
app.post(`/${process.env.APP_PATH}`, (req, res) => { app.post(`/${process.env.APP_PATH}`, (req, res) => {
const hmac = createHmac('sha256', process.env.SECRET) const hmac = createHmac('sha256', process.env.SECRET)
const local_repo = process.env.LOCAL_REPO 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 // check has signature header and the decrypted signature matches
if (req.get('X-Hub-Signature-256')) { if (req.get('X-Hub-Signature-256')) {