mirror of
https://github.com/Alvin-Zilverstand/nginx-proxy-manager.git
synced 2026-11-27 16:37:55 +01:00
Add nginx exec
This commit is contained in:
1 parent
b8008606fd
commit
5b6dbaf43e
6 files changed
+101
-14
No files matched your search
@@ -10,6 +10,8 @@ import (
|
||||
"npm/internal/api/middleware"
|
||||
"npm/internal/api/schema"
|
||||
"npm/internal/entity/certificate"
|
||||
"npm/internal/jobqueue"
|
||||
"npm/internal/logger"
|
||||
)
|
||||
|
||||
// GetCertificates will return a list of Certificates
|
||||
@@ -73,6 +75,8 @@ func CreateCertificate() func(http.ResponseWriter, *http.Request) {
|
||||
return
|
||||
}
|
||||
|
||||
configureCertificate(newCertificate)
|
||||
|
||||
h.ResultResponseJSON(w, r, http.StatusOK, newCertificate)
|
||||
}
|
||||
}
|
||||
@@ -119,6 +123,8 @@ func UpdateCertificate() func(http.ResponseWriter, *http.Request) {
|
||||
return
|
||||
}
|
||||
|
||||
configureCertificate(certificateObject)
|
||||
|
||||
h.ResultResponseJSON(w, r, http.StatusOK, certificateObject)
|
||||
}
|
||||
}
|
||||
@@ -143,3 +149,13 @@ func DeleteCertificate() func(http.ResponseWriter, *http.Request) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func configureCertificate(c certificate.Model) {
|
||||
err := jobqueue.AddJob(jobqueue.Job{
|
||||
Name: "RequestCertificate",
|
||||
Action: c.Request,
|
||||
})
|
||||
if err != nil {
|
||||
logger.Error("ConfigureCertificateError", err)
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user