This commit is contained in:
Saufi
2026-06-16 17:09:17 +08:00
parent fb4739e407
commit 9d4717eb45
3 changed files with 9 additions and 6 deletions

View File

@@ -3,7 +3,10 @@
Bila ada `git push` ke Gitea, Gitea hantar webhook ke server. Server tarik kod
terbaru dan jalankan `docker compose up --build -d` secara automatik.
Aliran: **push → Gitea webhook → `webhook` listener (port 9000) → `deploy.sh`**
Aliran: **push → Gitea webhook → `webhook` listener (port 9001) → `deploy.sh`**
> Nota: port **9001** digunakan (bukan 9000 default) kerana server ini sudah
> ada satu lagi app guna webhook di port 9001. Pastikan tiada port bertindih.
---
@@ -38,7 +41,7 @@ sudo systemctl status myansuran-webhook
Repo → **Settings → Webhooks → Add Webhook → Gitea**:
- **Target URL:** `http://SERVER_IP:9000/hooks/myansuran-deploy`
- **Target URL:** `http://SERVER_IP:9001/hooks/myansuran-deploy`
- **HTTP Method:** `POST`
- **Content Type:** `application/json`
- **Secret:** secret SAMA seperti dalam `hooks.json`
@@ -61,8 +64,8 @@ sudo journalctl -u myansuran-webhook -f
## Nota keselamatan
- Port `9000` hanya perlu dicapai oleh Gitea. Hadkan dengan firewall:
`sudo ufw allow from <IP_GITEA> to any port 9000 proto tcp`
- Port `9001` hanya perlu dicapai oleh Gitea. Hadkan dengan firewall:
`sudo ufw allow from <IP_GITEA> to any port 9001 proto tcp`
- Atau letak di belakang Nginx/Apache reverse proxy dengan HTTPS.
- Signature HMAC-SHA256 menghalang sesiapa tanpa secret daripada trigger deploy.