mirror of
https://github.com/ziirish/burp-ui.git
synced 2026-05-21 06:45:24 -06:00
add various informations for #89
This commit is contained in:
parent
57aa449817
commit
804e82388b
7 changed files with 23 additions and 5 deletions
|
|
@ -22,6 +22,7 @@ __title__ = 'burp-ui'
|
|||
__author__ = 'Benjamin SANS (Ziirish)'
|
||||
__author_email__ = 'ziirish+burpui@ziirish.info'
|
||||
__url__ = 'https://git.ziirish.me/ziirish/burp-ui'
|
||||
__doc__ = 'https://burp-ui.readthedocs.org/en/latest/'
|
||||
__description__ = 'Burp-UI is a web-ui for burp backup written in python with Flask and jQuery/Bootstrap'
|
||||
__license__ = 'BSD 3-clause'
|
||||
__version__ = open(os.path.join(os.path.dirname(os.path.realpath(__file__)), 'VERSION')).read().rstrip()
|
||||
|
|
@ -136,12 +137,16 @@ def init(conf=None, debug=0, logfile=None, gunicorn=True, unittest=False):
|
|||
|
||||
# Then we load our routes
|
||||
view.init_bui(app)
|
||||
view.__url__ = __url__
|
||||
view.__doc__ = __doc__
|
||||
app.register_blueprint(view)
|
||||
|
||||
# We initialize the API
|
||||
api.init_bui(app)
|
||||
api.version = __version__
|
||||
api.release = __release__
|
||||
api.__url__ = __url__
|
||||
api.__doc__ = __doc__
|
||||
app.register_blueprint(apibp)
|
||||
|
||||
# And the login_manager
|
||||
|
|
|
|||
|
|
@ -51,6 +51,8 @@ class ApiWrapper(Api):
|
|||
"""Wrapper class around :class:`flask.ext.restplus.Api`"""
|
||||
loaded = False
|
||||
release = None
|
||||
__doc__ = None
|
||||
__url__ = None
|
||||
LOGIN_NOT_REQUIRED = []
|
||||
|
||||
def init_bui(self, bui):
|
||||
|
|
@ -86,7 +88,7 @@ class ApiWrapper(Api):
|
|||
|
||||
|
||||
apibp = Blueprint('api', __name__, url_prefix='/api')
|
||||
api = ApiWrapper(apibp, title='Burp-UI API', description='Burp-UI API to interact with burp', decorators=[api_login_required])
|
||||
api = ApiWrapper(apibp, title='Burp-UI API', description='Burp-UI API to interact with burp', doc='/doc', decorators=[api_login_required])
|
||||
|
||||
|
||||
# Just in case the exception was not caught earlier
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ from ..exceptions import BUIserverException
|
|||
from six import iteritems
|
||||
from flask.ext.restplus import Resource, fields
|
||||
from flask.ext.login import current_user
|
||||
from flask import flash
|
||||
from flask import flash, url_for
|
||||
|
||||
ns = api.namespace('misc', 'Misc methods')
|
||||
|
||||
|
|
@ -281,6 +281,7 @@ class About(Resource):
|
|||
about_fields = api.model('About', {
|
||||
'version': fields.String(required=True, description='Burp-UI version'),
|
||||
'release': fields.String(description='Burp-UI release (commit number)'),
|
||||
'api': fields.String(description='Burp-UI API documentation URL'),
|
||||
'burp': fields.Nested(burp_fields, as_list=True, description='Burp version'),
|
||||
})
|
||||
|
||||
|
|
@ -298,6 +299,7 @@ class About(Resource):
|
|||
server = server or args['server']
|
||||
r['version'] = api.version
|
||||
r['release'] = api.release
|
||||
r['api'] = url_for('api.doc')
|
||||
r['burp'] = []
|
||||
cli = api.bui.cli.get_client_version(server)
|
||||
srv = api.bui.cli.get_server_version(server)
|
||||
|
|
|
|||
|
|
@ -17,6 +17,8 @@ else:
|
|||
|
||||
class BPWrapper(Blueprint):
|
||||
bui = None
|
||||
__url__ = None
|
||||
__doc__ = None
|
||||
|
||||
def init_bui(self, bui):
|
||||
"""Loads the right context.
|
||||
|
|
@ -245,7 +247,7 @@ def logout():
|
|||
@view.route('/about')
|
||||
def about():
|
||||
"""about view"""
|
||||
return render_template('about.html', about=True, login=(not current_user.is_authenticated))
|
||||
return render_template('about.html', about=True, login=(not current_user.is_authenticated), doc=view.__doc__, url=view.__url__)
|
||||
|
||||
|
||||
@view.route('/')
|
||||
|
|
|
|||
|
|
@ -4,8 +4,10 @@
|
|||
<br />
|
||||
<h1 class="page-header">About</h1>
|
||||
<p>
|
||||
<a href="https://git.ziirish.me/ziirish/burp-ui">Burp-UI</a> is
|
||||
<a href="{{ url }}">Burp-UI</a> is
|
||||
brought to you by <a href="https://ziirish.info/">Ziirish</a>.
|
||||
<br />
|
||||
You can find the documentation at <a href="{{ doc }}">{{ doc }}</a>.
|
||||
</p>
|
||||
{# From here, the jinja syntax is escaped because we use the angularjs syntax #}
|
||||
{% raw %}
|
||||
|
|
@ -15,6 +17,9 @@
|
|||
<p ng-repeat="b in burp" ng-if="b.client || b.server">
|
||||
<strong>{{ ::b.name }}</strong><span ng-if="b.client"> - client: <em>{{ ::b.client }}</em></span><span ng-if="b.server"> - server: <em>{{ ::b.server }}</em></span>
|
||||
</p>
|
||||
<p>
|
||||
API <a ng-href="{{ api }}">documentation</a>
|
||||
</p>
|
||||
{% endraw %}
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
|
|
|||
|
|
@ -17,11 +17,13 @@ var app = angular.module('MainApp', ['ngSanitize']);
|
|||
|
||||
app.controller('AboutCtrl', function($scope, $http) {
|
||||
$scope.version = '';
|
||||
$scope.api = '';
|
||||
$scope.burp = Array();
|
||||
|
||||
$http.get('{{ url_for("api.about") }}')
|
||||
.success(function(data, status, headers, config) {
|
||||
$scope.version = data.version;
|
||||
$scope.api = data.api;
|
||||
$scope.burp = data.burp;
|
||||
});
|
||||
});
|
||||
|
|
|
|||
|
|
@ -2,6 +2,6 @@ Flask==0.10.1
|
|||
Flask-Login==0.3.1
|
||||
Flask-Bower==1.2.1
|
||||
Flask-WTF==0.12
|
||||
flask-restplus==0.8.0
|
||||
flask-restplus==0.8.1
|
||||
WTForms==2.0.2
|
||||
six==1.10.0
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue