Compare commits
1 Commits
master
...
c1a5eed2ef
| Author | SHA1 | Date | |
|---|---|---|---|
|
c1a5eed2ef
|
@@ -23,8 +23,6 @@ run-name: ${{ gitea.actor }} ${{ gitea.event_name }} ${{ gitea.ref }} ${{ gitea.
|
|||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches:
|
|
||||||
- '**'
|
|
||||||
paths:
|
paths:
|
||||||
- 'client/**'
|
- 'client/**'
|
||||||
- 'container/**'
|
- 'container/**'
|
||||||
|
|||||||
62
CHANGELOG.md
62
CHANGELOG.md
@@ -18,68 +18,6 @@
|
|||||||
|
|
||||||
# Changelog (`docker-finance`)
|
# Changelog (`docker-finance`)
|
||||||
|
|
||||||
## 1.4.1 - 2026-03-18
|
|
||||||
|
|
||||||
This patch release fixes broken `import` for Trezor Suite v25.9.1+ by adding new FS support and backward compatibility.
|
|
||||||
|
|
||||||
### 1.4.1 - Fixes
|
|
||||||
|
|
||||||
- Add bash quotes when testing column(s) of given header and add custom delim support (lib_preprocess) ([#326](https://gitea.evergreencrypto.co/EvergreenCrypto/docker-finance/pulls/326))
|
|
||||||
|
|
||||||
- Add Trezor Suite v25.9.1+ FS support and backward compatibility ([#327](https://gitea.evergreencrypto.co/EvergreenCrypto/docker-finance/pulls/327))
|
|
||||||
* For devs (to generate new FS mockup), with `finance` image, run: `gen type=flow account=trezor dev=on confirm=no profile=<profile/subprofile>`
|
|
||||||
|
|
||||||
### 1.4.1 - Contributors
|
|
||||||
|
|
||||||
- Aaron Fiore
|
|
||||||
|
|
||||||
## 1.4.0 - 2026-03-16
|
|
||||||
|
|
||||||
This release brings a minor `dfi` fix (`fetch`), a new `dfi` feature (custom compose merge file functionality), `dfi` enhancements (base image and end-user), and patch releases for `hledger-flow` and ROOT.cern (`root`).
|
|
||||||
|
|
||||||
### 1.4.0 - Fixes
|
|
||||||
|
|
||||||
- Fix User-Agent when `fetch`ing prices ([#320](https://gitea.evergreencrypto.co/EvergreenCrypto/docker-finance/pulls/320))
|
|
||||||
|
|
||||||
### 1.4.0 - Features
|
|
||||||
|
|
||||||
- 🚨**Breaking**: Add custom compose merge file functionality ([#309](https://gitea.evergreencrypto.co/EvergreenCrypto/docker-finance/pulls/309)) ([#315](https://gitea.evergreencrypto.co/EvergreenCrypto/docker-finance/pulls/315))
|
|
||||||
* Like custom Dockerfile functionality, adds support for custom docker-compose.yml
|
|
||||||
* ⚠️ Run `gen type=compose` at least once for your respective existing image (e.g., `dfi archlinux/${USER}:default gen type=compose`)
|
|
||||||
|
|
||||||
### 1.4.0 - Enhancements
|
|
||||||
|
|
||||||
- Print locations of output for `reports` and `taxes` ([#310](https://gitea.evergreencrypto.co/EvergreenCrypto/docker-finance/pulls/310))
|
|
||||||
|
|
||||||
- Remove defaulting to `/` when using `shell` ([#311](https://gitea.evergreencrypto.co/EvergreenCrypto/docker-finance/pulls/311))
|
|
||||||
|
|
||||||
- Add 'Related "useful" packages' section to base `finance` (`archlinux`) image ([#312](https://gitea.evergreencrypto.co/EvergreenCrypto/docker-finance/pulls/312))
|
|
||||||
* For consistently useful packages that aren't dependencies
|
|
||||||
* Moves `calc` package from optional to this section
|
|
||||||
- If you previously uncommented the `calc` package in the custom build, run `gen type=build` to pickup the latest custom file or manually remove with `edit type=build` (otherwise, you'll simply re-install the package).
|
|
||||||
|
|
||||||
- Add man page support to base `finance` (`archlinux`) and `dev-tools` images ([#313](https://gitea.evergreencrypto.co/EvergreenCrypto/docker-finance/pulls/313)) ([#314](https://gitea.evergreencrypto.co/EvergreenCrypto/docker-finance/pulls/314)) ([#319](https://gitea.evergreencrypto.co/EvergreenCrypto/docker-finance/pulls/319))
|
|
||||||
|
|
||||||
- Don't run tags with Gitea CI Workflow ([#318](https://gitea.evergreencrypto.co/EvergreenCrypto/docker-finance/pulls/318))
|
|
||||||
|
|
||||||
- Improve handling of non-200 responses when `fetch`ing prices ([#321](https://gitea.evergreencrypto.co/EvergreenCrypto/docker-finance/pulls/321))
|
|
||||||
|
|
||||||
### 1.4.0 - Updates
|
|
||||||
|
|
||||||
- Bump `root` to 6.38.04-1 ([#317](https://gitea.evergreencrypto.co/EvergreenCrypto/docker-finance/pulls/317))
|
|
||||||
|
|
||||||
- Bump `hledger-flow` to v0.16.3 ([#324](https://gitea.evergreencrypto.co/EvergreenCrypto/docker-finance/pulls/324)) ([#325](https://gitea.evergreencrypto.co/EvergreenCrypto/docker-finance/pulls/325))
|
|
||||||
|
|
||||||
### 1.4.0 - Refactoring
|
|
||||||
|
|
||||||
- Run PHP linter, update fetch (blockchains) comments ([#316](https://gitea.evergreencrypto.co/EvergreenCrypto/docker-finance/pulls/316))
|
|
||||||
|
|
||||||
- Comment out `"ethereum:0xbcca60bb61934080951369a648fb03df4f96263c/aUSDC"` in default generated `fetch` config ([#322](https://gitea.evergreencrypto.co/EvergreenCrypto/docker-finance/pulls/322))
|
|
||||||
|
|
||||||
### 1.4.0 - Contributors
|
|
||||||
|
|
||||||
- Aaron Fiore
|
|
||||||
|
|
||||||
## 1.3.0 - 2026-02-27
|
## 1.3.0 - 2026-02-27
|
||||||
|
|
||||||
This release focuses on `dfi` code/usage enhancements, a ROOT.cern (`root`) patch release and **breaking** changes to the `dfi` client-side default layout (filesystem).
|
This release focuses on `dfi` code/usage enhancements, a ROOT.cern (`root`) patch release and **breaking** changes to the `dfi` client-side default layout (filesystem).
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
# docker-finance | modern accounting for the power-user
|
# docker-finance | modern accounting for the power-user
|
||||||
#
|
#
|
||||||
# Copyright (C) 2021-2024,2026 Aaron Fiore (Founder, Evergreen Crypto LLC)
|
# Copyright (C) 2021-2024 Aaron Fiore (Founder, Evergreen Crypto LLC)
|
||||||
#
|
#
|
||||||
# This program is free software: you can redistribute it and/or modify
|
# This program is free software: you can redistribute it and/or modify
|
||||||
# it under the terms of the GNU General Public License as published by
|
# it under the terms of the GNU General Public License as published by
|
||||||
@@ -22,10 +22,6 @@ RUN apt-get update -y
|
|||||||
# Add builder user (for `composer` and non-root building)
|
# Add builder user (for `composer` and non-root building)
|
||||||
RUN useradd -m -s /bin/bash -r builder
|
RUN useradd -m -s /bin/bash -r builder
|
||||||
|
|
||||||
# Enable man page support
|
|
||||||
RUN apt-get install man unminimize -y
|
|
||||||
RUN yes | unminimize
|
|
||||||
|
|
||||||
#
|
#
|
||||||
# 'dev-tools' linters
|
# 'dev-tools' linters
|
||||||
#
|
#
|
||||||
|
|||||||
@@ -49,7 +49,6 @@ RUN pacman -Syu \
|
|||||||
|
|
||||||
# Base packages
|
# Base packages
|
||||||
RUN pacman -Syu \
|
RUN pacman -Syu \
|
||||||
bash-completion \
|
|
||||||
bc \
|
bc \
|
||||||
csvkit \
|
csvkit \
|
||||||
vim \
|
vim \
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ RUN apt-get upgrade -y
|
|||||||
FROM haskell-build AS hledger-flow
|
FROM haskell-build AS hledger-flow
|
||||||
|
|
||||||
WORKDIR /usr/local/src
|
WORKDIR /usr/local/src
|
||||||
RUN git clone --depth=1 https://github.com/apauley/hledger-flow -b v0.16.3
|
RUN git clone --depth=1 https://github.com/apauley/hledger-flow -b v0.16.2
|
||||||
|
|
||||||
WORKDIR /usr/local/src/hledger-flow
|
WORKDIR /usr/local/src/hledger-flow
|
||||||
RUN stack setup
|
RUN stack setup
|
||||||
@@ -58,7 +58,7 @@ RUN cabal v1-copy
|
|||||||
FROM hledger-iadd AS hledger
|
FROM hledger-iadd AS hledger
|
||||||
|
|
||||||
WORKDIR /usr/local/src
|
WORKDIR /usr/local/src
|
||||||
RUN git clone --depth=1 https://github.com/simonmichael/hledger -b 1.52
|
RUN git clone --depth=1 https://github.com/simonmichael/hledger -b 1.51.2
|
||||||
|
|
||||||
WORKDIR /usr/local/src/hledger
|
WORKDIR /usr/local/src/hledger
|
||||||
RUN stack setup
|
RUN stack setup
|
||||||
|
|||||||
@@ -115,7 +115,7 @@ version: @DOCKER_FINANCE_VERSION@
|
|||||||
- "arbitrum:0xff970a61a04b1ca14834a43f5de4533ebddb5cc8/USDC.e"
|
- "arbitrum:0xff970a61a04b1ca14834a43f5de4533ebddb5cc8/USDC.e"
|
||||||
|
|
||||||
# Aave V2 USDC
|
# Aave V2 USDC
|
||||||
#- "ethereum:0xbcca60bb61934080951369a648fb03df4f96263c/aUSDC" # TODO: 2026-03-13: upstream has started to return 'Time range too large for period "5m". Would generate 10272 candles, max is 10000. Use a larger period or smaller time range.' which appears to be a server-side(?) problem. Commenting out here for now in order to not break CI.
|
- "ethereum:0xbcca60bb61934080951369a648fb03df4f96263c/aUSDC"
|
||||||
#- "polygon:0x625e7708f30ca75bfd92586e17077590c60eb4cd/aUSDC"
|
#- "polygon:0x625e7708f30ca75bfd92586e17077590c60eb4cd/aUSDC"
|
||||||
|
|
||||||
# Gemini USD
|
# Gemini USD
|
||||||
|
|||||||
@@ -20,7 +20,7 @@
|
|||||||
#
|
#
|
||||||
|
|
||||||
# Release version (tag format)
|
# Release version (tag format)
|
||||||
version: "v1.4.1"
|
version: "v1.3.0"
|
||||||
|
|
||||||
# Container dependencies (used by `version` command)
|
# Container dependencies (used by `version` command)
|
||||||
# NOTE: this must stay inline with Dockerfiles
|
# NOTE: this must stay inline with Dockerfiles
|
||||||
@@ -36,7 +36,6 @@ container:
|
|||||||
commands:
|
commands:
|
||||||
base:
|
base:
|
||||||
packages:
|
packages:
|
||||||
- "bash-completion"
|
|
||||||
- "bc"
|
- "bc"
|
||||||
- "csvkit"
|
- "csvkit"
|
||||||
- "vim"
|
- "vim"
|
||||||
|
|||||||
@@ -17,28 +17,6 @@
|
|||||||
# You should have received a copy of the GNU General Public License
|
# You should have received a copy of the GNU General Public License
|
||||||
# along with this program. If not, see <https://www.gnu.org/licenses/>.
|
# along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
# TODO:
|
|
||||||
#
|
|
||||||
# - Refactor using `bash-completion` "library" but keep backward compatibility,
|
|
||||||
# as this would otherwise break the "no more than 3 dependencies" approach to client-side `dfi`.
|
|
||||||
#
|
|
||||||
# - When possible, add completion to existing `dfi` arguments that aren't completing
|
|
||||||
# * e.g., `dfi archlinux/${USER}:default edit type=` -> `dfi archlinux/${USER}:default edit type=rules...`
|
|
||||||
#
|
|
||||||
# The not-so-straightforward resolution to this TODO hinges on the fact that
|
|
||||||
# the default delim for all `dfi` completion is the `=` character (which also exists in `COMP_WORDBREAKS`).
|
|
||||||
#
|
|
||||||
# One resolution can be found in:
|
|
||||||
#
|
|
||||||
# - https://github.com/scop/bash-completion/blob/c63826f8678e7d1fd36cf188bf1ba2eccaf2552e/completions-core/dd.bash
|
|
||||||
#
|
|
||||||
# See also:
|
|
||||||
#
|
|
||||||
# - https://github.com/scop/bash-completion/tree/main/completions-core
|
|
||||||
# - https://github.com/scop/bash-completion/blob/c63826f8678e7d1fd36cf188bf1ba2eccaf2552e/bash_completion#L1105-L1132
|
|
||||||
# - https://github.com/scop/bash-completion/blob/c63826f8678e7d1fd36cf188bf1ba2eccaf2552e/bash_completion#L1450-L1454
|
|
||||||
# - https://github.com/scop/bash-completion/blob/c63826f8678e7d1fd36cf188bf1ba2eccaf2552e/bash_completion#L2964-L2968
|
|
||||||
|
|
||||||
# WARNING: because of completion, the docker-finance environment file
|
# WARNING: because of completion, the docker-finance environment file
|
||||||
# is never read. Ergo, for debugging, you'll need to run the following
|
# is never read. Ergo, for debugging, you'll need to run the following
|
||||||
# with log-level 1 or 2:
|
# with log-level 1 or 2:
|
||||||
|
|||||||
@@ -122,10 +122,10 @@ function lib_gen::__parse_args()
|
|||||||
\e[37;2m#\e[0m
|
\e[37;2m#\e[0m
|
||||||
|
|
||||||
\e[37;2m# Generate all client related and all flow related for profile/subprofile called 'parent/child'\e[0m
|
\e[37;2m# Generate all client related and all flow related for profile/subprofile called 'parent/child'\e[0m
|
||||||
$ $global_usage type${global_arg_delim_2}env${global_arg_delim_3}build${global_arg_delim_3}compose${global_arg_delim_3}superscript${global_arg_delim_3}flow profile${global_arg_delim_2}parent${global_arg_delim_1}child
|
$ $global_usage type${global_arg_delim_2}env${global_arg_delim_3}build${global_arg_delim_3}superscript${global_arg_delim_3}flow profile${global_arg_delim_2}parent${global_arg_delim_1}child
|
||||||
|
|
||||||
\e[37;2m# Same command as above but without confirmations and with developer mockups\e[0m
|
\e[37;2m# Same command as above but without confirmations and with developer mockups\e[0m
|
||||||
$ $global_usage type${global_arg_delim_2}env${global_arg_delim_3}build${global_arg_delim_3}compose${global_arg_delim_3}superscript${global_arg_delim_3}flow profile${global_arg_delim_2}parent${global_arg_delim_1}child confirm${global_arg_delim_2}false dev${global_arg_delim_2}true
|
$ $global_usage type${global_arg_delim_2}env${global_arg_delim_3}build${global_arg_delim_3}superscript${global_arg_delim_3}flow profile${global_arg_delim_2}parent${global_arg_delim_1}child confirm${global_arg_delim_2}false dev${global_arg_delim_2}true
|
||||||
|
|
||||||
\e[37;2m# Generate only the given configurations for 'parent/child'\e[0m
|
\e[37;2m# Generate only the given configurations for 'parent/child'\e[0m
|
||||||
$ $global_usage type${global_arg_delim_2}flow profile${global_arg_delim_2}parent${global_arg_delim_1}child config${global_arg_delim_2}fetch${global_arg_delim_3}hledger${global_arg_delim_3}meta${global_arg_delim_3}subscript
|
$ $global_usage type${global_arg_delim_2}flow profile${global_arg_delim_2}parent${global_arg_delim_1}child config${global_arg_delim_2}fetch${global_arg_delim_3}hledger${global_arg_delim_3}meta${global_arg_delim_3}subscript
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
# docker-finance | modern accounting for the power-user
|
# docker-finance | modern accounting for the power-user
|
||||||
#
|
#
|
||||||
# Copyright (C) 2024-2026 Aaron Fiore (Founder, Evergreen Crypto LLC)
|
# Copyright (C) 2024-2025 Aaron Fiore (Founder, Evergreen Crypto LLC)
|
||||||
#
|
#
|
||||||
# This program is free software: you can redistribute it and/or modify
|
# This program is free software: you can redistribute it and/or modify
|
||||||
# it under the terms of the GNU General Public License as published by
|
# it under the terms of the GNU General Public License as published by
|
||||||
@@ -17,28 +17,6 @@
|
|||||||
# You should have received a copy of the GNU General Public License
|
# You should have received a copy of the GNU General Public License
|
||||||
# along with this program. If not, see <https://www.gnu.org/licenses/>.
|
# along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
# TODO:
|
|
||||||
#
|
|
||||||
# - Refactor using `bash-completion` "library".
|
|
||||||
# * i.e., remove direct access to COMP* and use what's available, etc.
|
|
||||||
#
|
|
||||||
# - Add completion to existing `dfi` arguments that aren't completing.
|
|
||||||
# * e.g., `dfi profile/subprofile edit type=` -> `dfi profile/subprofile edit type=rules...`
|
|
||||||
#
|
|
||||||
# The not-so-straightforward resolution to this TODO hinges on the fact that
|
|
||||||
# the default delim for all `dfi` completion is the `=` character (which also exists in `COMP_WORDBREAKS`).
|
|
||||||
#
|
|
||||||
# One resolution can be found in:
|
|
||||||
#
|
|
||||||
# - https://github.com/scop/bash-completion/blob/c63826f8678e7d1fd36cf188bf1ba2eccaf2552e/completions-core/dd.bash
|
|
||||||
#
|
|
||||||
# See also:
|
|
||||||
#
|
|
||||||
# - https://github.com/scop/bash-completion/tree/main/completions-core
|
|
||||||
# - https://github.com/scop/bash-completion/blob/c63826f8678e7d1fd36cf188bf1ba2eccaf2552e/bash_completion#L1105-L1132
|
|
||||||
# - https://github.com/scop/bash-completion/blob/c63826f8678e7d1fd36cf188bf1ba2eccaf2552e/bash_completion#L1450-L1454
|
|
||||||
# - https://github.com/scop/bash-completion/blob/c63826f8678e7d1fd36cf188bf1ba2eccaf2552e/bash_completion#L2964-L2968
|
|
||||||
|
|
||||||
# shellcheck disable=SC2154
|
# shellcheck disable=SC2154
|
||||||
[ "$DOCKER_FINANCE_DEBUG" == 2 ] && set -xv
|
[ "$DOCKER_FINANCE_DEBUG" == 2 ] && set -xv
|
||||||
|
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
// docker-finance | modern accounting for the power-user
|
// docker-finance | modern accounting for the power-user
|
||||||
//
|
//
|
||||||
// Copyright (C) 2021-2026 Aaron Fiore (Founder, Evergreen Crypto LLC)
|
// Copyright (C) 2021-2025 Aaron Fiore (Founder, Evergreen Crypto LLC)
|
||||||
//
|
//
|
||||||
// This program is free software: you can redistribute it and/or modify
|
// This program is free software: you can redistribute it and/or modify
|
||||||
// it under the terms of the GNU General Public License as published by
|
// it under the terms of the GNU General Public License as published by
|
||||||
@@ -77,11 +77,9 @@ namespace dfi\blockchains
|
|||||||
$metadata->set_year($this->get_env()->get_env('API_FETCH_YEAR'));
|
$metadata->set_year($this->get_env()->get_env('API_FETCH_YEAR'));
|
||||||
|
|
||||||
// Reconstruct subaccount directory for out directory
|
// Reconstruct subaccount directory for out directory
|
||||||
// API_OUT_DIR format: flow/profiles/parent_profile/child_profile/import/child_profile/account/subaccount/1-in/year
|
// API_OUT_DIR format: hledger-flow/profiles/parent_profile/child_profile/import/child_profile/account/subaccount/1-in/year
|
||||||
$path = explode('/', $this->get_env()->get_env('API_OUT_DIR'));
|
$path = explode('/', $this->get_env()->get_env('API_OUT_DIR'));
|
||||||
$path = array_filter($path, function ($element) {
|
$path = array_filter($path, function ($element) { return $element !== '';}); // Clear out extra / that get turned into nulls
|
||||||
return $element !== '';
|
|
||||||
}); // Clear out extra '/' that get turned into nulls
|
|
||||||
$head_end = $path;
|
$head_end = $path;
|
||||||
$tail_end = $path;
|
$tail_end = $path;
|
||||||
|
|
||||||
|
|||||||
@@ -153,9 +153,8 @@ namespace dfi\prices\internal
|
|||||||
*/
|
*/
|
||||||
protected function request_impl(string $url, array $header): mixed
|
protected function request_impl(string $url, array $header): mixed
|
||||||
{
|
{
|
||||||
$version = preg_replace('/^v/', '', $this->get_env()->get_env('API_VERSION'));
|
|
||||||
$headers = array(
|
$headers = array(
|
||||||
'User-Agent: docker-finance/' . $version,
|
'User-Agent: docker-finance /' . $this->get_env()->get_env('API_VERSION'),
|
||||||
'Accept: application/json',
|
'Accept: application/json',
|
||||||
'Content-Type: application/json',
|
'Content-Type: application/json',
|
||||||
);
|
);
|
||||||
@@ -361,17 +360,16 @@ namespace dfi\prices\internal
|
|||||||
$code = $e->getCode();
|
$code = $e->getCode();
|
||||||
$message = $e->getMessage();
|
$message = $e->getMessage();
|
||||||
|
|
||||||
$print = "server sent error '{$message}' with code '{$code}' for '{$asset['id']}'";
|
$print = "server sent error '{$message}' with code '{$code}' for '{$asset['id']}'"
|
||||||
|
. " - retrying in '{$timer}' seconds";
|
||||||
|
|
||||||
switch ($code) {
|
switch ($code) {
|
||||||
case 400:
|
// CoinGecko's unrecoverable error (paid plan needed)
|
||||||
utils\CLI::throw_fatal($print);
|
case 10012:
|
||||||
break;
|
|
||||||
case 10012: // CoinGecko's unrecoverable error (paid plan needed)
|
|
||||||
utils\CLI::throw_fatal($print);
|
utils\CLI::throw_fatal($print);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
utils\CLI::print_warning($print . " - retrying in '{$timer}' seconds");
|
utils\CLI::print_warning($print);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
// docker-finance | modern accounting for the power-user
|
// docker-finance | modern accounting for the power-user
|
||||||
//
|
//
|
||||||
// Copyright (C) 2021-2026 Aaron Fiore (Founder, Evergreen Crypto LLC)
|
// Copyright (C) 2021-2025 Aaron Fiore (Founder, Evergreen Crypto LLC)
|
||||||
//
|
//
|
||||||
// This program is free software: you can redistribute it and/or modify
|
// This program is free software: you can redistribute it and/or modify
|
||||||
// it under the terms of the GNU General Public License as published by
|
// it under the terms of the GNU General Public License as published by
|
||||||
@@ -182,14 +182,6 @@ namespace dfi\prices\internal\prices\crypto
|
|||||||
}
|
}
|
||||||
|
|
||||||
$response = $this->request_impl($url, $header);
|
$response = $this->request_impl($url, $header);
|
||||||
if (array_key_exists('statusCode', $response)) {
|
|
||||||
switch ($response['statusCode']) {
|
|
||||||
case 200:
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
throw new \Exception($response['message'], $response['statusCode']);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (array_key_exists('error', $response)) {
|
if (array_key_exists('error', $response)) {
|
||||||
throw new \Exception($response['error']);
|
throw new \Exception($response['error']);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -142,10 +142,6 @@ function lib_hledger::__hledger-import()
|
|||||||
{
|
{
|
||||||
lib_hledger::__parse_hledger-import "$@"
|
lib_hledger::__parse_hledger-import "$@"
|
||||||
|
|
||||||
# TODO: v0.16.3+: add `--new-files-only` only if hledger-flow adds support for
|
|
||||||
# tracking changes to rules and preprocess files. The tracking *must* apply to
|
|
||||||
# all repo files and any/all custom files. Currently, only *modified* time of
|
|
||||||
# source files compared to *modified* time of target files are tracked.
|
|
||||||
time hledger-flow import \
|
time hledger-flow import \
|
||||||
"$(dirname $global_child_profile_journal)" \
|
"$(dirname $global_child_profile_journal)" \
|
||||||
--start-year "$global_arg_year"
|
--start-year "$global_arg_year"
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
# docker-finance | modern accounting for the power-user
|
# docker-finance | modern accounting for the power-user
|
||||||
#
|
#
|
||||||
# Copyright (C) 2021-2026 Aaron Fiore (Founder, Evergreen Crypto LLC)
|
# Copyright (C) 2021-2025 Aaron Fiore (Founder, Evergreen Crypto LLC)
|
||||||
#
|
#
|
||||||
# This program is free software: you can redistribute it and/or modify
|
# This program is free software: you can redistribute it and/or modify
|
||||||
# it under the terms of the GNU General Public License as published by
|
# it under the terms of the GNU General Public License as published by
|
||||||
@@ -131,7 +131,6 @@ if %to_address (^0x39aa39c021dfbae8fac545936693ac917d5e7563$|^0x4ddc2d193948926d
|
|||||||
if %direction ^IN$
|
if %direction ^IN$
|
||||||
& %contract_address ^0xc00e94cb662c3520282e6f5717214004a7f26888$
|
& %contract_address ^0xc00e94cb662c3520282e6f5717214004a7f26888$
|
||||||
& %from_address ^0x3d9819210a31b4961b30ef54be2aed79b9c9cd3b$
|
& %from_address ^0x3d9819210a31b4961b30ef54be2aed79b9c9cd3b$
|
||||||
comment blockchain:%blockchain, type:%type, block:%block_number, blockid:%block_hash, index:%tx_index, subaccount_address:%subaccount_address, contract_address:%contract_address, from_address:%from_address, to_address:%to_address, txid:%tx_hash, direction:%direction, taxed_as:INCOME
|
|
||||||
account2 income:%account_name:%subaccount_name:%blockchain:%symbol
|
account2 income:%account_name:%subaccount_name:%blockchain:%symbol
|
||||||
comment2 %date +0000,INCOME,%account_name:%subaccount_name:%blockchain,%symbol,%amount_,USD,,COMP rewards
|
comment2 %date +0000,INCOME,%account_name:%subaccount_name:%blockchain,%symbol,%amount_,USD,,COMP rewards
|
||||||
|
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
@@ -1,2 +0,0 @@
|
|||||||
Timestamp,Date,Time,Type,Transaction ID,Fee,Fee unit,Address,Label,Amount,Amount unit,Fiat (USD),Other
|
|
||||||
1773852733,3/18/2026,9:52:13 AM GMT-7,SENT,XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX123,0.00001234,BTC,bc1qXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX123,New FS tx,0.00012345,BTC,"8.81",
|
|
||||||
|
@@ -36,35 +36,16 @@ source "${DOCKER_FINANCE_CONTAINER_REPO}/src/hledger-flow/lib/lib_preprocess.bas
|
|||||||
|
|
||||||
[ -z "$global_in_filename" ] && exit 1
|
[ -z "$global_in_filename" ] && exit 1
|
||||||
|
|
||||||
function reseat_fs()
|
|
||||||
{
|
|
||||||
[ -z $1 ] && exit 1
|
|
||||||
local -r _fs="$1"
|
|
||||||
local -r _header="Timestamp${_fs}Date${_fs}Time${_fs}Type${_fs}Transaction ID${_fs}Fee${_fs}Fee unit${_fs}Address${_fs}Label${_fs}Amount${_fs}Amount unit${_fs}Fiat (USD)${_fs}Other"
|
|
||||||
echo "$_header"
|
|
||||||
}
|
|
||||||
|
|
||||||
function parse()
|
function parse()
|
||||||
{
|
{
|
||||||
local _gawk=("gawk")
|
lib_preprocess::assert_header "Timestamp;Date;Time;Type;Transaction ID;Fee;Fee unit;Address;Label;Amount;Amount unit;Fiat (USD);Other"
|
||||||
local _fs _header
|
|
||||||
|
|
||||||
_header="$(reseat_fs ";")"
|
|
||||||
if lib_preprocess::test_header "$_header"; then
|
|
||||||
_fs="FS=;"
|
|
||||||
else
|
|
||||||
# Since v25.9.1
|
|
||||||
_header="$(reseat_fs ",")"
|
|
||||||
lib_preprocess::assert_header "$_header"
|
|
||||||
_gawk+=("--csv")
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Get subaccount(s) from filename
|
# Get subaccount(s) from filename
|
||||||
local _subaccount
|
local _subaccount
|
||||||
_subaccount="$(echo $global_in_filename | cut -d'_' -f1)"
|
_subaccount="$(echo $global_in_filename | cut -d'_' -f1)"
|
||||||
|
|
||||||
# NOTE: subaccount (account label) is entered within the app
|
# NOTE: subaccount (account label) is entered within the app
|
||||||
"${_gawk[@]}" \
|
gawk \
|
||||||
-v global_year="$global_year" \
|
-v global_year="$global_year" \
|
||||||
-v global_subaccount="$global_subaccount" \
|
-v global_subaccount="$global_subaccount" \
|
||||||
-v subaccount="$_subaccount" \
|
-v subaccount="$_subaccount" \
|
||||||
@@ -83,7 +64,7 @@ function parse()
|
|||||||
# skip # Date (N/A)
|
# skip # Date (N/A)
|
||||||
# skip # Time (N/A)
|
# skip # Time (N/A)
|
||||||
|
|
||||||
# Type (TODO: are there more types?)
|
# Type # TODO: are there more types?
|
||||||
direction=($4 ~ /^RECV$/ ? "IN" : "OUT")
|
direction=($4 ~ /^RECV$/ ? "IN" : "OUT")
|
||||||
printf $4 OFS
|
printf $4 OFS
|
||||||
|
|
||||||
@@ -99,19 +80,7 @@ function parse()
|
|||||||
|
|
||||||
printf("%.8f", $10); printf OFS # Amount # TODO: more than 8 places for Ethereum, etc.?
|
printf("%.8f", $10); printf OFS # Amount # TODO: more than 8 places for Ethereum, etc.?
|
||||||
printf "\"" $11 "\"" OFS # Amount unit
|
printf "\"" $11 "\"" OFS # Amount unit
|
||||||
|
printf "\"" $12 "\"" OFS # Fiat (USD)
|
||||||
# Fiat (USD)
|
|
||||||
# NOTE: is already quoted since v25.9.1
|
|
||||||
fiat=$12
|
|
||||||
if (fiat ~ /^"/)
|
|
||||||
{
|
|
||||||
printf fiat OFS
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
printf "\"" fiat "\"" OFS
|
|
||||||
}
|
|
||||||
|
|
||||||
printf "\"" $13 "\"" OFS # Other
|
printf "\"" $13 "\"" OFS # Other
|
||||||
|
|
||||||
printf direction OFS
|
printf direction OFS
|
||||||
@@ -119,7 +88,7 @@ function parse()
|
|||||||
|
|
||||||
printf "\n"
|
printf "\n"
|
||||||
|
|
||||||
}' "$_fs" OFS=, "$global_in_path" >"$global_out_path"
|
}' FS=\; OFS=, "$global_in_path" >"$global_out_path"
|
||||||
}
|
}
|
||||||
|
|
||||||
function main()
|
function main()
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
# docker-finance | modern accounting for the power-user
|
# docker-finance | modern accounting for the power-user
|
||||||
#
|
#
|
||||||
# Copyright (C) 2021-2026 Aaron Fiore (Founder, Evergreen Crypto LLC)
|
# Copyright (C) 2021-2025 Aaron Fiore (Founder, Evergreen Crypto LLC)
|
||||||
#
|
#
|
||||||
# This program is free software: you can redistribute it and/or modify
|
# This program is free software: you can redistribute it and/or modify
|
||||||
# it under the terms of the GNU General Public License as published by
|
# it under the terms of the GNU General Public License as published by
|
||||||
@@ -64,16 +64,9 @@ echo -e " \e[32m│ └─\e[37;2m ${global_in_filename}\e[0m"
|
|||||||
function lib_preprocess::test_header()
|
function lib_preprocess::test_header()
|
||||||
{
|
{
|
||||||
local _column="$1"
|
local _column="$1"
|
||||||
|
|
||||||
local _header
|
local _header
|
||||||
_header="$(lib_preprocess::__sanitize_header $2)"
|
_header="$(lib_preprocess::__sanitize_header $2)"
|
||||||
|
[[ "$_header" =~ (^${_column}$|^${_column},|,${_column},|,${_column}$) ]] && return 0 || return 2
|
||||||
local _delim="$3"
|
|
||||||
[ -z "$_delim" ] && _delim=","
|
|
||||||
|
|
||||||
# TODO: consolidate regexp
|
|
||||||
[[ "$_header" =~ (^"${_column}"$|^"${_column}${_delim}"|"${_delim}${_column}${_delim}"|"${_delim}${_column}"$) ]] \
|
|
||||||
&& return 0 || return 2
|
|
||||||
}
|
}
|
||||||
|
|
||||||
# Assert header in given CSV header
|
# Assert header in given CSV header
|
||||||
|
|||||||
Reference in New Issue
Block a user