Compare commits
4 Commits
feat/insta
...
afc227b5b4
| Author | SHA1 | Date | |
|---|---|---|---|
|
afc227b5b4
|
|||
|
ab7749ef93
|
|||
|
a568abeb49
|
|||
|
4652af3a2d
|
2
.gitignore
vendored
2
.gitignore
vendored
@@ -14,5 +14,5 @@ plugins/signatures.json
|
|||||||
user_data/
|
user_data/
|
||||||
customPlugins/
|
customPlugins/
|
||||||
cache/
|
cache/
|
||||||
dist/
|
|
||||||
build/
|
build/
|
||||||
|
dist/
|
||||||
|
|||||||
Binary file not shown.
@@ -436,7 +436,6 @@ def send(account,address,amount):
|
|||||||
def isOwnDomain(account,name: str):
|
def isOwnDomain(account,name: str):
|
||||||
domains = getDomains(account)
|
domains = getDomains(account)
|
||||||
for domain in domains:
|
for domain in domains:
|
||||||
print(domain)
|
|
||||||
if domain['name'] == name:
|
if domain['name'] == name:
|
||||||
return True
|
return True
|
||||||
return False
|
return False
|
||||||
@@ -1139,7 +1138,6 @@ def getxPub(account):
|
|||||||
|
|
||||||
|
|
||||||
try:
|
try:
|
||||||
print(account_name)
|
|
||||||
response = hsw.getAccountInfo(account_name,"default")
|
response = hsw.getAccountInfo(account_name,"default")
|
||||||
if 'error' in response:
|
if 'error' in response:
|
||||||
return {
|
return {
|
||||||
|
|||||||
10
main.py
10
main.py
@@ -551,7 +551,6 @@ def finalize(domain: str):
|
|||||||
return redirect("/logout")
|
return redirect("/logout")
|
||||||
|
|
||||||
domain = domain.lower()
|
domain = domain.lower()
|
||||||
print(domain)
|
|
||||||
response = account_module.finalize(request.cookies.get("account"),domain)
|
response = account_module.finalize(request.cookies.get("account"),domain)
|
||||||
if response['error'] != None:
|
if response['error'] != None:
|
||||||
print(response)
|
print(response)
|
||||||
@@ -570,7 +569,6 @@ def cancelTransfer(domain: str):
|
|||||||
return redirect("/logout")
|
return redirect("/logout")
|
||||||
|
|
||||||
domain = domain.lower()
|
domain = domain.lower()
|
||||||
print(domain)
|
|
||||||
response = account_module.cancelTransfer(request.cookies.get("account"),domain)
|
response = account_module.cancelTransfer(request.cookies.get("account"),domain)
|
||||||
if 'error' in response:
|
if 'error' in response:
|
||||||
if response['error'] != None:
|
if response['error'] != None:
|
||||||
@@ -885,7 +883,6 @@ def auction(domain):
|
|||||||
# Get TX
|
# Get TX
|
||||||
revealInfo = account_module.getRevealTX(reveal)
|
revealInfo = account_module.getRevealTX(reveal)
|
||||||
reveal['bid'] = revealInfo
|
reveal['bid'] = revealInfo
|
||||||
print(revealInfo)
|
|
||||||
bids = render.bids(bids,reveals)
|
bids = render.bids(bids,reveals)
|
||||||
|
|
||||||
|
|
||||||
@@ -947,7 +944,6 @@ def rescan_auction(domain):
|
|||||||
domain = domain.lower()
|
domain = domain.lower()
|
||||||
|
|
||||||
response = account_module.rescan_auction(account,domain)
|
response = account_module.rescan_auction(account,domain)
|
||||||
print(response)
|
|
||||||
return redirect("/auction/" + domain)
|
return redirect("/auction/" + domain)
|
||||||
|
|
||||||
@app.route('/auction/<domain>/bid')
|
@app.route('/auction/<domain>/bid')
|
||||||
@@ -1023,7 +1019,7 @@ def bid_confirm(domain):
|
|||||||
response = account_module.bid(request.cookies.get("account"),domain,
|
response = account_module.bid(request.cookies.get("account"),domain,
|
||||||
float(bid),
|
float(bid),
|
||||||
float(blind))
|
float(blind))
|
||||||
print(response)
|
|
||||||
if 'error' in response:
|
if 'error' in response:
|
||||||
return redirect("/auction/" + domain + "?error=" + response['error']['message'])
|
return redirect("/auction/" + domain + "?error=" + response['error']['message'])
|
||||||
|
|
||||||
@@ -1045,7 +1041,7 @@ def open_auction(domain):
|
|||||||
if 'error' in response:
|
if 'error' in response:
|
||||||
if response['error'] != None:
|
if response['error'] != None:
|
||||||
return redirect("/auction/" + domain + "?error=" + response['error']['message'])
|
return redirect("/auction/" + domain + "?error=" + response['error']['message'])
|
||||||
print(response)
|
|
||||||
return redirect("/success?tx=" + response['hash'])
|
return redirect("/success?tx=" + response['hash'])
|
||||||
|
|
||||||
@app.route('/auction/<domain>/reveal')
|
@app.route('/auction/<domain>/reveal')
|
||||||
@@ -1613,4 +1609,4 @@ if __name__ == '__main__':
|
|||||||
if "--debug" in sys.argv:
|
if "--debug" in sys.argv:
|
||||||
app.run(debug=True,host='0.0.0.0')
|
app.run(debug=True,host='0.0.0.0')
|
||||||
else:
|
else:
|
||||||
app.run(host='0.0.0.0',threaded=True)
|
app.run(host='0.0.0.0')
|
||||||
63
main.spec
63
main.spec
@@ -1,63 +0,0 @@
|
|||||||
# -*- mode: python ; coding: utf-8 -*-
|
|
||||||
|
|
||||||
import compileall
|
|
||||||
from PyInstaller.utils.hooks import collect_data_files
|
|
||||||
import os
|
|
||||||
|
|
||||||
compileall.compile_dir('.', force=True)
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
datas = [
|
|
||||||
('templates', 'templates'),
|
|
||||||
('assets', 'assets'),
|
|
||||||
('themes', 'themes'),
|
|
||||||
('plugins', 'plugins')
|
|
||||||
]
|
|
||||||
hiddenimports = [
|
|
||||||
'plugins.automations',
|
|
||||||
'plugins.batching',
|
|
||||||
'plugins.customPlugins',
|
|
||||||
'plugins.renewal',
|
|
||||||
'plugins.varo'
|
|
||||||
]
|
|
||||||
|
|
||||||
# Copy the plugins folder to the dist folder
|
|
||||||
os.system(f'cp -r plugins dist/')
|
|
||||||
|
|
||||||
a = Analysis(
|
|
||||||
['main.py'],
|
|
||||||
pathex=[],
|
|
||||||
binaries=[],
|
|
||||||
datas=datas,
|
|
||||||
hiddenimports=hiddenimports,
|
|
||||||
hookspath=[],
|
|
||||||
hooksconfig={},
|
|
||||||
runtime_hooks=[],
|
|
||||||
excludes=[],
|
|
||||||
noarchive=False,
|
|
||||||
optimize=0,
|
|
||||||
)
|
|
||||||
pyz = PYZ(a.pure)
|
|
||||||
|
|
||||||
exe = EXE(
|
|
||||||
pyz,
|
|
||||||
a.scripts,
|
|
||||||
a.binaries,
|
|
||||||
a.datas,
|
|
||||||
[],
|
|
||||||
name='FireWallet',
|
|
||||||
debug=False,
|
|
||||||
bootloader_ignore_signals=False,
|
|
||||||
strip=False,
|
|
||||||
upx=True,
|
|
||||||
upx_exclude=[],
|
|
||||||
runtime_tmpdir=None,
|
|
||||||
console=False,
|
|
||||||
disable_windowed_traceback=False,
|
|
||||||
argv_emulation=False,
|
|
||||||
target_arch=None,
|
|
||||||
codesign_identity=None,
|
|
||||||
entitlements_file=None,
|
|
||||||
onefile=False,
|
|
||||||
)
|
|
||||||
@@ -9,3 +9,4 @@ requests-doh
|
|||||||
Flask-QRcode
|
Flask-QRcode
|
||||||
PySocks
|
PySocks
|
||||||
python-git-info
|
python-git-info
|
||||||
|
waitress
|
||||||
58
server.py
58
server.py
@@ -1,38 +1,44 @@
|
|||||||
from flask import Flask
|
|
||||||
from main import app
|
|
||||||
import main
|
|
||||||
from gunicorn.app.base import BaseApplication
|
|
||||||
import os
|
import os
|
||||||
|
import sys
|
||||||
|
import platform
|
||||||
|
from main import app
|
||||||
|
from waitress import serve
|
||||||
|
|
||||||
|
|
||||||
class GunicornApp(BaseApplication):
|
threads = 4
|
||||||
def __init__(self, app, options=None):
|
|
||||||
self.options = options or {}
|
|
||||||
self.application = app
|
|
||||||
super().__init__()
|
|
||||||
|
|
||||||
def load_config(self):
|
def gunicornServer():
|
||||||
for key, value in self.options.items():
|
from gunicorn.app.base import BaseApplication
|
||||||
if key in self.cfg.settings and value is not None:
|
class GunicornApp(BaseApplication):
|
||||||
self.cfg.set(key.lower(), value)
|
def __init__(self, app, options=None):
|
||||||
|
self.options = options or {}
|
||||||
|
self.application = app
|
||||||
|
super().__init__()
|
||||||
|
|
||||||
def load(self):
|
def load_config(self):
|
||||||
return self.application
|
for key, value in self.options.items():
|
||||||
|
if key in self.cfg.settings and value is not None:
|
||||||
|
self.cfg.set(key.lower(), value)
|
||||||
|
|
||||||
if __name__ == '__main__':
|
def load(self):
|
||||||
workers = 1
|
return self.application
|
||||||
threads = 2
|
|
||||||
if workers is None:
|
|
||||||
workers = 1
|
|
||||||
if threads is None:
|
|
||||||
threads = 2
|
|
||||||
workers = int(workers)
|
|
||||||
threads = int(threads)
|
|
||||||
options = {
|
options = {
|
||||||
'bind': '0.0.0.0:5000',
|
'bind': '0.0.0.0:5000',
|
||||||
'workers': workers,
|
'workers': 2,
|
||||||
'threads': threads,
|
'threads': threads,
|
||||||
}
|
}
|
||||||
gunicorn_app = GunicornApp(app, options)
|
gunicorn_app = GunicornApp(app, options)
|
||||||
print('Starting server with ' + str(workers) + ' workers and ' + str(threads) + ' threads', flush=True)
|
print(f'Starting server with Gunicorn on {platform.system()} with {threads} threads...', flush=True)
|
||||||
gunicorn_app.run()
|
gunicorn_app.run()
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == '__main__':
|
||||||
|
# Check if --gunicorn is in the command line arguments
|
||||||
|
if "--gunicorn" in sys.argv:
|
||||||
|
gunicornServer()
|
||||||
|
sys.exit()
|
||||||
|
|
||||||
|
print(f'Starting server with Waitress on {platform.system()} with {threads} threads...', flush=True)
|
||||||
|
print(f'Press Ctrl+C to stop the server', flush=True)
|
||||||
|
print(f'Serving on http://0.0.0.0:5000/', flush=True)
|
||||||
|
serve(app, host="0.0.0.0", port=5000, threads=threads)
|
||||||
|
|||||||
@@ -64,7 +64,7 @@
|
|||||||
</nav>
|
</nav>
|
||||||
<div class="container-fluid" style="margin-bottom: 20px;">
|
<div class="container-fluid" style="margin-bottom: 20px;">
|
||||||
<h3 class="text-dark mb-1">{{name}}</h3>
|
<h3 class="text-dark mb-1">{{name}}</h3>
|
||||||
<h4 class="text-dark mb-1">{{description}}</h4>{{output|safe}}
|
<h4 class="text-dark mb-1">{{description|safe}}</h4>{{output|safe}}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<footer class="sticky-footer" style="background: var(--bs-primary-text-emphasis);">
|
<footer class="sticky-footer" style="background: var(--bs-primary-text-emphasis);">
|
||||||
|
|||||||
Reference in New Issue
Block a user