This commit is contained in:
Djkato 2023-02-08 18:31:28 +01:00
parent 69bf9e3bed
commit 64c0ce84bb

View file

@ -9,8 +9,11 @@ http.createServer(function (req, res) {
req.on('data', function (chunk) { req.on('data', function (chunk) {
let sig = "sha1=" + crypto.createHmac('sha1', secret).update(chunk.toString()).digest('hex') let sig = "sha1=" + crypto.createHmac('sha1', secret).update(chunk.toString()).digest('hex')
console.log("Got a request!")
if (req.headers["x-hub-signature"] == sig) { if (req.headers["x-hub-signature"] == sig) {
console.log("updating moover...")
exec("pm2 stop 'MOOver - main' && " + " cd " + repo + "&& git pull" + " && npm install" + " pm2 start 'MOOver - main'") exec("pm2 stop 'MOOver - main' && " + " cd " + repo + "&& git pull" + " && npm install" + " pm2 start 'MOOver - main'")
console.log("Success!")
} }
}) })