diff --git a/README.md b/README.md index 4d5e23d..2829f18 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,7 @@ Then in your configuration (using sops-nix, you will need to adjust it if you us nixpkgs.overlays = [ inputs.actualbudget-report.overlays.default ]; imports = [ - inputs.actualbudget-report.nixosModules.default + inputs.actualbudget-report.nixosModules.default; ]; # Fill out all the following environment variables for the service diff --git a/flake.nix b/flake.nix index 21fc84e..a07b5a6 100644 --- a/flake.nix +++ b/flake.nix @@ -42,8 +42,8 @@ domain = "git.wanderingcrow.net"; owner = "TheWanderingCrow"; repo = "actualbudget-report"; - rev = "v2.0"; - hash = "sha256-H+pA9dFsP5QQ3W32NEU1TWYiOiti53jnzN3Bnq+QJ5Q="; + rev = "v1.0"; + hash = "sha256-MP2JRBls5rqUZOMmb8BD60jcLwGgvGRAAixWxMttNhA="; }; vendorHash = "sha256-NHTKwUSIbNCUco88JbHOo3gt6S37ggee+LWNbHaRGEs="; }; diff --git a/main.go b/main.go index 38d12d0..945591e 100644 --- a/main.go +++ b/main.go @@ -149,7 +149,6 @@ func main() { var smtpUsername = os.Getenv("SMTP_USERNAME") var smtpPassword = os.Getenv("SMTP_PASSWORD") var smtpHost = os.Getenv("SMTP_HOST") - var smtpPort = os.Getenv("SMTP_PORT") var smtpRecipients = os.Getenv("SMTP_RECIPIENTS") client := CreateBudgetClient(baseUrl, apiKey, syncId, encryptionKey) if !client.BankSync() { @@ -185,8 +184,12 @@ func main() { message := []byte(subject + mime + body + categories.String()) var auth smtp.Auth - auth = smtp.PlainAuth("", smtpUsername, smtpPassword, smtpHost) - err := smtp.SendMail(smtpHost+":"+smtpPort, auth, smtpUsername, strings.Split(smtpRecipients, ","), []byte(message)) + if os.Getenv("ENVIRONMENT") == "dev" { + auth = nil + } else { + auth = smtp.PlainAuth("", smtpUsername, smtpPassword, smtpHost) + } + err := smtp.SendMail(smtpHost, auth, smtpUsername, strings.Split(smtpRecipients, ","), []byte(message)) if err != nil { log.Fatal(err) }