Updated acmedns tool

Add support for automatically generating acmedns module for Windows 7 using older version of lego
This commit is contained in:
Toby Chui
2024-05-18 14:48:55 +08:00
parent ec973eb3bc
commit fe48a9a0c3
4 changed files with 73 additions and 11 deletions

View File

@ -12,7 +12,22 @@ To update the module, simply run update.sh
The updated files will be written into the `acmedns` folder. Then, you can copy it to the ACME module folder (or later-on a CICD pipeline will be made to do this automatically, but for now you have to manually copy it into the module under `src/mod/acme/`)
### Build for Windows 7 (NT6.1)
If you want to build Zoraxy with NT6.1, the lego version must be kept on or below 4.15.0. To build acmedns module for win7, add -- "win7" as go run paramter as follows.
```bash
go run ./extract.go -- "win7"
```
After moving the generated modules into the acmedns folder, you will also need to force override the version of the lego in the go.mod file under `src/`. by adding this line at the bottom of the go.mod file
```
replace github.com/go-acme/lego/v4 v4.16.1 => github.com/go-acme/lego/v4 v4.15.0
```
Make sure your Go version is on or below `1.20` for Windows 7 support.
### Module Usage
@ -25,14 +40,9 @@ func GetDNSProviderByJsonConfig(name string, js string)(challenge.Provider, erro
providersdef.GetDNSProviderByJsonConfig("gandi", "{\"Username\":\"far\",\"Password\":\"boo\"}")
```
This should be able to replace the default lego v4 build in one (the one attached below) that requires the use of environment variables
```go
// NewDNSChallengeProviderByName Factory for DNS providers.
func NewDNSChallengeProviderByName(name string) (challenge.Provider, error)
```