diff --git a/server.js b/server.js index fbd173d..f8979e9 100644 --- a/server.js +++ b/server.js @@ -7,7 +7,7 @@ require('dotenv').config(); const app = express(); const PORT = process.env.PORT || 3000; -const GITEA_SECRET = "123"; +const GITEA_SECRET = process.env.GITEA_SECRET; // Serve static files from the 'public' directory app.use(express.static(path.join(__dirname, 'public'))); @@ -66,13 +66,7 @@ app.post('/api', (req, res) => { // Verify the secret const hmac = crypto.createHmac('sha256', GITEA_SECRET); - const digest = hmac.update(payload).digest('hex'); - - console.log('Signature from Gitea:', signature); - console.log('Computed digest:', digest); - console.log('Payload:', payload); - console.log('Secret:', GITEA_SECRET); - + const digest = hmac.update(payload).digest('hex'); const bufferSignature = Buffer.from(signature, 'hex'); const bufferDigest = Buffer.from(digest, 'hex');