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 # FireWalletBrowser
## Installation ## Installation
```bash ```bash
@ -72,7 +70,7 @@ For Docker you can mount a volume to persist the user data (/app/user_data)
- Rescan - Rescan
- Zap pending transactions - Zap pending transactions
- View xPub - View xPub
- Custom plugin support - Custom plugin support (find some [here](https://git.woodburn.au/nathanwoodburn?tab=repositories&q=plugin&sort=recentupdate))
## Themes ## Themes
Set a theme in the .env file Set a theme in the .env file
@ -113,3 +111,21 @@ DNS Editor page
Auction page Auction page
![Auction page](assets/auction.png) ![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 # Verify the connection
response = hsd.getInfo() response = hsd.getInfo()
exclude = ["primary"]
if os.getenv("exclude") is not None:
exclude = os.getenv("exclude").split(",")
def check_account(cookie: str): def check_account(cookie: str):
if cookie is None: if cookie is None:
@ -52,8 +54,9 @@ def check_password(cookie: str, password: str):
info = hsw.rpc_selectWallet(account) info = hsw.rpc_selectWallet(account)
if info['error'] is not None: if info['error'] is not None:
return False return False
info = hsw.rpc_walletPassphrase(password,10) info = hsw.rpc_walletPassphrase(password,1)
if info['error'] is not None: if info['error'] is not None:
if info['error']['message'] != "Wallet is not encrypted.":
return False return False
return True return True
@ -118,6 +121,9 @@ def listWallets():
# Check if response is json or an array # Check if response is json or an array
if isinstance(response, list): if isinstance(response, list):
# Remove excluded wallets
response = [wallet for wallet in response if wallet not in exclude]
return response return response
return ['Wallet not connected'] 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 #endregion
def generateReport(account,format="{name},{expiry},{value},{maxBid}"): 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 # Check if the account is valid
if account.count(":") > 0: if account.count(":") > 0:
wallets = account_module.listWallets()
wallets = render.wallets(wallets)
return render_template("login.html", sync=account_module.getNodeSync(), return render_template("login.html", sync=account_module.getNodeSync(),
wallet_status=account_module.getWalletStatus(), wallet_status=account_module.getWalletStatus(),
error="Invalid account") error="Invalid account",wallets=wallets)
account = account + ":" + password account = account + ":" + password
# Check if the account is valid # 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(), return render_template("login.html", sync=account_module.getNodeSync(),
error="Invalid account") error="Invalid account or password",wallets=wallets)
# Set the cookie # Set the cookie

View File

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

View File

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

View File

@ -19,6 +19,7 @@
<div class="container"> <div class="container">
<div class="row justify-content-center"> <div class="row justify-content-center">
<div class="col-md-9 col-lg-12 col-xl-10"> <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 shadow-lg o-hidden border-0 my-5">
<div class="card-body p-0"> <div class="card-body p-0">
<div class="row"> <div class="row">