Skip to content

jdegand/PingPulse

Repository files navigation

PingPulse: A Dockerized .NET & SQL Server Webhook Gateway

🌟 Project Architecture

[GitHub Repo Event] ➔ [GitHub Actions Workflow] ➔ [Pinggy Tunnel] ➔ [Docker: .NET API] ➔ [Docker: MS SQL for Linux]

How to Run

  1. Spin Up the Stack with Docker Compose

    sudo docker compose up -d
  2. Expose Port 5000 Securely via Pinggy

    Instead of installing an extra tunnel client, you can use SSH client to tunnel through Pinggy. Run this command in a new terminal window:

    ssh -p 443 -R0:localhost:5000 public@a.pinggy.io

    Pinggy will output a live public URL (e.g., https://pinggy.link).

  3. Configure the GitHub Actions Workflow

    This repository contains a workflow file located at:

    .github/workflows/notify-hub.yml

    The workflow runs on every push and forwards a JSON payload to your local API through your tunneling URL. To activate it, you only need to provide your own public tunnel endpoint.

    1. Set the PINGGY_URL Secret

      1. Go to GitHub Settings Tab → Security and Quality → Secrets and variables → Actions

      2. Create a new Repository secret named PINGGY_URL

      3. Paste the public URL generated by your tunneling tool (e.g., https://abc123.pinggy.link/api/github/events).

    Note: Watch out for double slashes in your PINGGY_URL. If you copy and paste URL, you will likely have a double slash and this will cause POST 404 error.

    Once the secret is saved, every push will automatically trigger the workflow and send the payload to your local stack.

  4. Trigger the Workflow

    git commit --allow-empty -m "test webhook"
    git push
  5. Verify the Data Reached Your Local SQL Server

    1. View the API Logs
    sudo docker logs --tail 30 dotnet_webhook_api
    1. Connect to the SQL Server container

      sudo docker exec -it sql_server_hub /opt/mssql-tools/bin/sqlcmd \
      -S localhost -U sa -P "YourStrongPassword123!" -C \
      -Q "SELECT * FROM NotificationHub.dbo.Notifications;"
    2. Check the database interactively

      sudo docker exec -it sql_server_hub /opt/mssql-tools/bin/sqlcmd -S localhost -U sa -P "YourStrongPassword123!" -C
      USE NotificationHub;
      GO
      SELECT TOP 20 * FROM Notifications ORDER BY ReceivedAt DESC;
      GO

About

A Dockerized .NET & SQL Server Webhook Gateway

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors