Commit Graph

146 Commits

Author SHA1 Message Date
Tiago Vasconcelos
576e20d0cd
Add deleted flag wallet (#1826)
* 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>
2023-09-11 14:06:31 +01:00
jackstar12
2623e9247a
track fiat value of payments (#1789)
* 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
2023-08-28 11:00:59 +01:00
dni ⚡
4e6f229db2
[CHORE] string formatting default length 88 (#1887)
* [CHORE] string formatting default length 88

uses blacks default off 88 and enabled autostringformatting

* formatting

* nitpicks jackstar

fix
2023-08-24 10:26:09 +01:00
dni ⚡
2ab18544c3
[BUG] use WalletType for get_wallet_for_key fn (#1896) 2023-08-24 08:26:34 +02:00
dni ⚡
c4da1dfdce
[REFACTOR] WalletType into enum (#1888)
* [REFACTOR] WalletType into enum

- move wallettype models from decorators.py into models.py
- use enum instead of int
- use HTTPStatus for consistency

* Update lnbits/core/models.py

Co-authored-by: jackstar12 <62219658+jackstar12@users.noreply.github.com>

* use dataclass

---------

Co-authored-by: jackstar12 <62219658+jackstar12@users.noreply.github.com>
2023-08-23 12:41:22 +02:00
dni ⚡
355806608b
[CHORE] E722 bare exception fix (#1871)
* [CHORE] E722 bare exception fix
remove all bare exceptions from codebase and change it in `.flake8`
2023-08-16 12:17:54 +02:00
Arc
7e1f43933d
Adds security tools, such as a rate limiter, IP block/allow, server logs (#1606)
* 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>
2023-06-20 11:26:33 +02:00
Tiago Vasconcelos
758a4ecaf6
Fix user label across lnbits (#1771)
* check for super user on get_user
* remove unecessary assingments
2023-06-20 08:41:57 +02:00
Vlad Stan
8c0e7725de
Add option to drop extension db at un-install time or later (#1746)
* chore: remove un-used file
* feat: allow extension DB clean-up
* feat: i18n and bundle update
* chore: code format
* fix: button color
* chore: delete temp file
* chore: fix merge conflicts
* chore: add extra log
* chore: bump CACHE_VERSION to `37`
2023-06-15 16:22:18 +02:00
Tiago Vasconcelos
eab19280d5
fix "boolean" query for sqlite (#1727)
use false
2023-05-24 12:14:21 +02:00
callebtc
e39241a9e9
Fix: get_payments crud default Filter values. (#1703)
* get_payments: deafult values for filter

* lololololoolol
2023-05-11 18:36:20 +02:00
callebtc
b6223f0e6d get_payments: deafult values for filter 2023-05-11 18:29:08 +02:00
dni ⚡
d8ccb4dcd8
fix old payments endpoint for lndhub (#1698)
* fix old payments endpoint for lndhub

* fixup tests
2023-05-10 11:47:04 +02:00
Vlad Stan
67d8b67ee5
Create super user account if it does not exist (#1688)
* 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
2023-05-09 09:22:19 +01:00
Vlad Stan
132d8a9320
fix: rename bool super_user to is_super_user (#1690) 2023-05-09 09:20:51 +01:00
jackstar12
c0f66989cb
Serverside Pagination for payments (#1613)
* initial backend support

* implement payments pagination on frontend

* implement search for payments api

* fix pyright issues

* sqlite support for searching

* backwards compatability

* formatting, small fixes

* small optimization

* fix sorting issue, add error handling

* GET payments test

* filter by dates, use List instead of list

* fix sqlite

* update bundle

* test old payments endpoint aswell

* refactor for easier review

* optimise test

* revert unnecessary change

---------

Co-authored-by: dni  <office@dnilabs.com>
2023-05-09 09:18:53 +01:00
Arc
91b28ebf83
Merge pull request #1612 from lnbits/fix_admin_ext_access
Fix admin ext access
2023-04-20 09:46:18 +01:00
Vlad Stan
0d14d2b56e fix: remove admin extensions for non admin users 2023-04-05 19:40:16 +03:00
dni ⚡
2a1a0f3a2f
fix pyright issues 2023-04-04 07:49:13 +02:00
dni ⚡
5dbd9a9192
add some assert description 2023-04-04 07:35:20 +02:00
Pavol Rusnak
0607cb1d6e
fix pyright lnbits/core
Co-authored-by: dni  <office@dnilabs.com>
2023-04-04 07:34:37 +02:00
calle
58c3b05e29
fix internal payment check (#1604) 2023-04-03 15:15:34 +02:00
dni ⚡
8ce84ce592
FEAT: Filters for GET requests, add it to GET /payments (#1557)
* feat filters, add them to GET payments

* add limit and offset to filters (#1563)

* add limit and offset to filters
* move filters example to parse_filters doc string

* black

* add openapi docs

* remove example commentC

* improve typing and make nested filter possible in openapi

* typo in fn name

* readd Type

---------

Co-authored-by: jackstar12 <62219658+jackstar12@users.noreply.github.com>
Co-authored-by: calle <93376500+callebtc@users.noreply.github.com>
2023-04-03 14:55:49 +02:00
dni ⚡
fe9e821af5
BUG: proper exception for already paid internal invoices (#1593)
* 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>
2023-04-03 14:44:17 +02:00
Pavol Rusnak
bc36e6bc4c
fix flake8 F541 (f-string is missing placeholders) 2023-01-30 11:46:44 +00:00
Pavol Rusnak
86e8a3a315
fix flake8 E711 (comparison-to-none) 2023-01-30 11:46:44 +00:00
Pavol Rusnak
d29fcca6aa
fix pylint W0612 (unused-variable) 2023-01-30 11:46:43 +00:00
Vlad Stan
6276a7a4db fix: icon missing after extension install 2023-01-26 12:30:42 +02:00
Vlad Stan
dd3fc7c2bb fix: merge errors 2023-01-25 09:56:05 +02:00
Vlad Stan
9cca87f738
Merge branch 'main' into extension_install_02 2023-01-25 09:50:54 +02:00
ben
c0c4c86808 Added wallet authentication to creat, get and delete tinyurls 2023-01-24 21:26:18 +00:00
ben
7322d27aa3 changed to shortuuid as suggested by Vlad 2023-01-24 20:27:20 +00:00
ben
caadeb77e2 format 2023-01-24 13:32:21 +00:00
ben
274615f0b3 Man, broken 2023-01-24 13:27:30 +00:00
ben
0d0817044c Pissy python and its tuples 2023-01-24 11:03:46 +00:00
Vlad Stan
fa5d824eea refactor: remove redundant changes 2023-01-20 15:59:44 +02:00
Vlad Stan
730017ed62 fix: import after renaming 2023-01-20 10:06:32 +02:00
Vlad Stan
5bcb8cb349 fix: deactivate on upgrade 2023-01-18 17:38:51 +02:00
Vlad Stan
86c86958ae refactor: more and more 2023-01-18 17:38:51 +02:00
Vlad Stan
6b360b927c feat: returned the installed release 2023-01-18 17:38:51 +02:00
Vlad Stan
12060b67ad feat: store and retrieved the installed_release 2023-01-18 17:38:36 +02:00
Vlad Stan
9d0cedfcb2 feat: install GitHib releases also 2023-01-18 17:38:36 +02:00
Vlad Stan
496346b3ba feat: use github releases for installing extensions 2023-01-18 17:38:36 +02:00
Vlad Stan
38a132604b feat: used dedicated table for installed extensions 2023-01-18 17:38:36 +02:00
Vlad Stan
66c908e600 chore: migrate after major changes on main 2023-01-18 17:38:36 +02:00
ben
ca4134eb02 added conn 2023-01-12 22:52:46 +00:00
ben
f97326bed0 Adde models 2023-01-12 22:42:49 +00:00
ben
6e33784061 Removed lnurlp tests 2023-01-12 22:39:20 +00:00
ben
6d8896c2f6 works 2023-01-12 20:37:03 +00:00
ben
2b3a2afe83 Making universal tinyurl function 2023-01-12 15:16:37 +00:00