Sandbot: Difference between revisions
No edit summary |
No edit summary |
||
Line 12: | Line 12: | ||
sudo chown www-data /var/www/html | sudo chown www-data /var/www/html | ||
git remote set-url origin https://git.xpub.nl/XPUB/sandbot.git | git remote set-url origin https://git.xpub.nl/XPUB/sandbot.git | ||
Created file /usr/lib/cgi-bin/pull_XXXXXXXXXX.cgi | |||
<source lang="bash"> | |||
#!/bin/bash | |||
echo "Content-type:text/html" | |||
echo | |||
cd /var/www/html | |||
git fetch --all | |||
git reset --hard origin/master | |||
</source> | |||
Line 19: | Line 31: | ||
cd /usr/lib/cgi-bin | cd /usr/lib/cgi-bin | ||
./pull_XXXXXX.cgi | ./pull_XXXXXX.cgi | ||
Test from browser: | |||
https://hub.xpub.nl/sandbot/cgi-bin/pull_XXXXXX.cgi |
Revision as of 18:33, 6 February 2021
Some useful links / notes related to the sandbot setup.
Running something as www-data
sudo su www-data -s /bin/sh
Setting up /var/www/html with githook:
sudo chown www-data /var/www/html git remote set-url origin https://git.xpub.nl/XPUB/sandbot.git
Created file /usr/lib/cgi-bin/pull_XXXXXXXXXX.cgi
#!/bin/bash
echo "Content-type:text/html"
echo
cd /var/www/html
git fetch --all
git reset --hard origin/master
Testing the webhook...
sudo su www-data -s /bin/sh cd /usr/lib/cgi-bin ./pull_XXXXXX.cgi
Test from browser:
https://hub.xpub.nl/sandbot/cgi-bin/pull_XXXXXX.cgi