Security News
Weekly Downloads Now Available in npm Package Search Results
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
code-hosting-webhooks
Advanced tools
This is an easy to use nodeJS based web hook for GitLab.
npm install gitlabhook
var gitlabhook = require('gitlabhook');
var gitlab = gitlabhook({/* options */} [, callback]);
gitlab.listen();
Configure a WebHook URL to whereever the server is listening.
0.0.0.0
3420
gitlabhook.conf
['/etc/gitlabhook/', '/usr/local/etc/gitlabhook/', '.']
false
. Mostly only for debugging purposes.logger:{info:function(s){}, error:function(s){}}
). Mostly only for debugging purposes.{repo1:'cmd1', repo2:['cmd2a','cmd2b','cmd2c']}
)/bin/sh
The config file will be ignored if a callback function is declared.
Example config file with task definitions:
{
"tasks": {
"myRepo": "/usr/local/bin/myDeploy %g",
"*": ["echo 'GitLab Server %s'",
"echo 'Repository: %r'",
"echo 'Event: %k'",
"echo 'User: %u'",
"echo 'Branch: %b'",
"echo 'Git Url: %g'",
"echo 'Last Commit: %i'",
"echo '\tMessage: %m'",
"echo '\tTime: %t'"]
},
"keep":false,
"logger": false,
"cmdshell":"/bin/bash"
}
The *
matches any tasks.
The place holders are:
%s
: GitLab server's IP address%r
: name of the repository (e.g. myRepo
)%k
: kind of event (e.g. tag_push
)%u
: owner of the repository (user name)%b
: branch reference (e.g. refs/heads/master
)%g
: ssh-based cloning url on the GitLab server (e.g. git@gitlab.host:rolf.niepraschk/myRepo.git
)%h
: http-based cloning url on the GitLab server (e.g. http://gitlab.host/rolf.niepraschk/myRepo.git
)%i
: id of the last commit%t
: timestamp of the last commit%m
: message of the last commitThe file gitlabhook-server.js
shows an example GitLab Hook server listen at port 3420.
The file gitlabhook.service
is intended to use as a systemd sercvice. The Makefile
helps to create an rpm archive for a systemd based OS. Call
make rpm
MIT
FAQs
This is an easy to use nodeJS based web hook for GitLab.
We found that code-hosting-webhooks demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
Security News
A Stanford study reveals 9.5% of engineers contribute almost nothing, costing tech $90B annually, with remote work fueling the rise of "ghost engineers."
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.