mirror of
https://github.com/lnbits/lnbits.git
synced 2025-04-07 11:28:19 +02:00
feature: admin toggle to disable outgoing payments (#2909)
This commit is contained in:
parent
8633891485
commit
eeebaffbed
@ -53,6 +53,8 @@ async def pay_invoice(
|
||||
tag: str = "",
|
||||
conn: Optional[Connection] = None,
|
||||
) -> Payment:
|
||||
if settings.lnbits_only_allow_incoming_payments:
|
||||
raise PaymentError("Only incoming payments allowed.", status="failed")
|
||||
invoice = _validate_payment_request(payment_request, max_sat)
|
||||
assert invoice.amount_msat
|
||||
|
||||
|
@ -31,7 +31,7 @@
|
||||
filled
|
||||
v-model="formData.auth_allowed_methods"
|
||||
multiple
|
||||
:hint="t$('auth_allowed_methods_hint')"
|
||||
:hint="$t('auth_allowed_methods_hint')"
|
||||
:label="$t('auth_allowed_methods_label')"
|
||||
:options="formData.auth_all_methods"
|
||||
></q-select>
|
||||
@ -285,7 +285,7 @@
|
||||
<div class="col-12 col-md-12">
|
||||
<p v-text="$t('wallet_limiter')"></p>
|
||||
<div class="row q-col-gutter-md">
|
||||
<div class="col-4">
|
||||
<div class="col-3">
|
||||
<q-input
|
||||
filled
|
||||
type="number"
|
||||
@ -293,7 +293,7 @@
|
||||
:label="$t('wallet_max_ballance')"
|
||||
></q-input>
|
||||
</div>
|
||||
<div class="col-4">
|
||||
<div class="col-3">
|
||||
<q-input
|
||||
filled
|
||||
type="number"
|
||||
@ -301,7 +301,7 @@
|
||||
:label="$t('wallet_limit_max_withdraw_per_day')"
|
||||
></q-input>
|
||||
</div>
|
||||
<div class="col-4">
|
||||
<div class="col-3">
|
||||
<q-input
|
||||
filled
|
||||
type="number"
|
||||
@ -309,6 +309,13 @@
|
||||
:label="$t('wallet_limit_secs_between_trans')"
|
||||
></q-input>
|
||||
</div>
|
||||
<div class="col-3">
|
||||
<q-toggle
|
||||
v-model="formData.lnbits_only_allow_incoming_payments"
|
||||
:label="$t('only_incoming_payments_allowed')"
|
||||
><q-tooltip v-text="$t('disable_outgoing_payments')"></q-tooltip
|
||||
></q-toggle>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -368,6 +368,7 @@ class SecuritySettings(LNbitsSettings):
|
||||
lnbits_wallet_limit_max_balance: int = Field(default=0)
|
||||
lnbits_wallet_limit_daily_max_withdraw: int = Field(default=0)
|
||||
lnbits_wallet_limit_secs_between_trans: int = Field(default=0)
|
||||
lnbits_only_allow_incoming_payments: bool = Field(default=False)
|
||||
lnbits_watchdog_switch_to_voidwallet: bool = Field(default=False)
|
||||
lnbits_watchdog_interval_minutes: int = Field(default=60)
|
||||
lnbits_watchdog_delta: int = Field(default=1_000_000)
|
||||
|
2
lnbits/static/bundle.min.js
vendored
2
lnbits/static/bundle.min.js
vendored
File diff suppressed because one or more lines are too long
@ -250,6 +250,8 @@ window.localisation.en = {
|
||||
wallet_max_ballance: 'Wallet max balance in sats (0 to disable)',
|
||||
wallet_limit_secs_between_trans:
|
||||
'Min secs between transactions per wallet (0 to disable)',
|
||||
only_incoming_payments_allowed: 'Only incoming payments allowed',
|
||||
disable_outgoing_payments: 'Disable outgoing payments',
|
||||
number_of_requests: 'Number of requests',
|
||||
time_unit: 'Time unit',
|
||||
minute: 'minute',
|
||||
|
Loading…
x
Reference in New Issue
Block a user