invoices: payout addresses in the database
Default crypto payout addresses lived in the CRYPTO_ADDRESSES and LTC_ADDRESS Forgejo secrets, so changing one meant editing a secret and redeploying. Keep them in a payout_addresses table edited at /admin/invoices/payout-addresses (read to view, write to change, every change audited), and prefill the new-invoice form from it. The old env values are imported once on the first boot with an empty table, so the current addresses carry over; after that the secrets can be removed. Assisted-by: Claude:opus-5
This commit is contained in:
parent
eeac07ed34
commit
1dd8f9081f
10 changed files with 179 additions and 14 deletions
13
db/migrations/010_payout_addresses.rb
Normal file
13
db/migrations/010_payout_addresses.rb
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
Sequel.migration do
|
||||
change do
|
||||
# Default crypto payout address per CryptoAsset code, prefilled into the
|
||||
# new-invoice form. Seeded once from the old CRYPTO_ADDRESSES/LTC_ADDRESS
|
||||
# env; managed at /admin/invoices/payout-addresses since.
|
||||
create_table(:payout_addresses) do
|
||||
String :coin, primary_key: true
|
||||
String :address, null: false
|
||||
String :updated_by
|
||||
DateTime :updated_at, null: false
|
||||
end
|
||||
end
|
||||
end
|
||||
Loading…
Add table
Add a link
Reference in a new issue