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

AI: Where in the Loop Should Humans Go?

This is a re-publishing of a blog post I originally wrote for work, but wanted on my own blog as well.AI is everywhere, and its impressive claims are leading to rapid adoption. At this stage, I’d qualify it as charismatic technology—someth…

via Ferd.ca

More Good Programming Quotes, Part 6

Here are more good programming quotes I have found since my last post. Programming “Configuration is coding in a poorly designed programming language without tests, version control, or documentation.”Gregor Hohpe “It’s the developers misunderstanding, not…

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