Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to run gnucash_web flask #38

Open
chdrsto opened this issue Apr 7, 2023 · 4 comments
Open

How to run gnucash_web flask #38

chdrsto opened this issue Apr 7, 2023 · 4 comments
Labels
documentation Improvements or additions to documentation support Just helping out a user

Comments

@chdrsto
Copy link

chdrsto commented Apr 7, 2023

I have to admit, I'm running GnucashDB (mariaDB) on a Raspi and would like to enable a web front end to the DB.
So I came along to this project.

To be fair, I have no clue about flask and would rather avoid to go too deep into flask setup and configuration.

So, how would i start the flask webserver after I installed it with pip install GnuCash-Web ?
I did the configuration in /etc/gnucash_web/config.py ... but have no clue how to start it w/o to learn flask setup

Hope somebody can provide an easy (end user) guide/hint

@joshuabach
Copy link
Owner

Thank you for trying to use my project, I always appreciate any interest :-)

You really don't need to know much about flask, but you should have some basic understanding of what WSGI is (doesn't matter how it works internally). Basically, WSGI is a python-focused alternative to FastCGI, so a mechanism for a webserver to call the python application based on the URL requested by the user.

At the end of the day, your setup might look like this:

  • Outward facing webserver listening on 80/443, most likely apache / nginx
  • WSGI-Server configured to call gnucash_web

But if you are using apache, using mod_wsgi directly is also an option.

You could start by reading the "Running" section in my Readme and follow the links there. This should help you get it up and running. Especially the guide on the Flask website is useful.

Anyway, I would appreciate if you'd report your results (positive or negative) or any suggestions for improvements in the code or docu back here.

Hope this helps

@joshuabach joshuabach added documentation Improvements or additions to documentation support Just helping out a user labels Apr 10, 2023
@stevemarkham81
Copy link

@joshuabach I'm not OP, but I started using your project today, and can report back on exactly what it took to get started. Firstly let me say, this is super cool, and thank you very much.

pip install GnuCash-Web
mkdir .config/gnucash_web
vi ~/.config/gnucash_web/config.py
# [Set up the file as per the README, but with 32 random bytes, sqlite as the DB, and the actual DB file]
pip install uwsgi
pip install Flask==2.2.5  # I had a newer version, and got an error similar to #49  
vi gnucashweb.ini
# [Set up the file as per the README]
uwsgi gnucashweb.ini
# [Experimented a little with a test book and eventually got my real book working after facing #42 (which I fixed by exporting and importing the account tree and the transactions, but probably could have just added a commodity to the root account]

I also added port-forwarding on my router, so that from my phone with Termux I can ssh into my machine, start uwsgi, use GnuCash-Web, then shut it down again. I don't know how to add authentication so that I can leave it running all the time. Maybe I need a proper DB backend instead of sqlite. But anyway, hopefully that short list of commands is something a newbie like me could use to save a few minutes getting started.

@plimptm
Copy link

plimptm commented Jan 10, 2024

@stevemarkham81 thanks for sharing those details! That's helpful extra documentation.

Personally, for a gnucash 'service' I would not use port forwarding on my router and instead utilize a VPN to get inside my network from a remote location. I use OpenVPN with the Android app and it has been useful for these sorts of things where I don't want to poke new holes in my firewall.

@stevemarkham81
Copy link

@plimptm Funny you should mention it, last week I put WireGuard on my router for another service (Immich). And I must agree, VPNs are a million times easier (and more secure) than port forwarding.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation support Just helping out a user
Projects
None yet
Development

No branches or pull requests

4 participants