VPS Deployment & Webhooks
Deployments for Planovi Webpage are fully automated. Pushing changes to the GitHub repository triggers an instantaneous update on the central Hostinger VPS (191.218.165.149).
1. Automated GitHub Webhook Deployment
The VPS runs a Python-based webhook daemon (vps-deployer on port 9000):
sequenceDiagram
autonumber
actor Dev as Developer
participant GH as "GitHub (PA-IDEAS/planovi-webpage)"
participant VPS as "VPS Deployer (:9000)"
participant Server as "/opt/vps-apps/webpage"
Dev->>GH: git push origin main (or dev)
GH->>VPS: POST /webhook (X-Hub-Signature-256)
VPS->>VPS: Validate HMAC SHA-256 signature
VPS->>Server: git pull origin [branch]
VPS->>Server: Set file permissions (chown www-data)
VPS-->>GH: 200 OK (Deployment Success)
2. Server Directory Mapping
| Branch | VPS File Path | Public Domain / URL |
|---|---|---|
main | /opt/vps-apps/webpage/prod | https://planovi.app |
dev | /opt/vps-apps/webpage/dev | https://dev-webpage.planovi.app |
3. Webhook Runner Specification
The webhook server evaluates incoming GitHub payloads and executes the following sequence:
# Automated deployment script executed by vps-deployercd /opt/vps-apps/webpage/prodgit fetch origin maingit reset --hard origin/mainchmod -R 755 .docker exec vps-proxy nginx -s reloadBecause PHP files are interpreted at runtime by PHP-FPM and static assets are served directly through Nginx, zero service restart is required. The reload is 100% zero-downtime.
4. Manual / FTP Fallback Deployment (deploy.sh)
In the event of an SSH or webhook outage, a legacy FTP synchronization script is maintained at the repository root:
./deploy.shThe script iterates through all non-hidden project files and uploads changed assets via curl --ftp-create-dirs directly to the Hostinger FTP endpoint (145.14.153.31).