Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Accessibility and SEO Improvements for Mayan EDMS #19

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
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
12 changes: 12 additions & 0 deletions .env
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Use this file to pass variables to Docker Compose to change how the
# docker-compose.yml file is interpreted.

# To pass values as environment variables to the running containers use
# the env_file instead.

# MAYAN_DOCKER_IMAGE_NAME=mayanedms/mayanedms
# MAYAN_DOCKER_IMAGE_TAG=s4.0

# Enable to use the RabbitMQ image with the management plugin.
# Also port mapping 15672:15672 in docker-compose file.
# MAYAN_DOCKER_RABBITMQ_TAG=3.8-management-alpine
222 changes: 222 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,222 @@
version: '3.9'

x-mayan-container:
&mayan-container
depends_on:
- postgresql
- redis
# Enable to use RabbitMQ
#- rabbitmq
env_file: env_file
environment:
# 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
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}'}}"
MAYAN_DOCKER_WAIT: "${MAYAN_DATABASE_HOST:-postgresql}:5432 redis:6379"
MAYAN_LOCK_MANAGER_BACKEND: mayan.apps.lock_manager.backends.redis_lock.RedisLock
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:-4.0.15}
networks:
- bridge
restart: unless-stopped
volumes:
- ${MAYAN_APP_VOLUME:-app}:/var/lib/mayan
# Optional volumes to access external data like staging or watch folders
# - /opt/staging_files:/staging_files
# - /opt/watch_folder:/watch_folder

networks:
bridge:
driver: bridge

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"

postgresql:
command:
- "postgres"
- "-c"
- "checkpoint_completion_target=0.6"
- "-c"
- "default_statistics_target=200"
- "-c"
- "maintenance_work_mem=128MB"
- "-c"
- "max_connections=200"
- "-c"
- "shared_buffers=256MB"
- "-c"
- "work_mem=8MB"
environment:
POSTGRES_DB: ${MAYAN_DATABASE_NAME:-mayan}
POSTGRES_PASSWORD: ${MAYAN_DATABASE_PASSWORD:-mayandbpass}
POSTGRES_USER: ${MAYAN_DATABASE_USER:-mayan}
image: postgres:${MAYAN_DOCKER_POSTGRES_TAG:-10.15-alpine}
networks:
- bridge
# Disable to allow external access to the database.
# ports:
# - "5432:5432"
restart: unless-stopped
volumes:
- ${MAYAN_POSTGRES_VOLUME:-postgres}:/var/lib/postgresql/data

redis:
command:
- redis-server
- --appendonly
- "no"
- --databases
- "3"
- --maxmemory
- "100mb"
- --maxclients
- "500"
- --maxmemory-policy
- "allkeys-lru"
- --save
- ""
- --tcp-backlog
- "256"
- --requirepass
- "${MAYAN_REDIS_PASSWORD:-mayanredispassword}"
image: redis:${MAYAN_DOCKER_REDIS_TAG:-6.0-alpine}
networks:
- bridge
restart: unless-stopped
volumes:
- ${MAYAN_REDIS_VOLUME:-redis}:/data

# Celery flower a monitor for Celery
celery_flower:
<<: *mayan-container
command:
- run_celery
- flower
ports:
- "5555:5555"
profiles:
- celery_flower

# Run a frontend gunicorn container
frontend:
<<: *mayan-container
command:
- run_worker
- fast
ports:
- "81:8000"
profiles:
- extra_frontend

# Enable to run standalone workers
mountindex:
<<: *mayan-container
cap_add:
- SYS_ADMIN
devices:
- "/dev/fuse:/dev/fuse"
entrypoint:
- /bin/sh
- -c
- 'mkdir --parents /mnt/index && chown mayan:mayan /mnt/index && /usr/local/bin/entrypoint.sh run_command "mountindex --allow-other creation_date /mnt/index"' # Replace "creation_date" with the index of your choice.
profiles:
- mountindex
security_opt:
- apparmor:unconfined
volumes:
- type: bind
source: /mnt/mayan_indexes/creation_date # Host location where the index will show up.
target: /mnt/index # Location inside the container where the index will be mounted. Must the same is in the "entrypoint" section.
bind:
propagation: shared

# Run a separate class A worker
worker_a:
<<: *mayan-container
command:
- run_worker
- worker_a
profiles:
- extra_worker_a

# Run a separate class B worker
worker_b:
<<: *mayan-container
command:
- run_worker
- worker_b
profiles:
- extra_worker_b

# Run a separate class C worker
worker_c:
<<: *mayan-container
command:
- run_worker
- worker_c
profiles:
- extra_worker_c

# Run a separate class D worker
worker_d:
<<: *mayan-container
command:
- run_worker
- worker_d
profiles:
- extra_worker_d

# Optional services

traefik:
container_name: "traefik"
command:
#- "--log.level=DEBUG"
- "--api.insecure=true"
- "--providers.docker=true"
- "--providers.docker.exposedbydefault=false"
- "--entrypoints.web.address=:80"
image: "traefik:v2.4"
ports:
- "80:80"
- "8080:8080"
profiles:
- traefik
volumes:
- /var/run/docker.sock:/var/run/docker.sock:ro

# Enable to use RabbitMQ
# rabbitmq:
# image: rabbitmq:${MAYAN_DOCKER_RABBITMQ_TAG:-3.8-alpine}
# environment:
# RABBITMQ_DEFAULT_USER: ${MAYAN_RABBITMQ_USER:-mayan}
# RABBITMQ_DEFAULT_PASS: ${MAYAN_RABBITMQ_PASSWORD:-mayanrabbitpass}
# RABBITMQ_DEFAULT_VHOST: ${MAYAN_RABBITMQ_VHOST:-mayan}
# networks:
# - bridge
# ports:
# - "15672:15672"
# restart: unless-stopped
# volumes:
# - ${MAYAN_RABBITMQ_VOLUME:-rabbitmq}:/var/lib/rabbitmq

volumes:
app:
postgres:
mountindex:
rabbitmq:
redis:
2 changes: 1 addition & 1 deletion docker/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ 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.15}
networks:
- bridge
restart: unless-stopped
Expand Down
30 changes: 30 additions & 0 deletions env_file
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# Use this file to set environment variables for the running containers

# To change how the docker-compose file is interpreted use the .env file
# instead.

# Default project name. Change this using the docker-compose `-p, --project-name NAME` option.
COMPOSE_PROJECT_NAME=mayan

# To use block storage.
# MAYAN_PIP_INSTALLS="django-storages==1.10 boto3==1.14.58"
# MAYAN_DOCUMENTS_STORAGE_BACKEND="storages.backends.s3boto3.S3Boto3Storage"
# MAYAN_DOCUMENTS_STORAGE_BACKEND_ARGUMENTS="{'access_key':'<access key>','secret_key':'<secret key>','bucket_name':'mayan','endpoint_url':'http://<URL:port>','verify':'False'}" # 'verify':'False' for local servers with self signed SSL certificate

# To add Debian package, like LDAP.
# MAYAN_APT_INSTALLS="<Debian package names>"

# To add operating system packages, like additional OCR language,
# packages, put then in the variable below.
# MAYAN_APT_INSTALLS="tesseract-ocr-deu tesseract-ocr-nld"

# To use LDAP authentication.
# Create a folder named `user_settings` in the `media` folder.
# Copy the file `contrib/settings/ldap_connection_settings.py` from the online
# repository and place in the new `user_settings` folder.
# Edit the `user_settings/ldap_connection_settings' file to work with your
# LDAP server.
# Example: https://django-auth-ldap.readthedocs.io/en/latest/example.html
# Enable the following environment variables and restart the stack.
# MAYAN_PIP_INSTALLS="python-ldap django_auth_ldap"
# MAYAN_APT_INSTALLS="gcc libldap2-dev/buster-backports libsasl2-dev python3-dev"
5 changes: 3 additions & 2 deletions mayan/apps/appearance/templates/appearance/base_plain.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,15 @@
<meta content="width=device-width, initial-scale=1, maximum-scale=5" name="viewport">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="Content-Language" content="{{ LANGUAGE_CODE }}" />
<title>
<meta name="description" content="Mayan EDMS is an open source and free to use Database Management System"/>
<title>
{% block base_title %}
{% block title %}{% endblock %} :: {% block project_name %} {% smart_setting 'COMMON_PROJECT_TITLE' as setting_project_title %}{% endblock %}
{% endblock base_title %}
</title>

<link href="{% static 'appearance/node_modules/@fortawesome/fontawesome-free/css/all.min.css' %}" media="screen" rel="stylesheet" type="text/css" />
<link href="{% static 'appearance/node_modules/bootswatch/flatly/bootstrap.min.css' %}" media="screen" rel="stylesheet" type="text/css" />
<link href="{% static 'appearance/node_modules/bootswatch/darkly/bootstrap.min.css' %}" media="screen" rel="stylesheet" type="text/css" />
<link href="{% static 'appearance/css/base.css' %}" media="screen" rel="stylesheet" type="text/css" />
{% block stylesheets %}{% endblock %}

Expand Down
5 changes: 3 additions & 2 deletions mayan/apps/appearance/templates/appearance/root.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,15 @@
<meta content="width=device-width, initial-scale=1, maximum-scale=5" name="viewport">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="Content-Language" content="{{ LANGUAGE_CODE }}" />
<title>
<meta name="description" content="Mayan EDMS is an open source and free to use Database Management System"/>
<title>
{% block base_title %}
{% block title %}{% endblock %} :: {% block project_name %}{% smart_setting 'COMMON_PROJECT_TITLE' %}{% endblock %}
{% endblock base_title %}
</title>

<link href="{% static 'appearance/node_modules/@fortawesome/fontawesome-free/css/all.min.css' %}" media="screen" rel="stylesheet" type="text/css" />
<link href="{% static 'appearance/node_modules/bootswatch/flatly/bootstrap.min.css' %}" media="screen" rel="stylesheet" type="text/css" />
<link href="{% static 'appearance/node_modules/bootswatch/darkly/bootstrap.min.css' %}" media="screen" rel="stylesheet" type="text/css" />
<link href="{% static 'appearance/node_modules/@fancyapps/fancybox/dist/jquery.fancybox.min.css' %}" media="screen" rel="stylesheet" type="text/css" />
<link href="{% static 'appearance/node_modules/select2/dist/css/select2.min.css' %}" media="screen" rel="stylesheet" type="text/css" />
<link href="{% static 'appearance/node_modules/toastr/build/toastr.min.css' %}" media="screen" rel="stylesheet" type="text/css" />
Expand Down