* feat: add payment tab
* feat: add buttons
* feat: persist `pay to enable` changes
* fix: do not disable extension on upgrade
* fix: show releases tab first
* feat: extract `enableExtension` logic
* refactor: rename routes
* feat: show dialog for paying extension
* feat: create invoice to enable
* refactor: extract enable/disable extension logic
* feat: add extra info to UserExtensions
* feat: check payment for extension enable
* fix: parsing
* feat: admins must not pay
* fix: code checks
* fix: test
* refactor: extract extension activate/deactivate to the `api` side
* feat: add `get_user_extensions `
* feat: return explicit `requiresPayment`
* feat: add `isPaymentRequired` to extension list
* fix: `paid_to_enable` status
* fix: ui layout
* feat: show QR Code
* feat: wait for invoice to be paid
* test: removed deprecated test and dead code
* feat: add re-check button
* refactor: rename paths for endpoints
* feat: i18n
* feat: add `{"success": True}`
* test: fix listener
* fix: rebase errors
* chore: update bundle
* fix: return error status code for the HTML error pages
* fix: active extension loading from file system
* chore: temp commit
* fix: premature optimisation
* chore: make check
* refactor: remove extracted logic
* chore: code format
* fix: enable by default after install
* fix: use `discard` instead of `remove` for `set`
* chore: code format
* fix: better error code
* fix: check for stop function before invoking
* feat: check if the wallet belongs to the admin user
* refactor: return 402 Requires Payment
* chore: more typing
* chore: temp checkout different branch for tests
* fix: too much typing
* fix: remove try-except
* fix: typo
* fix: manual format
* fix: merge issue
* remove this line
---------
Co-authored-by: dni ⚡ <office@dnilabs.com>
payments are not deleted oif we delete a wallets, so to get a accurate
total representation of the lnbits balance we need to create the
balances view based on the wallets table, not payments, else deleted
balances will still show up.
2nd, delete_unused_wallets and delete_accounts was never working if
because they never got an updated_at time, so i just check if its null
else i check to timedelta on created_at
basically use `list` and `type` instead of `List` and `Type`
this is save to use for python3.9 and has been deprecated. also has some
performance drawbacks.
read more here: https://docs.astral.sh/ruff/rules/non-pep585-annotation/
this logically groups api endpoints and gioves them specific openapi tags. which makes them nice on the `/docs` endpoint and makes the `api.py` more approachable
* add wallets list endpoint
* remove trailing slashes from endpoints
* fixup topup url
* fix trailing slash on auth
* backwards compatibility
* feat: `cleanup-wallet` cli command
`lnbits-cli db cleanup-wallets` removes all wallets that never had an transaction.
this helps against spammers creating random wallets, eventually slowing down the db.
* add commands
* add to example env
* db_versions was used in app
* add delta as cli argument
* use days unit
* simplify cli argument name (cleanup_wallet_days -> days)!
---------
Co-authored-by: Vlad Stan <stan.v.vlad@gmail.com>
Co-authored-by: Pavol Rusnak <pavol@rusnak.io>
* feat: allow all extension deactivation
* doc: updated comment
* fix: make sure `register_routes` executes after installed extensions are checked
* chore: code format
* fix: do not run migration on deactivated extensions
* fix: make sure the deactivated extension list is loaded in time
* feat: register extension routes if extension never loaded before
* fix: move `load_disabled_extension_list`
* doc: disable by default
* [FEAT] add extension functionality to lnbits-cli
WIP
draft cli commands for vlad :)
* add extension list command
* [feat] lnbits-cli add install, uninstall and upgrade
* feat: load settings from DB
* refactor: simplify settings loading
* feat: show current version if installed
* feat: add mor emessages
* feat: basic DB install
* feat: add extension
* feat: do not install if the server is up
* feat: add logic for uninstall
* refactor: prepare for upgrade
* feat: check extension before upgrade
* refactor: stuff
* fix: have a default value
* feat: use the API logic
* feat: use pi methods for un-install
* refactor: extract _select_release
* feat: add flags
* feat: check if extension already up to date
* refactor: use `_run_async`
* feat: install all extensions
* feat: install online
* fix: api install
* fix: API upgrade & install
* feat: add API uninstall
* failed typo
* typo running
* url duplication
* [fix] provide short-options too (same as upgrade command)
Co-authored-by: Pavol Rusnak <pavol@rusnak.io>
* make black
* fix: fail if .superuser file not found; add `--admin-user` option
* fix: ambiguous use of `logger.debug`
- register_new_ext_routes must not be None
- `logger.debug` was used because it allowed any arguments, but that was a bad idea
- now an explicit empty `_do_nothing(*_)` function is used
* fix: load settings
* doc: updated `--source-repo`
* chore: rename `upgrade` to `update`
* refactor: use `@annotation` for making commands async
* fix: code checks
---------
Co-authored-by: Vlad Stan <stan.v.vlad@gmail.com>
Co-authored-by: Pavol Rusnak <pavol@rusnak.io>
related to https://github.com/lnbits/lnbits/pull/1855
put the `.super_user` into our data_dir to not pollute our root dir
removed the weird mention to the url in the logs and mention
the `lnbits-cli superuser` instead
this is a breaking change for the bundlers, `cat .super_user` is not good anymore.
fix would be `cat data/.super_user` but for future compatibility i recommend
using `poetry run lnbits-cli superuser`
* remove static/vendor
* add node dependencies
* add bolt11-decoder
* run npm install inside dockerimage
* only use bundle.js and bundle.css
* use node_modules for bundling vendor assets
* remove dead code
* make argument optional
* reintroduce vendor dir
* reintroduce vendor and single javascript files, minification
* wrong moment, remove minification
* lock packages with non critical issues
* black