Initial Commit
This commit is contained in:
commit
11c83eca13
6
.gitignore
vendored
Normal file
6
.gitignore
vendored
Normal file
@ -0,0 +1,6 @@
|
||||
**/__pycache__/
|
||||
src/overseer.egg-info/
|
||||
build/
|
||||
dist/
|
||||
notes/
|
||||
overseer_venv/
|
4
MANIFEST.in
Normal file
4
MANIFEST.in
Normal file
@ -0,0 +1,4 @@
|
||||
include src/overseer/static/*
|
||||
include src/overseer/templates/*
|
||||
include src/overseer/api/*
|
||||
include src/overseer/api/v1/*
|
9
README.md
Normal file
9
README.md
Normal file
@ -0,0 +1,9 @@
|
||||
# Overseer
|
||||
## Description
|
||||
Overseer is a port scanning web interface. All current and historical results are stored in a database.
|
||||
|
||||
## Building
|
||||
|
||||
|
||||
## Running
|
||||
|
21
setup.py
Normal file
21
setup.py
Normal file
@ -0,0 +1,21 @@
|
||||
from setuptools import setup, find_packages
|
||||
|
||||
setup(
|
||||
name = "overseer",
|
||||
description = "Port Scanning Web Interface",
|
||||
author = "Evan Reichard",
|
||||
version = "0.0.1",
|
||||
packages = find_packages("src"),
|
||||
package_dir= {'': 'src'},
|
||||
zip_safe = False,
|
||||
include_package_data = True,
|
||||
entry_points = {
|
||||
"console_scripts": [
|
||||
"overseer = overseer:cli"
|
||||
]
|
||||
},
|
||||
install_requires = [
|
||||
"Flask",
|
||||
"flask_socketio"
|
||||
],
|
||||
)
|
16
src/overseer/__init__.py
Normal file
16
src/overseer/__init__.py
Normal file
@ -0,0 +1,16 @@
|
||||
import click
|
||||
from overseer.config import EnvConfig
|
||||
from flask import Flask
|
||||
from flask.cli import FlaskGroup
|
||||
|
||||
app = Flask(__name__)
|
||||
config = EnvConfig()
|
||||
|
||||
def create_app():
|
||||
return app
|
||||
|
||||
@click.group(cls=FlaskGroup, create_app=create_app)
|
||||
def cli():
|
||||
"""Management script for the Wiki application."""
|
||||
|
||||
import overseer.overseer
|
0
src/overseer/api/__init__.py
Normal file
0
src/overseer/api/__init__.py
Normal file
3
src/overseer/api/v1/__init__.py
Normal file
3
src/overseer/api/v1/__init__.py
Normal file
@ -0,0 +1,3 @@
|
||||
from flask import Blueprint
|
||||
api = Blueprint('v1', __name__, url_prefix="/api/v1")
|
||||
from overseer.api.v1 import routes, events
|
12
src/overseer/api/v1/events.py
Normal file
12
src/overseer/api/v1/events.py
Normal file
@ -0,0 +1,12 @@
|
||||
from overseer import app
|
||||
from flask_socketio import SocketIO
|
||||
|
||||
socketio = SocketIO(app, path="/api/v1/socket.io")
|
||||
|
||||
@socketio.on("message")
|
||||
def handle_message(data):
|
||||
print("RAW DATA: %s" % data)
|
||||
|
||||
@socketio.on("json")
|
||||
def handle_json(json):
|
||||
print("JSON DATA: %s" % json)
|
9
src/overseer/api/v1/routes.py
Normal file
9
src/overseer/api/v1/routes.py
Normal file
@ -0,0 +1,9 @@
|
||||
from overseer.api.v1 import api
|
||||
|
||||
@api.route('/status', methods=["GET"])
|
||||
def status():
|
||||
return "STATUS PLACEHOLDER"
|
||||
|
||||
@api.route('/scan', methods=["GET"])
|
||||
def scan():
|
||||
return "SCAN PLACEHOLDER"
|
9
src/overseer/config.py
Normal file
9
src/overseer/config.py
Normal file
@ -0,0 +1,9 @@
|
||||
import os
|
||||
|
||||
def get_env(key, default=None, required=False):
|
||||
if required:
|
||||
assert key in os.environ, "Missing Environment Variable: %s" % key
|
||||
return os.environ.get(key, default)
|
||||
|
||||
class EnvConfig:
|
||||
DATABASE = get_env("OVERSEER_DB", default="sqlite")
|
0
src/overseer/database.py
Normal file
0
src/overseer/database.py
Normal file
20
src/overseer/overseer.py
Normal file
20
src/overseer/overseer.py
Normal file
@ -0,0 +1,20 @@
|
||||
from overseer import app
|
||||
from flask import Flask, make_response, render_template, send_from_directory
|
||||
from overseer.api.v1 import api as api_v1
|
||||
|
||||
"""
|
||||
Initial Entrypoint to the SPA (i.e. 'index.html')
|
||||
"""
|
||||
@app.route("/", methods=["GET"])
|
||||
def main_entry():
|
||||
return make_response(render_template("index.html"))
|
||||
|
||||
"""
|
||||
Front End Static Resources
|
||||
"""
|
||||
@app.route("/static/<path:path>")
|
||||
def static_resources(path):
|
||||
return send_from_directory("static", path)
|
||||
|
||||
# Version API's
|
||||
app.register_blueprint(api_v1)
|
15
src/overseer/templates/index.html
Normal file
15
src/overseer/templates/index.html
Normal file
@ -0,0 +1,15 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>Overseer - Port Scanner</title>
|
||||
<script src="//cdnjs.cloudflare.com/ajax/libs/socket.io/3.1.3/socket.io.min.js" crossorigin="anonymous"></script>
|
||||
<script type="text/javascript" charset="utf-8">
|
||||
var socket = io({ path: "/api/v1/socket.io" });
|
||||
socket.on('connect', function() {
|
||||
socket.emit('json', {data: 'I\'m connected!'});
|
||||
});
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<p>This is a test</p>
|
||||
</body>
|
||||
</html>
|
Loading…
Reference in New Issue
Block a user