Git Product home page Git Product logo

jadetree-backend's People

Contributors

asymworks avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

jadetree-backend's Issues

API errors when no accounts are set up

GET /api/v1/ledger fails when no accounts are set up and frontend dashboard shows error. Traceback:

File "/Users//Projects/JadeTree/backend/jadetree/api/v1/budget/base.py", line 135, in get
data = budget_service.get_budget_month(
File "/Users//Projects/JadeTree/backend/jadetree/service/budget/data.py", line 234, in get_budget_month
budget_data = get_budget_data(session, user, budget_id)
File "/Users//Projects/JadeTree/backend/jadetree/service/budget/data.py", line 184, in get_budget_data
parent_id=categories[cat].parent_id,
KeyError: 38

Resend Confirmation Email API needs rate limiting

Need to rate-limit resending of confirmation emails to avoid spamming users (low likelihood but not difficult to implement)

  • Add confirmation_sent_at field to User model and users table
  • Add check in resend_confirmation against confirmation_sent_at and raise exception if too recent (application configured but default to 10 minutes?)

ERROR in factory: Startup Error (ConfigError): Either FRONTEND_HOST or SERVER_NAME must be set to resolve frontend URLs.

I tried DB init with MariaDB and sqllite and getting the same error:
ERROR in factory: Startup Error (ConfigError): Either FRONTEND_HOST or SERVER_NAME must be set to resolve frontend URLs.

Setting up FRONTEND_HOST and/or SERVER_NAME doesn't help.

1st try - using MariaDB installed on the server:
docker run --rm -ti
--env JADETREE_DB_DRIVER=mysql
--env JADETREE_DB_HOST=192.168.10.2
--env JADETREE_DB_PORT=3306
--env JADETREE_DB_NAME=jadetree
--env JADETREE_DB_USERNAME=jadetree_app
--env JADETREE_DB_PASSWORD='xxxxxxxxxxxxxxxxxxxx'
--env FRONTEND_HOST='https://jadetreeapi.xxxxxx.xxx'
asymworks/jadetree-backend:0.9-alpha
db init

2nd try - using sqllite
docker run --rm -ti
--env JADETREE_DB_DRIVER=sqlite
--env JADETREE_DB_FILE=jadetee.db
--env FRONTEND_HOST=https://jadetreeapi.xxxxxx.xxx
--env SERVER_NAME=jadetreeapi.xxxxxx.xxx
--volume /volume1/docker/jadetree:/jadetree
asymworks/jadetree-backend:0.9-alpha
db init

In both cases getting same stacktrace:
[2022-03-02 02:25:13,118] [None - None] DEBUG in mail: Skipping mail setup (disabled)
[2022-03-02 02:25:13,120] [None - None] DEBUG in cli: CLI Initialized
[2022-03-02 02:25:14,091] [None - None] DEBUG in init: API v1 Initialized
[2022-03-02 02:25:14,091] [None - None] DEBUG in init: API and CORS Initialized
[2022-03-02 02:25:14,092] [None - None] DEBUG in socketio: Web Sockets Initialized
[2022-03-02 02:25:14,094] [None - None] ERROR in factory: Startup Error (ConfigError): Either FRONTEND_HOST or SERVER_NAME must be set to resolve frontend URLs.
Traceback (most recent call last):
File "/home/jadetree/venv/bin/flask", line 8, in
sys.exit(main())
File "/home/jadetree/venv/lib/python3.8/site-packages/flask/cli.py", line 967, in main
cli.main(args=sys.argv[1:], prog_name="python -m flask" if as_module else None)
File "/home/jadetree/venv/lib/python3.8/site-packages/flask/cli.py", line 586, in main
return super(FlaskGroup, self).main(*args, **kwargs)
File "/home/jadetree/venv/lib/python3.8/site-packages/click/core.py", line 782, in main
rv = self.invoke(ctx)
File "/home/jadetree/venv/lib/python3.8/site-packages/click/core.py", line 1259, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/home/jadetree/venv/lib/python3.8/site-packages/click/core.py", line 1259, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/home/jadetree/venv/lib/python3.8/site-packages/click/core.py", line 1066, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/home/jadetree/venv/lib/python3.8/site-packages/click/core.py", line 610, in invoke
return callback(*args, **kwargs)
File "/home/jadetree/venv/lib/python3.8/site-packages/click/decorators.py", line 21, in new_func
return f(get_current_context(), *args, **kwargs)
File "/home/jadetree/venv/lib/python3.8/site-packages/flask/cli.py", line 425, in decorator
with __ctx.ensure_object(ScriptInfo).load_app().app_context():
File "/home/jadetree/venv/lib/python3.8/site-packages/flask/cli.py", line 388, in load_app
app = locate_app(self, import_name, name)
File "/home/jadetree/venv/lib/python3.8/site-packages/flask/cli.py", line 257, in locate_app
return find_best_app(script_info, module)
File "/home/jadetree/venv/lib/python3.8/site-packages/flask/cli.py", line 83, in find_best_app
app = call_factory(script_info, app_factory)
File "/home/jadetree/venv/lib/python3.8/site-packages/flask/cli.py", line 119, in call_factory
return app_factory()
File "/home/jadetree/jadetree/factory.py", line 161, in create_app
raise e
File "/home/jadetree/jadetree/factory.py", line 146, in create_app
init_templates(app)
File "/home/jadetree/jadetree/templates/init.py", line 118, in init_templates
setup_frontend_urls(app)
File "/home/jadetree/jadetree/templates/init.py", line 53, in setup_frontend_urls
raise ConfigError(
jadetree.exc.ConfigError: Either FRONTEND_HOST or SERVER_NAME must be set to resolve frontend URLs.

I would really love to give it a try :)

Raspberry Pi Support

Update build scripts to push armhf, armv7, and aarch64 images to Docker Hub for Raspberry PIs

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.