Tuesday, 4 May 2021

ngrok - Time saver when you want to expose local host to internet

I was working with bitbucket pipelines and integrating with spinnaker webhooks. Since SPINNAKER does not have a direct interaction with bitbucket pipelines. I started using webhooks from spinnaker and able to trigger bitbucketpipeline from SPINNAKER by calling API end points.

    Now the real problem is I need to trigger the spinnaker pipeline from bitbucket. So Bitbucket should call the SPINNAKER API webhook end point. I setup everything in my local spinnaker and bitbucket server which is in cloud is not able to call the local end point . What I did is I setup a webhook in my bitbucket pipeline for each commit. Bitbucket trying to ping my local url and throw error like invalid uri. from few posts on Atlassian forums suggesting ngrok to expose localhost to internet (from security wise its dangerous if its not secured/ controlled) . 

    Then finally I tried ngrok and the options its providing is super cool. Its much simple to use for testing purposes. The download size also so less and the command is like 'ngrok.exe http portnumber' thats it. Its providing a simple dashboard to monitor the incoming requests (which is very good to know who is using our end points). also providing inspect functionality, status codes and able to view header and body of incoming and response . Also we can setit for time bound after that it dissolves itself. We can load the dashboard from localhost:4040

 

 


If you register for their services, they provide an account with auth token and dashboard where we can see all tunnels . Also we can override the 2 hrs limit. They also provide an API end point so that we can programmatically expose the end points and destroy them automatically after use which is super cool. 

 

No comments:

Shrinking the size of Oracle Virtual Box

First, zero fill your virtual disk. Boot the VM and run: sudo dd if=/dev/zero of=/bigemptyfile bs=4096k status=progress sudo rm -f /bigempty...