mirror of
https://github.com/0xJacky/nginx-ui.git
synced 2025-05-11 18:35:51 +02:00
refactor: migrate to new cosy
This commit is contained in:
parent
6082aef5d5
commit
33a996e777
111 changed files with 1163 additions and 1772 deletions
|
@ -2,12 +2,12 @@ package certificate
|
|||
|
||||
import (
|
||||
"github.com/0xJacky/Nginx-UI/api"
|
||||
"github.com/0xJacky/Nginx-UI/internal/cosy"
|
||||
"github.com/0xJacky/Nginx-UI/model"
|
||||
"github.com/0xJacky/Nginx-UI/query"
|
||||
"github.com/0xJacky/Nginx-UI/settings"
|
||||
"github.com/gin-gonic/gin"
|
||||
"github.com/spf13/cast"
|
||||
"github.com/uozi-tech/cosy"
|
||||
"net/http"
|
||||
)
|
||||
|
||||
|
@ -31,7 +31,7 @@ func CreateAcmeUser(c *gin.Context) {
|
|||
"register_on_startup": "omitempty",
|
||||
}).BeforeExecuteHook(func(ctx *cosy.Ctx[model.AcmeUser]) {
|
||||
if ctx.Model.CADir == "" {
|
||||
ctx.Model.CADir = settings.ServerSettings.GetCADir()
|
||||
ctx.Model.CADir = settings.CertSettings.GetCADir()
|
||||
}
|
||||
err := ctx.Model.Register()
|
||||
if err != nil {
|
||||
|
@ -50,7 +50,7 @@ func ModifyAcmeUser(c *gin.Context) {
|
|||
"register_on_startup": "omitempty",
|
||||
}).BeforeExecuteHook(func(ctx *cosy.Ctx[model.AcmeUser]) {
|
||||
if ctx.Model.CADir == "" {
|
||||
ctx.Model.CADir = settings.ServerSettings.GetCADir()
|
||||
ctx.Model.CADir = settings.CertSettings.GetCADir()
|
||||
}
|
||||
|
||||
if ctx.OriginModel.Email != ctx.Model.Email ||
|
||||
|
|
|
@ -3,7 +3,6 @@ package certificate
|
|||
import (
|
||||
"github.com/0xJacky/Nginx-UI/api"
|
||||
"github.com/0xJacky/Nginx-UI/internal/cert"
|
||||
"github.com/0xJacky/Nginx-UI/internal/cosy"
|
||||
"github.com/0xJacky/Nginx-UI/internal/helper"
|
||||
"github.com/0xJacky/Nginx-UI/internal/nginx"
|
||||
"github.com/0xJacky/Nginx-UI/internal/notification"
|
||||
|
@ -12,6 +11,7 @@ import (
|
|||
"github.com/gin-gonic/gin"
|
||||
"github.com/go-acme/lego/v4/certcrypto"
|
||||
"github.com/spf13/cast"
|
||||
"github.com/uozi-tech/cosy"
|
||||
"net/http"
|
||||
"os"
|
||||
)
|
||||
|
|
|
@ -3,11 +3,11 @@ package certificate
|
|||
import (
|
||||
"github.com/0xJacky/Nginx-UI/api"
|
||||
"github.com/0xJacky/Nginx-UI/internal/cert/dns"
|
||||
"github.com/0xJacky/Nginx-UI/internal/cosy"
|
||||
"github.com/0xJacky/Nginx-UI/model"
|
||||
"github.com/0xJacky/Nginx-UI/query"
|
||||
"github.com/gin-gonic/gin"
|
||||
"github.com/spf13/cast"
|
||||
"github.com/uozi-tech/cosy"
|
||||
"net/http"
|
||||
)
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@ package certificate
|
|||
|
||||
import (
|
||||
"github.com/0xJacky/Nginx-UI/internal/cert"
|
||||
"github.com/0xJacky/Nginx-UI/internal/logger"
|
||||
"github.com/uozi-tech/cosy/logger"
|
||||
"github.com/0xJacky/Nginx-UI/model"
|
||||
"github.com/gin-gonic/gin"
|
||||
"github.com/go-acme/lego/v4/certcrypto"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue