Code Monkey home page Code Monkey logo

hledger-service's Introduction

Docker image for hledger and associated tools

This docker image provides hledger, the plain text accounting software, and associated tools:

  • hledger-web, the web interface for hledger
  • hledger-ui, the curses interface for hledger
  • hledger-iadd, the interactive console frontend for "hledger add"
  • hledger-diff, the tool to diff journal files
  • hledger-interest, tool to compute interest for loan/mortgage accounts

Image versions/tags

  • Most recent: latest,1.21,latest-dev,1.21-dev
  • Legacy: 1.20.4,1.20.4-dev,1.20.3,1.20.3-dev,1.20.2,1.20.2-dev,1.20,1.20-dev,1.19.1,1.19.1-dev,1.19,1.19-dev,1.18.1,1.18.1-dev,1.18,1.18-dev,1.17.1.1,1.17,1.16.2,1.16.1,1.15.2,1.15.1,1.14,1.14.1,1.14.2

Usage

Hledger-web

By default, container will start hledger-web on port 5000, reading journal hledger.journal from volume data, so assuming your journal is in ~/journals/all.journal, you can run:

docker run --rm -d -e HLEDGER_JOURNAL_FILE=/data/all.journal -v "$HOME/journals:/data" -p 5000:5000 --user $(id --user) dastapov/hledger

and navigate to http://localhost:5000 for hledger-web

If you have LEDGER_FILE environmed variable defined already, you can try:

docker run --rm -d -e HLEDGER_JOURNAL_FILE=/data/$(basename $LEDGER_FILE) -v "$(dirname $LEDGER_FILE):/data" -p 5000:5000 --user $(id --user) dastapov/hledger

Any extra arguments you provide will be passed to hledger-web.

Github repo contains helper script that simplifies invocation:

./run.sh ~/journals/all.journal web

Environment variables

  • HLEDGER_JOURNAL_FILE
    • input file (default: /data/hledger.journal)
  • HLEDGER_HOST
    • set the TCP host (default: 0.0.0.0)
  • HLEDGER_PORT
    • set the TCP port (default: 5000)
  • HLEDGER_DEBUG
    • debug output (default: 1, increase for more)
  • HLEDGER_BASE_URL
  • HLEDGER_FILE_URL
    • set the static files url (default: $HLEDGER_BASE_URL/static)
  • HLEDGER_RULES_FILE
    • CSV conversion rules file (default: /data/hledger.rules)
  • HLEDGER_ARGS
    • extra arguments you want to pass to hledger-web. You can supply extra arguments on the command line as well, but environment variable is useful for docker-compose recipes.

hledger cli in the shell

You can use this image to run command-line version of hledger (or hledger-iadd, hledger-ui, ...) by providing alternative start command to docker run.

You can just drop into a shell in the container and run hledger there (remember to include -it):

docker run --rm -it -v "$HOME/hledger-data:/data" --user $(id --user) dastapov/hledger bash

Github repo contains helper script that simplifies invocation:

./run.sh ~/journals/all.journal bash

hledger cli via docker run

You can use docker run to invoke hledger directly:

docker run --rm -v "$HOME/hledger-data:/data" --user $(id --user) dastapov/hledger hledger -f /data/hledger.journal stats

Make sure you provide --rm argument to docker run, otherwise your containers will be kept in the container registry even after you are done with them, which is probably not what you want.

Using image for hledger development

You can use the supplied Dockerfile to get yourself an image for hledger development. Build target dev will get you Debian-based image with stack and all the build dependencies of hledger installed:

docker image build --tag hledger-dev --target dev .

Alternatively, you can use pre-built image via latest-dev or VERSION-dev tags:

docker run --rm -it -v "$HOME/hledger-data:/data" dastapov/hledger:latest-dev bash

hledger-service's People

Contributors

adept avatar xeroc avatar omichaelo avatar dumbpy avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.