Compare commits
6 commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
eb74f08b2c | ||
| 3da46bd0a7 | |||
|
|
874eb0eff1 | ||
|
|
dc093bcade | ||
|
|
215a0fde7c | ||
|
|
c394af7127 |
3 changed files with 15 additions and 5 deletions
|
|
@ -26,6 +26,7 @@ sops.templates."actualbudget-report-env".content = ''
|
||||||
SMTP_USERNAME=
|
SMTP_USERNAME=
|
||||||
SMTP_PASSWORD=
|
SMTP_PASSWORD=
|
||||||
SMTP_HOST=
|
SMTP_HOST=
|
||||||
|
SMTP_PORT=
|
||||||
SMTP_RECIPIENTS=
|
SMTP_RECIPIENTS=
|
||||||
BUDGET_ENCRYPTION_KEY=
|
BUDGET_ENCRYPTION_KEY=
|
||||||
'';
|
'';
|
||||||
|
|
|
||||||
14
flake.nix
14
flake.nix
|
|
@ -24,7 +24,15 @@
|
||||||
"aarch64-darwin"
|
"aarch64-darwin"
|
||||||
"x86_64-darwin"
|
"x86_64-darwin"
|
||||||
];
|
];
|
||||||
flake.nixosModules.default = ./modules/actualbudget-report;
|
flake = {
|
||||||
|
nixosModules.default = ./modules/actualbudget-report;
|
||||||
|
hydraJobs = {
|
||||||
|
inherit (self)
|
||||||
|
packages
|
||||||
|
;
|
||||||
|
|
||||||
|
};
|
||||||
|
};
|
||||||
perSystem =
|
perSystem =
|
||||||
{
|
{
|
||||||
config,
|
config,
|
||||||
|
|
@ -42,8 +50,8 @@
|
||||||
domain = "git.wanderingcrow.net";
|
domain = "git.wanderingcrow.net";
|
||||||
owner = "TheWanderingCrow";
|
owner = "TheWanderingCrow";
|
||||||
repo = "actualbudget-report";
|
repo = "actualbudget-report";
|
||||||
rev = "v1.0";
|
rev = "v2.0.2";
|
||||||
hash = "sha256-rt4wiSzsNqmSWGoMBf6fiNpCxZfEPwYlZuClLI+s+A4=";
|
hash = "sha256-vnd1RvlMD4WOLtXpIOiPxuDxvHoBQVTP/8l/OMWR5No=";
|
||||||
};
|
};
|
||||||
vendorHash = "sha256-NHTKwUSIbNCUco88JbHOo3gt6S37ggee+LWNbHaRGEs=";
|
vendorHash = "sha256-NHTKwUSIbNCUco88JbHOo3gt6S37ggee+LWNbHaRGEs=";
|
||||||
};
|
};
|
||||||
|
|
|
||||||
5
main.go
5
main.go
|
|
@ -114,13 +114,14 @@ func (b BudgetClient) BankSync() bool {
|
||||||
func (b BudgetClient) GetBudgetMonths() *BudgetMonthsResponse {
|
func (b BudgetClient) GetBudgetMonths() *BudgetMonthsResponse {
|
||||||
currentTime := time.Now()
|
currentTime := time.Now()
|
||||||
year, month := currentTime.Year(), int(currentTime.Month())
|
year, month := currentTime.Year(), int(currentTime.Month())
|
||||||
budgetMonth := fmt.Sprintf("%v-%v", year, month)
|
budgetMonth := fmt.Sprintf("%v-%02d", year, month)
|
||||||
resp := b.callApi("GET", "/months/"+budgetMonth, map[string]string{
|
resp := b.callApi("GET", "/months/"+budgetMonth, map[string]string{
|
||||||
"budget-encryption-password": b.encryptionKey,
|
"budget-encryption-password": b.encryptionKey,
|
||||||
})
|
})
|
||||||
defer resp.Body.Close()
|
defer resp.Body.Close()
|
||||||
if resp.StatusCode != http.StatusOK {
|
if resp.StatusCode != http.StatusOK {
|
||||||
log.Fatal("GetBudgetAmounts failed with: " + string(resp.Status))
|
temp, _ := io.ReadAll(resp.Body)
|
||||||
|
log.Fatal("GetBudgetAmounts failed with: " + string(resp.Status) + " " + string(temp))
|
||||||
}
|
}
|
||||||
var data bytes.Buffer
|
var data bytes.Buffer
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue