Commit Graph

432 Commits

Author SHA1 Message Date
Vlad Stan
27b308ae1a feat: separate extension release into new API 2023-01-18 17:38:36 +02:00
Vlad Stan
a73e8ae44d feat: stub for extension versions 2023-01-18 17:38:36 +02:00
Vlad Stan
c9bb5a660c feat: show empty Upgrade dialog 2023-01-18 17:38:36 +02:00
Vlad Stan
97ea78f999 fix: return only the latest release 2023-01-18 17:38:36 +02:00
Vlad Stan
522bfcf4ae chore: optimize imports 2023-01-18 17:38:36 +02:00
Vlad Stan
76fbb5ccbb feat: return releases to UI 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
032a000da7 fix: do not fail when one of the extension manifest files is not available 2023-01-18 17:38:36 +02:00
Vlad Stan
e3ee04edc7 refactor: code clean-up 2023-01-18 17:38:36 +02:00
Vlad Stan
de929c6c70 refactor: extract more methods into InstallableExtension 2023-01-18 17:38:36 +02:00
Vlad Stan
1ca0cf4313 refactor: use factory method 2023-01-18 17:38:36 +02:00
Vlad Stan
0ab913e502 chore: code format 2023-01-18 17:38:36 +02:00
Vlad Stan
2edb9da387 fix: name conflict 2023-01-18 17:38:36 +02:00
Vlad Stan
795d05c109 refactor: extract extensions.py 2023-01-18 17:38:36 +02:00
Vlad Stan
e7a150e708 refactor: move more logic to InstallableExtension 2023-01-18 17:38:36 +02:00
Vlad Stan
1b07768b76 refactor: use check_admin decorator 2023-01-18 17:38:36 +02:00
Vlad Stan
3ed2b3cdeb refactor: move more logic to InstallableExtension 2023-01-18 17:38:36 +02:00
Vlad Stan
cb6349fd76 refactor: extract dome methods to helpers 2023-01-18 17:38:36 +02:00
Vlad Stan
cae71faf37 refactor: use the new check_admin 2023-01-18 17:38:36 +02:00
Vlad Stan
6ec1a668ae chore: code format 2023-01-18 17:38:36 +02:00
Vlad Stan
8c1479427d fix: merge issues 2023-01-18 17:38:36 +02:00
Vlad Stan
9dfeef15fd fix: merge issue 2023-01-18 17:38:36 +02:00
Vlad Stan
0d61db13ec fix: handle first time install different than subsequent updates 2023-01-18 17:38:36 +02:00
Vlad Stan
a6e3b5e049 feat: use hash for unique extension id 2023-01-18 17:38:36 +02:00
Vlad Stan
598d2a6939 feat: re-route trafic when an extension is upgraded 2023-01-18 17:38:36 +02:00
Vlad Stan
6c41ac841b feat: temporary fix for upgrades 2023-01-18 17:38:36 +02:00
Vlad Stan
11815958a3 chore: remove test code 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
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
Vlad Stan
c370bd18c6 refactor: remove redundant # type: ignore 2023-01-10 09:45:12 +02:00
callebtc
c96fd6783b fix super_user check, fixes #1250 2023-01-04 10:41:56 +01:00
calle
b622028f7d
Merge pull request #1271 from lnbits/fix/mypy/ignores
removing type: ignore from Query, Depends, Body and import them correctly
2023-01-04 09:19:06 +01:00
Pavol Rusnak
3d0c66f0f6
remove unnecessary argument encoding from bytes.decode() and str.encode()
the encoding parameter defaults to utf-8, so it's not needed
2023-01-03 22:38:28 +01:00
calle
7a406786f6
Merge pull request #1246 from prusnak/drop-binascii
use bytes.fromhex/hex builtins instead of binascii.hexlify/unhexlify
2023-01-03 10:52:28 +01:00
dni âš¡
b1d1cc6de3 removing type: ignore from Query, Depends, Body and import them correctly 2023-01-02 11:56:28 +01:00
Pavol Rusnak
a377381942
use bytes.fromhex/hex builtins instead of binascii.hexlify/unhexlify 2022-12-29 16:46:35 +01:00
callebtc
ead5ae0d82 refactor: remove unused imports 2022-12-27 14:50:42 +01:00
callebtc
6e7bfd03ee clean up 2022-12-27 14:19:51 +01:00
callebtc
a243e4e320 fix: update to latest changes 2022-12-26 12:12:27 +01:00
callebtc
feb61a3fa7 merge 2022-12-26 12:04:07 +01:00
callebtc
b6f0d7b769 feat: api health check endpoint 2022-12-25 18:49:51 +01:00
calle
7b7d06cee3
Merge pull request #1232 from lnbits/fix/allowed_user
BUG: fix auth issue for superusers  when allowed users are set
2022-12-24 11:22:49 +01:00
dni âš¡
1be460aec3 fix user not exist bug in frontend 2022-12-23 11:53:45 +01:00
Vlad Stan
b68b8a0292 fix: do not loose error, log it 2022-12-21 15:06:45 +02:00
Vlad Stan
1d509fb9d2 fix: typo Setings -> Settings 2022-12-19 11:07:24 +02:00
dni âš¡
ffe0a77106 fix admin ui only have superuser to topup 2022-12-17 09:52:07 +01:00
ben
940615cb0b Merge branch 'main' into FinalAdminUI 2022-12-16 22:45:54 +00:00
callebtc
ac87c49603 fix: disable compression 2022-12-16 17:18:02 +01:00
dni âš¡
02946c1d1c remove old topup route using new one, change wallet.js handling of that url 2022-12-13 10:17:40 +01:00
dni âš¡
ab49b7740c add superuser decorator, fix restart route and mypy issue 2022-12-12 09:45:12 +01:00
Vlad Stan
e28dea97d8 fix: update the in-memory settings object when the DB is updated 2022-12-09 14:53:51 +02:00
Vlad Stan
4cd2fe7ee1
Merge branch 'main' into FinalAdminUI 2022-12-09 14:06:47 +02:00
Vlad Stan
0d4954c01a chore: temp commit (does not work); don't want to lose changes 2022-12-09 09:46:30 +02:00
Vlad Stan
d15782521d refactor: include admin extension into core 2022-12-08 15:41:52 +02:00
callebtc
0538035084 msat values are ints 2022-12-08 14:33:52 +01:00
callebtc
ab4a9370e7 style: make format 2022-12-07 14:57:10 +01:00
callebtc
5f4fa61310 refactor:depend_admin_user 2022-12-07 14:56:45 +01:00
callebtc
6f5f7753ef fix audit endpoint 2022-12-06 20:58:09 +01:00
dni âš¡
c56a31e6f5 add superuser and refactor check_admin function, also put it into satspay 2022-12-05 20:41:23 +01:00
Tiago Vasconcelos
fe5e1241bf fix some of Vlad's review comments 2022-12-02 14:52:31 +00:00
benarc
a220acb583 Removed id, using param instead 2022-12-01 14:41:57 +00:00
benarc
4aeb7683e5 Added Response 2022-12-01 13:15:46 +00:00
Tiago Vasconcelos
3ff14cb71b change status code to 400 on exception 2022-12-01 12:21:25 +01:00
ben
9a9733c1ce Auto stash before merge of "universalwebsocket" and "origin/universalwebsocket" 2022-11-29 11:23:34 +00:00
Arc
a7fd44f4ca
Merge branch 'main' into universalwebsocket 2022-11-29 11:12:28 +00:00
Tiago Vasconcelos
b68172696d change status code to 400 on exception 2022-11-29 10:28:19 +00:00
ben
187d709098 isort 2022-11-28 13:28:11 +00:00
ben
bb84f6b0e8 Black 2022-11-28 13:24:10 +00:00
ben
aefd1fad69 isort 2022-11-28 13:13:45 +00:00
ben
00123d6c16 Merge remote-tracking branch 'origin/main' into universalwebsocket 2022-11-28 12:29:34 +00:00
dni âš¡
a92bb03664 merge from main 2022-11-24 14:37:50 +01:00
ben
dce4da96b7 fixed function name clash 2022-11-24 00:46:39 +00:00
ben
c2a737ab84 Black 2022-11-24 00:34:46 +00:00
ben
f876f0659f Moved into correct files, and added payment example 2022-11-24 00:21:39 +00:00
ben
fde128e961 Better naming 2022-11-23 23:35:02 +00:00
ben
cea4f9350c black 2022-11-23 22:42:32 +00:00
ben
152991fbec added try for return 2022-11-23 22:31:11 +00:00
ben
2f08255e92 added get option 2022-11-23 22:27:09 +00:00
ben
4b707b5a30 updated function names 2022-11-23 22:22:33 +00:00
ben
51ca515d26 renamed for clarity 2022-11-23 21:51:32 +00:00
ben
5a96bcd558 Adds universal websocket manager any extension can use
Connect to the `ws://<your-lnbits>/api/v1/ws/{item_id}` endpoint

POST data to the websocket with `https://<your-lnbits>/api/v1/ws/{item_id}`
2022-11-23 21:47:26 +00:00
Vlad Stan
3edbe1b895 fix: allow both description_hash and unhashed_description to be present 2022-11-22 11:52:29 +02:00
dni âš¡
e670b53412 fix WALLET initialisation 2022-10-25 09:24:14 +02:00
dni âš¡
f9de542361 use new settings and remove unused amdin extension stuff 2022-10-25 09:23:30 +02:00
dni âš¡
bfff5f3775 fix ADMIN_UI=false errors 2022-10-25 09:20:16 +02:00
dni âš¡
a6bdd8c575 format 2022-10-25 09:20:16 +02:00
ben
3129692ab1 reverted other try 2022-10-25 09:20:16 +02:00
ben
429217f5a4 Had to add a couple of tries 2022-10-25 09:20:16 +02:00
Tiago vasconcelos
a07fbf0187 allow user settings without restart 2022-10-25 09:20:16 +02:00
Anton Kovalenko
193d037ad6
Allow more than 2-nd level domain in incoming ln-addresses (#914) 2022-10-24 12:23:11 +02:00
calle
5a12f4f237
Improved SSE listeners (#865)
* logging listeners

* comments

* generate privkey upon init

* listener queue

* remove duplicate check

* make format

* reuse channel

* error handling in sse listener

* uuid for listeners

* register named invoices

* uuid for listeners and listener list

* fix poetry lock

* setuptools

* requirements asyncio timeout

* setuptool;s

* make format

* remove async-timeout

* async_timeout readd

* try lower setuptools version

* try lower lower setuptools version

* back to current version + fix, maybe

* fix worflows to use poetry 1.2.1

* remove uneeded setuptools from build-system

* fix up formatting workflow

* debug to trace

* more traces

* debug logs to trace

Co-authored-by: dni âš¡ <office@dnilabs.com>
2022-10-04 09:51:47 +02:00
Gene Takavic
e75610a04f
API auditor (#1002)
* just quick auditor

* fix for none balance

* handle node down case

Co-authored-by: calle <93376500+callebtc@users.noreply.github.com>

Co-authored-by: calle <93376500+callebtc@users.noreply.github.com>
2022-09-23 16:33:51 +03:00
calle
1660b9dcf1
Revert "Revert "API key check: assert that wallet exists (#961)" (#962)" (#963)
This reverts commit 57fffa0c7f.
2022-09-12 18:49:57 +03:00
calle
57fffa0c7f
Revert "API key check: assert that wallet exists (#961)" (#962)
This reverts commit 0930fca7ec.
2022-09-12 18:41:27 +03:00
calle
0930fca7ec
API key check: assert that wallet exists (#961)
* check if wallet exists

* check wallet existence in key check
2022-09-12 18:39:53 +03:00
calle
2ee10e28c5
Backend: Unstuck outgoing payments (#857)
* first attempts

* lndrest works

* fix details

* optional fee update

* use base64.urlsafe_b64encode

* return paymentstatus

* CLN: return pending for pending invoices

* grpc wip

* lndgrpc works

* cln: return pending for pending invoices really this time

* retry wallet out of exception

* wip eclair

* take all routines into try except

* cliche: return error

* rename payment.check_pending() to payment.check_status()

* rename payment.check_pending() to payment.check_status()

* eclair: works

* eclair: better error check

* opennode: works

* check payment.checking_id istead of payment.ok

* payment.ok check as well

* cln: works?

* cln: works

* lntxbot: works

* lnbits/wallets/lnpay.py

* cln: error handling

* make format

* lndhub full detail update

* spark: wip

* error to False

* wallets: return clean PaymentResponse

* opennode: strict error

* cliche: works

* lnbits: works

* cln: dont throw error

* preimage not error

* fix cln

* do not add duplicate payments

* revert cln

* extra safety for cln

* undo crud changes until tests work

* tasks: better logging and 0.5s sleep for regular status check

* 0.1 s

* check if wallet exists

* lnbits unhashed description

* remove sleep

* revert app.py

* cleanup

* add check

* clean error

* readd app.py

* fix eclaid
2022-08-30 13:28:58 +02:00
dni âš¡
5fecb02b8d
fix typo in view api.py (#933) 2022-08-29 17:32:36 +02:00
calle
24de8f6611
isort api.py (#898) 2022-08-17 14:27:52 +02:00
calle
790f0efda7
Chore/unhashed description expressive error (#894)
* dont assume field

* expressive error for desciprion_hash and unhashed_description in format that isnt hex
2022-08-17 00:59:11 +02:00
calle
28661903b6
return http error UNAUTHORIZED instead of BAD_REQUEST if key is missing (#869)
* return http error UNAUTHORIZED instead of BAD_REQUEST if key is missing

* fix regtest (#867)

Co-authored-by: dni <dni.khr@gmail.com>

* return http error UNAUTHORIZED instead of BAD_REQUEST if key is missing

Co-authored-by: dni âš¡ <office@dnilabs.com>
Co-authored-by: dni <dni.khr@gmail.com>
2022-08-13 14:41:44 +02:00
calle
e5d8c500d2
Wallets/unhashed_description (#870)
* new argument: unhashed_description

* accept in api

* set unhashed_description for memo case

* bolt11.py: dont be like CLN, accept the hash

* send hash to lnd in b64

* fix cln

* skip descr_hash for cln

* skip

* format
2022-08-13 14:29:04 +02:00
calle
05edd908f0
fix lnurlw balance_check (#854) 2022-08-09 12:48:10 +02:00
calle
4fc0a25d41
Mega-merge 4: Reenable LndWallet gRPC and use TrackPaymentV2 (#745)
* readd lndgrpc

* debug logging

* Use TrackPaymentV2

* /v2/router/track

* lnd_router_grpc

* flag for blocking check

* error handling

* fix name

* regtest lndgrpc

* new test pipeline

* fix env

* check for description hash

* remove unnecessary asserts for clarity

* assume that description_hash is a hash already

* no lock

* description hashing in backend

* restore bolt11.py

* /api/v1/payments with hex of description

* comment

* refactor wallets

* forgot eclair

* fix lnpay

* bytes directly

* make format

* mypy check

* make format

* remove old code

* WIP status check

* LND GRPC docs

* restore cln to main

* fix regtest

* import

* remove unused import

* format

* do not expect ok

* check ok

* delete comments
2022-08-09 11:49:39 +02:00
calle
b3c866fd1d
Code health: Small linting fix (#813)
* small linting fix

* je lint therefore je suis
2022-08-02 16:17:47 +02:00
calle
f1ec7e33f0
Mega-merge 2: Invoice/refactor description hash (WIP) (#814)
* description hashing in backend
2022-08-01 16:20:25 +02:00
ben
618717b529 Merge branch 'main' into qrcodemaker 2022-07-28 12:40:25 +01:00
ben
4199f1bf98 Make format 2022-07-28 11:02:49 +01:00
calle
730add5116
Core/tag check get (#797)
* safer tag checking

* annotate
2022-07-28 11:53:40 +02:00
ben
4c8641fe00 Merge remote-tracking branch 'origin/main' into qrcodemaker 2022-07-28 10:48:12 +01:00
dni
c72834e47e revert attribute check 2022-07-27 09:50:16 +02:00
dni
7da496dbb4 remove asserts and add ignore instead for now 2022-07-27 09:39:52 +02:00
dni
347baa076a Merge branch 'main' into fix/mypy 2022-07-26 13:00:06 +02:00
dni
36cb1eb47b fix int type by changing the order 2022-07-26 12:46:43 +02:00
dni
00dba54ac8 remove FIXME add couple of ignores 2022-07-26 12:21:21 +02:00
dni
e4078910c4 fix another fastapi type 2022-07-26 09:38:31 +02:00
dni âš¡
5810a4993b
Update lnbits/core/views/api.py
Co-authored-by: calle <93376500+callebtc@users.noreply.github.com>
2022-07-26 09:08:16 +02:00
Arc
2d46eda5f5
Revert "Revert "LNURLp: check description hash"" 2022-07-25 15:54:49 +01:00
Arc
b708950b93
Revert "LNURLp: check description hash" 2022-07-25 15:32:59 +01:00
Arc
1da7c9b349
Merge pull request #758 from lnbits/lnurl/check_description_hash
LNURLp: check description hash
2022-07-25 15:19:20 +01:00
dni
5779243d3e blacked 2022-07-25 13:30:45 +02:00
dni
3d1abfa35a last mypy fails 2022-07-25 13:27:31 +02:00
dni
0bf4457c2f fixup types 2022-07-25 13:19:35 +02:00
dni
a7c10dde4a fixup types 2022-07-25 13:13:50 +02:00
dni
9cecd42467 ignore Body type 2022-07-25 12:09:29 +02:00
dni
df00a018f0 added FIXME tags and fix WalletTypeInfo 2022-07-25 12:05:16 +02:00
dni
4dfa0873e5 fix isort check 2022-07-25 12:03:06 +02:00
dni
463fbb39bd make test run again, introduce mypy again 2022-07-25 12:03:06 +02:00
dni
a80fd5de7a black formating 2022-07-25 12:03:06 +02:00
dni
9a17e4896b fix last views api bug, thanks calle 2022-07-25 12:03:06 +02:00
dni
25d19244be mypy fixes, api, eclair 2022-07-25 12:03:06 +02:00
dni
56560fca02 mypy fixes for generic.py, decurators.py, eclair.py 2022-07-25 12:03:06 +02:00
dni
808bd36e23 some more mypy fixes 2022-07-25 12:02:59 +02:00
calle
32a8736f32
CI: Test core/views/generic.py enabling and disabling extensions (#774) 2022-07-23 11:58:29 +02:00
calle
96af5fc3a7
CI: Test core/views/generic.py (#772)
* Adds tests for GET /wallet

* Update `httpx` to `0.23.0` and `http-core` to `0.15.0` in `venv` installation path

* Fix `secp256k1 = "==0.14.0"` and `cffi = "==1.15.0"`
2022-07-23 10:39:58 +02:00
Tiago Vasconcelos
ed2c5cc586
Fix/lnurl auth (#757)
* remove g() and add wallet

* wallet type

* add wallet object

* send wallet as param

* make lnurlauth work

* remove g() and add wallet

* wallet type

* add wallet object

* send wallet as param

* make lnurlauth work

* black'ed

* blacked

Co-authored-by: callebtc <93376500+callebtc@users.noreply.github.com>
2022-07-19 11:35:28 +02:00
callebtc
694124b5d6 require admin 2022-07-19 11:27:32 +02:00
callebtc
b2a0faf9de error check for pr 2022-07-19 11:21:54 +02:00
callebtc
8d52b1b359 check description hash 2022-07-19 11:15:11 +02:00
calle
f4580955b9
loguru warnings (#751) 2022-07-17 22:25:37 +02:00
calle
6646fce549
Core: add internal flag for invoice creation to use FakeWallet (#646)
* add internal flag for invoice creation to use FakeWallet
2022-07-17 14:34:25 +02:00
calle
f4e7d62ca3
make format everything (#743) 2022-07-16 14:23:03 +02:00
calle
63d4e60542
Testing: postgres db backend (#711)
* try postgres run

* fix yaml

* test with postgres

* check with postgres

* inkey_from

* remove trio

* add coverage

* add coverage

* more python testing

* use @pytest_asyncio.fixture

* remove unused imports

* fix api_payment payment lookup

* measure durations
2022-07-07 18:29:26 +02:00
calle
089313f613
Logging with loguru (#708)
* logging

* requirements

* add loguru dependency

* restore it

* add loguru

* set log level in .env file

* remove service fee print

* set log level

* more logging

* more logging

* more logging

* pyament.checking_id

* fix
2022-07-07 14:30:16 +02:00
Lee Salminen
ebeb3d213b alter injection of tpos to match 2022-07-05 15:09:04 -06:00
Lee Salminen
2cb87d96f2 better way of handling injection of webmanifests 2022-07-05 15:05:31 -06:00
Lee Salminen
56c60587a1 fix prettier 2022-07-05 09:14:24 -06:00