Merge branch 'versions/minor' into nightly

Signed-off-by: Roberto Rosario <roberto.rosario@mayan-edms.com>
This commit is contained in:
Roberto Rosario
2019-06-21 12:05:19 -04:00
16 changed files with 176 additions and 26 deletions

View File

@@ -1,9 +1,27 @@
3.2.3 (2019-06-XX)
Importer branch
===============
* Add a reusable task to upload documents.
* Add MVP of the importer app.
3.2.4 (2019-06-XX)
==================
* Support configurable GUnicorn timeouts. Defaults to
current value of 120 seconds.
3.2.3 (2019-06-21)
==================
* Add support for disabling the random primary key
test mixin.
* Add a reusable task to upload documents.
* Add MVP of the importer app.
* Fix mailing profile log columns mappings.
GitLab issue #626. Thanks to Jesaja Everling (@jeverling)
for the report.
* Fix the Django SMTP backend username field name.
GitLab issue #625. Thanks to Jesaja Everling (@jeverling)
for the report and the research.
* Increase the Django STMP username.
GitLab issue #625. Thanks to Jesaja Everling (@jeverling)
for the report and the research.
>>>>>>> versions/minor
3.2.2 (2019-06-19)
==================

View File

@@ -22,6 +22,7 @@ export MAYAN_SETTINGS_MODULE=${MAYAN_SETTINGS_MODULE:-mayan.settings.production}
export MAYAN_GUNICORN_BIN=${MAYAN_PYTHON_BIN_DIR}gunicorn
export MAYAN_GUNICORN_WORKERS=${MAYAN_GUNICORN_WORKERS:-2}
export MAYAN_GUNICORN_TIMEOUT=${MAYAN_GUNICORN_TIMEOUT:-120}
export MAYAN_PIP_BIN=${MAYAN_PYTHON_BIN_DIR}pip
export MAYAN_STATIC_ROOT=${MAYAN_INSTALL_DIR}/static

View File

@@ -1 +1 @@
3.2.2
3.2.3

View File

@@ -1,7 +1,7 @@
Version 3.2.3
=============
Released: June XX, 2019
Released: June 21, 2019
Changes
@@ -9,7 +9,16 @@ Changes
- Add support for disabling the random primary key
test mixin.
- Fix mailing profile log columns mappings.
GitLab issue #626. Thanks to Jesaja Everling (@jeverling)
for the report.
- Fix the Django SMTP backend username field name.
GitLab issue #625. Thanks to Jesaja Everling (@jeverling)
for the report and the research.
- Increase the Django STMP username.
GitLab issue #625. Thanks to Jesaja Everling (@jeverling)
for the report and the research.
Removals
--------
@@ -98,6 +107,12 @@ Backward incompatible changes
Bugs fixed or issues closed
---------------------------
<<<<<<< HEAD
- :gitlab-issue:`615`
=======
- :gitlab-issue:`619` poplib.POP3_SSL and poplib.POP3 initialized with wrong kwarg
- :gitlab-issue:`625` mayan.apps.mailer.mailers.DjangoSMTP uses "user", but django.core.mail.backends.smtp.EmailBackend expects "username"
- :gitlab-issue:`626` Mailing profile error log is empty, despite errors
>>>>>>> versions/minor
.. _PyPI: https://pypi.python.org/pypi/mayan-edms/

103
docs/releases/3.2.4.rst Normal file
View File

@@ -0,0 +1,103 @@
Version 3.2.4
=============
Released: June XX, 2019
Changes
-------
- Support configurable GUnicorn timeouts. Defaults to
current value of 120 seconds.
Removals
--------
- None
Upgrading from a previous version
---------------------------------
If installed via Python's PIP
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Remove deprecated requirements::
$ curl https://gitlab.com/mayan-edms/mayan-edms/raw/master/removals.txt | pip uninstall -r /dev/stdin
Type in the console::
$ pip install mayan-edms==3.2.3
the requirements will also be updated automatically.
Using Git
^^^^^^^^^
If you installed Mayan EDMS by cloning the Git repository issue the commands::
$ git reset --hard HEAD
$ git pull
otherwise download the compressed archived and uncompress it overriding the
existing installation.
Remove deprecated requirements::
$ pip uninstall -y -r removals.txt
Next upgrade/add the new requirements::
$ pip install --upgrade -r requirements.txt
Common steps
^^^^^^^^^^^^
Perform these steps after updating the code from either step above.
Make a backup of your supervisord file::
sudo cp /etc/supervisor/conf.d/mayan.conf /etc/supervisor/conf.d/mayan.conf.bck
Update the supervisord configuration file. Replace the environment
variables values show here with your respective settings. This step will refresh
the supervisord configuration file with the new queues and the latest
recommended layout::
MAYAN_DATABASE_ENGINE=django.db.backends.postgresql MAYAN_DATABASE_NAME=mayan \
MAYAN_DATABASE_PASSWORD=mayanuserpass MAYAN_DATABASE_USER=mayan \
MAYAN_DATABASE_HOST=127.0.0.1 MAYAN_MEDIA_ROOT=/opt/mayan-edms/media \
/opt/mayan-edms/bin/mayan-edms.py platformtemplate supervisord > /etc/supervisor/conf.d/mayan.conf
Edit the supervisord configuration file and update any setting the template
generator missed::
vi /etc/supervisor/conf.d/mayan.conf
Migrate existing database schema with::
$ mayan-edms.py performupgrade
Add new static media::
$ mayan-edms.py preparestatic --noinput
The upgrade procedure is now complete.
Backward incompatible changes
-----------------------------
- None
Bugs fixed or issues closed
---------------------------
- :gitlab-issue:`628` mailbox.user in POP3Email gets passed keyword argument, but only accepts "user" or positional argument
.. _PyPI: https://pypi.python.org/pypi/mayan-edms/

View File

@@ -20,6 +20,7 @@ versions of the documentation contain the release notes for any later releases.
.. toctree::
:maxdepth: 1
3.2.4
3.2.3
3.2.2
3.2.1

View File

@@ -1,9 +1,9 @@
from __future__ import unicode_literals
__title__ = 'Mayan EDMS'
__version__ = '3.2.2'
__build__ = 0x030202
__build_string__ = 'v3.2.2_Wed Jun 19 00:39:13 2019 -0400'
__version__ = '3.2.3'
__build__ = 0x030203
__build_string__ = 'v3.2.3_Fri Jun 21 00:01:37 2019 -0400'
__django_version__ = '1.11'
__author__ = 'Roberto Rosario'
__author_email__ = 'roberto.rosario@mayan-edms.com'

View File

@@ -51,6 +51,7 @@ class MailerApp(MayanAppConfig):
LogEntry = self.get_model(model_name='LogEntry')
UserMailer = self.get_model(model_name='UserMailer')
UserMailerLogEntry = self.get_model(model_name='UserMailerLogEntry')
MailerBackend.initialize()
@@ -79,6 +80,13 @@ class MailerApp(MayanAppConfig):
SourceColumn(
source=UserMailer, attribute='backend_label'
)
SourceColumn(
attribute='datetime', label=_('Date and time'),
source=UserMailerLogEntry
)
SourceColumn(
attribute='message', label=_('Message'), source=UserMailerLogEntry
)
ModelPermission.register(
model=Document, permissions=(

View File

@@ -96,7 +96,7 @@ class UserMailerDynamicForm(DynamicModelForm):
if self.instance.backend_data:
backend_data = json.loads(self.instance.backend_data)
for key in self.instance.get_backend().fields:
self.fields[key].initial = backend_data[key]
self.fields[key].initial = backend_data.get(key)
return result

View File

@@ -12,11 +12,11 @@ class DjangoSMTP(MailerBackend):
Backend that wraps Django's SMTP backend
"""
class_fields = (
'host', 'port', 'use_tls', 'use_ssl', 'user', 'password'
'host', 'port', 'use_tls', 'use_ssl', 'username', 'password'
)
class_path = 'django.core.mail.backends.smtp.EmailBackend'
field_order = (
'host', 'port', 'use_tls', 'use_ssl', 'user', 'password', 'from'
'host', 'port', 'use_tls', 'use_ssl', 'username', 'password', 'from'
)
fields = {
'from': {
@@ -60,14 +60,14 @@ class DjangoSMTP(MailerBackend):
'that "Use TLS" and "Use SSL" are mutually exclusive, '
'so only set one of those settings to True.'
), 'required': False
}, 'user': {
}, 'username': {
'label': _('Username'),
'class': 'django.forms.CharField', 'default': '',
'help_text': _(
'Username to use for the SMTP server. If empty, '
'authentication won\'t attempted.'
), 'kwargs': {
'max_length': 48
'max_length': 254
}, 'required': False
}, 'password': {
'label': _('Password'),

View File

@@ -208,7 +208,7 @@ class UserMailerLogEntryListView(SingleObjectListView):
return {
'hide_object': True,
'object': self.get_user_mailer(),
'title': _('%s error log') % self.get_user_mailer(),
'title': _('Error log for: %s') % self.get_user_mailer(),
}
def get_source_queryset(self):

View File

@@ -120,6 +120,10 @@ class PlatformTemplateSupervisord(PlatformTemplate):
name='GUNICORN_WORKERS', default=2,
environment_name='MAYAN_GUNICORN_WORKERS'
),
Variable(
name='GUNICORN_TIMEOUT', default=120,
environment_name='MAYAN_GUNICORN_TIMEOUT'
),
Variable(
name='DATABASE_CONN_MAX_AGE', default=0,
environment_name='MAYAN_DATABASE_CONN_MAX_AGE'

View File

@@ -16,7 +16,7 @@ environment=
[program:mayan-gunicorn]
autorestart = true
autostart = true
command = {{ INSTALLATION_PATH }}/bin/gunicorn -w {{ GUNICORN_WORKERS }} mayan.wsgi --max-requests 500 --max-requests-jitter 50 --worker-class gevent --bind 0.0.0.0:8000 --timeout 120
command = {{ INSTALLATION_PATH }}/bin/gunicorn -w {{ GUNICORN_WORKERS }} mayan.wsgi --max-requests 500 --max-requests-jitter 50 --worker-class gevent --bind 0.0.0.0:8000 --timeout {{ GUNICORN_TIMEOUT }}
user = mayan
{% for worker in workers %}

View File

@@ -1,7 +1,7 @@
[program:mayan-gunicorn]
autorestart = false
autostart = true
command = /bin/bash -c "${MAYAN_GUNICORN_BIN} -w ${MAYAN_GUNICORN_WORKERS} mayan.wsgi --max-requests 500 --max-requests-jitter 50 --worker-class gevent --bind 0.0.0.0:8000 --env DJANGO_SETTINGS_MODULE=${MAYAN_SETTINGS_MODULE}" --timeout 120
command = /bin/bash -c "${MAYAN_GUNICORN_BIN} -w ${MAYAN_GUNICORN_WORKERS} mayan.wsgi --max-requests 500 --max-requests-jitter 50 --worker-class gevent --bind 0.0.0.0:8000 --env DJANGO_SETTINGS_MODULE=${MAYAN_SETTINGS_MODULE}" --timeout ${MAYAN_GUNICORN_TIMEOUT}
redirect_stderr = true
stderr_logfile = /dev/fd/2
stderr_logfile_maxbytes = 0

View File

@@ -277,15 +277,15 @@ class POP3Email(EmailBaseModel):
logger.debug('ssl: %s', self.ssl)
if self.ssl:
mailbox = poplib.POP3_SSL(host=self.host, post=self.port)
mailbox = poplib.POP3_SSL(host=self.host, port=self.port)
else:
mailbox = poplib.POP3(
host=self.host, post=self.port, timeout=self.timeout
host=self.host, port=self.port, timeout=self.timeout
)
mailbox.getwelcome()
mailbox.user(username=self.username)
mailbox.pass_(password=self.password)
mailbox.user(self.username)
mailbox.pass_(self.password)
messages_info = mailbox.list()
logger.debug(msg='messages_info:')

View File

@@ -203,7 +203,10 @@ class POP3SourceTestCase(GenericDocumentTestCase):
def list(self, which=None):
return (None, ['1 test'])
def pass_(self, password):
def user(self, user):
return
def pass_(self, pswd):
return
def quit(self):
@@ -214,10 +217,7 @@ class POP3SourceTestCase(GenericDocumentTestCase):
1, [TEST_EMAIL_BASE64_FILENAME]
)
def user(self, username):
return
@mock.patch('poplib.POP3_SSL')
@mock.patch('poplib.POP3_SSL', autospec=True)
def test_download_document(self, mock_poplib):
mock_poplib.return_value = POP3SourceTestCase.MockMailbox()
self.source = POP3Email.objects.create(