Skip to content

Commit e80a06a

Browse files
authored
Merge pull request #185 from StackFocus/1.2
Release v1.2.0
2 parents 647f333 + de8ac4a commit e80a06a

File tree

11 files changed

+94
-130
lines changed

11 files changed

+94
-130
lines changed

.travis.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ python:
66
install:
77
- cp config.default.py config.py
88
- pip install -r requirements.txt
9+
- pip install -r test-requirements.txt
910
before_script:
1011
- ./pylint-check.py
1112
script:

docs/ChangeLog.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,21 @@
1-
### Unreleased
1+
### v1.2.0 - Rubber Soul
22

33
BACKWARDS INCOMPATIBILITIES / NOTES:
44

55
* The default MySQL Python connector of "mysqlclient" has been replaced with "pymysql" for a pure Python replacement.
66
Upgrades will be unaffected by this, but please note that reinstalls will require you to either install "mysqlclient"
77
([Ubuntu Instructions](https://github.com/PyMySQL/mysqlclient-python#install) or change the start of your database URI
8-
with "mysql+pymysql://" instead of "mysql://" [GH-170].
8+
with "mysql+pymysql://" instead of "mysql://" [GH-170]
99

1010
Features:
1111

1212
* Supports Two-Factor Authentication on the backend [GH-169]
1313

1414
Improvements:
1515

16-
* Replaced GIF spinner with a pure CSS spinner using CSS3 animations [GH-177].
16+
* Replaced GIF spinner with a pure CSS spinner using CSS3 animations [GH-177]
1717
* Adds Python 3.5 support [GH-179] [GH-180]
18+
* Update Python dependencies when updating PostMaster using the deb package (apt-get) [GH-185]
1819

1920
Bug Fixes:
2021

ops/ansible/roles/postmaster_deploy/tasks/main.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,10 @@
3131
- name: Install python dependencies
3232
pip: requirements=/opt/postmaster/git/requirements.txt virtualenv=/opt/postmaster/env
3333

34+
- name: Install python test dependencies
35+
pip: requirements=/opt/postmaster/git/test-requirements.txt virtualenv=/opt/postmaster/env
36+
when: provision_type == "dev"
37+
3438
- name: Checking if config.py exists
3539
stat: path=/opt/postmaster/git/config.py
3640
register: config_file

ops/ansible/roles/postmaster_upgrade/tasks/main.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@
55
args:
66
chdir: /opt/postmaster/git
77

8+
- name: Upgrade python dependencies
9+
pip: requirements=/opt/postmaster/git/requirements.txt virtualenv=/opt/postmaster/env
10+
811
- name: Ensure apache is reloaded
912
become: yes
1013
service: name=apache2 state=reloaded

postmaster/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
from flask_login import LoginManager
1111
from flask_bcrypt import Bcrypt
1212

13-
__version__ = 'v1.1.0.0'
13+
__version__ = 'v1.2.0.0'
1414
app = Flask(__name__)
1515

1616
if environ.get('POSTMASTER_DEV') == 'TRUE':

postmaster/forms.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,14 @@
44
Purpose: form definitions for the app
55
"""
66

7-
from flask_wtf import Form
7+
from flask_wtf import FlaskForm
88
from wtforms import StringField, PasswordField, SelectField, IntegerField
99
from wtforms.validators import DataRequired, Optional
1010
from postmaster import models
1111
from postmaster.utils import validate_wtforms_password
1212

1313

14-
class LoginForm(Form):
14+
class LoginForm(FlaskForm):
1515
""" Class for login form on /login
1616
"""
1717
username = StringField(label='Username', validators=[DataRequired()])

postmaster/models.py

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,7 @@
99
from re import search, match
1010
from os import urandom
1111
import base64
12-
from passlib.hash import sha512_crypt as sha512 # pylint: disable=no-name-in-module
13-
from hashlib import sha1
12+
import passlib.hash
1413
import onetimepass
1514

1615

@@ -119,12 +118,7 @@ def from_json(self, json):
119118

120119
@staticmethod
121120
def encrypt_password(password):
122-
salt = (sha1(urandom(16)).hexdigest())[:16]
123-
protectedPassword = sha512.encrypt(password,
124-
rounds=5000,
125-
salt=salt,
126-
implicit_rounds=True)
127-
return protectedPassword
121+
return passlib.hash.sha512_crypt.hash(password, rounds=5000)
128122

129123

130124
class VirtualAliases(db.Model):

requirements.in

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
coverage
21
Flask
32
Flask-Bcrypt
43
Flask-Login
@@ -7,11 +6,7 @@ Flask-Script
76
Flask-SQLAlchemy
87
Flask-WTF
98
ldap3
10-
mock
119
onetimepass
1210
passlib
13-
pylint
1411
pymysql
1512
pyqrcode
16-
pytest
17-
pytest-cov

requirements.txt

Lines changed: 25 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -4,45 +4,30 @@
44
#
55
# pip-compile --output-file requirements.txt requirements.in
66
#
7-
alembic==0.8.7 # via flask-migrate
8-
astroid==1.4.8 # via pylint
9-
backports.functools-lru-cache==1.2.1 # via pylint
10-
bcrypt==3.1.0 # via flask-bcrypt
11-
cffi==1.7.0 # via bcrypt
12-
click==6.6 # via flask
13-
configparser==3.5.0 # via pylint
14-
coverage==4.2
15-
Flask-Bcrypt==0.7.1
16-
Flask-Login==0.3.2
17-
Flask-Migrate==2.0.0
18-
Flask-Script==2.0.5 # via flask-migrate
19-
Flask-SQLAlchemy==2.1 # via flask-migrate
20-
Flask-WTF==0.12
21-
Flask==0.11.1 # via flask-bcrypt, flask-login, flask-migrate, flask-script, flask-sqlalchemy, flask-wtf
22-
funcsigs==1.0.2 # via mock
23-
isort==4.2.5 # via pylint
7+
alembic==0.9.1 # via flask-migrate
8+
bcrypt==3.1.3 # via flask-bcrypt
9+
cffi==1.9.1 # via bcrypt
10+
click==6.7 # via flask
11+
flask-bcrypt==0.7.1
12+
flask-login==0.4.0
13+
flask-migrate==2.0.3
14+
flask-script==2.0.5
15+
flask-sqlalchemy==2.2
16+
flask-wtf==0.14.2
17+
flask==0.12
2418
itsdangerous==0.24 # via flask
25-
Jinja2==2.8 # via flask
26-
lazy-object-proxy==1.2.2 # via astroid
27-
ldap3==2.1.0
28-
Mako==1.0.4 # via alembic
29-
MarkupSafe==0.23 # via jinja2, mako
30-
mccabe==0.5.2 # via pylint
31-
mock==2.0.0
19+
jinja2==2.9.5 # via flask
20+
ldap3==2.2.1
21+
mako==1.0.6 # via alembic
22+
markupsafe==1.0 # via jinja2, mako
3223
onetimepass==1.0.1
33-
passlib==1.6.5
34-
pbr==1.10.0 # via mock
35-
py==1.4.31 # via pytest
36-
pyasn1==0.1.9 # via ldap3
37-
pycparser==2.14 # via cffi
38-
pylint==1.6.4
39-
pymysql==0.7.9
40-
PyQRCode==1.2.1
41-
pytest-cov==2.3.1
42-
pytest==2.9.2
43-
python-editor==1.0.1 # via alembic
44-
six==1.10.0 # via astroid, bcrypt, mock, onetimepass, pylint
45-
SQLAlchemy==1.0.14 # via alembic, flask-sqlalchemy
46-
Werkzeug==0.11.10 # via flask, flask-wtf
47-
wrapt==1.10.8 # via astroid
48-
WTForms==2.1 # via flask-wtf
24+
passlib==1.7.1
25+
pyasn1==0.2.3 # via ldap3
26+
pycparser==2.17 # via cffi
27+
pymysql==0.7.10
28+
pyqrcode==1.2.1
29+
python-editor==1.0.3 # via alembic
30+
six==1.10.0 # via bcrypt, onetimepass
31+
sqlalchemy==1.1.6 # via alembic, flask-sqlalchemy
32+
werkzeug==0.12 # via flask
33+
wtforms==2.1 # via flask-wtf

test-requirements.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
coverage
2+
mock
3+
pylint
4+
pytest
5+
pytest-cov

0 commit comments

Comments
 (0)