setup a server message for relaying info

add_server_msg
lza_menace 3 years ago
parent a5f2422abd
commit fdba5d7ea7

@ -15,7 +15,7 @@ from wowstash.library.jsonrpc import Wallet, daemon, to_atomic
from wowstash.library.cache import cache
from wowstash.forms import Send, Delete, Restore
from wowstash.factory import db
from wowstash.models import User
from wowstash.models import User, ServerMessage
from wowstash import config
@ -83,6 +83,9 @@ def dashboard():
spend_key = wallet.spend_key()
view_key = wallet.view_key()
capture_event(current_user.id, 'load_dashboard')
sm = ServerMessage.query.all()
if sm:
flash(f'Server message from admin: <a href="https://google.com">yo</a>')
return render_template(
'wallet/dashboard.html',
transfers=all_transfers,

@ -3,7 +3,7 @@ from flask import Blueprint, url_for
import wowstash.models
from wowstash.library.docker import docker
from wowstash.models import User, PasswordReset
from wowstash.models import User, PasswordReset, ServerMessage
from wowstash.factory import db, bcrypt
@ -42,3 +42,16 @@ def reset_password(user_email, 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)}')
@bp.cli.command('set_message')
@click.argument('msg_content')
def set_message(msg_content):
s = ServerMessage.query.all()
if s:
db.session.delete(s.first())
db.session.commit()
_s = ServerMessage(
content=msg_content
)
db.session.add(_s)
db.session.commit()

@ -89,3 +89,13 @@ class PasswordReset(db.Model):
def __repr__(self):
return self.id
class ServerMessage(db.Model):
__tablename__ = 'server_message'
id = db.Column(db.Integer, primary_key=True)
content = db.Column(db.Text)
date = db.Column(db.DateTime, server_default=func.now())
def __repr__(self):
return self.id

@ -0,0 +1,35 @@
<!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">Privacy Policy</h1>
<p>Here is the information I will collect from you:</p>
<ul>
<li>Web server access logs (Source IP address, browser user-agent, page requests, etc)</li>
<li>Email address and salted/hashed password (registration)</li>
<li>Application events and metrics (function execution and the user who triggered)</li>
</ul>
<p>I check logs and capture events for troubleshooting purposes only. None of this data is shared with any third parties because I'm not a fucking lame.</p>
</div>
</div>
</div>
</div>
</header>
{% include 'footer.html' %}
{% include 'scripts.html' %}
</body>
</html>