Skip to content

Commit

Permalink
Merge CMU-313 Fall 2020 with Mayan v4.0.7
Browse files Browse the repository at this point in the history
  • Loading branch information
rohanpadhye committed Aug 24, 2021
2 parents f1d147d + 1a1b00c commit d1394c1
Show file tree
Hide file tree
Showing 8 changed files with 20 additions and 16 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,4 @@ docs/_templates/layout.html
docs/_templates/footer.html
gitlab-ci-volume/
.DS_Store
data/
4 changes: 3 additions & 1 deletion docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ apt-get update \
libmagic1 \
libmariadb3 \
libpq5 \
procps \
poppler-utils \
python3-distutils \
sane-utils \
Expand Down Expand Up @@ -124,6 +125,7 @@ apt-get install -y --no-install-recommends \
python3-dev \
python3-venv \
zlib1g-dev \
procps \
&& mkdir -p "${PROJECT_INSTALL_DIR}" \
&& chown -R mayan:mayan "${PROJECT_INSTALL_DIR}" \
&& chown -R mayan:mayan /src
Expand Down Expand Up @@ -156,7 +158,7 @@ RUN set -a \
&& pip install --no-cache-dir dist/mayan_edms-*.whl \
# Install the static content.
&& mayan-edms.py installdependencies \
&& MAYAN_STATIC_ROOT=${PROJECT_INSTALL_DIR}static mayan-edms.py preparestatic --link --noinput
&& MAYAN_STATIC_ROOT=${PROJECT_INSTALL_DIR}static mayan-edms.py preparestatic --noinput

COPY --chown=mayan:mayan requirements/testing-base.txt "${PROJECT_INSTALL_DIR}"

Expand Down
16 changes: 7 additions & 9 deletions docker/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ x-mayan-container:
# Enable to use RabbitMQ
# MAYAN_CELERY_BROKER_URL: amqp://${MAYAN_RABBITMQ_USER:-mayan}:${MAYAN_RABBITMQ_PASSWORD:-mayanrabbitpass}@rabbitmq:5672/${MAYAN_RABBITMQ_VHOST:-mayan}
# To use RabbitMQ as broker, disable Redis as broker
PYTHONDONTWRITEBYTECODE: 1
MAYAN_CELERY_BROKER_URL: redis://:${MAYAN_REDIS_PASSWORD:-mayanredispassword}@redis:6379/0
MAYAN_CELERY_RESULT_BACKEND: redis://:${MAYAN_REDIS_PASSWORD:-mayanredispassword}@redis:6379/1
MAYAN_DATABASES: "{'default':{'ENGINE':'django.db.backends.postgresql','NAME':'${MAYAN_DATABASE_NAME:-mayan}','PASSWORD':'${MAYAN_DATABASE_PASSWORD:-mayandbpass}','USER':'${MAYAN_DATABASE_USER:-mayan}','HOST':'${MAYAN_DATABASE_HOST:-postgresql}'}}"
Expand All @@ -20,12 +21,14 @@ x-mayan-container:
MAYAN_LOCK_MANAGER_BACKEND_ARGUMENTS: "{'redis_url':'redis://:${MAYAN_REDIS_PASSWORD:-mayanredispassword}@redis:6379/2'}"
# Replace with the line below when using RabbitMQ
# MAYAN_DOCKER_WAIT: "${MAYAN_DATABASE_HOST:-postgresql}:5432 redis:6379 rabbitmq:5672"
image: ${MAYAN_DOCKER_IMAGE_NAME:-mayanedms/mayanedms}:${MAYAN_DOCKER_IMAGE_TAG:-s4.0}
image: ${MAYAN_DOCKER_IMAGE_NAME:-mayanedms/mayanedms}:${MAYAN_DOCKER_IMAGE_TAG:-4.0.7}
networks:
- bridge
restart: unless-stopped
volumes:
- ${MAYAN_APP_VOLUME:-app}:/var/lib/mayan
- ${PWD}/data/app:/var/lib/mayan
- ${PWD}/mayan/apps/appearance/static/appearance/css:/opt/mayan-edms/static/appearance/css
- ${PWD}/mayan:/opt/mayan-edms/lib/python3.7/site-packages/mayan
# Optional volumes to access external data like staging or watch folders
# - /opt/staging_files:/staging_files
# - /opt/watch_folder:/watch_folder
Expand All @@ -37,11 +40,6 @@ networks:
services:
app:
<<: *mayan-container
labels:
- "traefik.enable=true"
- "traefik.http.routers.app.rule=Host(`www.example.com`)" # Replace this with your published URL
- "traefik.http.routers.mayan.rule=Host(`mayan.app`)"
- "traefik.http.routers.mayan.entrypoints=web"
ports:
- "80:8000"

Expand Down Expand Up @@ -72,7 +70,7 @@ services:
# - "5432:5432"
restart: unless-stopped
volumes:
- ${MAYAN_POSTGRES_VOLUME:-postgres}:/var/lib/postgresql/data
- ${PWD}/data/postgres:/var/lib/postgresql/data

redis:
command:
Expand All @@ -98,7 +96,7 @@ services:
- bridge
restart: unless-stopped
volumes:
- ${MAYAN_REDIS_VOLUME:-redis}:/data
- ${PWD}/data/redis:/data

# Celery flower a monitor for Celery
celery_flower:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@ export MAYAN_BIN=/opt/mayan-edms/bin/mayan-edms.py
export MAYAN_INSTALL_DIR=/opt/mayan-edms
export MAYAN_PYTHON_BIN_DIR=/opt/mayan-edms/bin/
export MAYAN_MEDIA_ROOT=/var/lib/mayan
export MAYAN_SETTINGS_MODULE=${MAYAN_SETTINGS_MODULE:-mayan.settings.production}
export MAYAN_SETTINGS_MODULE=${MAYAN_SETTINGS_MODULE:-mayan.settings.development}

export PYTHONDONTWRITEBYTECODE=1

# Set DJANGO_SETTINGS_MODULE to MAYAN_SETTINGS_MODULE to avoid two
# different environments for the setting file.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[program:mayan-edms-gunicorn]
autorestart = false
autostart = true
command = /bin/bash -c "${MAYAN_GUNICORN_BIN} --workers ${MAYAN_GUNICORN_WORKERS} ${MAYAN_GUNICORN_TEMPORARY_DIRECTORY} mayan.wsgi --max-requests ${MAYAN_GUNICORN_MAX_REQUESTS} --max-requests-jitter ${MAYAN_GUNICORN_JITTER} --worker-class ${MAYAN_GUNICORN_WORKER_CLASS} --bind 0.0.0.0:8000 --env DJANGO_SETTINGS_MODULE=${MAYAN_SETTINGS_MODULE} --timeout ${MAYAN_GUNICORN_TIMEOUT} --limit-request-line ${MAYAN_GUNICORN_LIMIT_REQUEST_LINE}"
command = /bin/bash -c "${MAYAN_GUNICORN_BIN} --workers ${MAYAN_GUNICORN_WORKERS} ${MAYAN_GUNICORN_TEMPORARY_DIRECTORY} mayan.wsgi --max-requests ${MAYAN_GUNICORN_MAX_REQUESTS} --max-requests-jitter ${MAYAN_GUNICORN_JITTER} --worker-class ${MAYAN_GUNICORN_WORKER_CLASS} --bind 0.0.0.0:8000 --env DJANGO_SETTINGS_MODULE=${MAYAN_SETTINGS_MODULE} --timeout ${MAYAN_GUNICORN_TIMEOUT} --limit-request-line ${MAYAN_GUNICORN_LIMIT_REQUEST_LINE} --reload"
redirect_stderr = true
stderr_logfile = /dev/fd/2
stderr_logfile_maxbytes = 0
Expand Down
5 changes: 3 additions & 2 deletions mayan/apps/platform/templates/platform/supervisord.tmpl
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
[supervisord]
environment=
PYTHONPATH="{{ MEDIA_ROOT }}{{ USER_SETTINGS_FOLDER }}",
DJANGO_SETTINGS_MODULE=mayan.settings.production,
DJANGO_SETTINGS_MODULE=mayan.settings.development,
MAYAN_ALLOWED_HOSTS='["*"]',
MAYAN_MEDIA_ROOT="{{ MEDIA_ROOT }}"
PYTHONDONTWRITEBYTECODE=1

[program:mayan-edms-gunicorn]
autorestart = true
autostart = true
command = {{ INSTALLATION_PATH }}bin/gunicorn --workers {{ GUNICORN_WORKERS }} mayan.wsgi --max-requests {{ GUNICORN_MAX_REQUESTS }} --max-requests-jitter {{ GUNICORN_JITTER }} --worker-class {{ GUNICORN_WORKER_CLASS }} --bind 0.0.0.0:8000 --timeout {{ GUNICORN_TIMEOUT }} --limit-request-line {{ GUNICORN_LIMIT_REQUEST_LINE }}
command = {{ INSTALLATION_PATH }}bin/gunicorn --workers {{ GUNICORN_WORKERS }} mayan.wsgi --max-requests {{ GUNICORN_MAX_REQUESTS }} --max-requests-jitter {{ GUNICORN_JITTER }} --worker-class {{ GUNICORN_WORKER_CLASS }} --bind 0.0.0.0:8000 --timeout {{ GUNICORN_TIMEOUT }} --limit-request-line {{ GUNICORN_LIMIT_REQUEST_LINE }} --reload
user = mayan
{% for worker in workers %}
[program:mayan-edms-{{ worker.name }}]
Expand Down
2 changes: 1 addition & 1 deletion mayan/settings/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@
'mayan.apps.views.finders.MayanAppDirectoriesFinder'
)

STATICFILES_STORAGE = 'whitenoise.storage.CompressedManifestStaticFilesStorage'
STATICFILES_STORAGE = 'whitenoise.storage.StaticFilesStorage'

TEST_RUNNER = 'mayan.apps.testing.runner.MayanTestRunner'

Expand Down
2 changes: 1 addition & 1 deletion mayan/settings/testing/development.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from .base import * # NOQA

DEBUG = False
DEBUG = True
SIGNATURES_GPG_PATH = '/usr/bin/gpg1'

0 comments on commit d1394c1

Please sign in to comment.