simplify environment variables required.

instead of multiple keys/macaroons with different permissions we request only one.
if someone wants to use lnbits with an invoice macaroon they're free to do it and
we will just fail on 'pay' methods, as before.

this also grandfathers the previous environment variables names so everything keeps
working without people having to change their setups.

in the meantime some bugs with lntxbot and c-lightning were fixed and the `requests`
dependency was eliminated because I can't organize myself into meaningful chunks of
changes.
This commit is contained in:
fiatjaf
2020-10-08 16:03:21 -03:00
parent fc6e49b821
commit 9185342c72
15 changed files with 145 additions and 157 deletions
+4 -3
View File
@@ -1,5 +1,6 @@
import trio # type: ignore
import json
import traceback
from quart import g, jsonify, request, make_response
from http import HTTPStatus
from binascii import unhexlify
@@ -87,10 +88,10 @@ async def api_payments_pay_invoice():
return jsonify({"message": str(e)}), HTTPStatus.BAD_REQUEST
except PermissionError as e:
return jsonify({"message": str(e)}), HTTPStatus.FORBIDDEN
except Exception as e:
print(e)
except Exception as exc:
traceback.print_exc(7)
g.db.rollback()
return jsonify({"message": str(e)}), HTTPStatus.INTERNAL_SERVER_ERROR
return jsonify({"message": str(exc)}), HTTPStatus.INTERNAL_SERVER_ERROR
return (
jsonify(