New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

deploy-hook-server

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

deploy-hook-server

Server listen port and check headers, if headers correct, server execute custom script

latest
Source
npmnpm
Version
1.0.6
Version published
Maintainers
1
Created
Source

Library for create deploy hook server

Server listen port and check headers, if headers correct, server execute custom script

Usage

install library npm i deploy-hook-server
start server:

const serverLib = require('../lib/server');
const server = serverLib.Server({
    port: 40312,
    accessHeaderName: 'deploy-token',
    accessHeaderValue: 'meex0c8wdmcpjhjsssrfbeveasarhydnoe9g0bxot8fojk708kaiegbo091oaaybl',
    handlerOptions: {
        executeScriptPath: './tests/test-deploy-script.sh',
        formatExecuteScriptFn: function (currentPath, deployParams) {
            console.log('formatExecuteScriptFn', `currentPath:${currentPath}`, 'deployParams:', deployParams);
            currentPath += ' ' + deployParams['deployService'];
            currentPath += ' ' + deployParams['deployVersion'];
            return currentPath;
        },
    },
    extractRequestDataFn: function (req, res) {
        return new Promise( (resolve, reject) => {
            if ( req.headers['content-type'] !== 'application/json' ) {
                return reject(new Error('Content type must be application/json'));
            }
            let totalData = '';
            req.on('data', function (data) {
                totalData+= data;
            });
            req.on('end', function () {
                resolve( JSON.parse(totalData) );
            });
        });
    }
});

FAQs

Package last updated on 11 Oct 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts