2020-11-24 17:36:42 +08:00
|
|
|
package certs
|
2020-09-13 20:37:07 +08:00
|
|
|
|
|
|
|
|
import (
|
2020-12-03 11:03:12 +08:00
|
|
|
"github.com/TeaOSLab/EdgeAdmin/internal/configloaders"
|
2020-11-24 17:36:42 +08:00
|
|
|
"github.com/TeaOSLab/EdgeAdmin/internal/web/actions/default/servers/certs/acme"
|
2021-10-03 13:09:49 +08:00
|
|
|
"github.com/TeaOSLab/EdgeAdmin/internal/web/actions/default/servers/certs/acme/accounts"
|
2020-11-24 17:36:42 +08:00
|
|
|
"github.com/TeaOSLab/EdgeAdmin/internal/web/actions/default/servers/certs/acme/users"
|
2020-09-13 20:37:07 +08:00
|
|
|
"github.com/TeaOSLab/EdgeAdmin/internal/web/helpers"
|
|
|
|
|
"github.com/iwind/TeaGo"
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
func init() {
|
|
|
|
|
TeaGo.BeforeStart(func(server *TeaGo.Server) {
|
|
|
|
|
server.
|
2020-12-03 11:03:12 +08:00
|
|
|
Helper(helpers.NewUserMustAuth(configloaders.AdminModuleCodeServer)).
|
2020-09-13 20:37:07 +08:00
|
|
|
Helper(NewHelper()).
|
2020-11-24 17:36:42 +08:00
|
|
|
Data("teaSubMenu", "cert").
|
|
|
|
|
Prefix("/servers/certs").
|
|
|
|
|
Data("leftMenuItem", "cert").
|
2020-09-13 20:37:07 +08:00
|
|
|
Get("", new(IndexAction)).
|
2020-09-30 17:46:38 +08:00
|
|
|
GetPost("/uploadPopup", new(UploadPopupAction)).
|
|
|
|
|
Post("/delete", new(DeleteAction)).
|
|
|
|
|
GetPost("/updatePopup", new(UpdatePopupAction)).
|
|
|
|
|
Get("/certPopup", new(CertPopupAction)).
|
|
|
|
|
Get("/viewKey", new(ViewKeyAction)).
|
|
|
|
|
Get("/viewCert", new(ViewCertAction)).
|
|
|
|
|
Get("/downloadKey", new(DownloadKeyAction)).
|
|
|
|
|
Get("/downloadCert", new(DownloadCertAction)).
|
|
|
|
|
Get("/downloadZip", new(DownloadZipAction)).
|
2020-10-01 16:01:04 +08:00
|
|
|
Get("/selectPopup", new(SelectPopupAction)).
|
|
|
|
|
Get("/datajs", new(DatajsAction)).
|
2020-11-24 17:36:42 +08:00
|
|
|
|
2021-10-03 13:09:49 +08:00
|
|
|
// ACME任务
|
2020-11-24 17:36:42 +08:00
|
|
|
Prefix("/servers/certs/acme").
|
|
|
|
|
Data("leftMenuItem", "acme").
|
|
|
|
|
Get("", new(acme.IndexAction)).
|
|
|
|
|
GetPost("/create", new(acme.CreateAction)).
|
2020-11-25 21:19:07 +08:00
|
|
|
Post("/run", new(acme.RunAction)).
|
|
|
|
|
GetPost("/updateTaskPopup", new(acme.UpdateTaskPopupAction)).
|
|
|
|
|
Post("/deleteTask", new(acme.DeleteTaskAction)).
|
2020-11-24 17:36:42 +08:00
|
|
|
|
2021-10-03 13:09:49 +08:00
|
|
|
// ACME用户
|
2020-11-24 17:36:42 +08:00
|
|
|
Prefix("/servers/certs/acme/users").
|
|
|
|
|
Get("", new(users.IndexAction)).
|
|
|
|
|
GetPost("/createPopup", new(users.CreatePopupAction)).
|
|
|
|
|
GetPost("/updatePopup", new(users.UpdatePopupAction)).
|
|
|
|
|
Post("/delete", new(users.DeleteAction)).
|
|
|
|
|
GetPost("/selectPopup", new(users.SelectPopupAction)).
|
2021-10-03 13:09:49 +08:00
|
|
|
Post("/accountsWithCode", new(users.AccountsWithCodeAction)).
|
|
|
|
|
|
|
|
|
|
// ACME账号
|
|
|
|
|
Prefix("/servers/certs/acme/accounts").
|
|
|
|
|
Get("", new(accounts.IndexAction)).
|
|
|
|
|
GetPost("/createPopup", new(accounts.CreatePopupAction)).
|
|
|
|
|
GetPost("/updatePopup", new(accounts.UpdatePopupAction)).
|
|
|
|
|
Post("/delete", new(accounts.DeleteAction)).
|
2020-11-24 17:36:42 +08:00
|
|
|
|
2021-10-03 13:09:49 +08:00
|
|
|
//
|
2020-09-13 20:37:07 +08:00
|
|
|
EndAll()
|
|
|
|
|
})
|
|
|
|
|
}
|