lnbits-legend/lnbits/extensions/subdomains
2020-12-29 20:52:54 +01:00
..
templates/subdomains working subdomains frontend, table, popup, payments 2020-12-29 20:52:54 +01:00
__init__.py started working on subdomains extension 2020-12-28 19:51:45 +01:00
config.json started working on subdomains extension 2020-12-28 19:51:45 +01:00
crud.py working subdomains frontend, table, popup, payments 2020-12-29 20:52:54 +01:00
migrations.py working subdomains frontend, table, popup, payments 2020-12-29 20:52:54 +01:00
models.py working subdomains frontend, table, popup, payments 2020-12-29 20:52:54 +01:00
README.md started working on subdomains extension 2020-12-28 19:51:45 +01:00
views_api.py working subdomains frontend, table, popup, payments 2020-12-29 20:52:54 +01:00
views.py working subdomains frontend, table, popup, payments 2020-12-29 20:52:54 +01:00

Subdomains Extension

#TODO - fix formatting etc...
on lnbits there should be an interface with input fields: subdomain (for example: subdomain1) ip address (for example: 192.168.21.21) duration (1 month / 1 year etc...)

then when user presses SUBMIT button the ln invoice is shown that has to be paid...

when invoice is paid, the lnbits backend send request to the cloudflare domain registration service, that creates a new A record for that subdomain

for example, i am hosting lnbits on lnbits.grmkris.com

and i am selling my subdomains subdomain1.grmkris.com subdomain2.grmkris.com subdomain3.grmkris.com

there should be checks if that subdomain is already taken

and maybe an option to blacklist certain subdomains that i don't want to sell

If your extension has API endpoints, include useful ones here

curl -H "Content-type: application/json" -X POST https://YOUR-LNBITS/YOUR-EXTENSION/api/v1/EXAMPLE -d '{"amount":"100","memo":"subdomains"}' -H "X-Api-Key: YOUR_WALLET-ADMIN/INVOICE-KEY"

cloudflare

example curls: List dns records

curl --location --request GET 'https://api.cloudflare.com/client/v4/zones/bf3c1e516b35878c9f6532db2f2705ee/dns_records?type=A' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer mS3gGFC3ySLqBe2ERtRTlh7H2YiGbFp2KLDK62uu' 
curl --location --request POST 'https://api.cloudflare.com/client/v4/zones/bf3c1e516b35878c9f6532db2f2705ee/dns_records' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer mS3gGFC3ySLqBe2ERtRTlh7H2YiGbFp2KLDK62uu' \
--data-raw '{
  "type":"A",
  "name":"subdomain1.grmkris.com",
  "content":"31.15.150.237",
  "ttl":0,
  "proxied":true
}'