yegle / fava-docker Goto Github PK
View Code? Open in Web Editor NEWA Dockerfile for beancount-fava
License: MIT License
A Dockerfile for beancount-fava
License: MIT License
Using
# ensure latest image
$ docker image pull yegle/fava
$ docker run -v $PWD:/bean \
-e BEANCOUNT_FILE=/bean/example.bean \
-d \
--name fava \
yegle/fava
Fava is not available at http://localhost:5000.
Loading the page in Firefox simply yields an “Unable to Connect” error page—the same as when the container is not running at all.
docker container ls
shows that the container exposes port 5000:
$ docker container ls
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
935da98ab485 5fbe21937db8 "fava" 2 seconds ago Up 2 seconds 5000/tcp fava
BUT it appears that port 5000 is not actually in use, because it’s possible to launch new services on port 5000:
$ ruby -rwebrick -e"WEBrick::HTTPServer.new(Port: 5000, DocumentRoot: Dir.pwd).start"
[2020-12-26 17:45:44] INFO WEBrick 1.6.0
[2020-12-26 17:45:44] INFO ruby 2.7.0 (2019-12-25) [x86_64-linux]
[2020-12-26 17:45:44] INFO WEBrick::HTTPServer#start: pid=123771
port=5000
At this point, loading http://localhost:5000 succeeds, returning the Ruby WEBrick file server. Port 5000 is actually in use now, as subsequent attempts to launch services on it raise this error:
Address already in use - bind(2) for [::]:5000 (Errno::EADDRINUSE)
Explicitly setting the --port 5000:5000
option when running the container fixes the problem.
Thank you so much for this work!
I have a line in my beanfile:
2022-01-01 custom "fava-option" "language" "nl"
I can tell this is being recognized when I have a click on 'options' in the left menubar, I can see the setting listed in the fava options on the right.
However, fava is still in English.
This seems also mentioned in #34 which suggests to use another docker container. However, because of the available arm64 version, and reds plugins, I would very much like to use this docker container.
Is there a way to get the language option working?
Kind regards
After I called the beancount_periodic.amortize plugin in the bean file, the "Error importing "beancount_periodic.amortize": Traceback (most recent call last):" error was displayed in fava. How can I resolve this?
Hello. First of all, thanks for making this image and also making me discover the reds plugins !
It seems there is no tag for v1.24 on Docker Hub, despite this version having been built by Github Actions and pushed to :latest tag.
Am I missing something, is this tag available elsewhere ? Looking at the Actions, I indeed only see them pushing to :latest, how were the previous versioned tags (v1.23, etc.) pushed ?
EDIT: Ah, got it, the versioned tags are pushed when a branch is created. Can you please create the branch for version v1.24 so that I can pin it in my deployments :) ?
Best regards,
Léo.
Hey!
Not really sure if this is the right place for this, but figured I'd reach out to you.
I am using your Dockerfile to make a container for Fava. The end result is a webhost that is missing the CSS and JS from /static/gen. Any tips for me to make that work? I am 99% sure I am doing something wrong, but I am not sure what.
I built the Dockerfile exactly as it is on the repo and called it "fava."
To run the container, I ran the following docker run:
sudo docker run -d --name="fava" --net=host -v /home/shmcg/Dropbox/Beancount/:/beancount -e BEANCOUNT_INPUT_FILE="beancount/shm.beancount" fava
I have the host up at port 5000. I can see the shm.beancount file. But all that is there are the numbers. I attached an image below.
I have remade the container a couple of times. Is my mount point the problem? What is the best way to set up the variable for BEANCOUNT_INPUT_FILE?
Any tips would be greatly appreciated!
Running the container in a vanilla state (no customisation) results in an ImportError
:
$ docker run yegle/fava
Traceback (most recent call last):
File "/usr/local/bin/fava", line 7, in <module>
from fava.cli import main
File "/usr/local/lib/python3.6/site-packages/fava/cli.py", line 12, in <module>
from fava import __version__
ImportError: cannot import name '__version__'
Just discovered fava, thanks a ton for maintaining this Docker image. Any chance we could get an ARM variant, so that I can run fava on my Raspberry Pi?
I don't know much about writing Docker files, but if you'd like a PR, I can look into it this weekend. (Can't be that hard, right?)
Thanks for maintaining this repo. Is it possible/feasible to change the default shortcut for showing/hiding the charts? I often want copy amount or balance and have to right click and select copy versus just pressing Ctrl+c
. Perhaps replacing this Alt+c
would work?
I thought I could just update or comment out the code from here like so:
<button
type="button"
on:click={() => showCharts.update((v) => !v)}
// use:keyboardShortcut={"Control+c"} <--- comment out this line
class:closed={!$showCharts}
class="toggle-chart"
/>
I'm not sure how to properly enter the docker container and access the files. Here's my docker-compose file if it makes any difference:
version: "3.7"
services:
fava:
image: yegle/fava
ports:
- 5000:5000
volumes:
- /path/to/beanfile:/data/
environment:
BEANCOUNT_FILE: /data/main.bean
Any guidance is helpful here, thanks.
Beancount contains some old version of beanprice
, but the main repo is now at https://github.com/beancount/beanprice . Do you think it would be possible to include that in the Docker file?
Hi!
I think i am missing something obvious, but you may be able to help me.
I am trying to start your container using a docker-compose file:
Here is my docker-compose.yml file:
## This docker-compose file is designed to be used as a template in portainer.
##
## This template can be set up in your portainer "App template".
## Don't forget to set the following environment variables:
## - DOMAIN => your DNS domainname ( example.com )
## - OAUTH2_PROXY_CLIENT_ID => please see https://github.com/bitly/oauth2_proxy
## - OAUTH2_PROXY_CLIENT_SECRET => please see https://github.com/bitly/oauth2_proxy
## - OAUTH2_PROXY_COOKIE_SECRET => Some random long string
version: "3.0"
services:
fava:
image: yegle/fava:latest
volumes:
- /var/data/volumes/fava:/myData
environment:
- BEANCOUNT_FILE=/myData/test.beancount
networks:
- internal
fava-proxy:
image: a5huynh/oauth2_proxy
networks:
- internal
- traefik_public
deploy:
labels:
- traefik.frontend.rule=Host:fava.$DOMAIN
- traefik.docker.network=traefik_public
- traefik.port=4180
volumes:
- /var/data/volumes/authenticated-emails.txt:/authenticated-emails.txt
command: |
-cookie-secure=false
-upstream=http://fava:5000
-redirect-url=https://fava.$DOMAIN
-http-address=http://0.0.0.0:4180
-email-domain=$DOMAIN
-provider=google
-authenticated-emails-file=/authenticated-emails.txt
environment:
- OAUTH2_PROXY_CLIENT_ID=$OAUTH2_PROXY_CLIENT_ID
- OAUTH2_PROXY_CLIENT_SECRET=$OAUTH2_PROXY_CLIENT_SECRET
- OAUTH2_PROXY_COOKIE_SECRET=$OAUTH2_PROXY_COOKIE_SECRET
networks:
traefik_public:
external: true
internal:
driver: overlay
ipam:
config:
- subnet: 172.16.2.0/24
As you can see the part related strictly to the fava container is pretty straightforward.
Unfortunately, the fava container does not start and close immediately at start up with the following error:
Error: No file specified```
I guess, the BEANCOUNT FILE environment is not passed to the command line . Is there something i have missed ?
Hi @yegle,
Thank you very much for this very useful docker image.
One feature I use quite regularly in fava is the split_income
plugin from the fava-plugins
package. Would it be possible to add it to the build? I would submit a PR for it, but I'm unsure if it should be included in requirements.txt
or the Dockerfile
.
Please let me know if I can help and thanks again.
Hello developers
I am working well with yegle/fava-docker with A.main.bean untill I am trying to open another main.bean ,lets call B.main.bean
it seems yegle/fava-docker dont support such feathers
I also tried deploy two another docker image with different ports ,-p 5001:5000, but things wont fly either
it returns
Exception on /favicon.ico [GET]
Traceback (most recent call last):
File "/app/lib/python3.9/site-packages/flask/app.py", line 2525, in wsgi_app
response = self.full_dispatch_request()
File "/app/lib/python3.9/site-packages/flask/app.py", line 1822, in full_dispatch_request
rv = self.handle_user_exception(e)
File "/app/lib/python3.9/site-packages/flask/app.py", line 1818, in full_dispatch_request
rv = self.preprocess_request()
File "/app/lib/python3.9/site-packages/flask/app.py", line 2304, in preprocess_request
url_func(request.endpoint, request.view_args)
File "/app/lib/python3.9/site-packages/fava/application.py", line 266, in _pull_beancount_file
_load_file()
File "/app/lib/python3.9/site-packages/fava/application.py", line 132, in _load_file
ledgers = [
File "/app/lib/python3.9/site-packages/fava/application.py", line 133, in
FavaLedger(filepath) for filepath in app.config["BEANCOUNT_FILES"]
File "/app/lib/python3.9/site-packages/fava/core/init.py", line 320, in init
self.load_file()
File "/app/lib/python3.9/site-packages/fava/core/init.py", line 327, in load_file
self.all_entries, self.errors, self.options = _load(
File "/app/lib/python3.9/site-packages/beancount/loader.py", line 501, in _load
entries, parse_errors, options_map = _parse_recursive(
File "/app/lib/python3.9/site-packages/beancount/loader.py", line 371, in _parse_recursive
assert path.isabs(source)
AssertionError
As can be seen by the numerous forks of this repository, a lot of people would like to pip install
some more things as part of the build (I, for one, am interested in https://github.com/redstreet/beancount_reds_plugins).
Options include:
pip3 install -U beancount-reds-plugins
)WDYT?
Previous builds worked fine with environment variable defined as:
BEANCOUNT_FILE=/file1.bean /file2.bean /file3.bean
In current docker image, this results in a "beancount file not found" error embedded in the html page.
I'm looking through the DockerFile and it seems git IS installed, but my hooks fail because git can't be located. Is this expected behaviour or am I somehow doing something wrong? Do I need to base the DockerFile off a different image? The current one seems to be 'only' a node image, so it doesn't have apt-get/apk or whatever.
To be clear, I'm trying to add git to the existing (distroless?) image.
Hello, congratulations for your work! I am new to using Docker, I installed the fava image from docker but I have an error when I launch the image, I have this error and I do not know how to modify the file to correct this error despite the right number of hours spent reading the docker and fava docs
2024-06-11 14:10:28 Usage: fava [OPTIONS] [FILENAMES]... 2024-06-11 14:10:28 Try 'fava --help' for help. 2024-06-11 14:10:28 2024-06-11 14:10:28 Error: No file specified
I had problems building a new image for ARMv7 (while #7 is still not solved 🙈): Fava's makefile
calls pybabel
, but it's not installed. I had to first install pip
and then call pip3 install babel
to fix this.
Is this my mistake? Or do you want a PR?
The latest build fails: https://github.com/yegle/fava-docker/actions/runs/8402693021/job/23012360617
> [linux/amd64 build_env 13/17] RUN pip3 install --require-hashes -U -r requirements.txt:
1.215 Collecting beancount-reds-plugins==0.3.0
1.465 Downloading beancount_reds_plugins-0.3.0-py3-none-any.whl (54 kB)
1.522 Collecting beancount-periodic==0.1.2
1.546 Downloading beancount-periodic-0.1.2.tar.gz (11 kB)
1.773 Requirement already satisfied: beancount>=2.3.4 in /app/lib/python3.9/site-packages (from beancount-periodic==0.1.2->-r requirements.txt (line 2)) (2.3.6)
1.802 Collecting python-dateutil~=2.8.2
1.802 ERROR: In --require-hashes mode, all requirements must have their versions pinned with ==. These do not:
1.802 python-dateutil~=2.8.2 from https://files.pythonhosted.org/packages/36/7a/87837f39d0296e723bb9b62bbb257d0355c7f6128853c78955f57342a56d/python_dateutil-2.8.2-py2.py3-none-any.whl#sha256=961d03dc3453ebbc59dbdea9e4e11c5651520a876d0f4db161e8674aae935da9 (from beancount-periodic==0.1.2->-r requirements.txt (line 2))
Indeed beancount-periodic
doesn't pin hashes in its own requirements.txt
... and never did. I'm not sure how this worked before.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.