Commit 0e7cc949 authored by Mitchell Moore's avatar Mitchell Moore
Browse files

Implement rabbitmq calls to producer scripts. Check for account creation, remove sleep function

- Duplicate producer code for in app testing
- Implement rabbitmq calls option/script call option
- Clean whitespace
- Create placeholder functions for acct. creation. Remove producer
- Check for creation
- Remove sleep in creation. Define goals for confirm function
- Fix variable convention
- Update requirements.txt
- Include asyncronous delay. Remove old validate method. Add rough global username exchange
- Fix tabs and remove validate create
- Fix logo resizing issue
- Create unique session id and log to consile
parent 521a7486
...@@ -4,6 +4,7 @@ ...@@ -4,6 +4,7 @@
from __future__ import print_function from __future__ import print_function
# third-party imports # third-party imports
import uuid
from flask import Flask, redirect, url_for, request, render_template, flash, session from flask import Flask, redirect, url_for, request, render_template, flash, session
from flask_bootstrap import Bootstrap from flask_bootstrap import Bootstrap
...@@ -20,6 +21,9 @@ def create_app(config_name): ...@@ -20,6 +21,9 @@ def create_app(config_name):
global return_url global return_url
username = "name_test" username = "name_test"
if 'uid' not in session:
session['uid']=str(uuid.uuid4())
if "redir" in request.args and return_url == "": # check for redir arg in url if "redir" in request.args and return_url == "": # check for redir arg in url
return_url = request.args.get("redir") or "/pun/sys/dashboard" return_url = request.args.get("redir") or "/pun/sys/dashboard"
if name != "": if name != "":
......
<svg id="Layer_1" data-name="Layer 1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 300 157"><title>Supercomputer-logo</title><image width="300" height="157" xlink:href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAASwAAACdCAYAAAAOnEURAAAACXBIWXMAAAsSAAALEgHS3X78AAAgAElEQVR4Xu2dfZAc5X3nP30VUi5cLq3FH7hipzQDzYtUEG2dkxMkddHgEUYrMFoW+0hAghUmxkQmWtspRK441OJyPsSVzRKCMQ6GXRAYAizLmwSJxsziM0h3RxXCLgmRQTtbVlLHH8hsuaxLna76uT+epzW9vd1Pd8/0zHbvPp8qaWbneeaZ7v49z/d5nt/zZgkhMCwe/t2OjX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E/N2c7ck1Rg7mkqc2qnXmHL5nqhT81ZCOyI7Yt9972GVpno+NScQB71p/shHZQLOJX2g7TcIJ7tb4m7Vk3+8cpPpqdCBUklWEVCJ1gGQ1qiBMvQW2K7hAaDwZAXjGAZDIbCYATLYDAUBiNYBoOhMBjBMhgMhcEIlsFgKAyLdlqDwWBYfJgWlsFgKAxGsAwGQ2EwgmUwGArD/weo98DC2yYdnQAAAABJRU5ErkJggg=="/></svg>
\ No newline at end of file
...@@ -16,8 +16,8 @@ function displayloading() { ...@@ -16,8 +16,8 @@ function displayloading() {
" <div class=\"joyride-modal-bg\" style=\"display: block;\"></div>" " <div class=\"joyride-modal-bg\" style=\"display: block;\"></div>"
} }
function socketIO() { function request_account() {
socket.emit('user data', { socket.emit('request account', {
fullname: document.getElementById("fullname").value, fullname: document.getElementById("fullname").value,
reason: document.getElementById("reason").value, reason: document.getElementById("reason").value,
username: document.getElementById("username").innerText username: document.getElementById("username").innerText
......
...@@ -9,34 +9,29 @@ ...@@ -9,34 +9,29 @@
<script> <script>
var socket = io.connect('http://' + document.domain + ':' + location.port); var socket = io.connect('http://' + document.domain + ':' + location.port);
socket.on( 'connect', function() { socket.on( 'connect', function() {
socket.emit( 'user connect', { socket.emit( 'user connected', {
user: document.getElementById("username").innerText user: document.getElementById("username").innerText
} ) } )
socket.on( 'creating account', function( msg ) { socket.on( 'creating account', function( msg ) {
document.getElementById("error").innerText = ""; document.getElementById("error").innerText = "";
displayloading(); displayloading();
socket.emit("validate creation", { })
username: document.getElementById("username").innerText
})
})
socket.on( 'Account creation failed', function( msg ) {
document.getElementById("error").innerText = "Registration Failed. Please try again.";
})
socket.on( 'account ready', function( msg ) {
let element = document.getElementById("notification_window");
element.parentNode.removeChild(element);
element.innerHTML = " ";
alert("Account creation successful!");
socket.on( 'Account created', function( msg ) { })
let element = document.getElementById("notification_window");
element.parentNode.removeChild(element);
element.innerHTML = " ";
alert("Account creation successful!");
})
socket.on( 'Account creation failed', function( msg ) {
document.getElementById("error").innerText = "Registration Failed. Please try again.";
})
}) })
</script> </script>
<style type="text/css"> <style type="text/css">
...@@ -84,7 +79,7 @@ ...@@ -84,7 +79,7 @@
<div class="container content" role="main" style="width: 625px"> <div class="container content" role="main" style="width: 625px">
<div style="position:relative;"> <div style="position:relative;">
<img alt="logo" height="100" style="margin-bottom: 20px" src="/static/img/cheaha-logo-a605de0aecd3006b82a5ee30a6d0cb8cd9bf8b7e836296cc293eac746a4c2b11.png"> <img alt="logo" height="auto" width="100%" style="margin-bottom: 20px" src="/static/img/cheaha-logo-a605de0aecd3006b82a5ee30a6d0cb8cd9bf8b7e836296cc293eac746a4c2b11.png">
<a href="https://tinyurl.com/cheahaAL" target="_blank"> <a href="https://tinyurl.com/cheahaAL" target="_blank">
<div style="float:left;position:absolute;display:block;left:310px;top:-6px;padding:10px 20px;"> </div> <div style="float:left;position:absolute;display:block;left:310px;top:-6px;padding:10px 20px;"> </div>
</a> </a>
...@@ -98,7 +93,7 @@ ...@@ -98,7 +93,7 @@
<input class="form-control" id="fullname" name="fullname" placeholder="Enter Full Name" required="" type="text"> <input class="form-control" id="fullname" name="fullname" placeholder="Enter Full Name" required="" type="text">
<label><b><label for="reason">Reason for Requesting Account: </label><br></b></label> <label><b><label for="reason">Reason for Requesting Account: </label><br></b></label>
<textarea class="form-control" id="reason" name="reason" placeholder="Enter Reason for Account Request" required=""></textarea> <textarea class="form-control" id="reason" name="reason" placeholder="Enter Reason for Account Request" required=""></textarea>
<input class="btn btn-primary btn-block" id="submit" name="submit" type="button" value="Submit" onclick="socketIO()"> <input class="btn btn-primary btn-block" id="submit" name="submit" type="button" value="Submit" onclick="request_account()">
<div> <div>
<strong id="error" style="color: #be051b; text-align: center;"></strong> <strong id="error" style="color: #be051b; text-align: center;"></strong>
......
alembic==1.3.1 alembic==1.4.0
appdirs==1.4.3
argh==0.26.2 argh==0.26.2
blinker==1.4 blinker==1.4
certifi==2019.9.11 certifi==2019.11.28
chardet==3.0.4 chardet==3.0.4
Click==7.0 Click==7.0
distlib==0.3.0
dnspython==1.16.0 dnspython==1.16.0
dominate==2.4.0 dominate==2.4.0
enum34==1.1.6 enum34==1.1.6
eventlet==0.25.1 eventlet==0.25.1
filelock==3.0.12
Flask==1.1.1 Flask==1.1.1
Flask-Bootstrap==3.3.7.1 Flask-Bootstrap==3.3.7.1
Flask-Dance==3.0.0 Flask-Dance==3.0.0
Flask-DebugToolbar==0.10.1 Flask-DebugToolbar==0.11.0
Flask-Login==0.4.1 Flask-Login==0.5.0
Flask-Migrate==2.5.2 Flask-Migrate==2.5.2
Flask-OAuth==0.12 Flask-OAuth==0.12
Flask-OAuthlib==0.9.5 Flask-OAuthlib==0.9.5
Flask-SocketIO==4.2.1 Flask-SocketIO==4.2.1
Flask-SQLAlchemy==2.4.1 Flask-SQLAlchemy==2.4.1
Flask-Testing==0.7.1 Flask-Testing==0.7.1
Flask-WTF==0.14.2 Flask-WTF==0.14.3
greenlet==0.4.15 greenlet==0.4.15
gunicorn==19.9.0 gunicorn==20.0.4
httplib2==0.14.0 httplib2==0.17.0
idna==2.8 idna==2.9
importlib-metadata==1.5.0
itsdangerous==1.1.0 itsdangerous==1.1.0
Jinja2==2.10.3 Jinja2==2.11.1
lazy==1.4 lazy==1.4
Mako==1.1.0 Mako==1.1.1
MarkupSafe==1.1.1 MarkupSafe==1.1.1
monotonic==1.5 monotonic==1.5
oauth2==1.9.0.post1 oauth2==1.9.0.post1
oauthlib==3.1.0 oauthlib==3.1.0
pathtools==0.1.2 pathtools==0.1.2
pbr==5.4.3 pbr==5.4.4
pika==1.1.0 pika==1.1.0
python-dateutil==2.8.1 python-dateutil==2.8.1
python-editor==1.0.4 python-editor==1.0.4
python-engineio==3.10.0 python-engineio==3.11.2
python-socketio==4.3.1 python-socketio==4.4.0
pytz==2019.3 pytz==2019.3
PyYAML==5.1.2 PyYAML==5.3
requests==2.22.0 requests==2.23.0
requests-oauthlib==1.3.0 requests-oauthlib==1.3.0
six==1.13.0 six==1.14.0
SQLAlchemy==1.3.11 SQLAlchemy==1.3.13
SQLAlchemy-Utils==0.35.0 SQLAlchemy-Utils==0.36.1
stevedore==1.31.0 stevedore==1.32.0
supervisor==4.1.0 supervisor==4.1.0
urllib3==1.25.7 urllib3==1.25.8
URLObject==2.4.3 URLObject==2.4.3
virtualenv==16.7.7 virtualenv==20.0.4
virtualenv-clone==0.5.3 virtualenv-clone==0.5.3
virtualenvwrapper==4.8.4 virtualenvwrapper==4.8.4
visitor==0.1.3 visitor==0.1.3
watchdog==0.9.0 watchdog==0.10.2
Werkzeug==0.16.0 Werkzeug==1.0.0
wincertstore==0.2 wincertstore==0.2
WTForms==2.2.1 WTForms==2.2.1
zipp==3.0.0
...@@ -2,111 +2,63 @@ ...@@ -2,111 +2,63 @@
import os import os
import time import time
import signal
import pika import pika
import sys from flask import session
from flask_socketio import SocketIO, join_room
from app import create_app from app import create_app
from flask_socketio import SocketIO
from flask import flash
config_name = os.getenv('FLASK_CONFIG') config_name = os.getenv('FLASK_CONFIG')
app = create_app(config_name) app = create_app(config_name)
app.config['SECRET_KEY'] = 'vnkdjnfjknfl1232#' app.config['SECRET_KEY'] = 'vnkdjnfjknfl1232#'
socketio = SocketIO(app) socketio = SocketIO(app)
global username_global
def messageReceived(methods=['GET', 'POST']):
print('message was received!!!')
def create_account(username, fullname, reason):
# Todo: Ravi's and Louis's code goes here
print (time.strftime("%m-%d-%Y_%H:%M:%S") + '\tUser ' + username + ' added to queue')
global username_global
username_global = username
socketio.emit("creating account")
signal.signal(signal.SIGALRM, account_agent)
signal.alarm(5)
def check_dir(user, interval):
# Todo: Make this mothod in a consumer
""" def account_agent(*args):
:param user: (string) username to check for in DB. # Todo: Code to create a consumer based on the username goes here
:param interval: (int) Frequency to check in seconds. # Todo: Goal is to have it listening for confirmation.
:return: (boolean) if account has been registered. global username_global
""" username = username_global
seconds = 0 print(time.strftime("%m-%d-%Y_%H:%M:%S") + '\tAccount successfully created for ' + username)
socketio.emit("account ready")
return True
while seconds < 600:
querystring = "_" + user + ".done"
for filename in os.listdir("flat_db/"): @socketio.on('user connected')
if filename.endswith(querystring): def user_connected(json, methods=['GET', 'POST']):
return True username = json["user"]
time.sleep(interval)
seconds = seconds + interval
return False room = str(session['uid'])
join_room(room)
@socketio.on('user connect')
def handle_my_custom_event(json, methods=['GET', 'POST']):
username = json["user"]
print(time.strftime("%m-%d-%Y_%H:%M:%S") + '\tUser ' + username + ' connected.') print(time.strftime("%m-%d-%Y_%H:%M:%S") + '\tUser ' + username + ' connected.')
print('\t\t\t|-----Room ID: ' + room)
@socketio.on('user data') @socketio.on('request account')
def ingest_data(json, methods=['GET', 'POST']): def request_account(json, methods=['GET', 'POST']):
print (time.strftime("%m-%d-%Y_%H:%M:%S") + '\tQueue request received: ' + str(json)) print (time.strftime("%m-%d-%Y_%H:%M:%S") + '\tQueue request received: ' + str(json))
# Begin RabbitMQ process. try:
connection = pika.BlockingConnection( create_account(json['username'], json['fullname'], json['reason'])
pika.ConnectionParameters(host='localhost'))
channel = connection.channel() except Exception as e:
print(time.strftime("%m-%d-%Y_%H:%M:%S") + "\tError in account creation: ", e)
channel.exchange_declare(exchange='direct_logs', exchange_type='direct')
message = "Hey there" # todo: account info goes here
channel.basic_publish(
exchange='direct_logs', routing_key="ohpc", body=message)
print(" [x] Sent %r:%r" % ("ohpc", message))
channel.basic_publish(
exchange='direct_logs', routing_key="ood", body=message)
print(" [x] Sent %r:%r" % ("ood", message))
connection.close()
# Todo: Make the remaining portion of this method in a RabbitMQ consumer
# try:
# fullname = json["fullname"]
# reason = json["reason"]
# username = json["username"]
#
# time_stamp = time.strftime("%m-%d-%Y_%H:%M:%S")
# directory = "flat_db/"
# complete_file_name = os.path.join(directory, time_stamp + "_" + username + ".txt")
#
# if not os.path.exists(directory):
# os.makedirs(directory)
#
# file = open(complete_file_name, "w") # create time stamped file to be queued
#
# file.write(fullname + "\n")
# file.write(reason)
#
# file.close()
# print (time.strftime("%m-%d-%Y_%H:%M:%S") + '\tUser ' + username + ' added to queue')
# socketio.emit("creating account")
#
# except Exception as e:
# print(time.strftime("%m-%d-%Y_%H:%M:%S") + "\tError in directory creation: ", e)
# socketio.emit("Account creation failed")
@socketio.on("validate creation")
def creation_confirmation(json, methods=['GET', 'POST']):
# Todo: Make this mthod in a RabbitMQ consumer
username = json["username"]
if check_dir(username, 10):
print (time.strftime("%m-%d-%Y_%H:%M:%S") + '\tAccount successfully created for ' + username)
socketio.emit("Account created")
else:
socketio.emit("Account creation failed") socketio.emit("Account creation failed")
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment