Tunnel Services APIs to facilitate Tunnel configuration for Lazarus Network, Functions implemented :
After placing the .path and .service files in /etc/systemd/system, Run:
-
sudo systemctl daemon-reload
-
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.
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.
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.
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.
-
sudo systemctl status caddy-watcher.path
-
sudo systemctl status caddy-watcher.service
-
sudo systemctl status nginx-watcher.path
-
sudo systemctl status nginx-watcher.service
Creates Web Tunnel with Caddyfile
POST - /api/v1.0/caddy
Request - name
Response - {"message":{"name":"name1","port":"port1", "createdAt":"timeStamp", domain":"caddyDomain"},"status":200}
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}
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}
Deletes Web Tunnel configuration from Caddyfile
DELETE - /api/v1.0/caddy/:name
Request - name
Response - {"message": ”Deleted Tunnel $name”,"status":200}
Creates SSH Tunnel nginx
POST - /api/v1.0/nginx
Request - name
Response - {"message":{"name":"name1","port":"port1", "createdAt":"timeStamp", domain":"nginxDomain"},"status":200}
Fetches SSH Tunnel configuration
GET - /api/v1.0/nginx/:name
Request - name
Response - {"message":{"name":"name1","port":"port1"},"status":200}
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}
Deletes SSH Tunnel configuration
DELETE - /api/v1.0/nginx/:name
Request - name
Response - {"message": ”Deleted Tunnel $name”,"status":200}