Compare commits
4 Commits
master
...
event-logs
Author | SHA1 | Date |
---|---|---|
lza_menace | 22e96d38ee | 4 years ago |
lza_menace | 17ba5680c5 | 4 years ago |
lza_menace | b1ce459be6 | 4 years ago |
lza_menace | 6d9abe3a6d | 4 years ago |
@ -1,67 +1,23 @@
|
||||
import click
|
||||
from flask import Blueprint, url_for
|
||||
from wowstash.library.jsonrpc import wallet
|
||||
from wowstash.models import Transaction
|
||||
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)
|
||||
|
||||
bp = Blueprint("cli", "cli", cli_group=None)
|
||||
|
||||
|
||||
@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():
|
||||
# @app.cli.command('initdb')
|
||||
def init_db():
|
||||
db.create_all()
|
||||
|
||||
@bp.cli.command('list_users')
|
||||
def list_users():
|
||||
users = User.query.all()
|
||||
for i in users:
|
||||
print(f'{i.id} - {i.email}')
|
||||
|
||||
@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)}')
|
||||
# @app.cli.command('send_transfers')
|
||||
def send_transfers():
|
||||
txes = Transaction.query.all()
|
||||
for i in txes:
|
||||
print(i)
|
||||
# tx = wallet.transfer(
|
||||
# 0, current_user.subaddress_index, address, amount
|
||||
# )
|
||||
|
@ -1,67 +0,0 @@
|
||||
<!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>
|
@ -1,30 +0,0 @@
|
||||
<!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>
|
@ -1,33 +0,0 @@
|
||||
<!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