Commit 8a178930 authored by Benjamin "Ziirish" SANS's avatar Benjamin "Ziirish" SANS

Merge branch 'master' into 'stable'

Master

new stable release

See merge request !55
parents ac23ef56 b3fff881
Pipeline #898 passed with stage
in 1 minute and 55 seconds
......@@ -113,7 +113,7 @@ def create_db(myapp, cli=False):
test_database()
except OperationalError as exp:
if 'no such table' in str(exp):
myapp.logger.error(
myapp.logger.critical(
'Your database seem out of sync, you may want '
'to run \'bui-manage db upgrade\'. Disabling '
'SQL support for now.'
......@@ -122,8 +122,9 @@ def create_db(myapp, cli=False):
return None
return db
except ImportError:
myapp.logger.warning(
'Unable to load requirements, SQL support disabled'
myapp.logger.critical(
'Unable to load requirements, you may want to run \'pip '
'install "burp-ui[sql]"\'. Disabling SQL support for now.'
)
myapp.config['WITH_SQL'] = False
......@@ -456,10 +457,7 @@ def create_app(conf=None, verbose=0, logfile=None, gunicorn=True,
babel.init_app(app)
# Create SQLAlchemy if enabled
mcli = cli
if unittest:
mcli = True
create_db(app, mcli)
create_db(app, cli)
# We initialize the API
api.version = __version__
......
......@@ -41,15 +41,21 @@ app = create_app(
cli=CLI
)
if app.config['WITH_SQL']:
try:
from .app import create_db
from .ext.sql import db
from flask_migrate import Migrate
app.config['WITH_SQL'] = True
create_db(app, True)
mig_dir = os.getenv('BUI_MIGRATIONS')
if mig_dir:
migrate = Migrate(app, db, mig_dir)
else:
migrate = Migrate(app, db)
except ImportError:
pass
@app.cli.command()
......
......@@ -4,15 +4,6 @@ Installation
`Burp-UI`_ is written in Python with the `Flask`_ micro-framework.
The easiest way to install `Burp-UI`_ is to use ``pip``.
On Debian, you can install ``pip`` with the following command:
::
aptitude install python-pip
Once ``pip`` is installed, you can install ``Burp-UI`` this way:
::
pip install burp-ui
......@@ -32,7 +23,7 @@ virtualenv)
Then you can run ``burp-ui``: ``burp-ui``
By default, ``burp-ui`` listens on all interfaces (including IPv6) on port 5000.
By default, ``burp-ui`` listens on localhost on port 5000.
You can then point your browser to http://127.0.0.1:5000/
......
......@@ -24,7 +24,9 @@ Some libraries are required to be able to compile some requirements:
::
apt-get install libffi-dev libssl-dev python-dev
apt-get install libffi-dev libssl-dev python-dev python-pip
# this package conflicts with the pip requirements
apt-get remove python-cffi
Debian Wheezy
-------------
......
......@@ -33,6 +33,9 @@ v0.4.0
``1`` since burp-2.0.52 is now the stable release.
- **New** - The ``bui-manage`` tool can now help you setup both `Burp`_ and
`Burp-UI`_.
- **New** - The SQL requirements have evolved, you **MUST** run
``pip install --upgrade "burp-ui[sql]"`` if you wish to keep using persistent
storage.
v0.3.0
......
......@@ -254,7 +254,7 @@ setup(
'dev': dev_requires,
'debian_wheezy': ['functools32'],
'celery': ['Celery', 'redis'],
'sql': ['Flask-SQLAlchemy', 'Flask-Migrate==2.0.1', 'sqlalchemy-utils'],
'sql': ['Flask-SQLAlchemy', 'Flask-Migrate>=2.0.1', 'sqlalchemy-utils'],
},
tests_require=test_requires,
classifiers=[
......
......@@ -22,18 +22,18 @@ $PYTHON setup.py bdist_egg
echo "publishing build"
cd dist
tgz=$(ls -1rt dist/burp-ui*.tar.gz | tail -1)
egg=$(ls -1rt dist/burp_ui*.egg | tail -1)
whl=$(ls -1rt dist/burp_ui*.whl | tail -1)
tgz=$(ls -1rt burp-ui*.tar.gz | tail -1)
egg=$(ls -1rt burp_ui*.egg | tail -1)
whl=$(ls -1rt burp_ui*.whl | tail -1)
cd ..
cp -vf dist/burp-ui*.tar.gz /pub/ 2>/dev/null
cp -vf dist/burp_ui*.egg /pub/ 2>/dev/null
cp -vf dist/burp_ui*.whl /pub/ 2>/dev/null
cd /pub
rm burp-ui.dev.tar.gz burp_ui-dev-py${VERSION}.egg burp_ui-dev-py2.py3-none-any.whl 2>/dev/null
ln -sf $tgz burp-ui.dev.tar.gz
ln -sf $egg burp_ui-dev-py${VERSION}.egg
ln -sf $whl burp_ui-dev-py2.py3-none-any.whl
#rm burp-ui.dev.tar.gz burp_ui-dev-py${VERSION}.egg burp_ui-dev-py2.py3-none-any.whl 2>/dev/null
[ -n "$tgz" ] && ln -sf $tgz burp-ui.dev.tar.gz
[ -n "$egg" ] && ln -sf $egg burp_ui-dev-py${VERSION}.egg
[ -n "$whl" ] && ln -sf $whl burp_ui-dev-py2.py3-none-any.whl
exit 0
......@@ -413,8 +413,11 @@ class BurpuiRedisTestCase(TestCase):
bui.config['LOGIN_DISABLED'] = False
bui.client.port = 9999
with bui.app_context():
from burpui.app import create_db
from burpui.ext.sql import db
from burpui.models import Session, Task
bui.config['WITH_SQL'] = True
create_db(bui, True)
db.create_all()
db.session.commit()
return bui
......
Markdown is supported
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