feat: add proxy option for acme user

This commit is contained in:
Jacky 2024-10-07 12:19:20 +08:00
parent deda31a6e1
commit 46a9ccbdf1
No known key found for this signature in database
GPG key ID: 215C21B10DF38B4D
17 changed files with 956 additions and 641 deletions

View file

@ -18,11 +18,13 @@ type PrivateKey struct {
type AcmeUser struct {
Model
Name string `json:"name"`
Email string `json:"email"`
CADir string `json:"ca_dir"`
Registration registration.Resource `json:"registration" gorm:"serializer:json"`
Key PrivateKey `json:"-" gorm:"serializer:json"`
Name string `json:"name"`
Email string `json:"email"`
CADir string `json:"ca_dir"`
Registration registration.Resource `json:"registration" gorm:"serializer:json"`
Key PrivateKey `json:"-" gorm:"serializer:json"`
Proxy string `json:"proxy"`
RegisterOnStartup bool `json:"register_on_startup"`
}
func (u *AcmeUser) GetEmail() string {
@ -61,7 +63,8 @@ func (u *AcmeUser) Register() error {
// Skip TLS check
if config.HTTPClient != nil {
t, err := transport.NewTransport()
t, err := transport.NewTransport(
transport.WithProxy(u.Proxy))
if err != nil {
return err
}