From 6eb0beb355259b8a7ef29202508b605dc97a61fc Mon Sep 17 00:00:00 2001 From: TheWanderingCrow Date: Sat, 27 Dec 2025 10:45:31 -0500 Subject: [PATCH 1/9] add support for encryption key protected budget files --- README.md | 1 + main.go | 23 +++++++++++++++-------- 2 files changed, 16 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 0bec688..2829f18 100644 --- a/README.md +++ b/README.md @@ -27,6 +27,7 @@ sops.templates."actualbudget-report-env".content = '' SMTP_PASSWORD= SMTP_HOST= SMTP_RECIPIENTS= + BUDGET_ENCRYPTION_KEY= ''; services.actualbudget-report = { diff --git a/main.go b/main.go index 195a22a..945591e 100644 --- a/main.go +++ b/main.go @@ -32,10 +32,11 @@ import ( ) type BudgetClient struct { - baseUrl string - apiKey string - syncId string - fullUrl string + baseUrl string + apiKey string + syncId string + fullUrl string + encryptionKey string } type BudgetMonthsResponse struct { @@ -73,9 +74,12 @@ type BudgetMonthsResponse struct { } `json:"data"` } -func CreateBudgetClient(baseUrl string, apiKey string, syncId string) *BudgetClient { +// Create budget client, you may pass empty strings to optional parameters +// Required: baseUrl, apiKey, syncId +// Optional: encryptionKey +func CreateBudgetClient(baseUrl string, apiKey string, syncId string, encryptionKey string) *BudgetClient { fullUrl := baseUrl + "/v1/budgets/" + syncId - client := BudgetClient{baseUrl, apiKey, syncId, fullUrl} + client := BudgetClient{baseUrl, apiKey, syncId, fullUrl, encryptionKey} return &client } @@ -111,7 +115,9 @@ func (b BudgetClient) GetBudgetMonths() *BudgetMonthsResponse { currentTime := time.Now() year, month := currentTime.Year(), int(currentTime.Month()) budgetMonth := fmt.Sprintf("%v-%v", year, month) - resp := b.callApi("GET", "/months/"+budgetMonth, nil) + resp := b.callApi("GET", "/months/"+budgetMonth, map[string]string{ + "budget-encryption-password": b.encryptionKey, + }) defer resp.Body.Close() if resp.StatusCode != http.StatusOK { log.Fatal("GetBudgetAmounts failed with: " + string(resp.Status)) @@ -139,11 +145,12 @@ func main() { var baseUrl = os.Getenv("BASE_URL") var apiKey = os.Getenv("API_KEY") var syncId = os.Getenv("SYNC_ID") + var encryptionKey = os.Getenv("BUDGET_ENCRYPTION_KEY") var smtpUsername = os.Getenv("SMTP_USERNAME") var smtpPassword = os.Getenv("SMTP_PASSWORD") var smtpHost = os.Getenv("SMTP_HOST") var smtpRecipients = os.Getenv("SMTP_RECIPIENTS") - client := CreateBudgetClient(baseUrl, apiKey, syncId) + client := CreateBudgetClient(baseUrl, apiKey, syncId, encryptionKey) if !client.BankSync() { log.Println("Bank Sync failed, information may not be up to date") } From ae765605d9fce350c3773abb6b14bbd2c67d95c5 Mon Sep 17 00:00:00 2001 From: TheWanderingCrow Date: Sat, 27 Dec 2025 10:49:42 -0500 Subject: [PATCH 2/9] chore: release v1.0 --- flake.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/flake.nix b/flake.nix index 29ec137..a07b5a6 100644 --- a/flake.nix +++ b/flake.nix @@ -42,8 +42,8 @@ domain = "git.wanderingcrow.net"; owner = "TheWanderingCrow"; repo = "actualbudget-report"; - rev = "v0.1"; - hash = "sha256-1Z3+Efx0MCsZhfz49nKsdaWgyVt9+7kekwgfQyaYUxQ="; + rev = "v1.0"; + hash = "sha256-MP2JRBls5rqUZOMmb8BD60jcLwGgvGRAAixWxMttNhA="; }; vendorHash = "sha256-NHTKwUSIbNCUco88JbHOo3gt6S37ggee+LWNbHaRGEs="; }; From 00104dc59a91875835e98fff123608fb55397874 Mon Sep 17 00:00:00 2001 From: TheWanderingCrow Date: Sat, 27 Dec 2025 11:04:02 -0500 Subject: [PATCH 3/9] docs: fix syntax error in README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 2829f18..4d5e23d 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 From 43d4e6caee531c8ad1a0bb4f54ae4e0470b72331 Mon Sep 17 00:00:00 2001 From: TheWanderingCrow Date: Tue, 30 Dec 2025 21:20:52 -0500 Subject: [PATCH 4/9] chore: update sha256 --- flake.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flake.nix b/flake.nix index a07b5a6..1db92a9 100644 --- a/flake.nix +++ b/flake.nix @@ -43,7 +43,7 @@ owner = "TheWanderingCrow"; repo = "actualbudget-report"; rev = "v1.0"; - hash = "sha256-MP2JRBls5rqUZOMmb8BD60jcLwGgvGRAAixWxMttNhA="; + hash = "sha256-rt4wiSzsNqmSWGoMBf6fiNpCxZfEPwYlZuClLI+s+A4="; }; vendorHash = "sha256-NHTKwUSIbNCUco88JbHOo3gt6S37ggee+LWNbHaRGEs="; }; From 1c1b2a3a1d1475a1b04a6a4e37b9d484ae19518a Mon Sep 17 00:00:00 2001 From: TheWanderingCrow Date: Tue, 30 Dec 2025 21:49:28 -0500 Subject: [PATCH 5/9] fix!: SMTP now works properly in non-dev environments --- main.go | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/main.go b/main.go index 945591e..38d12d0 100644 --- a/main.go +++ b/main.go @@ -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) } From 215a0fde7c075baf47b31a084420335e0efe808a Mon Sep 17 00:00:00 2001 From: TheWanderingCrow Date: Tue, 20 Jan 2026 10:43:59 -0500 Subject: [PATCH 6/9] chore: flake updates for v2.0.1 release --- flake.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/flake.nix b/flake.nix index 29ec137..c0b6f18 100644 --- a/flake.nix +++ b/flake.nix @@ -42,8 +42,8 @@ domain = "git.wanderingcrow.net"; owner = "TheWanderingCrow"; repo = "actualbudget-report"; - rev = "v0.1"; - hash = "sha256-1Z3+Efx0MCsZhfz49nKsdaWgyVt9+7kekwgfQyaYUxQ="; + rev = "v2.0.1"; + hash = "sha256-FytoZUN8g3ilzTa1xKEbsCaZiHHz0QMGVbS+NYow920="; }; vendorHash = "sha256-NHTKwUSIbNCUco88JbHOo3gt6S37ggee+LWNbHaRGEs="; }; From 874eb0eff1f8ad6248952555a59ab1c0e75b78b7 Mon Sep 17 00:00:00 2001 From: TheWanderingCrow Date: Tue, 20 Jan 2026 15:39:59 -0500 Subject: [PATCH 7/9] chore: v2.0.2 release --- flake.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/flake.nix b/flake.nix index c0b6f18..dfaa2df 100644 --- a/flake.nix +++ b/flake.nix @@ -42,8 +42,8 @@ domain = "git.wanderingcrow.net"; owner = "TheWanderingCrow"; repo = "actualbudget-report"; - rev = "v2.0.1"; - hash = "sha256-FytoZUN8g3ilzTa1xKEbsCaZiHHz0QMGVbS+NYow920="; + rev = "v2.0.2"; + hash = "sha256-vnd1RvlMD4WOLtXpIOiPxuDxvHoBQVTP/8l/OMWR5No="; }; vendorHash = "sha256-NHTKwUSIbNCUco88JbHOo3gt6S37ggee+LWNbHaRGEs="; }; From 3da46bd0a775645e1eb62d2fe74409328b74c095 Mon Sep 17 00:00:00 2001 From: TheWanderingCrow Date: Tue, 20 Jan 2026 15:44:39 -0500 Subject: [PATCH 8/9] chore: Update README.md --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 4d5e23d..2fb5830 100644 --- a/README.md +++ b/README.md @@ -26,6 +26,7 @@ sops.templates."actualbudget-report-env".content = '' SMTP_USERNAME= SMTP_PASSWORD= SMTP_HOST= + SMTP_PORT= SMTP_RECIPIENTS= BUDGET_ENCRYPTION_KEY= ''; From eb74f08b2c34ba98b0b169935c1e7ea93f67f88d Mon Sep 17 00:00:00 2001 From: TheWanderingCrow Date: Fri, 30 Jan 2026 16:10:30 -0500 Subject: [PATCH 9/9] add hydraJobs to flake --- flake.nix | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/flake.nix b/flake.nix index dfaa2df..3d96a69 100644 --- a/flake.nix +++ b/flake.nix @@ -24,7 +24,15 @@ "aarch64-darwin" "x86_64-darwin" ]; - flake.nixosModules.default = ./modules/actualbudget-report; + flake = { + nixosModules.default = ./modules/actualbudget-report; + hydraJobs = { + inherit (self) + packages + ; + + }; + }; perSystem = { config,