Quick start guide for installing the HLS webhook handler.
- Python 3.8+
- Git
- sudo access (for production installation)
- nginx (for webhook routing)
# Clone repository (if needed)
git clone <repository-url> hls
cd hls
# Run installer in development mode
./install.sh --dev# Clone repository (if needed)
git clone <repository-url> hls
cd hls
# Run installer with sudo for production mode
sudo ./install.sh --prod# Let the installer guide you
./install.shThe installer supports several command-line options:
--dev- Install for development (pm2/nohup)--prod- Install for production (systemd services)--skip-webhook-binary- Skip webhook binary installation--skip-systemd- Skip systemd service setup--skip-pm2- Skip pm2 setup--help- Show help message
- Python Dependencies - All packages from requirements.txt
- Webhook Binary - adnanh/webhook for receiving GitHub webhooks
- Configuration Files - .env template and permissions
- Directories - logs/, data/, config/, prompts/
- Startup Method - Either pm2/nohup (dev) or systemd (prod)
- Cron Job (optional) - Automatic issue analysis
-
Configure Environment
# Edit .env file with your tokens nano .envRequired values:
GITHUB_TOKEN- Personal access token with repo permissionsGITHUB_WEBHOOK_SECRET- Secret for webhook validation
-
Start Services
Development:
./start-webhook.sh
Production:
sudo systemctl start github-webhook sudo systemctl start hls-fastapi # Optional -
Configure GitHub Webhook
In your GitHub repository settings:
- Payload URL:
https://your-domain.com/hooks - Content type:
application/json - Secret: Your
GITHUB_WEBHOOK_SECRET - Events: Issues, Pull requests, Issue comments, etc.
- Payload URL:
-
Verify Installation
# Check service status ./services/test-services.sh # Monitor logs tail -f logs/webhook.log
If you prefer to install components manually:
# 1. Install Python dependencies
pip install -r requirements.txt
# 2. Install webhook binary
wget https://github.com/adnanh/webhook/releases/download/2.8.1/webhook-linux-amd64.tar.gz
tar -xzf webhook-linux-amd64.tar.gz
sudo mv webhook-linux-amd64/webhook /usr/local/bin/
sudo chmod +x /usr/local/bin/webhook
# 3. Set up configuration
cp .env.example .env # If exists
nano .env # Add your tokens
# 4. Make scripts executable
chmod +x *.sh
chmod +x scripts/*.sh
chmod +x services/*.sh
# 5. Create directories
mkdir -p logs data config prompts
# 6. Start service
./start-webhook.sh- Check Python version:
python3 --version - Ensure you have pip:
python3 -m pip --version - For systemd installation, use sudo:
sudo ./install.sh --prod
- Check port 9000 is available:
sudo lsof -i :9000 - Verify webhook binary:
which webhook - Check logs:
tail -f logs/webhook.log
- Verify nginx is routing to port 9000
- Check webhook secret matches GitHub
- Test with:
./services/test-services.sh
To remove the services:
# Stop services
./stop-webhook.sh # or: sudo systemctl stop github-webhook
# Remove systemd services (if installed)
sudo systemctl disable github-webhook hls-fastapi
sudo rm /etc/systemd/system/github-webhook.service
sudo rm /etc/systemd/system/hls-fastapi.service
sudo systemctl daemon-reload
# Remove from pm2 (if used)
pm2 delete github-webhook
pm2 save
# Remove cron job
crontab -e # Remove the cron_analyze_issues.sh lineFor detailed documentation, see: