How to build lego with only Cloudflare and Google Domains DNS providers? #2551
-
How to build lego with only Cloudflare and Google Domains DNS providers (to reduce the binary size)? |
Beta Was this translation helpful? Give feedback.
Answered by
abdeldjalil-fellah
Jun 30, 2025
Replies: 2 comments 2 replies
-
This is not possible. The binary size is about 100MiB, I think it's already small. |
Beta Was this translation helpful? Give feedback.
2 replies
-
this solution works for me (keep only
// Code generated by 'make generate-dns'; DO NOT EDIT.
package dns
import (
"fmt"
"github.com/go-acme/lego/v4/challenge"
"github.com/go-acme/lego/v4/challenge/dns01"
"github.com/go-acme/lego/v4/providers/dns/cloudflare"
"github.com/go-acme/lego/v4/providers/dns/rfc2136"
)
// NewDNSChallengeProviderByName Factory for DNS providers.
func NewDNSChallengeProviderByName(name string) (challenge.Provider, error) {
switch name {
case "manual":
return dns01.NewDNSProviderManual()
case "cloudflare":
return cloudflare.NewDNSProvider()
case "rfc2136":
return rfc2136.NewDNSProvider()
default:
return nil, fmt.Errorf("unrecognized DNS provider: %s", name)
}
}
the binary size has been decreased from 110MB to 22MB |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
abdeldjalil-fellah
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
this solution works for me (keep only
cloudflare
andrfc2136
):providers/dns/*
exceptcloudflare
andrfc2136
providers/dns/zz_gen_dns_providers.go