* 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>
* invoices without the x tag, should be assumed to take 3600 seconds to expire
* update bolt11 package and use built in method to calculate the invoice expiry date
* fix linter errors
* fix: rest `pay_invoice` pending instead of failed
* fix: rpc `pay_invoice` pending instead of failed
* fix: return "failed" value for payment
* fix: handle failed status for LNbits funding source
* chore: `phoenixd` todo
* test: fix condition
* fix: wait for payment status to be updated
* fix: fail payment when explicit status provided
---------
Co-authored-by: dni ⚡ <office@dnilabs.com>
* chore: adhere to ruff's "N" rules
WARN: reinstall failing extensions!
bunch of more consistent variable naming. inspired by this issue.
https://github.com/lnbits/lnbits/issues/2308
* fixup! chore: adhere to ruff's "N" rules
* rename to funding_source
* skip jmeter
---------
Co-authored-by: Pavol Rusnak <pavol@rusnak.io>
* Login form loading
* add first install middleware and settings
* updates
* Login form loading
* add first install middleware and settings
* updates
* only set first install when superuser is created
* refactor first install
* only show if first install
* cleanup
* set password
* update calls
* login superuser on first install
* fix
* fixup!
* fixup!
* fixup!
* fixup!
* fixup!
* last fixup!
* fix mypy and prettier CI errors
* disable first install
* add random super user
* set first install after startup
* remove user id from form
* Update lnbits/core/views/auth_api.py
Co-authored-by: Vlad Stan <stan.v.vlad@gmail.com>
* Update lnbits/core/views/auth_api.py
Co-authored-by: Vlad Stan <stan.v.vlad@gmail.com>
* Update lnbits/middleware.py
Co-authored-by: dni ⚡ <office@dnilabs.com>
* addressing Vlad's comments
* remove super user
* move to transient settings
* fix: show `first_install` page even after a server restart
* fix: do not add `user_id` in the auth token
* fix: `make check` errors
* fix: `username` is not optional for `UpdateSuperuserPassword`
* feat: nicer error message
---------
Co-authored-by: dni ⚡ <office@dnilabs.com>
Co-authored-by: Tiago Vasconcelos <talvasconcelos@gmail.com>
Co-authored-by: Vlad Stan <stan.v.vlad@gmail.com>
* add service fee to specific wallet
* add to .env.example
* Added service fee wallet to manage server
* cleaned
* prettier
* Added badge for service fee
* Added tooltip
* Added service fee max
* allow ignoring service fee for internal transactions
* add fee_reserve_total helper funciton that includes service_fee
* html for admin ui
* typo
* Update .env.example
Co-authored-by: Pavol Rusnak <pavol@rusnak.io>
* fix .env.template comment
* bundle
* WIP: expose fee reserve endpoint
---------
Co-authored-by: Arc <ben@arc.wales>
Co-authored-by: dni ⚡ <office@dnilabs.com>
Co-authored-by: Pavol Rusnak <pavol@rusnak.io>
* F541 fix
remove unused workflow and combine linters into one
add lnbits/static to ruff ignore
remote setupnode
ignore upgrades for mypy
ignore F401 for __init__ files
unused noqa
ignore upgrades for black
F821: undefine name
disabled and logged webhook_listener for opennode and lnpay because they are obvisouly not working
E402: module level import not at top of file
fixup
revert breaking changes wait for PR #1876https://github.com/lnbits/lnbits/pull/1876
E721 fixes, only popped up for python3.9 not 3.10
[REFACTOR] core/__init__ to not have circular import issues
WIP
add db for backwards compat
fix pyright
make mypy happy again
pyright did not catch those, i think mypy got confused with relative imports. maybe we should use absolute ones everywhere
E402: module level import not at top of file
dont forget to add core_app
rebase on ruff pr
f
remo
format
* fix clnrest
* ignore E402 in conftest
* refactoring issues
---------
Co-authored-by: jacksn <jkranawetter05@gmail.com>
* [FEAT] improve update_admin_settings
while working on the push notification pr i found it very hard just to update
2 settings inside the db, so i improved upon update_admin_settings.
now you just need to provide a dict with key/values you want to update inside db.
also debugging the endpoints for update_settings i found despite the type of `EditableSettings`
fastapi did in fact pass a dict.
* t
* use `EditableSettings` as param in update_settings
* fix settings model validation
we previously overrode the pydantic validation with our own method
* make `LnbitsSettings` a `BaseModel` and only add `BaseSettings` later
this allows us to instantiate `EditableSettings` without the environment values being loaded in
* add test
* forbid extra fields in update api
* fixup
* add test
* test datadir
* move UpdateSettings
* fix compat
* fixup webpush
---------
Co-authored-by: jacksn <jkranawetter05@gmail.com>
* push notification integration into core
added missing component
fixed bell working on all pages
- made pubkey global template env var
- had to move `get_push_notification_pubkey` to `helpers.py` because of circular reference with `tasks.py`
formay
trying to fix mypy
added py-vapid to requirements
Trying to fix stub mypy issue
* removed key files
* webpush key pair is saved in db `webpush_settings`
* removed lnaddress extension changes
* support for multi user account subscriptions, subscriptions are stored user based
fixed syntax error
fixed syntax error
removed unused line
* fixed subscribed user storage with local storage, no get request required
* method is singular now
* cleanup unsubscribed or expired push subscriptions
fixed flake8 errors
fixed poetry errors
* updating to latest lnbits
formatting, rebase error
fix
* remove unused?
* revert
* relock
* remove
* do not create settings table use adminsettings
mypy
fix
* cleanup old code
* catch case when client tries to recreate existing webpush subscription e.g. on cleared local storage
* show notification bell on user related pages only
* use local storage with one key like array, some refactoring
* fixed crud import
* fixed too long line
* removed unused imports
* ruff
* make webpush editable
* fixed privkey encoding
* fix ruff
* fix migration
---------
Co-authored-by: schneimi <admin@schneimi.de>
Co-authored-by: schneimi <dev@schneimi.de>
Co-authored-by: dni ⚡ <office@dnilabs.com>
* add deleted flag on wallets
set deleted on delete wallet
2 twelves
format
fail on create invoice
make deleted check on SQL query
nazi flake8
add_test
boom... it works and passes!!
* add app fixture
vlad's recommendations
add deleted
* Add deleted flag to Wallet
* restore crud
* do not check for wallet in services.py
* add deleted flag on wallets
set deleted on delete wallet
2 twelves
format
fail on create invoice
make deleted check on SQL query
nazi flake8
add_test
boom... it works and passes!!
* add app fixture
vlad's recommendations
* add deleted
* error checks
---------
Co-authored-by: callebtc <93376500+callebtc@users.noreply.github.com>
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`
* save fiat_amounts on payment creation
* show fiat amount in frontend
* add lnbits_default_accounting_currency
* extract fiat calculation logic into service
* move all currency conversions to calc_fiat_amounts
move all conversion logic into create_invoice so extensions can benefit aswell
* show user-defined and wallet-defined currency in frontend
* remove sat from fiat units
* make bundle
* improve tests
* debug log
* [CHORE] update mypy and new issues
lnbits/cache.py:21: note: By default the bodies of untyped functions are not checked, consider using --check-untyped-defs [annotation-unchecked]
lnbits/extension_manager.py:210: note: By default the bodies of untyped functions are not checked, consider using --check-untyped-defs [annotation-unchecked]
lnbits/db.py:110: error: Only instance methods can be decorated with @property [misc]
lnbits/tasks.py:152: note: By default the bodies of untyped functions are not checked, consider using --check-untyped-defs [annotation-unchecked]
lnbits/tasks.py:171: note: By default the bodies of untyped functions are not checked, consider using --check-untyped-defs [annotation-unchecked]
lnbits/core/services.py:520: note: By default the bodies of untyped functions are not checked, consider using --check-untyped-defs [annotation-unchecked]
lnbits/app.py:520: note: By default the bodies of untyped functions are not checked, consider using --check-untyped-defs [annotation-unchecked]
lnbits/app.py:525: note: By default the bodies of untyped functions are not checked, consider using --check-untyped-defs [annotation-unchecked]
lnbits/app.py:532: note: By default the bodies of untyped functions are not checked, consider using --check-untyped-defs [annotation-unchecked]
* fix db.py
* fix mypy notes, type were not needed
* add send_payment_notification service
payment notifications are sent from multiple places with inconsistent and incomplete data
* adopt new send_payment_notification service
* add tests
* added ratelimiter
* Adds server logs to admin ui
* Added IP allow/ban list
* fixed remove ips
* Split rate limit number and unit
* security tab and background tasks for killswitch
* fix test for auditor api
---------
Co-authored-by: dni ⚡ <office@dnilabs.com>
* Merged extensions into one page
* Bundle files updated
* Fixed install bug
* feat: client side version compatibility check
* fix: hide `Activated/Deactivated` toggle for non-admins
* feat: translate labels to `EN`
* feat: add other language translations
* chore: update bundle for i18n
* feat: check extension version server-side
* feat: show warning message
* refactor: nicer mapping
Co-authored-by: dni ⚡ <office@dnilabs.com>
* chore: code format
* chore: extra log
* feat: check_latest_version of ext
* feat: show tooltip for new version
* chore: `make bundle`
* chore: `mypy`
* chore: code clean-up
* feat: show version in badge (spacing is fine)
* chore: make bundle
* feat: check `min_lnbits_version` and `warning` in `config.json`
* chore: code formatting
* chore: downgrade log level
* fix: extract `ExtensionsInstallSettings` as readonly
* fix: do not show installed and deactivated extensions
* chore: format
* fix: `Enable` button tooltip
* fix: set installed release after installation
* fix: hide deactivated extensions from regular users
* bundle fundle
* bundle fundle
---------
Co-authored-by: Vlad Stan <stan.v.vlad@gmail.com>
Co-authored-by: dni ⚡ <office@dnilabs.com>
* fix: temp create account for `super_user_id` if missing
* chore: remove dumb import
* refactor: move logic outside `crud`
* feat: add uuid4 conversion
* fix: require valid string in .env file
* fix: update the `settings.super_user` value in case or normalisation for UUID4
* fix: allow long super_user
* chore: code format
* fix: add UI redirect with the normalized user
* fix: normalize `super_user` up one level
* fix: should normalize user in non-ui mode also
* bugfix: 500 error if same wallet tries to pay an external invoice twice
* fstring
* log the error
---------
Co-authored-by: callebtc <93376500+callebtc@users.noreply.github.com>
* BUG: proper exception for paid interal invoices
* test should now fail, because we pay invoice twice, and should also work in regtest
* sorting
* unpack check_internal
* introduce another crud fn for checking internal paid payment
* rename
---------
Co-authored-by: callebtc <93376500+callebtc@users.noreply.github.com>