diff --git a/.tx/config b/.tx/config index 82c6d647c5..158957b39c 100644 --- a/.tx/config +++ b/.tx/config @@ -169,6 +169,12 @@ source_lang = en source_file = mayan/apps/permissions/locale/en/LC_MESSAGES/django.po type = PO +[mayan-edms.platform-2-0] +file_filter = mayan/apps/platform/locale//LC_MESSAGES/django.po +source_lang = en +source_file = mayan/apps/platform/locale/en/LC_MESSAGES/django.po +type = PO + [mayan-edms.rest_api-2-0] file_filter = mayan/apps/rest_api/locale//LC_MESSAGES/django.po source_lang = en diff --git a/contrib/scripts/process_messages.py b/contrib/scripts/process_messages.py index a311082661..1e73851143 100755 --- a/contrib/scripts/process_messages.py +++ b/contrib/scripts/process_messages.py @@ -15,7 +15,7 @@ APP_LIST = ( 'document_parsing', 'document_signatures', 'document_states', 'documents', 'dynamic_search', 'events', 'file_metadata', 'linking', 'lock_manager', 'mayan_statistics', 'mailer', 'metadata', 'mirroring', - 'motd', 'navigation', 'ocr', 'permissions', 'rest_api', + 'motd', 'navigation', 'ocr', 'permissions', 'platform', 'rest_api', 'smart_settings', 'sources', 'storage', 'tags', 'task_manager', 'user_management' ) diff --git a/docker/Dockerfile b/docker/Dockerfile index 7b340394de..b4f7042b4d 100755 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -142,7 +142,8 @@ ENTRYPOINT ["entrypoint.sh"] EXPOSE 8000 CMD ["mayan"] -RUN apt-get clean autoclean \ +RUN ${PROJECT_INSTALL_DIR}/bin/mayan-edms.py platformtemplate supervisord_docker > /etc/supervisor/conf.d/mayan.conf \ +&& apt-get clean autoclean \ && apt-get autoremove --purge -y \ && rm -rf /var/lib/apt/lists/* \ && rm -f /var/cache/apt/archives/*.deb \ diff --git a/docker/rootfs/etc/supervisor/conf.d/mayan.conf b/docker/rootfs/etc/supervisor/conf.d/mayan.conf deleted file mode 100644 index 646be4c10b..0000000000 --- a/docker/rootfs/etc/supervisor/conf.d/mayan.conf +++ /dev/null @@ -1,80 +0,0 @@ -[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 -redirect_stderr = true -stderr_logfile = /dev/fd/2 -stderr_logfile_maxbytes = 0 -stdout_logfile = /dev/fd/1 -stdout_logfile_maxbytes = 0 -user = mayan - -[program:redis] -autorestart = false -autostart = true -command = /bin/bash -c "if [ ${MAYAN_BROKER_URL} == ${MAYAN_DEFAULT_BROKER_URL} ] && [ ${MAYAN_CELERY_RESULT_BACKEND} == ${MAYAN_DEFAULT_CELERY_RESULT_BACKEND} ];then /usr/bin/redis-server /etc/redis/;fi" -stderr_logfile = /dev/fd/2 -stderr_logfile_maxbytes = 0 -stdout_logfile = /dev/fd/1 -stdout_logfile_maxbytes = 0 -user = root - -[program:mayan-worker-fast] -autorestart = false -autostart = true -command = nice -n 1 /bin/bash -c "${MAYAN_BIN} celery --settings=${MAYAN_SETTINGS_MODULE} worker -Ofair -l ERROR -Q converter,sources_fast -n mayan-worker-fast.%%h ${MAYAN_WORKER_FAST_CONCURRENCY}" -killasgroup = true -numprocs = 1 -priority = 998 -startsecs = 10 -stderr_logfile = /dev/fd/2 -stderr_logfile_maxbytes = 0 -stdout_logfile = /dev/fd/1 -stdout_logfile_maxbytes = 0 -stopwaitsecs = 1 -user = mayan - -[program:mayan-worker-medium] -autorestart = false -autostart = true -command = nice -n 18 /bin/bash -c "${MAYAN_BIN} celery --settings=${MAYAN_SETTINGS_MODULE} worker -Ofair -l ERROR -Q checkouts_periodic,documents_periodic,indexing,metadata,sources,sources_periodic,uploads,documents -n mayan-worker-medium.%%h ${MAYAN_WORKER_MEDIUM_CONCURRENCY}" -killasgroup = true -numprocs = 1 -priority = 998 -startsecs = 10 -stderr_logfile = /dev/fd/2 -stderr_logfile_maxbytes = 0 -stdout_logfile = /dev/fd/1 -stdout_logfile_maxbytes = 0 -stopwaitsecs = 1 -user = mayan - -[program:mayan-worker-slow] -autorestart = false -autostart = true -command = nice -n 19 /bin/bash -c "${MAYAN_BIN} celery --settings=${MAYAN_SETTINGS_MODULE} worker -Ofair -l ERROR -Q mailing,tools,statistics,parsing,ocr -n mayan-worker-slow.%%h ${MAYAN_WORKER_SLOW_CONCURRENCY}" -killasgroup = true -numprocs = 1 -priority = 998 -startsecs = 10 -stderr_logfile = /dev/fd/2 -stderr_logfile_maxbytes = 0 -stdout_logfile = /dev/fd/1 -stdout_logfile_maxbytes = 0 -stopwaitsecs = 1 -user = mayan - -[program:mayan-celery-beat] -autorestart = false -autostart = true -command = nice -n 1 /bin/bash -c "${MAYAN_BIN} celery --settings=${MAYAN_SETTINGS_MODULE} beat --pidfile= -l ERROR" -killasgroup = true -numprocs = 1 -priority = 998 -stderr_logfile = /dev/fd/2 -stderr_logfile_maxbytes = 0 -stdout_logfile = /dev/fd/1 -stdout_logfile_maxbytes = 0 -startsecs = 10 -stopwaitsecs = 1 -user = mayan diff --git a/mayan/apps/platform/apps.py b/mayan/apps/platform/apps.py index 320b65972d..561d881224 100644 --- a/mayan/apps/platform/apps.py +++ b/mayan/apps/platform/apps.py @@ -1,84 +1,8 @@ from __future__ import absolute_import, unicode_literals -from django.apps import apps -from django.db.models.signals import m2m_changed, pre_delete from django.utils.translation import ugettext_lazy as _ -from mayan.apps.acls.classes import ModelPermission -from mayan.apps.acls.links import link_acl_list -from mayan.apps.acls.permissions import permission_acl_edit, permission_acl_view from mayan.apps.common.apps import MayanAppConfig -from mayan.apps.common.classes import ModelField -from mayan.apps.common.menus import ( - menu_facet, menu_list_facet, menu_main, menu_multi_item, menu_object, - menu_secondary -) -from mayan.apps.documents.search import document_page_search, document_search -from mayan.apps.events.classes import ModelEventType -from mayan.apps.events.links import ( - link_events_for_object, link_object_event_types_user_subcriptions_list, -) -from mayan.apps.events.permissions import permission_events_view -from mayan.apps.navigation.classes import SourceColumn - -""" -from .dependencies import * # NOQA -from .events import ( - event_tag_attach, event_tag_created, event_tag_edited, event_tag_remove -) -from .handlers import handler_index_document, handler_tag_pre_delete -from .html_widgets import widget_document_tags -from .links import ( - link_document_tag_list, link_document_multiple_attach_multiple_tag, - link_document_multiple_tag_multiple_remove, - link_document_tag_multiple_remove, link_document_tag_multiple_attach, link_tag_create, - link_tag_delete, link_tag_edit, link_tag_list, - link_tag_multiple_delete, link_tag_document_list -) -from .menus import menu_tags -from .methods import method_document_get_tags -from .permissions import ( - permission_tag_attach, permission_tag_delete, permission_tag_edit, - permission_tag_remove, permission_tag_view -) -from .search import tag_search # NOQA -""" -#from mayan.apps.common.classes import Template -from mayan.apps.task_manager.classes import Worker - - -class PlatformTemplate(object): - _registry = {} - context = {} - - @classmethod - def all(cls): - return cls._registry.values() - - @classmethod - def get(cls, name): - return cls._registry[name] - - def __init__(self, name, template_name): - self.name = name - self.template_name = template_name - self.__class__._registry[name] = self - - def get_context(self): - return self.context - - def render(self): - from django.template import loader - return loader.render_to_string( - template_name=self.template_name, - context=self.get_context() - ) - - - -class PlatformTemplateSupervisord(PlatformTemplate): - def get_context(self): - return {'workers': Worker.all()} class PlatformApp(MayanAppConfig): @@ -91,11 +15,3 @@ class PlatformApp(MayanAppConfig): def ready(self): super(PlatformApp, self).ready() - - t = PlatformTemplateSupervisord( - name='platform_supervisord', - template_name='platform/supervisord.html' - ) - - print ("#@#@", t.render()) - print("!!!!", Worker.all()) diff --git a/mayan/apps/platform/classes.py b/mayan/apps/platform/classes.py index 8b13789179..5c89e855a0 100644 --- a/mayan/apps/platform/classes.py +++ b/mayan/apps/platform/classes.py @@ -1 +1,92 @@ +from __future__ import absolute_import, unicode_literals +import yaml +try: + from yaml import CSafeLoader as SafeLoader +except ImportError: + from yaml import SafeLoader + +from django.template import loader +from django.utils.encoding import force_text, python_2_unicode_compatible +from django.utils.translation import ugettext_lazy as _ + +from mayan.apps.task_manager.classes import Worker + + +@python_2_unicode_compatible +class PlatformTemplate(object): + _registry = {} + context = {} + label = None + template_name = None + + @classmethod + def all(cls): + return cls._registry.values() + + @classmethod + def get(cls, name): + return cls._registry[name] + + @classmethod + def register(cls, klass): + cls._registry[klass.name] = klass + + def __str__(self): + return force_text(self.get_label()) + + def get_context(self): + return self.context + + def get_label(self): + return self.label or self.name + + def get_template_name(self): + return self.template_name or 'platform/{}.tmpl'.format(self.name) + + def render(self, context_string=None): + context = self.get_context() + + if context_string: + context.update( + yaml.load( + stream=context_string, Loader=SafeLoader + ) + ) + return loader.render_to_string( + template_name=self.get_template_name(), + context=context + ) + + +class PlatformTemplateSupervisord(PlatformTemplate): + label = _('Template for Supervisord.') + name = 'supervisord' + + def get_context(self): + return { + 'gunicorn_workers': 2, + 'result_backend': 'redis://127.0.0.1:6379/0', + 'broker_url': 'redis://127.0.0.1:6379/0', + 'database_conn_max_age': 60, + 'database_engine': 'django.db.backends.postgresql', + 'database_host': '127.0.0.1', + 'database_name': 'mayan', + 'database_password': 'mayanuserpass', + 'database_user': 'mayan', + 'installation_path': '/opt/mayan-edms', + 'media_root': '/opt/mayan-edms/media', + 'workers': Worker.all() + } + + +class PlatformTemplateSupervisordDocker(PlatformTemplate): + label = _('Template for Supervisord inside a Docker image.') + name = 'supervisord_docker' + + def get_context(self): + return {'workers': Worker.all()} + + +PlatformTemplate.register(klass=PlatformTemplateSupervisord) +PlatformTemplate.register(klass=PlatformTemplateSupervisordDocker) diff --git a/mayan/apps/platform/locale/ar/LC_MESSAGES/django.po b/mayan/apps/platform/locale/ar/LC_MESSAGES/django.po new file mode 100644 index 0000000000..e024b7d093 --- /dev/null +++ b/mayan/apps/platform/locale/ar/LC_MESSAGES/django.po @@ -0,0 +1,32 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# FIRST AUTHOR , YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2019-05-13 03:58-0400\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"Language: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=6; plural=n==0 ? 0 : n==1 ? 1 : n==2 ? 2 : n%100>=3 " +"&& n%100<=10 ? 3 : n%100>=11 && n%100<=99 ? 4 : 5;\n" + +#: apps.py:14 +msgid "Platform" +msgstr "" + +#: classes.py:49 +msgid "Template for Supervisord." +msgstr "" + +#: classes.py:70 +msgid "Template for Supervisord inside a Docker image." +msgstr "" diff --git a/mayan/apps/platform/locale/bg/LC_MESSAGES/django.po b/mayan/apps/platform/locale/bg/LC_MESSAGES/django.po new file mode 100644 index 0000000000..2114053d6f --- /dev/null +++ b/mayan/apps/platform/locale/bg/LC_MESSAGES/django.po @@ -0,0 +1,31 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# FIRST AUTHOR , YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2019-05-13 03:58-0400\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"Language: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#: apps.py:14 +msgid "Platform" +msgstr "" + +#: classes.py:49 +msgid "Template for Supervisord." +msgstr "" + +#: classes.py:70 +msgid "Template for Supervisord inside a Docker image." +msgstr "" diff --git a/mayan/apps/platform/locale/bs_BA/LC_MESSAGES/django.po b/mayan/apps/platform/locale/bs_BA/LC_MESSAGES/django.po new file mode 100644 index 0000000000..715efc3d0a --- /dev/null +++ b/mayan/apps/platform/locale/bs_BA/LC_MESSAGES/django.po @@ -0,0 +1,30 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# FIRST AUTHOR , YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2019-05-13 03:58-0400\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"Language: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#: apps.py:14 +msgid "Platform" +msgstr "" + +#: classes.py:49 +msgid "Template for Supervisord." +msgstr "" + +#: classes.py:70 +msgid "Template for Supervisord inside a Docker image." +msgstr "" diff --git a/mayan/apps/platform/locale/cs/LC_MESSAGES/django.po b/mayan/apps/platform/locale/cs/LC_MESSAGES/django.po new file mode 100644 index 0000000000..ded6462242 --- /dev/null +++ b/mayan/apps/platform/locale/cs/LC_MESSAGES/django.po @@ -0,0 +1,31 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# FIRST AUTHOR , YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2019-05-13 03:58-0400\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"Language: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=3; plural=(n==1) ? 0 : (n>=2 && n<=4) ? 1 : 2;\n" + +#: apps.py:14 +msgid "Platform" +msgstr "" + +#: classes.py:49 +msgid "Template for Supervisord." +msgstr "" + +#: classes.py:70 +msgid "Template for Supervisord inside a Docker image." +msgstr "" diff --git a/mayan/apps/platform/locale/da_DK/LC_MESSAGES/django.po b/mayan/apps/platform/locale/da_DK/LC_MESSAGES/django.po new file mode 100644 index 0000000000..715efc3d0a --- /dev/null +++ b/mayan/apps/platform/locale/da_DK/LC_MESSAGES/django.po @@ -0,0 +1,30 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# FIRST AUTHOR , YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2019-05-13 03:58-0400\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"Language: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#: apps.py:14 +msgid "Platform" +msgstr "" + +#: classes.py:49 +msgid "Template for Supervisord." +msgstr "" + +#: classes.py:70 +msgid "Template for Supervisord inside a Docker image." +msgstr "" diff --git a/mayan/apps/platform/locale/de_DE/LC_MESSAGES/django.po b/mayan/apps/platform/locale/de_DE/LC_MESSAGES/django.po new file mode 100644 index 0000000000..715efc3d0a --- /dev/null +++ b/mayan/apps/platform/locale/de_DE/LC_MESSAGES/django.po @@ -0,0 +1,30 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# FIRST AUTHOR , YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2019-05-13 03:58-0400\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"Language: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#: apps.py:14 +msgid "Platform" +msgstr "" + +#: classes.py:49 +msgid "Template for Supervisord." +msgstr "" + +#: classes.py:70 +msgid "Template for Supervisord inside a Docker image." +msgstr "" diff --git a/mayan/apps/platform/locale/el/LC_MESSAGES/django.po b/mayan/apps/platform/locale/el/LC_MESSAGES/django.po new file mode 100644 index 0000000000..2114053d6f --- /dev/null +++ b/mayan/apps/platform/locale/el/LC_MESSAGES/django.po @@ -0,0 +1,31 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# FIRST AUTHOR , YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2019-05-13 03:58-0400\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"Language: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#: apps.py:14 +msgid "Platform" +msgstr "" + +#: classes.py:49 +msgid "Template for Supervisord." +msgstr "" + +#: classes.py:70 +msgid "Template for Supervisord inside a Docker image." +msgstr "" diff --git a/mayan/apps/platform/locale/en/LC_MESSAGES/django.po b/mayan/apps/platform/locale/en/LC_MESSAGES/django.po new file mode 100644 index 0000000000..715efc3d0a --- /dev/null +++ b/mayan/apps/platform/locale/en/LC_MESSAGES/django.po @@ -0,0 +1,30 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# FIRST AUTHOR , YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2019-05-13 03:58-0400\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"Language: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#: apps.py:14 +msgid "Platform" +msgstr "" + +#: classes.py:49 +msgid "Template for Supervisord." +msgstr "" + +#: classes.py:70 +msgid "Template for Supervisord inside a Docker image." +msgstr "" diff --git a/mayan/apps/platform/locale/es/LC_MESSAGES/django.po b/mayan/apps/platform/locale/es/LC_MESSAGES/django.po new file mode 100644 index 0000000000..2114053d6f --- /dev/null +++ b/mayan/apps/platform/locale/es/LC_MESSAGES/django.po @@ -0,0 +1,31 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# FIRST AUTHOR , YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2019-05-13 03:58-0400\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"Language: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#: apps.py:14 +msgid "Platform" +msgstr "" + +#: classes.py:49 +msgid "Template for Supervisord." +msgstr "" + +#: classes.py:70 +msgid "Template for Supervisord inside a Docker image." +msgstr "" diff --git a/mayan/apps/platform/locale/fa/LC_MESSAGES/django.po b/mayan/apps/platform/locale/fa/LC_MESSAGES/django.po new file mode 100644 index 0000000000..33b15ed2ae --- /dev/null +++ b/mayan/apps/platform/locale/fa/LC_MESSAGES/django.po @@ -0,0 +1,31 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# FIRST AUTHOR , YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2019-05-13 03:58-0400\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"Language: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=1; plural=0;\n" + +#: apps.py:14 +msgid "Platform" +msgstr "" + +#: classes.py:49 +msgid "Template for Supervisord." +msgstr "" + +#: classes.py:70 +msgid "Template for Supervisord inside a Docker image." +msgstr "" diff --git a/mayan/apps/platform/locale/fr/LC_MESSAGES/django.po b/mayan/apps/platform/locale/fr/LC_MESSAGES/django.po new file mode 100644 index 0000000000..85ff4302c5 --- /dev/null +++ b/mayan/apps/platform/locale/fr/LC_MESSAGES/django.po @@ -0,0 +1,31 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# FIRST AUTHOR , YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2019-05-13 03:58-0400\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"Language: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=(n > 1);\n" + +#: apps.py:14 +msgid "Platform" +msgstr "" + +#: classes.py:49 +msgid "Template for Supervisord." +msgstr "" + +#: classes.py:70 +msgid "Template for Supervisord inside a Docker image." +msgstr "" diff --git a/mayan/apps/platform/locale/hu/LC_MESSAGES/django.po b/mayan/apps/platform/locale/hu/LC_MESSAGES/django.po new file mode 100644 index 0000000000..2114053d6f --- /dev/null +++ b/mayan/apps/platform/locale/hu/LC_MESSAGES/django.po @@ -0,0 +1,31 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# FIRST AUTHOR , YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2019-05-13 03:58-0400\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"Language: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#: apps.py:14 +msgid "Platform" +msgstr "" + +#: classes.py:49 +msgid "Template for Supervisord." +msgstr "" + +#: classes.py:70 +msgid "Template for Supervisord inside a Docker image." +msgstr "" diff --git a/mayan/apps/platform/locale/id/LC_MESSAGES/django.po b/mayan/apps/platform/locale/id/LC_MESSAGES/django.po new file mode 100644 index 0000000000..33b15ed2ae --- /dev/null +++ b/mayan/apps/platform/locale/id/LC_MESSAGES/django.po @@ -0,0 +1,31 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# FIRST AUTHOR , YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2019-05-13 03:58-0400\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"Language: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=1; plural=0;\n" + +#: apps.py:14 +msgid "Platform" +msgstr "" + +#: classes.py:49 +msgid "Template for Supervisord." +msgstr "" + +#: classes.py:70 +msgid "Template for Supervisord inside a Docker image." +msgstr "" diff --git a/mayan/apps/platform/locale/it/LC_MESSAGES/django.po b/mayan/apps/platform/locale/it/LC_MESSAGES/django.po new file mode 100644 index 0000000000..2114053d6f --- /dev/null +++ b/mayan/apps/platform/locale/it/LC_MESSAGES/django.po @@ -0,0 +1,31 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# FIRST AUTHOR , YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2019-05-13 03:58-0400\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"Language: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#: apps.py:14 +msgid "Platform" +msgstr "" + +#: classes.py:49 +msgid "Template for Supervisord." +msgstr "" + +#: classes.py:70 +msgid "Template for Supervisord inside a Docker image." +msgstr "" diff --git a/mayan/apps/platform/locale/nl_NL/LC_MESSAGES/django.po b/mayan/apps/platform/locale/nl_NL/LC_MESSAGES/django.po new file mode 100644 index 0000000000..715efc3d0a --- /dev/null +++ b/mayan/apps/platform/locale/nl_NL/LC_MESSAGES/django.po @@ -0,0 +1,30 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# FIRST AUTHOR , YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2019-05-13 03:58-0400\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"Language: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#: apps.py:14 +msgid "Platform" +msgstr "" + +#: classes.py:49 +msgid "Template for Supervisord." +msgstr "" + +#: classes.py:70 +msgid "Template for Supervisord inside a Docker image." +msgstr "" diff --git a/mayan/apps/platform/locale/pl/LC_MESSAGES/django.po b/mayan/apps/platform/locale/pl/LC_MESSAGES/django.po new file mode 100644 index 0000000000..7ce9fbf002 --- /dev/null +++ b/mayan/apps/platform/locale/pl/LC_MESSAGES/django.po @@ -0,0 +1,33 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# FIRST AUTHOR , YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2019-05-13 03:58-0400\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"Language: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=4; plural=(n==1 ? 0 : (n%10>=2 && n%10<=4) && (n" +"%100<12 || n%100>=14) ? 1 : n!=1 && (n%10>=0 && n%10<=1) || (n%10>=5 && n" +"%10<=9) || (n%100>=12 && n%100<=14) ? 2 : 3);\n" + +#: apps.py:14 +msgid "Platform" +msgstr "" + +#: classes.py:49 +msgid "Template for Supervisord." +msgstr "" + +#: classes.py:70 +msgid "Template for Supervisord inside a Docker image." +msgstr "" diff --git a/mayan/apps/platform/locale/pt/LC_MESSAGES/django.po b/mayan/apps/platform/locale/pt/LC_MESSAGES/django.po new file mode 100644 index 0000000000..2114053d6f --- /dev/null +++ b/mayan/apps/platform/locale/pt/LC_MESSAGES/django.po @@ -0,0 +1,31 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# FIRST AUTHOR , YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2019-05-13 03:58-0400\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"Language: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#: apps.py:14 +msgid "Platform" +msgstr "" + +#: classes.py:49 +msgid "Template for Supervisord." +msgstr "" + +#: classes.py:70 +msgid "Template for Supervisord inside a Docker image." +msgstr "" diff --git a/mayan/apps/platform/locale/pt_BR/LC_MESSAGES/django.po b/mayan/apps/platform/locale/pt_BR/LC_MESSAGES/django.po new file mode 100644 index 0000000000..85ff4302c5 --- /dev/null +++ b/mayan/apps/platform/locale/pt_BR/LC_MESSAGES/django.po @@ -0,0 +1,31 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# FIRST AUTHOR , YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2019-05-13 03:58-0400\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"Language: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=(n > 1);\n" + +#: apps.py:14 +msgid "Platform" +msgstr "" + +#: classes.py:49 +msgid "Template for Supervisord." +msgstr "" + +#: classes.py:70 +msgid "Template for Supervisord inside a Docker image." +msgstr "" diff --git a/mayan/apps/platform/locale/ro_RO/LC_MESSAGES/django.po b/mayan/apps/platform/locale/ro_RO/LC_MESSAGES/django.po new file mode 100644 index 0000000000..715efc3d0a --- /dev/null +++ b/mayan/apps/platform/locale/ro_RO/LC_MESSAGES/django.po @@ -0,0 +1,30 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# FIRST AUTHOR , YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2019-05-13 03:58-0400\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"Language: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#: apps.py:14 +msgid "Platform" +msgstr "" + +#: classes.py:49 +msgid "Template for Supervisord." +msgstr "" + +#: classes.py:70 +msgid "Template for Supervisord inside a Docker image." +msgstr "" diff --git a/mayan/apps/platform/locale/ru/LC_MESSAGES/django.po b/mayan/apps/platform/locale/ru/LC_MESSAGES/django.po new file mode 100644 index 0000000000..b39f23e2a3 --- /dev/null +++ b/mayan/apps/platform/locale/ru/LC_MESSAGES/django.po @@ -0,0 +1,33 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# FIRST AUTHOR , YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2019-05-13 03:58-0400\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"Language: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=4; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n" +"%10<=4 && (n%100<12 || n%100>14) ? 1 : n%10==0 || (n%10>=5 && n%10<=9) || (n" +"%100>=11 && n%100<=14)? 2 : 3);\n" + +#: apps.py:14 +msgid "Platform" +msgstr "" + +#: classes.py:49 +msgid "Template for Supervisord." +msgstr "" + +#: classes.py:70 +msgid "Template for Supervisord inside a Docker image." +msgstr "" diff --git a/mayan/apps/platform/locale/sl_SI/LC_MESSAGES/django.po b/mayan/apps/platform/locale/sl_SI/LC_MESSAGES/django.po new file mode 100644 index 0000000000..715efc3d0a --- /dev/null +++ b/mayan/apps/platform/locale/sl_SI/LC_MESSAGES/django.po @@ -0,0 +1,30 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# FIRST AUTHOR , YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2019-05-13 03:58-0400\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"Language: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#: apps.py:14 +msgid "Platform" +msgstr "" + +#: classes.py:49 +msgid "Template for Supervisord." +msgstr "" + +#: classes.py:70 +msgid "Template for Supervisord inside a Docker image." +msgstr "" diff --git a/mayan/apps/platform/locale/tr_TR/LC_MESSAGES/django.po b/mayan/apps/platform/locale/tr_TR/LC_MESSAGES/django.po new file mode 100644 index 0000000000..715efc3d0a --- /dev/null +++ b/mayan/apps/platform/locale/tr_TR/LC_MESSAGES/django.po @@ -0,0 +1,30 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# FIRST AUTHOR , YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2019-05-13 03:58-0400\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"Language: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#: apps.py:14 +msgid "Platform" +msgstr "" + +#: classes.py:49 +msgid "Template for Supervisord." +msgstr "" + +#: classes.py:70 +msgid "Template for Supervisord inside a Docker image." +msgstr "" diff --git a/mayan/apps/platform/locale/vi_VN/LC_MESSAGES/django.po b/mayan/apps/platform/locale/vi_VN/LC_MESSAGES/django.po new file mode 100644 index 0000000000..715efc3d0a --- /dev/null +++ b/mayan/apps/platform/locale/vi_VN/LC_MESSAGES/django.po @@ -0,0 +1,30 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# FIRST AUTHOR , YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2019-05-13 03:58-0400\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"Language: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#: apps.py:14 +msgid "Platform" +msgstr "" + +#: classes.py:49 +msgid "Template for Supervisord." +msgstr "" + +#: classes.py:70 +msgid "Template for Supervisord inside a Docker image." +msgstr "" diff --git a/mayan/apps/platform/locale/zh/LC_MESSAGES/django.po b/mayan/apps/platform/locale/zh/LC_MESSAGES/django.po new file mode 100644 index 0000000000..715efc3d0a --- /dev/null +++ b/mayan/apps/platform/locale/zh/LC_MESSAGES/django.po @@ -0,0 +1,30 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# FIRST AUTHOR , YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2019-05-13 03:58-0400\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"Language: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#: apps.py:14 +msgid "Platform" +msgstr "" + +#: classes.py:49 +msgid "Template for Supervisord." +msgstr "" + +#: classes.py:70 +msgid "Template for Supervisord inside a Docker image." +msgstr "" diff --git a/mayan/apps/platform/management/__init__.py b/mayan/apps/platform/management/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/mayan/apps/platform/management/commands/__init__.py b/mayan/apps/platform/management/commands/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/mayan/apps/platform/management/commands/platformtemplate.py b/mayan/apps/platform/management/commands/platformtemplate.py new file mode 100644 index 0000000000..f76fcc8c7e --- /dev/null +++ b/mayan/apps/platform/management/commands/platformtemplate.py @@ -0,0 +1,44 @@ +from __future__ import unicode_literals + +from django.core import management + +from ...classes import PlatformTemplate + + +class Command(management.BaseCommand): + help = 'Render a platform configuration template.' + + def add_arguments(self, parser): + parser.add_argument('name', nargs='?', help='Template name') + parser.add_argument( + '--list', action='store_true', dest='list', + help='Show a list of available templates.', + ) + parser.add_argument( + '--context', action='store', default='', dest='context', + help='Show a list of available templates.', + ) + + def handle(self, *args, **options): + if options.get('list'): + self.stdout.write('\nAvailable platform templates.') + self.stdout.write('----') + for template_class in PlatformTemplate.all(): + template = template_class() + self.stdout.write( + '* {}\t{}'.format(template.name, template.get_label()) + ) + + self.stdout.write('\n') + else: + try: + template = PlatformTemplate.get(name=options['name']) + except KeyError: + self.stderr.write( + 'Unknown template "{}".'.format(options['name']) + ) + exit(1) + else: + self.stdout.write(template().render( + context_string=options.get('context')) + ) diff --git a/mayan/apps/platform/templates/platform/supervisord.tmpl b/mayan/apps/platform/templates/platform/supervisord.tmpl new file mode 100644 index 0000000000..8d54ad6c33 --- /dev/null +++ b/mayan/apps/platform/templates/platform/supervisord.tmpl @@ -0,0 +1,44 @@ +[supervisord] +environment= + MAYAN_ALLOWED_HOSTS='["*"]', # Allow access to other network hosts other than localhost + MAYAN_CELERY_RESULT_BACKEND="{{ result_backend }}", + MAYAN_BROKER_URL="{{ broker_url }}", + PYTHONPATH={{ installation_path }}/lib/python2.7/site-packages:{{ media_root }}/mayan_settings, + MAYAN_MEDIA_ROOT={{ media_root }}, + MAYAN_DATABASE_ENGINE={{ database_engine }}, + MAYAN_DATABASE_HOST={{ database_host }}, + MAYAN_DATABASE_NAME={{ database_name }}, + MAYAN_DATABASE_PASSWORD={{ database_password }}, + MAYAN_DATABASE_USER={{ database_user }}, + MAYAN_DATABASE_CONN_MAX_AGE={{ database_conn_max_age }}, + DJANGO_SETTINGS_MODULE=mayan.settings.production + +[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 +user = mayan + +{% for worker in workers %} +[program:mayan-worker-{{ worker.name }}] +autorestart = true +autostart = true +command = nice -n {{ worker.nice_level }} {{ installation_path }}/bin/mayan-edms.py celery worker -Ofair -l ERROR -Q {% for queue in worker.queues %}{{ queue.name }}{% if not forloop.last %},{% endif %}{% endfor %} -n mayan-worker-{{ worker.name }}.%%h --concurrency=1 +killasgroup = true +numprocs = 1 +priority = 998 +startsecs = 10 +stopwaitsecs = 1 +user = mayan +{% endfor %} + +[program:mayan-celery-beat] +autorestart = true +autostart = true +command = nice -n 1 {{ installation_path }}/bin/mayan-edms.py celery beat -l ERROR +killasgroup = true +numprocs = 1 +priority = 998 +startsecs = 10 +stopwaitsecs = 1 +user = mayan diff --git a/mayan/apps/platform/templates/platform/supervisord.html b/mayan/apps/platform/templates/platform/supervisord_docker.tmpl similarity index 91% rename from mayan/apps/platform/templates/platform/supervisord.html rename to mayan/apps/platform/templates/platform/supervisord_docker.tmpl index d11cf3cdc6..3e04c50136 100644 --- a/mayan/apps/platform/templates/platform/supervisord.html +++ b/mayan/apps/platform/templates/platform/supervisord_docker.tmpl @@ -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 120 redirect_stderr = true stderr_logfile = /dev/fd/2 stderr_logfile_maxbytes = 0 @@ -39,7 +39,7 @@ user = mayan [program:mayan-celery-beat] autorestart = false autostart = true -command = nice -n 1 /bin/bash -c "${MAYAN_BIN} celery --settings=${MAYAN_SETTINGS_MODULE} beat --pidfile= -l ERROR" +command = nice -n 1 /bin/bash -c "${MAYAN_BIN} celery --settings=${MAYAN_SETTINGS_MODULE} beat -l ERROR" killasgroup = true numprocs = 1 priority = 998 diff --git a/mayan/apps/task_manager/classes.py b/mayan/apps/task_manager/classes.py index e36f1ef342..40f90a739a 100644 --- a/mayan/apps/task_manager/classes.py +++ b/mayan/apps/task_manager/classes.py @@ -10,7 +10,6 @@ from celery.five import monotonic from celery.task.control import inspect from django.apps import apps - from django.utils.encoding import force_text, python_2_unicode_compatible from django.utils.timezone import now diff --git a/mayan/settings/base.py b/mayan/settings/base.py index 42a5677fd6..6ac588b982 100644 --- a/mayan/settings/base.py +++ b/mayan/settings/base.py @@ -101,8 +101,13 @@ INSTALLED_APPS = ( 'mayan.apps.mimetype', 'mayan.apps.navigation', 'mayan.apps.permissions', + 'mayan.apps.platform', + 'mayan.apps.rest_api', 'mayan.apps.smart_settings', + 'mayan.apps.task_manager', 'mayan.apps.user_management', + # Project apps + 'mayan.apps.motd', # Document apps 'mayan.apps.cabinets', 'mayan.apps.checkouts', @@ -118,13 +123,10 @@ INSTALLED_APPS = ( 'mayan.apps.mayan_statistics', 'mayan.apps.metadata', 'mayan.apps.mirroring', - 'mayan.apps.motd', 'mayan.apps.ocr', - 'mayan.apps.rest_api', 'mayan.apps.sources', 'mayan.apps.storage', 'mayan.apps.tags', - 'mayan.apps.task_manager', # Placed after rest_api to allow template overriding 'drf_yasg', )