BTCPay settings, admin page, and new Lightning balance API #147

Merged
raucao merged 12 commits from feature/btcpay_configs into master 2023-09-26 10:13:09 +00:00
Owner

Please see commits for review/changes.

This PR contains the following breaking changes:

  • The BTCPay configuration has all been moved to env vars/settings
  • The LndHub admin token has been moved from the credentials file to an env var/setting
  • The public API for BTCPay balances has been renamed from "api/kredits" to "api/btcpay"
  • The amounts of the onchain balances are now sats instead of BTC

refs #31

Please see commits for review/changes. This PR contains the following breaking changes: * The BTCPay configuration has all been moved to env vars/settings * The LndHub admin token has been moved from the credentials file to an env var/setting * The public API for BTCPay balances has been renamed from "api/kredits" to "api/btcpay" * The amounts of the onchain balances are now sats instead of BTC refs #31
raucao added the
feature
kredits-2
labels 2023-09-04 14:08:29 +00:00
raucao added 6 commits 2023-09-04 14:08:29 +00:00
raucao requested review from bumi 2023-09-04 14:08:33 +00:00
bumi reviewed 2023-09-06 09:20:21 +00:00
bumi left a comment
Owner

utACK.

utACK.
@ -41,0 +46,4 @@
default: ENV["BTCPAY_API_URL"].presence
field :btcpay_enabled, type: :boolean,
default: (ENV["BTCPAY_API_URL"].present?.to_s || false)
Owner

the default is here either a string or a boolean? can it handle both?

the default is here either a string or a boolean? can it handle both?
Author
Owner

This just got copypasta'd across the whole file, for some reason that I'm sure is now forgottten. I have removed the silliness just now.

This just got copypasta'd across the whole file, for some reason that I'm sure is now forgottten. I have removed the silliness just now.
raucao marked this conversation as resolved
@ -0,0 +5,4 @@
def initialize
@base_url = Setting.btcpay_api_url
@store_id = Setting.btcpay_store_id
@auth_token = Setting.btcpay_auth_token
Owner

I'd use attr_readers here then it is a bit clearer that those are also potentially used from the outside/from inheriting classes

I'd use attr_readers here then it is a bit clearer that those are also potentially used from the outside/from inheriting classes
raucao marked this conversation as resolved
@ -55,3 +55,3 @@
namespace :api do
get 'kredits/onchain_btc_balance', to: 'kredits#onchain_btc_balance'
get 'btcpay/onchain_btc_balance', to: 'btcpay#onchain_btc_balance'
Owner

where do we use those again?

where do we use those again?
Author
Owner
https://kredits.kosmos.org/budget
raucao marked this conversation as resolved
raucao reviewed 2023-09-06 17:31:34 +00:00
@ -0,0 +1,22 @@
#
# API Docs: https://docs.btcpayserver.org/API/Greenfield/v1/
#
class BtcpayManagerService < LdapService
Author
Owner

< LdapService

Oops.

> < LdapService Oops.
raucao marked this conversation as resolved
raucao added 1 commit 2023-09-07 17:15:34 +00:00
Fix code being silly
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
2c2ddabdff
raucao added 1 commit 2023-09-07 17:17:53 +00:00
Fix wrong inheritance
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
2ba0116ca6
raucao added 1 commit 2023-09-07 17:22:18 +00:00
Use attr_reader instead of shared instance variables
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
1949f1876f
Author
Owner

@bumi Thanks! Addressed all comments.

@bumi Thanks! Addressed all comments.
Author
Owner

@bumi Can you review the latest changes and approve the PR if they're good to go?

@bumi Can you review the latest changes and approve the PR if they're good to go?
raucao added 2 commits 2023-09-20 16:37:10 +00:00
Make publishing of BTCPay wallet balances optional
Some checks failed
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is failing
69fffb29d8
raucao added 1 commit 2023-09-20 17:12:36 +00:00
Merge branch 'master' into feature/btcpay_configs
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
Release Drafter / Update release notes draft (pull_request) Successful in 4s
d939f5d649
galfert approved these changes 2023-09-25 12:26:00 +00:00
galfert left a comment
Owner

LGTM

LGTM
raucao merged commit 14ff0c0e16 into master 2023-09-26 10:13:09 +00:00
raucao deleted branch feature/btcpay_configs 2023-09-26 10:13:09 +00:00
Sign in to join this conversation.
No description provided.