mirror of
https://github.com/sipeed/NanoKVM.git
synced 2026-09-11 09:26:44 -05:00
feat: support downloading image from online URL feat: add keyboard shortcut Ctrl+Alt+Del fix: fix the CSRF issue perf: add an option to configure custom ICE servers perf: removed unnecessary modifications to DNS configuration perf: add an SSH enable/disable toggle in the web UI perf: add a Tailscale enable/disable toggle in the web UI perf: download Tailscale installation package from the official source perf: automatic enable/disable GOMEMLIMIT on tailscale start/stop perf: add JWT configuration perf: implement secure password storage using bcrypt hashing perf: implement integrity checks for online updates refactor: refactor HDMI module and remove the dependency libmaixcam_lib.so refactor: web terminal use pty instead of SSH refactor: move Tailscale APIs from the network module to the extensions module
26 lines
957 B
Go
26 lines
957 B
Go
package router
|
|
|
|
import (
|
|
"NanoKVM-Server/middleware"
|
|
"NanoKVM-Server/service/extensions/tailscale"
|
|
|
|
"github.com/gin-gonic/gin"
|
|
)
|
|
|
|
func extensionsRouter(r *gin.Engine) {
|
|
api := r.Group("/api/extensions").Use(middleware.CheckToken())
|
|
|
|
ts := tailscale.NewService()
|
|
|
|
api.POST("/tailscale/install", ts.Install) // install tailscale
|
|
api.POST("/tailscale/uninstall", ts.Uninstall) // uninstall tailscale
|
|
api.GET("/tailscale/status", ts.GetStatus) // get tailscale status
|
|
api.POST("/tailscale/up", ts.Up) // run tailscale up
|
|
api.POST("/tailscale/down", ts.Down) // run tailscale down
|
|
api.POST("/tailscale/login", ts.Login) // tailscale login
|
|
api.POST("/tailscale/logout", ts.Logout) // tailscale logout
|
|
api.POST("/tailscale/start", ts.Start) // tailscale start
|
|
api.POST("/tailscale/stop", ts.Stop) // tailscale stop
|
|
api.POST("/tailscale/restart", ts.Restart) // tailscale restart
|
|
}
|