Compare commits
17 Commits
event-logs
...
master
Author | SHA1 | Date |
---|---|---|
lza_menace | 8da92e6919 | 3 years ago |
lza_menace | b34cf05497 | 3 years ago |
lza_menace | c54c37b10e | 3 years ago |
lza_menace | 5a3bf57a32 | 3 years ago |
lza_menace | 1a48e7db77 | 3 years ago |
lza_menace | f178878fb5 | 3 years ago |
lza_menace | 952d251160 | 3 years ago |
lza_menace | a5f2422abd | 3 years ago |
lza_menace | abcf5b5dd9 | 4 years ago |
lza_menace | fbc8917a7b | 4 years ago |
lza_menace | 91ff0f8796 | 4 years ago |
lza_menace | cf20b46d7d | 4 years ago |
lza_menace | a009450caa | 4 years ago |
lza_menace | 34d47ad39f | 4 years ago |
lza_menace | 2829d698fa | 4 years ago |
lza_menace | 9428a47537 | 4 years ago |
lza_menace | 2567db144f | 4 years ago |
@ -1,23 +1,67 @@
|
|||||||
from wowstash.library.jsonrpc import wallet
|
import click
|
||||||
from wowstash.models import Transaction
|
from flask import Blueprint, url_for
|
||||||
from wowstash.factory import db
|
|
||||||
|
|
||||||
|
import wowstash.models
|
||||||
|
from wowstash.library.docker import docker
|
||||||
|
from wowstash.models import User, PasswordReset, Event
|
||||||
|
from wowstash.factory import db, bcrypt
|
||||||
|
|
||||||
# @app.errorhandler(404)
|
|
||||||
def not_found(error):
|
|
||||||
return make_response(jsonify({
|
|
||||||
'error': 'Page not found'
|
|
||||||
}), 404)
|
|
||||||
|
|
||||||
# @app.cli.command('initdb')
|
bp = Blueprint("cli", "cli", cli_group=None)
|
||||||
def init_db():
|
|
||||||
|
|
||||||
|
@bp.cli.command('clean_containers')
|
||||||
|
def clean_containers():
|
||||||
|
docker.cleanup()
|
||||||
|
|
||||||
|
@bp.cli.command('reset_wallet')
|
||||||
|
@click.argument('user_id')
|
||||||
|
def reset_wallet(user_id):
|
||||||
|
user = User.query.get(user_id)
|
||||||
|
user.clear_wallet_data()
|
||||||
|
print(f'Wallet data cleared for user {user.id}')
|
||||||
|
|
||||||
|
@bp.cli.command('init')
|
||||||
|
def init():
|
||||||
db.create_all()
|
db.create_all()
|
||||||
|
|
||||||
# @app.cli.command('send_transfers')
|
@bp.cli.command('list_users')
|
||||||
def send_transfers():
|
def list_users():
|
||||||
txes = Transaction.query.all()
|
users = User.query.all()
|
||||||
for i in txes:
|
for i in users:
|
||||||
print(i)
|
print(f'{i.id} - {i.email}')
|
||||||
# tx = wallet.transfer(
|
|
||||||
# 0, current_user.subaddress_index, address, amount
|
@bp.cli.command('wipe_user')
|
||||||
# )
|
@click.argument('user_id')
|
||||||
|
def wipe_user(user_id):
|
||||||
|
user = User.query.get(user_id)
|
||||||
|
if user:
|
||||||
|
events = Event.query.filter(Event.user == user.id)
|
||||||
|
for i in events:
|
||||||
|
print(f'[+] Deleting event {i.id} for user {user.id}')
|
||||||
|
db.session.delete(i)
|
||||||
|
print(f'[+] Deleting user {user.id}')
|
||||||
|
db.session.delete(user)
|
||||||
|
db.session.commit()
|
||||||
|
return True
|
||||||
|
else:
|
||||||
|
print('That user id does not exist')
|
||||||
|
return False
|
||||||
|
|
||||||
|
@bp.cli.command('reset_password')
|
||||||
|
@click.argument('user_email')
|
||||||
|
@click.argument('duration')
|
||||||
|
def reset_password(user_email, duration):
|
||||||
|
user = User.query.filter(User.email==user_email).first()
|
||||||
|
if not user:
|
||||||
|
click.echo('[!] Email address does not exist!')
|
||||||
|
return
|
||||||
|
|
||||||
|
pwr = PasswordReset(
|
||||||
|
user=user.id,
|
||||||
|
hash=PasswordReset().generate_hash(),
|
||||||
|
expiration_hours=duration
|
||||||
|
)
|
||||||
|
db.session.add(pwr)
|
||||||
|
db.session.commit()
|
||||||
|
click.echo(f'[+] Password reset link #{pwr.id} for {user_email} expires in {duration} hours: {url_for("auth.reset", hash=pwr.hash)}')
|
||||||
|
@ -0,0 +1,67 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en">
|
||||||
|
|
||||||
|
{% include 'head.html' %}
|
||||||
|
|
||||||
|
<body id="page-top">
|
||||||
|
|
||||||
|
{% include 'navbar.html' %}
|
||||||
|
|
||||||
|
<!-- <header class="masthead">
|
||||||
|
<div class="container h-100">
|
||||||
|
<div class="row h-100">
|
||||||
|
<div class="col-lg-12 my-auto">
|
||||||
|
<div class="header-content mx-auto">
|
||||||
|
<h1 class="mb-4">Reset your password</h1>
|
||||||
|
<p>Wownero is a privacy centric cryptocurrency and is most safely managed on your own personal devices, on your own network, and with your own copy of the blockchain. This is a publicly accessible website, and while strict security measures are implemented on our servers, your account's security <strong>cannot</strong> be guaranteed. </p>
|
||||||
|
<p>If you decide to use this site for managing your funds, you do so at your own risk and are bound by the terms and conditions of this site. Practice good operational security and do not use this site for large amounts of funds.</p>
|
||||||
|
<div>
|
||||||
|
<a href="{{ url_for('meta.faq') }}">FAQ</a> -
|
||||||
|
<a href="{{ url_for('meta.terms') }}">Terms</a> -
|
||||||
|
<a href="{{ url_for('meta.privacy') }}">Privacy</a>
|
||||||
|
</div><br>
|
||||||
|
<a href="#register" class="btn btn-outline btn-xl js-scroll-trigger">Proceed</a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</header> -->
|
||||||
|
|
||||||
|
<section class="section1" id="reset">
|
||||||
|
<div class="container">
|
||||||
|
<div class="section-heading text-center">
|
||||||
|
<form method="POST" action="">
|
||||||
|
{{ form.csrf_token }}
|
||||||
|
{% for f in form %}
|
||||||
|
{% if f.name != 'csrf_token' %}
|
||||||
|
{% if f.type == 'BooleanField' %}
|
||||||
|
<div class="form-group-span">
|
||||||
|
{{ f.label }}
|
||||||
|
{{ f }}
|
||||||
|
</div>
|
||||||
|
{% else %}
|
||||||
|
<div class="form-group">
|
||||||
|
{{ f.label }}
|
||||||
|
{{ f }}
|
||||||
|
</div>
|
||||||
|
{% endif %}
|
||||||
|
{% endif %}
|
||||||
|
{% endfor %}
|
||||||
|
<ul>
|
||||||
|
{% for field, errors in form.errors.items() %}
|
||||||
|
<li>{{ form[field].label }}: {{ ', '.join(errors) }}</li>
|
||||||
|
{% endfor %}
|
||||||
|
</ul>
|
||||||
|
<input type="submit" value="Reset" class="btn btn-link btn-outline-inverse btn-xl">
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
|
||||||
|
{% include 'footer.html' %}
|
||||||
|
|
||||||
|
{% include 'scripts.html' %}
|
||||||
|
|
||||||
|
</body>
|
||||||
|
|
||||||
|
</html>
|
@ -0,0 +1,30 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en">
|
||||||
|
|
||||||
|
{% include 'head.html' %}
|
||||||
|
|
||||||
|
<body id="page-top">
|
||||||
|
|
||||||
|
{% include 'navbar.html' %}
|
||||||
|
|
||||||
|
<header class="masthead">
|
||||||
|
<div class="container h-100">
|
||||||
|
<div class="row h-100">
|
||||||
|
<div class="col-lg-12 my-auto">
|
||||||
|
<div class="header-content-sm mx-auto">
|
||||||
|
<h2 class="mb-4">Error</h2>
|
||||||
|
<p>There was an error - an administrator has been notified.</p>
|
||||||
|
<p>Error: <code style="background-color: white;">{{ error.original_exception }}</code></p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</header>
|
||||||
|
|
||||||
|
{% include 'footer.html' %}
|
||||||
|
|
||||||
|
{% include 'scripts.html' %}
|
||||||
|
|
||||||
|
</body>
|
||||||
|
|
||||||
|
</html>
|
@ -0,0 +1,33 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en">
|
||||||
|
|
||||||
|
{% include 'head.html' %}
|
||||||
|
|
||||||
|
<body id="page-top">
|
||||||
|
|
||||||
|
{% include 'navbar.html' %}
|
||||||
|
|
||||||
|
<header class="masthead">
|
||||||
|
<div class="container h-100">
|
||||||
|
<div class="row h-100">
|
||||||
|
<div class="col-lg-12 my-auto">
|
||||||
|
<div class="header-content mx-auto">
|
||||||
|
<h1 class="mb-4">Donate</h1>
|
||||||
|
<p>Hey, this service is provided to you for free, please consider donating some WOW since I both donate my time and money keeping the service alive and paying for hosting.</p>
|
||||||
|
<p>lza_menace: <code style="background-color: white;">Wo59kvcHiDd48sstysDqGgBAN1fECLKALKw2bPUJhS4UjX9wj2SK4e4GH6HvrBmot6cBrWNE1T65UR6a5SLbzh882c1SXEhiK</code></p>
|
||||||
|
<a href="{{ url_for('wallet.dashboard') }}?to_addr=Wo59kvcHiDd48sstysDqGgBAN1fECLKALKw2bPUJhS4UjX9wj2SK4e4GH6HvrBmot6cBrWNE1T65UR6a5SLbzh882c1SXEhiK#send" class="btn btn-outline btn-xl js-scroll-trigger">Ok, take me to my wallet</a>
|
||||||
|
<br/><br/>
|
||||||
|
<a href="https://www.youtube.com/watch?v=dQw4w9WgXcQ" target=_blank class="btn btn-outline btn-xl js-scroll-trigger">Nah, fuck you menace.</a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</header>
|
||||||
|
|
||||||
|
{% include 'footer.html' %}
|
||||||
|
|
||||||
|
{% include 'scripts.html' %}
|
||||||
|
|
||||||
|
</body>
|
||||||
|
|
||||||
|
</html>
|
Loading…
Reference in New Issue