Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
git-server-repo
Advanced tools
A custom git command which creates a remote repository specifically for git deployments.
npm install git-server-repo -g
Ensure this is installed GLOBALLY in order for it to work as a custom git command
I wanted to setup a git repo on my server which would perform some actions on my code once pushed.
git push ...
commandOn your server/raspberry pi you will have a git repository which accepts commits from other devices (aka your computer where you are working), moves your projects files to your desired directory and then runs a build script on those files (optional).
post-install
in your package.json file?git-server-repo
is more versatile as it does not require that you are using node or npm for your project, specifically.
Example - a C program can be compiled after I push it to my Raspberry Pi.
I want to practice my C programming on my Raspberry Pi but...:
.c files
git server-repo
your/project/.git/hooks/post-receive
file and add whatever commands you would like to execute after a new update is receivedgit push <your-remote> master
your/project
SSH into your server/Raspberry Pi
ssh <username>@<ip/domain>
Enter your password if prompted
$ npm i git-server-repo -g
cd your/project
You can optionally just use the --working-dir
flag and specify your desired directory. Example: --working-dir=your/project
git server-repo
ssh://<your-username>@<your-server-ip>/your/project/.git
nano your/project/.git/hooks/post-receive
You will want to make all your changes BELOW the following comments
#
# DO WHAT YOU WANT WITH THE FILES YOU'VE JUST PUSHED
# example:
#
# $ gcc app.c -o app
#
# The above compiles your app.c file into an executable after each push
Now, in a new terminal window, open the project you've been working on. Ensure there is a git repository already setup for your project
Add your server/Raspberry Pi as a remote in your git repo. This will allow you to push your code to your server/Raspberry Pi
git remote add <remote-name> <your-generated-remote-url>
git remote add raspberry-pi ssh://<your-username>@<your-server-ip>/your/project/.git
git push raspberry-pi master
The above pushes your master branch to the remote repository. Once there, the post-receive file will move your files to the your/project/directory
and run your custom commands
FAQs
A custom git command which creates a remote repository specifically for git deployments.
The npm package git-server-repo receives a total of 0 weekly downloads. As such, git-server-repo popularity was classified as not popular.
We found that git-server-repo 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.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.