Merge branch 'dev'
All checks were successful
Build Docker / Build Image (push) Successful in 45s

This commit is contained in:
Nathan Woodburn 2025-01-29 17:28:50 +11:00
commit 4b15a1aa0c
Signed by: nathanwoodburn
GPG Key ID: 203B000478AD0EF1
8 changed files with 59 additions and 12 deletions

Binary file not shown.

View File

@ -1,6 +1,4 @@
# FireWalletBrowser
## Installation
```bash
@ -72,7 +70,7 @@ For Docker you can mount a volume to persist the user data (/app/user_data)
- Rescan
- Zap pending transactions
- View xPub
- Custom plugin support
- Custom plugin support (find some [here](https://git.woodburn.au/nathanwoodburn?tab=repositories&q=plugin&sort=recentupdate))
## Themes
Set a theme in the .env file
@ -113,3 +111,21 @@ DNS Editor page
Auction page
![Auction page](assets/auction.png)
## 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
```
## Warnings
- This is a work in progress and is not guaranteed to work
- This is not a wallet by itself but rather a frontend for HSD
- I am not responsible for any loss of funds from using this wallet (including loss of funds from auctions)
- I am not responsible if you expose this frontend to the internet (please don't do this unless you know what you are doing)

View File

@ -26,7 +26,9 @@ hsw = api.hsw(APIKEY,ip)
# Verify the connection
response = hsd.getInfo()
exclude = ["primary"]
if os.getenv("exclude") is not None:
exclude = os.getenv("exclude").split(",")
def check_account(cookie: str):
if cookie is None:
@ -52,9 +54,10 @@ def check_password(cookie: str, password: str):
info = hsw.rpc_selectWallet(account)
if info['error'] is not None:
return False
info = hsw.rpc_walletPassphrase(password,10)
info = hsw.rpc_walletPassphrase(password,1)
if info['error'] is not None:
return False
if info['error']['message'] != "Wallet is not encrypted.":
return False
return True
def createWallet(account: str, password: str):
@ -118,6 +121,9 @@ 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]
return response
return ['Wallet not connected']
@ -830,6 +836,25 @@ def signMessage(account,domain,message):
}
}
def verifyMessageWithName(domain,signature,message):
try:
response = hsd.rpc_verifyMessageWithName(domain,signature,message)
if 'result' in response:
return response['result']
return False
except Exception as e:
return False
def verifyMessage(address,signature,message):
try:
response = hsd.rpc_verifyMessage(address,signature,message)
if 'result' in response:
return response['result']
return False
except Exception as e:
return False
#endregion
def generateReport(account,format="{name},{expiry},{value},{maxBid}"):

10
main.py
View File

@ -1154,16 +1154,20 @@ def login_post():
# Check if the account is valid
if account.count(":") > 0:
wallets = account_module.listWallets()
wallets = render.wallets(wallets)
return render_template("login.html", sync=account_module.getNodeSync(),
wallet_status=account_module.getWalletStatus(),
error="Invalid account")
error="Invalid account",wallets=wallets)
account = account + ":" + password
# Check if the account is valid
if not account_module.check_account(account):
if not account_module.check_password(account,password):
wallets = account_module.listWallets()
wallets = render.wallets(wallets)
return render_template("login.html", sync=account_module.getNodeSync(),
error="Invalid account")
error="Invalid account or password",wallets=wallets)
# Set the cookie

View File

@ -126,7 +126,6 @@ def getPluginData(pluginStr: str):
# Check if the plugin is in customPlugins
if pluginStr.startswith("customPlugins"):
# Get git url for dir
print(f"cd customPlugins/{pluginStr.split('/')[-2]} && git remote get-url origin")
url = subprocess.check_output(f"cd customPlugins/{pluginStr.split('/')[-2]} && git remote get-url origin", shell=True).decode("utf-8").strip()
info["source"] = url

View File

@ -348,5 +348,7 @@ def plugin_output_dash(outputs, returns):
for returnOutput in returns:
if returnOutput not in outputs:
continue
if outputs[returnOutput] == None:
continue
html += render_template('components/dashboard-plugin.html', name=returns[returnOutput]["name"], output=outputs[returnOutput])
return html

View File

@ -19,6 +19,7 @@
<div class="container">
<div class="row justify-content-center">
<div class="col-md-9 col-lg-12 col-xl-10">
<h1 class="text-center" style="color: var(--bs-danger);background: var(--bs-primary);">{{error}}</h1>
<div class="card shadow-lg o-hidden border-0 my-5">
<div class="card-body p-0">
<div class="row">