Webhooklar Nasıl Debug Edilir?

June 18, 2022

Webhookları debug etmek zor değil ama sorunlu bir süreç. Kodu yazıyorsunuz. Deploy edip çalıştırıyorsunuz. Loglara bakıyorsunuz. Düzgün haberleşemediğinizi görüyorsunuz. Aynı adımları tekrarlıyorsunuz.

Olası problemler;

Karşılaşılabilecek her türlü sorunla karşılaşmış biri olarak bunu yazıyı yazma ihtiyacı hissettim. Bu işi kolaylaştıracak ngrok , hookbin gibi araçlar mevcut. Güvenip güvenmemek size kalmış. Benim görüşümü sorarsanız pek güvenilir bulmuyorum. Benzer fonksiyonaliteyi elde etmek için standart araçları kullanarak nasıl yapabileceğimize bakalım.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
server {
    listen 443 ssl http2;
    server_name debughooks.yourdomain.com;

    location / {
        include proxy_params;
        proxy_pass http://127.0.0.1:5700;
    }

    # ssl keys, bad bots etc...
}

Forwarding

Ssh forwarding yapmanız durumunda serverınız varsayılan olarak loopback adresini kullanıyor. sshd_config üzerinden bunu client tarafından belirlenecek hale getirebilirsiniz.

1
2
#/etc/ssh/sshd_config:
GatewayPorts clientspecified

son olarak port forwarding yapıyoruz.

1
ssh -nN -R 0.0.0.0:5700:127.0.0.1:5700 user@yourdomain

böylelikle size yapılan webhooks isteklerini sizin bilgisayarınıza yönlendiriliyor. Web hookunuzun çalıştığından emin olduğunuzda domain isminizi gerçek hook adresi ile değiştirebilirsiniz.

hidden

The Review Is the Action Item

2024/05/30The Review Is the Action ItemI like to consider running an incident review to be its own action item. Other follow-ups emerging from it are a plus, but the point is to learn from incidents, and the review gives room for that to happen.This is no…

via Ferd.ca

Finding a New Software Developer Job

For the first time ever, I was laid off, and had to find a new software developer job. I managed to find a new one, but it took longer than I thought, and it was a lot of work. I … Continue reading →

via Henrik Warne's blog

HOWTO: Change your behavior

In theory, behavior change should be easy. At first glance, it seems like you control your behavior. So, if you desire different behavior, why doesn’t your behavior change as instantly as your desire to change it? In short, lasting change of habitual behavio…

via Matt Might's blog