feat: Update .env format to use uppercase

This commit is contained in:
Nathan Woodburn 2025-01-31 15:58:46 +11:00
parent 50164e9d5d
commit 7e861534a6
Signed by: nathanwoodburn
GPG Key ID: 203B000478AD0EF1
3 changed files with 22 additions and 22 deletions

View File

@ -35,13 +35,13 @@ Also available as a docker image:
To run using a HSD running directly on the host:
```bash
sudo docker run --network=host -e hsd_api=yourapikeyhere git.woodburn.au/nathanwoodburn/firewallet:latest
sudo docker run --network=host -e HSD_API=yourapikeyhere git.woodburn.au/nathanwoodburn/firewallet:latest
```
If you have HSD running on a different IP/container
```bash
sudo docker run -p 5000:5000 -e hsd_api=yourapikeyhere -e hsd_ip=hsdcontainer git.woodburn.au/nathanwoodburn/firewallet:latest
sudo docker run -p 5000:5000 -e HSD_API=yourapikeyhere -e HSD_IP=hsdcontainer git.woodburn.au/nathanwoodburn/firewallet:latest
```
For Docker you can mount a volume to persist the user data (/app/user_data)
@ -115,11 +115,11 @@ Auction page
## Environment variables
```yaml
hsd_api: HSD API key
hsd_ip: HSD IP address
theme: Theme to use (dark-purple, black)
show_expired: Show expired domains (true/false)
exclude: Comma separated list of wallets to exclude from the wallet list
HSD_API: HSD API key
HSD_IP: HSD IP address
THEME: Theme to use (dark-purple, black)
SHOW_EXPIRED: Show expired domains (true/false)
EXCLUDE: Comma separated list of wallets to exclude from the wallet list
```

View File

@ -10,12 +10,12 @@ import time
dotenv.load_dotenv()
HSD_API = os.getenv("hsd_api")
HSD_IP = os.getenv("hsd_ip")
HSD_API = os.getenv("HSD_API")
HSD_IP = os.getenv("HSD_IP")
if HSD_IP is None:
HSD_IP = "localhost"
HSD_NETWORK = os.getenv("hsd_network")
HSD_NETWORK = os.getenv("HSD_NETWORK")
HSD_WALLET_PORT = 12039
HSD_NODE_PORT = 12037
@ -35,9 +35,9 @@ elif HSD_NETWORK == "regtest":
HSD_NODE_PORT = 14037
show_expired = os.getenv("show_expired")
if show_expired is None:
show_expired = False
SHOW_EXPIRED = os.getenv("SHOW_EXPIRED")
if SHOW_EXPIRED is None:
SHOW_EXPIRED = False
hsd = api.hsd(HSD_API,HSD_IP,HSD_NODE_PORT)
hsw = api.hsw(HSD_API,HSD_IP,HSD_WALLET_PORT)
@ -47,9 +47,9 @@ cacheTime = 3600
# Verify the connection
response = hsd.getInfo()
exclude = ["primary"]
EXCLUDE = ["primary"]
if os.getenv("exclude") is not None:
exclude = os.getenv("exclude").split(",")
EXCLUDE = os.getenv("EXCLUDE").split(",")
def hsdConnected():
if hsdVersion() == -1:
@ -163,7 +163,7 @@ def listWallets():
# Check if response is json or an array
if isinstance(response, list):
# Remove excluded wallets
response = [wallet for wallet in response if wallet not in exclude]
response = [wallet for wallet in response if wallet not in EXCLUDE]
return response
return ['Wallet not connected']
@ -244,7 +244,7 @@ def getDomains(account,own=True):
response = requests.get(f"http://x:{HSD_API}@{HSD_IP}:{HSD_WALLET_PORT}/wallet/{account}/name")
info = response.json()
if show_expired:
if SHOW_EXPIRED:
return info
# Remove any expired domains
@ -476,7 +476,6 @@ def getDNS(domain: str):
return []
return response['result']['records']
def setDNS(account,domain,records):
account_name = check_account(account)
password = ":".join(account.split(":")[1:])

View File

@ -1,4 +1,5 @@
hsd_api=123480615465636893475aCwyaae6s45
hsd_ip=localhost
theme=black
show_expired=false
HSD_API=123480615465636893475aCwyaae6s45
HSD_IP=localhost
THEME=black
SHOW_EXPIRED=false
EXPLORER_TX=https://niami.io/tx/