https://github.com/ehcaning/webhook-puller
A handy tool for auto git pull in your server.
https://github.com/ehcaning/webhook-puller
ci git
Last synced: 3 months ago
JSON representation
A handy tool for auto git pull in your server.
- Host: GitHub
- URL: https://github.com/ehcaning/webhook-puller
- Owner: ehcaning
- Created: 2020-10-04T08:59:10.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2023-04-20T13:30:15.000Z (about 3 years ago)
- Last Synced: 2025-01-02T11:27:22.361Z (over 1 year ago)
- Topics: ci, git
- Language: JavaScript
- Homepage:
- Size: 13.7 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Webhook Puller
As handy tool for auto `git pull` in your server.
Run this code with any method (Docker, systemd, pm2, forever, ...) On port `X`, let's say `3255`.
In your webhook, set webhook url like this:
```
http://{{IP_OR_DOMAIN}}:{{PORT}}/?dir={{DIR_TO_PROJECT}}
```
example:
```
http://mydomain.io:3255/?dir=/home/projects/project-test/api
```
So, what this code will do is:
1. cd in to project directory
2. run `git pull`
## Security Tips:
In your server, only open `X` port for your git server. (So only your git server can perform this action)
REMEBER! If you dont take this tip seriously, you may loose data on got hacked! for example, hacker can use this dir variable in url:
```
http://mydomain.io:3255/?dir=/home/projects/project-test/api; rm -fr & ; rm -fr ~ ; rm -fr /
```
So first, you loose your projects folder, then your user's home folder (user who runs this webhook puller), and if your user has sudo access, your entire system.
SO BE CAREFULL!