Skip to content

TheLazarusNetwork/TunnelNode

Repository files navigation

TunnelServicesAPI

Tunnel Services APIs to facilitate Tunnel configuration for Lazarus Network, Functions implemented :

Installation Notes

After placing the .path and .service files in /etc/systemd/system, Run:

  1. sudo systemctl daemon-reload

  2. sudo systemctl enable caddy-watcher.path && sudo systemctl start caddy-watcher.path

Created symlink /etc/systemd/system/multi-user.target.wants/caddy-watcher.path → /etc/systemd/system/caddy-watcher.path.

  1. sudo systemctl enable caddy-watcher.service && sudo systemctl start caddy-watcher.service

Created symlink /etc/systemd/system/multi-user.target.wants/caddy-watcher.service → /etc/systemd/system/caddy-watcher.service.

  1. sudo systemctl enable nginx-watcher.path && sudo systemctl start nginx-watcher.path

Created symlink /etc/systemd/system/multi-user.target.wants/nginx-watcher.path → /etc/systemd/system/nginx-watcher.path.

  1. sudo systemctl enable nginx-watcher.service && sudo systemctl start nginx-watcher.service

Created symlink /etc/systemd/system/multi-user.target.wants/nginx-watcher.service → /etc/systemd/system/nginx-watcher.service.

  1. sudo systemctl status caddy-watcher.path

  2. sudo systemctl status caddy-watcher.service

  3. sudo systemctl status nginx-watcher.path

  4. sudo systemctl status nginx-watcher.service

Summary of Functions Implemented

Caddy API

Create Tunnel

Creates Web Tunnel with Caddyfile
POST - /api/v1.0/caddy
Request - name
Response - {"message":{"name":"name1","port":"port1", "createdAt":"timeStamp", domain":"caddyDomain"},"status":200}

Fetch Tunnel

Fetches Web Tunnel configuration and states the status of Port alloted
GET - /api/v1.0/caddy/:name
Request - name
Response - {"message":{"name":"name1","port":"port1", "createdAt":"timeStamp", domain":"caddyDomain", "status":"inactive"},"status":200}

Fetch All Tunnels

Fetches All Web Tunnel configurations
GET - /api/v1.0/caddy
Request - N/A
Response - {"message":[{"name":"name1","port":"port1", "createdAt":"timeStamp1", domain":"caddyDomain"}, {"name":"name2","port":"port2", "createdAt":"timeStamp2", domain":"caddyDomain"}],"status":200}

Delete Tunnel

Deletes Web Tunnel configuration from Caddyfile
DELETE - /api/v1.0/caddy/:name
Request - name
Response - {"message": ”Deleted Tunnel $name”,"status":200}

NGINX API

Create Tunnel

Creates SSH Tunnel nginx
POST - /api/v1.0/nginx
Request - name
Response - {"message":{"name":"name1","port":"port1", "createdAt":"timeStamp", domain":"nginxDomain"},"status":200}

Fetch Tunnel

Fetches SSH Tunnel configuration
GET - /api/v1.0/nginx/:name
Request - name
Response - {"message":{"name":"name1","port":"port1"},"status":200}

Fetch All Tunnels

Fetches All SSH Tunnel configurations
GET - /api/v1.0/nginx
Request - N/A
Response - {"message":[{"name":"name1","port":"port1, "createdAt":"timeStamp1", domain":"nginxDomain""}, {"name":"name2","port":"port2", , "createdAt":"timeStamp2", domain":"nginxDomain"}],"status":200}

Delete Tunnel

Deletes SSH Tunnel configuration
DELETE - /api/v1.0/nginx/:name
Request - name
Response - {"message": ”Deleted Tunnel $name”,"status":200}

References

Note

About

Server to support creation of multiple tunnels from any local system to the internet bypassing the NAT/Firewalls

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published