Compare commits

...

4 commits
v1.0 ... main

Author SHA1 Message Date
TheWanderingCrow
586e336cb8 chore: release v2.0 2025-12-30 22:11:21 -05:00
TheWanderingCrow
1c1b2a3a1d fix!: SMTP now works properly in non-dev environments 2025-12-30 21:50:16 -05:00
TheWanderingCrow
43d4e6caee chore: update sha256 2025-12-30 21:21:02 -05:00
TheWanderingCrow
00104dc59a docs: fix syntax error in README.md 2025-12-27 11:04:28 -05:00
3 changed files with 6 additions and 9 deletions

View file

@ -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

View file

@ -42,8 +42,8 @@
domain = "git.wanderingcrow.net";
owner = "TheWanderingCrow";
repo = "actualbudget-report";
rev = "v1.0";
hash = "sha256-MP2JRBls5rqUZOMmb8BD60jcLwGgvGRAAixWxMttNhA=";
rev = "v2.0";
hash = "sha256-H+pA9dFsP5QQ3W32NEU1TWYiOiti53jnzN3Bnq+QJ5Q=";
};
vendorHash = "sha256-NHTKwUSIbNCUco88JbHOo3gt6S37ggee+LWNbHaRGEs=";
};

View file

@ -149,6 +149,7 @@ 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() {
@ -184,12 +185,8 @@ func main() {
message := []byte(subject + mime + body + categories.String())
var auth smtp.Auth
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))
auth = smtp.PlainAuth("", smtpUsername, smtpPassword, smtpHost)
err := smtp.SendMail(smtpHost+":"+smtpPort, auth, smtpUsername, strings.Split(smtpRecipients, ","), []byte(message))
if err != nil {
log.Fatal(err)
}