diff --git a/middleware/acme.go b/middleware/acme.go index d25a7a3..cb46e25 100644 --- a/middleware/acme.go +++ b/middleware/acme.go @@ -14,7 +14,6 @@ var usr, _ = user.Current() func InitAcme() { ca() email() - export() } func ca() { @@ -43,10 +42,10 @@ func email() { func Issue(name string) { logger := GetLogger() - produce := os.Getenv("ACME_PRODUCE") + dns := os.Getenv("ACME_DNS") alias := os.Getenv("ACME_ALIAS") - cmd := exec.Command(filepath.Join(usr.HomeDir, ".acme.sh/acme.sh"), "--issue", "--dns", produce, "-d", name, "--challenge-alias", alias) + cmd := exec.Command(filepath.Join(usr.HomeDir, ".acme.sh/acme.sh"), "--issue", "--dns", dns, "-d", name, "--challenge-alias", alias) cmd.Stdout = os.Stdout cmd.Stderr = os.Stdout err := cmd.Start() @@ -65,16 +64,3 @@ func Install(name string, id string) { logger.Error("cmd.Start() failed with %s\n", zap.String("error", err.Error())) } } - -func export() { - logger := GetLogger() - account := os.Getenv("ACME_ACCOUNT") - token := os.Getenv("ACME_TOKEN") - - cmd := exec.Command("sh", "-c", "echo $CF_Email && echo $CF_Key") - cmd.Env = []string{"CF_Email=" + account, "CF_Key=" + token} - err := cmd.Run() - if err != nil { - logger.Error("cmd.Start() failed with %s\n", zap.String("error", err.Error())) - } -}