mirror of
https://github.com/ziirish/burp-ui.git
synced 2026-05-15 14:16:08 -06:00
update demo
This commit is contained in:
parent
22c231d7af
commit
e27e5fe36d
37 changed files with 384 additions and 74 deletions
5
pkgs/burp-ui-monitor/MANIFEST.in
Normal file
5
pkgs/burp-ui-monitor/MANIFEST.in
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
include README
|
||||
include share/burpui/etc/buimonitor.sample.cfg
|
||||
global-exclude *.pyc
|
||||
global-exclude __pycache__
|
||||
graft burpui_monitor
|
||||
1
pkgs/burp-ui-monitor/README
Normal file
1
pkgs/burp-ui-monitor/README
Normal file
|
|
@ -0,0 +1 @@
|
|||
Burp-UI Meta package for monitor requirements
|
||||
12
pkgs/burp-ui-monitor/burpui_monitor-decoy/__init__.py
Normal file
12
pkgs/burp-ui-monitor/burpui_monitor-decoy/__init__.py
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
# -*- coding: utf8 -*-
|
||||
"""
|
||||
Burp-UI is a web-ui for burp backup written in python with Flask and
|
||||
jQuery/Bootstrap
|
||||
|
||||
.. module:: burpui_monitor
|
||||
:platform: Unix
|
||||
:synopsis: Burp-UI monitor module.
|
||||
|
||||
.. moduleauthor:: Ziirish <hi+burpui@ziirish.me>
|
||||
"""
|
||||
__title__ = 'burp-ui-monitor'
|
||||
87
pkgs/burp-ui-monitor/burpui_monitor-decoy/__main__.py
Normal file
87
pkgs/burp-ui-monitor/burpui_monitor-decoy/__main__.py
Normal file
|
|
@ -0,0 +1,87 @@
|
|||
#!/usr/bin/env python
|
||||
# -*- coding: utf8 -*-
|
||||
"""
|
||||
Burp-UI is a web-ui for burp backup written in python with Flask and
|
||||
jQuery/Bootstrap
|
||||
|
||||
.. module:: burpui.__main__
|
||||
:platform: Unix
|
||||
:synopsis: Burp-UI main module.
|
||||
|
||||
.. moduleauthor:: Ziirish <hi+burpui@ziirish.me>
|
||||
"""
|
||||
import os
|
||||
import sys
|
||||
import logging
|
||||
|
||||
from argparse import ArgumentParser
|
||||
|
||||
ROOT = os.path.dirname(os.path.realpath(__file__))
|
||||
# Try to load modules from our current env first
|
||||
sys.path.insert(0, os.path.join(ROOT, '..'))
|
||||
|
||||
from burpui_monitor.tools.logging import logger
|
||||
|
||||
logger.init_logger(config=dict(level=logging.CRITICAL))
|
||||
|
||||
|
||||
def parse_args(name=None):
|
||||
mname = name
|
||||
if not name:
|
||||
mname = 'bui-monitor'
|
||||
parser = ArgumentParser(prog=mname)
|
||||
parser.add_argument('-v', '--verbose', dest='log', help='increase output verbosity (e.g., -vv is more verbose than -v)', action='count')
|
||||
parser.add_argument('-V', '--version', dest='version', help='print version and exit', action='store_true')
|
||||
parser.add_argument('-c', '--config', dest='config', help='burp-ui configuration file', metavar='<CONFIG>')
|
||||
parser.add_argument('-l', '--logfile', dest='logfile', help='output logs in defined file', metavar='<FILE>')
|
||||
|
||||
options = parser.parse_args()
|
||||
|
||||
if options.version:
|
||||
from burpui_monitor import __title__
|
||||
from burpui_monitor.desc import __version__, __release__
|
||||
ver = '{}: v{}'.format(mname or __title__, __version__)
|
||||
if options.log:
|
||||
ver = '{} ({})'.format(ver, __release__)
|
||||
print(ver)
|
||||
sys.exit(0)
|
||||
|
||||
return options
|
||||
|
||||
|
||||
def main():
|
||||
"""
|
||||
Main function
|
||||
"""
|
||||
options = parse_args()
|
||||
monitor(options)
|
||||
|
||||
|
||||
def monitor(options=None):
|
||||
import trio
|
||||
from burpui_monitor.engines.monitor import MonitorPool
|
||||
from burpui_monitor.utils import lookup_file
|
||||
|
||||
if not options:
|
||||
options = parse_args(name='bui-monitor')
|
||||
|
||||
conf = ['buimonitor.cfg', 'buimonitor.sample.cfg']
|
||||
if options.config:
|
||||
conf = lookup_file(options.config, guess=False)
|
||||
else:
|
||||
conf = lookup_file(conf)
|
||||
check_config(conf)
|
||||
|
||||
monitor = MonitorPool(conf, options.log, options.logfile)
|
||||
trio.run(monitor.run)
|
||||
|
||||
|
||||
def check_config(conf):
|
||||
if not conf:
|
||||
raise IOError('No configuration file found')
|
||||
if not os.path.isfile(conf):
|
||||
raise IOError('File does not exist: \'{0}\''.format(conf))
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
1
pkgs/burp-ui-monitor/burpui_monitor-decoy/_compat.py
Symbolic link
1
pkgs/burp-ui-monitor/burpui_monitor-decoy/_compat.py
Symbolic link
|
|
@ -0,0 +1 @@
|
|||
../../../burpui/_compat.py
|
||||
1
pkgs/burp-ui-monitor/burpui_monitor-decoy/_json.py
Symbolic link
1
pkgs/burp-ui-monitor/burpui_monitor-decoy/_json.py
Symbolic link
|
|
@ -0,0 +1 @@
|
|||
../../../burpui/_json.py
|
||||
1
pkgs/burp-ui-monitor/burpui_monitor-decoy/config.py
Symbolic link
1
pkgs/burp-ui-monitor/burpui_monitor-decoy/config.py
Symbolic link
|
|
@ -0,0 +1 @@
|
|||
../../../burpui/config.py
|
||||
1
pkgs/burp-ui-monitor/burpui_monitor-decoy/datastructures.py
Symbolic link
1
pkgs/burp-ui-monitor/burpui_monitor-decoy/datastructures.py
Symbolic link
|
|
@ -0,0 +1 @@
|
|||
../../../burpui/datastructures.py
|
||||
1
pkgs/burp-ui-monitor/burpui_monitor-decoy/decorators.py
Symbolic link
1
pkgs/burp-ui-monitor/burpui_monitor-decoy/decorators.py
Symbolic link
|
|
@ -0,0 +1 @@
|
|||
../../../burpui/decorators.py
|
||||
1
pkgs/burp-ui-monitor/burpui_monitor-decoy/desc.py
Symbolic link
1
pkgs/burp-ui-monitor/burpui_monitor-decoy/desc.py
Symbolic link
|
|
@ -0,0 +1 @@
|
|||
../../../burpui/desc.py
|
||||
1
pkgs/burp-ui-monitor/burpui_monitor-decoy/engines/monitor.py
Symbolic link
1
pkgs/burp-ui-monitor/burpui_monitor-decoy/engines/monitor.py
Symbolic link
|
|
@ -0,0 +1 @@
|
|||
../../../../burpui/engines/monitor.py
|
||||
1
pkgs/burp-ui-monitor/burpui_monitor-decoy/exceptions.py
Symbolic link
1
pkgs/burp-ui-monitor/burpui_monitor-decoy/exceptions.py
Symbolic link
|
|
@ -0,0 +1 @@
|
|||
../../../burpui/exceptions.py
|
||||
1
pkgs/burp-ui-monitor/burpui_monitor-decoy/misc/backend
Symbolic link
1
pkgs/burp-ui-monitor/burpui_monitor-decoy/misc/backend
Symbolic link
|
|
@ -0,0 +1 @@
|
|||
../../../../burpui/misc/backend
|
||||
1
pkgs/burp-ui-monitor/burpui_monitor-decoy/misc/parser
Symbolic link
1
pkgs/burp-ui-monitor/burpui_monitor-decoy/misc/parser
Symbolic link
|
|
@ -0,0 +1 @@
|
|||
../../../../burpui/misc/parser
|
||||
1
pkgs/burp-ui-monitor/burpui_monitor-decoy/security.py
Symbolic link
1
pkgs/burp-ui-monitor/burpui_monitor-decoy/security.py
Symbolic link
|
|
@ -0,0 +1 @@
|
|||
../../../burpui/security.py
|
||||
1
pkgs/burp-ui-monitor/burpui_monitor-decoy/tools/logging.py
Symbolic link
1
pkgs/burp-ui-monitor/burpui_monitor-decoy/tools/logging.py
Symbolic link
|
|
@ -0,0 +1 @@
|
|||
../../../../burpui/tools/logging.py
|
||||
1
pkgs/burp-ui-monitor/burpui_monitor-decoy/utils.py
Symbolic link
1
pkgs/burp-ui-monitor/burpui_monitor-decoy/utils.py
Symbolic link
|
|
@ -0,0 +1 @@
|
|||
../../../burpui/utils.py
|
||||
132
pkgs/burp-ui-monitor/setup.py
Executable file
132
pkgs/burp-ui-monitor/setup.py
Executable file
|
|
@ -0,0 +1,132 @@
|
|||
#!/usr/bin/env python
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
import os
|
||||
import re
|
||||
import sys
|
||||
import shutil
|
||||
import subprocess
|
||||
|
||||
from setuptools import setup, find_packages
|
||||
|
||||
# only used to build the package
|
||||
ROOT = os.path.join(os.path.dirname(os.path.realpath(__file__)), '..', '..')
|
||||
|
||||
if 'sdist' in sys.argv or 'bdist' in sys.argv:
|
||||
if not os.path.exists('burpui_monitor'):
|
||||
os.makedirs('burpui_monitor', mode=0o0755)
|
||||
if os.path.exists(os.path.join(ROOT, 'burpui', 'VERSION')):
|
||||
shutil.copyfile(os.path.join(ROOT, 'burpui', 'VERSION'), 'burpui_monitor/VERSION')
|
||||
rev = 'stable'
|
||||
ci = os.getenv('CI')
|
||||
commit = os.getenv('CI_COMMIT_SHA')
|
||||
if not ci and os.path.exists(os.path.join(ROOT, '.git/HEAD')):
|
||||
try:
|
||||
branch = subprocess.check_output('sed s@^.*/@@g {}/.git/HEAD'.format(ROOT).split()).rstrip()
|
||||
ver = open(os.path.join('burpui_monitor', 'VERSION')).read().rstrip()
|
||||
if branch and 'dev' in ver:
|
||||
rev = branch
|
||||
try:
|
||||
with open('burpui_monitor/RELEASE', 'wb') as f:
|
||||
f.write(rev)
|
||||
except:
|
||||
pass
|
||||
except:
|
||||
pass
|
||||
elif ci:
|
||||
try:
|
||||
ver = open(os.path.join('burpui_monitor', 'VERSION')).read().rstrip()
|
||||
if 'dev' in ver:
|
||||
rev = commit
|
||||
try:
|
||||
with open('burpui_monitor/RELEASE', 'wb') as f:
|
||||
f.write(rev)
|
||||
except:
|
||||
pass
|
||||
except:
|
||||
pass
|
||||
find = subprocess.Popen(r'find burpui_monitor-decoy -type l', shell=True, stdout=subprocess.PIPE)
|
||||
(out, _) = find.communicate()
|
||||
for decoy in out.splitlines():
|
||||
real = os.path.normpath(os.path.join(os.path.dirname(decoy), os.readlink(decoy))).decode('utf-8')
|
||||
# print '{} -> {}'.format(decoy, real)
|
||||
target = os.path.join('burpui_monitor', re.sub(r'.*/burpui/', '', real))
|
||||
dirname = os.path.dirname(target)
|
||||
if not os.path.isdir(dirname):
|
||||
# print 'mkdir {}'.format(dirname)
|
||||
os.makedirs(dirname, mode=0o0755)
|
||||
# print 'cp -r {} {}'.format(real, target)
|
||||
if os.path.isdir(real):
|
||||
if os.path.exists(target):
|
||||
shutil.rmtree(target)
|
||||
shutil.copytree(real, target)
|
||||
else:
|
||||
shutil.copy(real, target)
|
||||
|
||||
files = subprocess.Popen(r'find burpui_monitor-decoy -type f', shell=True, stdout=subprocess.PIPE)
|
||||
(out, _) = files.communicate()
|
||||
for src in out.splitlines():
|
||||
src = src.decode('utf-8')
|
||||
dst = src.replace('burpui_monitor-decoy', 'burpui_monitor')
|
||||
dirname = os.path.dirname(dst)
|
||||
if not os.path.isdir(dirname):
|
||||
# print 'mkdir {}'.format(dirname)
|
||||
os.makedirs(dirname, mode=0o0755)
|
||||
shutil.copy(src, dst)
|
||||
|
||||
readme = """
|
||||
Burp-UI Meta package for monitor requirements
|
||||
"""
|
||||
|
||||
from burpui_monitor import __title__
|
||||
from burpui_monitor.desc import __author__, __author_email__, __description__, \
|
||||
__url__, __version__, __license__
|
||||
name = __title__
|
||||
author = __author__
|
||||
author_email = __author_email__
|
||||
description = __description__
|
||||
url = __url__
|
||||
version = __version__
|
||||
license = __license__
|
||||
|
||||
datadir = os.path.join('share', 'burpui')
|
||||
confdir = os.path.join(datadir, 'etc')
|
||||
|
||||
setup(
|
||||
name=name,
|
||||
packages=find_packages(exclude=['burpui_monitor-decoy', 'burpui_monitor-decoy.*']),
|
||||
version=version,
|
||||
description=description,
|
||||
long_description=readme,
|
||||
license=license,
|
||||
author=author,
|
||||
author_email=author_email,
|
||||
url=url,
|
||||
include_package_data=True,
|
||||
keywords='burp web ui backup monitoring',
|
||||
entry_points={
|
||||
'console_scripts': [
|
||||
'bui-monitor=burpui_monitor.__main__:monitor',
|
||||
],
|
||||
},
|
||||
data_files=[
|
||||
(confdir, [os.path.join(confdir, 'buimonitor.sample.cfg')]),
|
||||
],
|
||||
install_requires=[
|
||||
'trio==0.11.0',
|
||||
'arrow==0.13.1',
|
||||
'tzlocal==1.5.1',
|
||||
'pyOpenSSL>=19.0.0',
|
||||
'configobj==5.0.6',
|
||||
],
|
||||
classifiers=[
|
||||
'Intended Audience :: System Administrators',
|
||||
'Natural Language :: English',
|
||||
'License :: OSI Approved :: BSD License',
|
||||
'Operating System :: POSIX :: Linux',
|
||||
'Programming Language :: Python',
|
||||
'Programming Language :: Python :: 3.6',
|
||||
'Topic :: System :: Archiving :: Backup',
|
||||
'Topic :: System :: Monitoring',
|
||||
]
|
||||
)
|
||||
1
pkgs/burp-ui-monitor/share
Symbolic link
1
pkgs/burp-ui-monitor/share
Symbolic link
|
|
@ -0,0 +1 @@
|
|||
../../share
|
||||
Loading…
Add table
Add a link
Reference in a new issue