mirror of
https://github.com/0xJacky/nginx-ui.git
synced 2025-05-11 10:25:52 +02:00
refactor(cert): introducing new management page
1. User can now view the latest renew logs of the certain certificate. 2. Add manually renew button in certificate modify page for managed certificate (auto cert)
This commit is contained in:
parent
7c47f08a72
commit
ac68fd05c9
36 changed files with 1908 additions and 1286 deletions
43
internal/cert/issue.go
Normal file
43
internal/cert/issue.go
Normal file
|
@ -0,0 +1,43 @@
|
|||
package cert
|
||||
|
||||
import (
|
||||
"crypto"
|
||||
"github.com/go-acme/lego/v4/registration"
|
||||
)
|
||||
|
||||
type ChannelWriter struct {
|
||||
Ch chan []byte
|
||||
}
|
||||
|
||||
func NewChannelWriter() *ChannelWriter {
|
||||
return &ChannelWriter{
|
||||
Ch: make(chan []byte, 1024),
|
||||
}
|
||||
}
|
||||
|
||||
func (cw *ChannelWriter) Write(p []byte) (n int, err error) {
|
||||
n = len(p)
|
||||
temp := make([]byte, n)
|
||||
copy(temp, p)
|
||||
cw.Ch <- temp
|
||||
return n, nil
|
||||
}
|
||||
|
||||
// User You'll need a user or account type that implements acme.User
|
||||
type User struct {
|
||||
Email string
|
||||
Registration *registration.Resource
|
||||
Key crypto.PrivateKey
|
||||
}
|
||||
|
||||
func (u *User) GetEmail() string {
|
||||
return u.Email
|
||||
}
|
||||
|
||||
func (u *User) GetRegistration() *registration.Resource {
|
||||
return u.Registration
|
||||
}
|
||||
|
||||
func (u *User) GetPrivateKey() crypto.PrivateKey {
|
||||
return u.Key
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue