Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docs/ChangeLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ Features:
* Adds the ability to lockout local accounts after x number of failed login attempts [GH-142]
* Database upgrades/migrations are automatic during ugrades via the deb package and Docker [GH-138]
* Adds the ability to unlock administrators and reset administrator passwords via the CLI [GH-145]
* Adds the `python manage.py version` command [GH-156]

Improvements:

Expand Down
2 changes: 2 additions & 0 deletions docs/Configuration/CommandLineConfiguration.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ Use the following commands to restore the proper permissions on the PostMaster f

### Command Line Commands

**version** returns the version of PostMaster that is installed.

**setlogfile** sets the location of the logfile. The default is `/opt/postmaster/logs/postmaster.log`.

**setdburi** sets the MySQL database URI that PostMaster uses to connect to the MySQL server used by your mail server.
Expand Down
8 changes: 7 additions & 1 deletion manage.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
import flask_migrate
from re import sub
from flask_script import Manager
from postmaster import app, db, models
from postmaster import app, db, models, __version__
from postmaster.utils import add_default_configuration_settings, clear_lockout_fields_on_user, reset_admin_password

migrate = flask_migrate.Migrate(app, db)
Expand Down Expand Up @@ -105,5 +105,11 @@ def resetadminpassword(username, new_password):
reset_admin_password(username, new_password)


@manager.command
def version():
"""Returns the version of PostMaster"""
return __version__


if __name__ == "__main__":
manager.run()
1 change: 1 addition & 0 deletions postmaster/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
from flask_login import LoginManager
from flask_bcrypt import Bcrypt

__version__ = '1.1.0.0-beta'
app = Flask(__name__)

if environ.get('POSTMASTER_DEV') == 'TRUE':
Expand Down