mirror of
https://github.com/0xJacky/nginx-ui.git
synced 2025-05-11 10:25:52 +02:00
Merge branch 'dev' into refactor/otp
This commit is contained in:
commit
121287df21
40 changed files with 1084 additions and 326 deletions
22
api/crypto/crypto.go
Normal file
22
api/crypto/crypto.go
Normal file
|
@ -0,0 +1,22 @@
|
|||
package crypto
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
|
||||
"github.com/0xJacky/Nginx-UI/api"
|
||||
"github.com/0xJacky/Nginx-UI/internal/crypto"
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
|
||||
// GetPublicKey generates a new ED25519 key pair and registers it in the cache
|
||||
func GetPublicKey(c *gin.Context) {
|
||||
params, err := crypto.GetCryptoParams()
|
||||
if err != nil {
|
||||
api.ErrHandler(c, err)
|
||||
return
|
||||
}
|
||||
|
||||
c.JSON(http.StatusOK, gin.H{
|
||||
"public_key": params.PublicKey,
|
||||
})
|
||||
}
|
10
api/crypto/router.go
Normal file
10
api/crypto/router.go
Normal file
|
@ -0,0 +1,10 @@
|
|||
package crypto
|
||||
|
||||
import "github.com/gin-gonic/gin"
|
||||
|
||||
func InitPublicRouter(r *gin.RouterGroup) {
|
||||
g := r.Group("/crypto")
|
||||
{
|
||||
g.GET("public_key", GetPublicKey)
|
||||
}
|
||||
}
|
|
@ -1,12 +1,13 @@
|
|||
package system
|
||||
|
||||
import (
|
||||
"github.com/0xJacky/Nginx-UI/internal/middleware"
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
|
||||
func InitPublicRouter(r *gin.RouterGroup) {
|
||||
r.GET("install", InstallLockCheck)
|
||||
r.POST("install", InstallNginxUI)
|
||||
r.POST("install", middleware.EncryptedParams(), InstallNginxUI)
|
||||
r.GET("translation/:code", GetTranslation)
|
||||
}
|
||||
|
||||
|
|
|
@ -6,7 +6,7 @@ import (
|
|||
)
|
||||
|
||||
func InitAuthRouter(r *gin.RouterGroup) {
|
||||
r.POST("/login", Login)
|
||||
r.POST("/login", middleware.EncryptedParams(), Login)
|
||||
r.DELETE("/logout", Logout)
|
||||
|
||||
r.GET("/begin_passkey_login", BeginPasskeyLogin)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue