Compare commits

..

89 Commits

Author SHA1 Message Date
Roberto Rosario
971d643759 Merge branch 'feature/multi-tenant' of gitlab.com:mayan-edms/mayan-edms into feature/multi-tenant 2016-06-13 03:14:24 -04:00
Roberto Rosario
ba493cf984 Update document_states app to support organizations. 2016-06-10 19:59:09 -04:00
Roberto Rosario
9ffcfeb49b Use simple password hasher to speed up tests.
Before: Ran 346 tests in 156.928s
After: Ran 346 tests in 144.324s
2016-06-08 19:30:45 -04:00
Roberto Rosario
41f68cf435 Remove unused import. 2016-06-08 19:30:34 -04:00
Roberto Rosario
072bfcf2aa Use organization manager. 2016-06-08 19:30:20 -04:00
Roberto Rosario
6a258e4a02 Remove remarked imports. 2016-06-08 19:30:04 -04:00
Roberto Rosario
59fbe2d409 Turn on all warnings when running tests. 2016-06-08 19:29:45 -04:00
Roberto Rosario
aa0f48b1a0 Update OCR app to use organizations. 2016-06-08 19:29:20 -04:00
Roberto Rosario
a2f8e8b8d8 Finish updating checkouts app to support organizations. 2016-06-08 16:58:57 -04:00
Roberto Rosario
7ae0917564 Fix document app tests. 2016-06-08 02:02:25 -04:00
Roberto Rosario
ff30268a4b Fix folder api tests. 2016-06-08 01:59:32 -04:00
Roberto Rosario
5466dcdad3 Convert metadata app to use organizations. 2016-06-08 01:37:15 -04:00
Roberto Rosario
2035602836 Make the organization and rest api tests cleaner to import from other modules. 2016-06-08 01:26:01 -04:00
Roberto Rosario
326919271a Merge branch 'development' into feature/multi-tenant 2016-06-06 05:20:43 -04:00
Roberto Rosario
331a4da3b3 Don't create a default organization on each initialization of the organization app. GitLab issue #297. 2016-06-06 02:54:32 -04:00
Roberto Rosario
017dc67d3c Fix trashed document list view url name. 2016-06-01 12:19:41 -04:00
Roberto Rosario
aea00db37e Replace imports of Group for MayanGroup. 2016-05-31 01:23:24 -04:00
Roberto Rosario
629cc24090 Add OrganizationAdminMixin. Enable OrganizationAdminMixin for the tags, folders and user_management apps. 2016-05-31 01:22:15 -04:00
Roberto Rosario
f799d379d1 Remove print statement. 2016-05-30 23:55:25 -04:00
Roberto Rosario
8221f90fd3 Improve tags app organization test. 2016-05-30 23:55:02 -04:00
Roberto Rosario
f6dfff5949 Use the OrganizationTestCase class for the tags app model tests. 2016-05-30 23:54:32 -04:00
Roberto Rosario
38eb65151a Use the GenericAPITestCase for the documents and tags api tests. 2016-05-30 23:52:23 -04:00
Roberto Rosario
8435b8444a Add REST API base test case class. 2016-05-30 23:51:28 -04:00
Roberto Rosario
e5c51749da The return value is an user instance not an username. 2016-05-30 23:50:54 -04:00
Roberto Rosario
132d66fff8 Use the plural form 'required_permissions' to make it all uniform thruough the project. 2016-05-30 23:47:49 -04:00
Roberto Rosario
0a545f4b33 Return the created organization instance when creating the default organization. 2016-05-30 23:46:11 -04:00
Roberto Rosario
305aad0bfa Invalidate caches when creating organization admins. 2016-05-30 23:45:26 -04:00
Roberto Rosario
ccf3795601 Update the acls, common and documents tests to use OrganizationTestCase class. 2016-05-30 19:33:49 -04:00
Roberto Rosario
18bd82ba55 Fix authentication app view tests. 2016-05-30 19:23:27 -04:00
Roberto Rosario
3ebadf763b Add clean up method to OrganizationModelTestCase 2016-05-30 19:18:23 -04:00
Roberto Rosario
f9670ea7c2 Add a base organization test case class. 2016-05-30 19:16:58 -04:00
Roberto Rosario
de40977f5f Convert checkouts app to use organizations. 2016-05-30 19:14:34 -04:00
Roberto Rosario
aca93a0deb Update the Message of the day (motd) app to support organizations. 2016-05-30 17:51:24 -04:00
Roberto Rosario
e943588ba2 Move the OrganizationSourceManager manager to it's own module. Cleanups. 2016-05-30 15:42:33 -04:00
Roberto Rosario
db1673dd0a Convert sources app to use organizations. 2016-05-30 15:37:58 -04:00
Roberto Rosario
2dcad10805 Add missing .objects. 2016-05-30 06:49:52 -04:00
Roberto Rosario
ead86806d4 Add explicit organization deletion to the common generic test. 2016-05-30 06:18:26 -04:00
Roberto Rosario
cc360be4a4 Finish converting the tags app to user organizations. 2016-05-30 06:18:06 -04:00
Roberto Rosario
69bd6cc308 Finish conversion of the folders app to organizations. 2016-05-30 06:12:57 -04:00
Roberto Rosario
395fe0cb98 Finish conversion of the documents app to support organizations. 2016-05-30 06:10:08 -04:00
Roberto Rosario
d9137b4361 Folder model no longer links to the user model. 2016-05-30 06:00:24 -04:00
Roberto Rosario
e5c9e91104 Rename view and models from "deleted document" to "trashed document". Implement document level organization support via custom 'on_organization' manager. Unfilter default 'objects' manager to operate on all documents in the database. 2016-05-30 03:58:30 -04:00
Roberto Rosario
67f88b79c6 Fix queryset filter. 2016-05-27 23:03:52 -04:00
Roberto Rosario
266cf5c8a3 Import from the permissions app, not the permission module. 2016-05-27 18:03:25 -04:00
Roberto Rosario
e228dfc8c5 Add initial organization view tests for the documents app. 2016-05-27 18:01:31 -04:00
Roberto Rosario
fc86abe951 Make generic organization test class inherit from GenericViewTestCase. 2016-05-27 18:00:57 -04:00
Roberto Rosario
bc7682ab8a Trying to create a default organization in the ready() method of the app interfieres the organization app migration. 2016-05-27 00:38:35 -04:00
Roberto Rosario
ba1c5c1b17 Add organization view tests for the tags app. 2016-05-27 00:16:46 -04:00
Roberto Rosario
48d88d39e7 The folder creation is meant to succeed. 2016-05-26 23:52:24 -04:00
Roberto Rosario
de81fc58dd Generalize organization test. Add more organization tests to the folders app. 2016-05-26 21:58:31 -04:00
Roberto Rosario
b71ebe45f9 Initial sample a organization view test. 2016-05-26 14:52:25 -04:00
Roberto Rosario
05a46445d9 Don't use on_organization as we may be operating on an organization that is not our own. Return the username and password to be used for tests. 2016-05-26 14:47:41 -04:00
Roberto Rosario
907744cf18 Document page has to reference to document model. 2016-05-25 03:11:55 -04:00
Roberto Rosario
f7fd9634df Change group->user related_name to 'users'. Update all references. 2016-05-25 03:07:45 -04:00
Roberto Rosario
796e4cea04 Test are completely broken, disable CI for now. 2016-05-25 02:55:46 -04:00
Roberto Rosario
b2304119fc Improve the organization app tests. 2016-05-25 02:51:58 -04:00
Roberto Rosario
07a124187f Organization related improvements to the permissions app tests. 2016-05-25 02:51:32 -04:00
Roberto Rosario
eab5296c7a Organization related improvements to the user management app tests. 2016-05-25 02:51:06 -04:00
Roberto Rosario
ab83e23f27 Use the new group accessor for the user groups. 2016-05-25 02:50:39 -04:00
Roberto Rosario
5e7a62e022 Use MayanGroup in the user management views. Filter user for the current organization. 2016-05-25 02:49:19 -04:00
Roberto Rosario
e34dffb176 Make a hybrid user manager class to allow calling 'create_user' and 'create_superuser' from the on_organization manager. 2016-05-25 02:48:35 -04:00
Roberto Rosario
3a2d8bac33 Use the organization aware group model in the user serializer. Filter users for the current organization. 2016-05-25 02:47:58 -04:00
Roberto Rosario
58d634a395 Organization related improvements for the tags app. 2016-05-25 02:47:26 -04:00
Roberto Rosario
a0df9d260d Organization support improvements in the common app tests. 2016-05-25 02:46:32 -04:00
Roberto Rosario
626cc1cd07 Move the organizations.managment module to .utils to avoid class with /management/ folder. 2016-05-25 02:45:42 -04:00
Roberto Rosario
c49f8b1def Improve organization support for the folders app. 2016-05-25 02:45:20 -04:00
Roberto Rosario
2ca3a67c9c Don't make the default organization name hardcoded. 2016-05-25 02:44:24 -04:00
Roberto Rosario
7be1d76f62 Move import. Improve comment. 2016-05-25 02:44:05 -04:00
Roberto Rosario
c5f64d4805 Make the acls app organizations aware. 2016-05-25 02:43:12 -04:00
Roberto Rosario
27c1a33762 Call the command to create an organization admin during the initial setup stage. 2016-05-25 01:08:20 -04:00
Roberto Rosario
ce0b0a9a79 Add management command to create an organization admin. 2016-05-25 01:08:03 -04:00
Roberto Rosario
90778c709c Style cleanups 2016-05-25 01:07:42 -04:00
Roberto Rosario
6e6a6073d2 Relate roles to organizations 2016-05-25 01:06:57 -04:00
Roberto Rosario
a3a03ec095 Add custom Group model that relates to organization. 2016-05-25 01:06:20 -04:00
Roberto Rosario
433e295d07 Fix folder document list. GitLab issue #273 2016-05-24 18:18:40 -04:00
Roberto Rosario
c37430ff12 Folders no longer have an user field. GitLab issue #272. 2016-05-24 18:09:01 -04:00
Roberto Rosario
0e5521160b Move basic tests from the Site convertion to tests/test_middleware 2016-05-24 18:08:33 -04:00
Roberto Rosario
83046882b1 Remove repeated migrations. 2016-05-24 17:53:33 -04:00
Baptiste GAILLET
56f1a7d537 Add initial tests for organizations 2016-05-24 17:48:29 -04:00
Baptiste GAILLET
fba20b0a91 Fix postgresql organization creation id error after the first migration 2016-05-24 17:47:25 -04:00
Baptiste GAILLET
ab69031662 Add data migration for organizations apps and change documents migration 35 dependencies to this new migration 2016-05-24 17:46:50 -04:00
Roberto Rosario
14bd599387 Merge branch 'development' into feature/multi-tenant 2016-05-22 17:47:12 -04:00
Roberto Rosario
d71357cf81 Merge branch 'development' into feature/multi-tenant 2016-05-17 17:02:00 -04:00
Roberto Rosario
4aea55339f Merge branch 'development' into feature/multi-tenant 2016-05-07 20:13:52 -04:00
Roberto Rosario
9013793b5c Fix migrations conflicts with development branch. 2016-05-04 02:40:28 -04:00
Roberto Rosario
bd3bdb9b13 Merge branch 'development' into feature/multi-tenant 2016-05-04 02:22:38 -04:00
Roberto Rosario
9efa7c9543 Fix typo in document image generation query. Support multiple logins using different sessions iDS. 2016-03-07 04:13:14 -04:00
Roberto Rosario
8a5a26c0b4 Update authenthication code to support multitenants. Replace all remaining instances of hardcoded User model. 2016-03-07 03:08:11 -04:00
Roberto Rosario
6492908c59 Make folders and tags apps multitenant. 2016-03-07 01:53:13 -04:00
4266 changed files with 223300 additions and 338388 deletions

View File

@@ -1,10 +0,0 @@
.git
.gitignore
HISTORY.md
mayan/media
db.sqlite*
docker
!docker/rootfs
./.*
docs

View File

@@ -1,31 +0,0 @@
kind: pipeline
name: default
steps:
- name: docker
image: plugins/docker
settings:
registry: registry.d1v3.de
repo: registry.d1v3.de/mayan-edms
username:
from_secret: docker_username
password:
from_secret: docker_password
dockerfile: docker/Dockerfile
tags: latest
auto_tag: true
---
kind: secret
name: docker_username
get:
path: kv/data/drone/docker
name: username
---
kind: secret
name: docker_password
get:
path: kv/data/drone/docker
name: token

View File

@@ -1,3 +0,0 @@
[flake8]
exclude = node_modules,static,templates
ignore = E501, N801, N802, N804, N805, N806

1
.github/FUNDING.yml vendored
View File

@@ -1 +0,0 @@
custom: https://www.mayan-edms.com/donation/

45
.gitignore vendored
View File

@@ -3,35 +3,26 @@
*.pyo *.pyo
*.sqlite *.sqlite
*.sqlite3 *.sqlite3
*egg-info*
.coverage
.coverage.tox*
.idea/
*.swp
.tox/
.vagrant
_build/
/build/
coverage.xml
document_storage/
gpg_home/
htmlcov/
mayan/media/
mayan/media/document_cache/
mayan/settings/local.py
mayan/error.log
settings_local.py settings_local.py
static_collected/
/celerybeat-schedule /celerybeat-schedule
/fabfile_install document_storage/
/dist/
/misc/mayan.geany /misc/mayan.geany
mayan/media/document_cache/
build/
_build/
gpg_home/
/mayan/media/static/ /mayan/media/static/
/venv/
/venv3/
/whoosh_index/ /whoosh_index/
google_fonts/ /fabfile_install
node_modules/ /venv/
docs/build/ .coverage
docs/_templates/layout.html /dist/
docs/_templates/footer.html .idea/
static_collected/
*egg-info*
mayan/settings/local.py
.vagrant
.tox/
coverage.xml
.coverage.tox*
htmlcov/

View File

@@ -1,233 +1,35 @@
stages: image: python:2.7
- test
- build_python
- build_docker
- build_documentation
- push_python
- push_docker
- push_documentation
- deploy
job_docker_build:
stage: build_docker
image: docker:latest
services: services:
- docker:dind
before_script:
- docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY
script:
- docker build --pull -t "$CI_REGISTRY_IMAGE" -f docker/Dockerfile .
- VERSION=`cat docker/rootfs/version`
- docker tag "$CI_REGISTRY_IMAGE" "$CI_REGISTRY_IMAGE:$VERSION"
- docker run --rm "$CI_REGISTRY_IMAGE:$VERSION" run_tests
- docker push "$CI_REGISTRY_IMAGE:$VERSION"
- docker push "$CI_REGISTRY_IMAGE:latest"
- docker tag "$CI_REGISTRY_IMAGE:$VERSION" registry-1.docker.io/mayanedms/mayanedms:"$VERSION"
- docker tag "$CI_REGISTRY_IMAGE:$VERSION" registry-1.docker.io/mayanedms/mayanedms:latest
- docker logout
only:
- releases/all
- releases/docker
job_docker_push:
stage: push_docker
image: docker:latest
services:
- docker:dind
before_script:
- docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY
script:
- VERSION=`cat docker/rootfs/version`
- docker pull "$CI_REGISTRY_IMAGE:$VERSION"
- docker tag "$CI_REGISTRY_IMAGE:$VERSION" registry-1.docker.io/mayanedms/mayanedms:"$VERSION"
- docker tag "$CI_REGISTRY_IMAGE:$VERSION" registry-1.docker.io/mayanedms/mayanedms:latest
- docker logout
- docker login -u "$DOCKER_HUB_USERNAME" -p "$DOCKER_HUB_PASSWORD" https://registry-1.docker.io
- docker push registry-1.docker.io/mayanedms/mayanedms:"$VERSION"
- docker push registry-1.docker.io/mayanedms/mayanedms:latest
only:
- releases/all
- releases/docker
job_docker_nightly:
stage: build_docker
image: docker:latest
services:
- docker:dind
before_script:
- docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY
script:
- docker build --pull -t "$CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG" -f docker/Dockerfile .
- docker run --rm "$CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG" run_tests
- docker push "$CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG"
only:
- nightly
- staging
job_documentation_build:
stage: build_documentation
image: ubuntu:18.04
artifacts:
expire_in: 1 hr
paths:
- docs
before_script:
- apt-get -qq update
- apt-get install -qq locales make python-pip enchant
- echo "LC_ALL=\"en_US.UTF-8\"" >> /etc/default/locale
- locale-gen en_US.UTF-8
- update-locale LANG=en_US.UTF-8
- export LC_ALL=en_US.UTF-8
script:
- pip install -r requirements/documentation.txt
- cd docs
- make html
only:
- releases/all
- releases/documentation
job_documentation_push:
stage: push_documentation
image: ubuntu:18.04
before_script:
- mkdir -p ~/.ssh
- chmod 700 ~/.ssh
- echo "$DOCUMENTATION_SSH_KNOWN_HOSTS" > ~/.ssh/known_hosts
- chmod 644 ~/.ssh/known_hosts
- 'which ssh-agent || ( apt-get update -y && apt-get install openssh-client rsync -y )'
- eval $(ssh-agent -s)
- echo "$DOCUMENTATION_SSH_PRIVATE_KEY" | tr -d '\r' | ssh-add - > /dev/null
script:
- rsync -avzP --progress -e ssh docs/_build/html/* mayandocs@docs.mayan-edms.com:/home/rosarior/webapps/mayan_docs
only:
- releases/all
- releases/documentation
job_build_python:
stage: build_python
image: ubuntu:18.04
artifacts:
expire_in: 1 hr
paths:
- dist
before_script:
- apt-get -qq update
- apt-get install -qq locales make python-pip
script:
- echo "LC_ALL=\"en_US.UTF-8\"" >> /etc/default/locale
- locale-gen en_US.UTF-8
- update-locale LANG=en_US.UTF-8
- export LC_ALL=en_US.UTF-8
- pip install -r requirements/build.txt
- make python-wheel
only:
- releases/all
- releases/python
job_push_python:
stage: push_python
image: ubuntu:18.04
before_script:
- apt-get -qq update
- apt-get install -qq python-pip
script:
- pip install -r requirements/build.txt
- echo "$PYPIRC" > ~/.pypirc
- twine upload dist/* -r pypi
only:
- releases/all
- releases/python
.test_base: &test_base
stage: test
image: ubuntu:18.04
cache:
paths:
- ~/.cache/pip/
- /var/cache/apt/archives/
before_script:
- apt-get -qq update
- apt-get install -qq locales
- echo "LC_ALL=\"en_US.UTF-8\"" >> /etc/default/locale
- locale-gen en_US.UTF-8
- update-locale LANG=en_US.UTF-8
- export LC_ALL=en_US.UTF-8
- apt-get install -qq curl exiftool firefox-geckodriver gcc ghostscript gnupg1 graphviz libfuse2 libjpeg-dev libmagic1 libpng-dev libtiff-dev poppler-utils libreoffice poppler-utils python-dev python-virtualenv python3-dev tesseract-ocr tesseract-ocr-deu
- virtualenv venv -p /usr/bin/python3
- . venv/bin/activate
- pip install -r requirements.txt -r requirements/testing-base.txt
only:
- releases/all
- releases/docker
- releases/python
- staging
- nightly
test-mysql:
<<: *test_base
variables:
MYSQL_ALLOW_EMPTY_PASSWORD: "yes"
MYSQL_DATABASE: "mayan_edms"
services:
- mysql:8.0.3
script:
- apt-get install -qq libmysqlclient-dev libssl-dev mysql-client
- . venv/bin/activate
- set -a && . ./config.env && set +a
- pip install mysqlclient==$PYTHON_MYSQL_VERSION
- mysql -h"$MYSQL_PORT_3306_TCP_ADDR" -P"$MYSQL_PORT_3306_TCP_PORT" -uroot -p"$MYSQL_ENV_MYSQL_ROOT_PASSWORD" -e "set global character_set_server=utf8mb4;"
- python manage.py test --mayan-apps --settings=mayan.settings.testing.gitlab-ci.db_mysql --nomigrations
tags:
- mysql - mysql
- postgres
test-postgres: before_script:
<<: *test_base - apt-get update -qq
- apt-get install -qq python-dev gcc tesseract-ocr tesseract-ocr-deu unpaper ghostscript libjpeg-dev libpng-dev libtiff-dev poppler-utils libreoffice
variables: variables:
POSTGRES_DB: "mayan_edms" POSTGRES_DB: "mayan_edms"
POSTGRES_PASSWORD: "postgres" POSTGRES_PASSWORD: "postgres"
services: MYSQL_ALLOW_EMPTY_PASSWORD: "yes"
- postgres MYSQL_DATABASE: "mayan_edms"
script: #test:mysql:
- apt-get install -qq libpq-dev # script:
- . venv/bin/activate # - pip install -r requirements/testing.txt
- set -a && . ./config.env && set +a # - pip install -q mysql-python
- pip install psycopg2==$PYTHON_PSYCOPG2_VERSION # - apt-get install -qq mysql-client
- python manage.py test --mayan-apps --settings=mayan.settings.testing.gitlab-ci.db_postgres --nomigrations # - mysql -h"$MYSQL_PORT_3306_TCP_ADDR" -P"$MYSQL_PORT_3306_TCP_PORT" -uroot -p"$MYSQL_ENV_MYSQL_ROOT_PASSWORD" -e "ALTER DATABASE $MYSQL_DATABASE CHARACTER SET utf8 COLLATE utf8_unicode_ci;"
tags: # - coverage run manage.py runtests --settings=mayan.settings.testing.gitlab-ci.db_mysql --nomigrations
- postgres # - bash <(curl https://raw.githubusercontent.com/codecov/codecov-bash/master/codecov) -t $CODECOV_TOKEN
# tags:
test-sqlite: # - mysql
<<: *test_base #test:postgres:
script: # script:
- . venv/bin/activate # - pip install -r requirements/testing.txt
- python manage.py test --mayan-apps --settings=mayan.settings.testing.gitlab-ci --nomigrations # - pip install -q psycopg2
# - coverage run manage.py runtests --settings=mayan.settings.testing.gitlab-ci.db_postgres --nomigrations
deploy_demo: # - bash <(curl https://raw.githubusercontent.com/codecov/codecov-bash/master/codecov) -t $CODECOV_TOKEN
environment: # tags:
name: demo # - postgres
stage: deploy #test:sqlite:
before_script: # script:
- mkdir -p ~/.ssh # - pip install -r requirements/testing.txt
- echo "${DEMO_SSH_KNOWN_HOST}" > ~/.ssh/known_hosts # - coverage run manage.py runtests --settings=mayan.settings.testing.gitlab-ci --nomigrations
- chmod 644 ~/.ssh/known_hosts # - bash <(curl https://raw.githubusercontent.com/codecov/codecov-bash/master/codecov) -t $CODECOV_TOKEN
- echo "${DEMO_PRIVATE_KEY}" > ~/.ssh/id_rsa
- chmod 600 ~/.ssh/id_rsa
script:
- scp contrib/scripts/install/docker.sh root@$DEMO_IP_ADDRESS:~
- ssh root@$DEMO_IP_ADDRESS "DELETE_VOLUMES=true ./docker.sh"
when: manual
deploy_staging:
environment:
name: staging
stage: deploy
before_script:
- mkdir -p ~/.ssh
- echo "${STAGING_SSH_KNOWN_HOST}" > ~/.ssh/known_hosts
- chmod 644 ~/.ssh/known_hosts
- echo "${STAGING_PRIVATE_KEY}" > ~/.ssh/id_rsa
- chmod 600 ~/.ssh/id_rsa
script:
- scp contrib/scripts/install/docker.sh root@$STAGING_IP_ADDRESS:~
- ssh root@$STAGING_IP_ADDRESS "DOCKER_MAYAN_IMAGE=registry.gitlab.com/mayan-edms/mayan-edms:staging ./docker.sh"
when: manual

View File

@@ -1,5 +1,3 @@
dist: trusty
sudo: required
language: python language: python
python: python:
- 2.7 - 2.7
@@ -10,7 +8,7 @@ env:
- DB=sqlite - DB=sqlite
before_install: before_install:
- sudo apt-get update -qq - sudo apt-get update -qq
- sudo apt-get install -qq python-dev python-pip gcc tesseract-ocr tesseract-ocr-deu ghostscript libjpeg-dev libpng-dev libtiff-dev poppler-utils libreoffice - sudo apt-get install -qq python-dev gcc tesseract-ocr tesseract-ocr-deu unpaper ghostscript libjpeg-dev libpng-dev poppler-utils libreoffice
install: install:
- "pip install -r requirements/testing.txt" - "pip install -r requirements/testing.txt"
- if [[ $DB == mysql ]]; then pip install -q mysql-python; fi - if [[ $DB == mysql ]]; then pip install -q mysql-python; fi
@@ -19,9 +17,9 @@ before_script:
- mysql -e 'create database mayan_edms;' - mysql -e 'create database mayan_edms;'
- psql -c 'create database mayan_edms;' -U postgres - psql -c 'create database mayan_edms;' -U postgres
script: script:
- if [[ $DB == mysql ]]; then coverage run manage.py test --mayan-apps --settings=mayan.settings.testing.travis.db_mysql --nomigrations; fi - if [[ $DB == mysql ]]; then coverage run manage.py runtests --settings=mayan.settings.testing.travis.db_mysql --nomigrations; fi
- if [[ $DB == postgres ]]; then coverage run manage.py test --mayan-apps --settings=mayan.settings.testing.travis.db_postgres --nomigrations; fi - if [[ $DB == postgres ]]; then coverage run manage.py runtests --settings=mayan.settings.testing.travis.db_postgres --nomigrations; fi
- if [[ $DB == sqlite ]]; then coverage run manage.py test --mayan-apps --settings=mayan.settings.testing.base --nomigrations; fi - if [[ $DB == sqlite ]]; then coverage run manage.py runtests --settings=mayan.settings.testing.base --nomigrations; fi
after_success: after_success:
- coveralls - coveralls
branches: branches:

View File

@@ -19,18 +19,6 @@ source_lang = en
source_file = mayan/apps/authentication/locale/en/LC_MESSAGES/django.po source_file = mayan/apps/authentication/locale/en/LC_MESSAGES/django.po
type = PO type = PO
[mayan-edms.autoadmin-2-0]
file_filter = mayan/apps/autoadmin/locale/<lang>/LC_MESSAGES/django.po
source_lang = en
source_file = mayan/apps/autoadmin/locale/en/LC_MESSAGES/django.po
type = PO
[mayan-edms.cabinets-2-0]
file_filter = mayan/apps/cabinets/locale/<lang>/LC_MESSAGES/django.po
source_lang = en
source_file = mayan/apps/cabinets/locale/en/LC_MESSAGES/django.po
type = PO
[mayan-edms.checkouts-2-0] [mayan-edms.checkouts-2-0]
file_filter = mayan/apps/checkouts/locale/<lang>/LC_MESSAGES/django.po file_filter = mayan/apps/checkouts/locale/<lang>/LC_MESSAGES/django.po
source_lang = en source_lang = en
@@ -49,24 +37,18 @@ source_lang = en
source_file = mayan/apps/converter/locale/en/LC_MESSAGES/django.po source_file = mayan/apps/converter/locale/en/LC_MESSAGES/django.po
type = PO type = PO
[mayan-edms.dashboards-2-0]
file_filter = mayan/apps/dashboards/locale/<lang>/LC_MESSAGES/django.po
source_lang = en
source_file = mayan/apps/dashboards/locale/en/LC_MESSAGES/django.po
type = PO
[mayan-edms.dependencies-3-0]
file_filter = mayan/apps/dependencies/locale/<lang>/LC_MESSAGES/django.po
source_lang = en
source_file = mayan/apps/dependencies/locale/en/LC_MESSAGES/django.po
type = PO
[mayan-edms.django_gpg-2-0] [mayan-edms.django_gpg-2-0]
file_filter = mayan/apps/django_gpg/locale/<lang>/LC_MESSAGES/django.po file_filter = mayan/apps/django_gpg/locale/<lang>/LC_MESSAGES/django.po
source_lang = en source_lang = en
source_file = mayan/apps/django_gpg/locale/en/LC_MESSAGES/django.po source_file = mayan/apps/django_gpg/locale/en/LC_MESSAGES/django.po
type = PO type = PO
[mayan-edms.documents-2-0]
file_filter = mayan/apps/documents/locale/<lang>/LC_MESSAGES/django.po
source_lang = en
source_file = mayan/apps/documents/locale/en/LC_MESSAGES/django.po
type = PO
[mayan-edms.document_comments-2-0] [mayan-edms.document_comments-2-0]
file_filter = mayan/apps/document_comments/locale/<lang>/LC_MESSAGES/django.po file_filter = mayan/apps/document_comments/locale/<lang>/LC_MESSAGES/django.po
source_lang = en source_lang = en
@@ -79,12 +61,6 @@ source_lang = en
source_file = mayan/apps/document_indexing/locale/en/LC_MESSAGES/django.po source_file = mayan/apps/document_indexing/locale/en/LC_MESSAGES/django.po
type = PO type = PO
[mayan-edms.document_parsing-2-0]
file_filter = mayan/apps/document_parsing/locale/<lang>/LC_MESSAGES/django.po
source_lang = en
source_file = mayan/apps/document_parsing/locale/en/LC_MESSAGES/django.po
type = PO
[mayan-edms.document_signatures-2-0] [mayan-edms.document_signatures-2-0]
file_filter = mayan/apps/document_signatures/locale/<lang>/LC_MESSAGES/django.po file_filter = mayan/apps/document_signatures/locale/<lang>/LC_MESSAGES/django.po
source_lang = en source_lang = en
@@ -97,12 +73,6 @@ source_lang = en
source_file = mayan/apps/document_states/locale/en/LC_MESSAGES/django.po source_file = mayan/apps/document_states/locale/en/LC_MESSAGES/django.po
type = PO type = PO
[mayan-edms.documents-2-0]
file_filter = mayan/apps/documents/locale/<lang>/LC_MESSAGES/django.po
source_lang = en
source_file = mayan/apps/documents/locale/en/LC_MESSAGES/django.po
type = PO
[mayan-edms.dynamic_search-2-0] [mayan-edms.dynamic_search-2-0]
file_filter = mayan/apps/dynamic_search/locale/<lang>/LC_MESSAGES/django.po file_filter = mayan/apps/dynamic_search/locale/<lang>/LC_MESSAGES/django.po
source_lang = en source_lang = en
@@ -115,16 +85,16 @@ source_lang = en
source_file = mayan/apps/events/locale/en/LC_MESSAGES/django.po source_file = mayan/apps/events/locale/en/LC_MESSAGES/django.po
type = PO type = PO
[mayan-edms.file_caching-3-0] [mayan-edms.folders-2-0]
file_filter = mayan/apps/file_caching/locale/<lang>/LC_MESSAGES/django.po file_filter = mayan/apps/folders/locale/<lang>/LC_MESSAGES/django.po
source_lang = en source_lang = en
source_file = mayan/apps/file_caching/locale/en/LC_MESSAGES/django.po source_file = mayan/apps/folders/locale/en/LC_MESSAGES/django.po
type = PO type = PO
[mayan-edms.file_metadata-3-0] [mayan-edms.installation-2-0]
file_filter = mayan/apps/file_metadata/locale/<lang>/LC_MESSAGES/django.po file_filter = mayan/apps/installation/locale/<lang>/LC_MESSAGES/django.po
source_lang = en source_lang = en
source_file = mayan/apps/file_metadata/locale/en/LC_MESSAGES/django.po source_file = mayan/apps/installation/locale/en/LC_MESSAGES/django.po
type = PO type = PO
[mayan-edms.linking-2-0] [mayan-edms.linking-2-0]
@@ -157,6 +127,12 @@ source_lang = en
source_file = mayan/apps/mirroring/locale/en/LC_MESSAGES/django.po source_file = mayan/apps/mirroring/locale/en/LC_MESSAGES/django.po
type = PO type = PO
[mayan-edms.mirroring-2-0]
file_filter = mayan/apps/mirroring/locale/<lang>/LC_MESSAGES/django.po
source_lang = en
source_file = mayan/apps/mirroring/locale/en/LC_MESSAGES/django.po
type = PO
[mayan-edms.motd-2-0] [mayan-edms.motd-2-0]
file_filter = mayan/apps/motd/locale/<lang>/LC_MESSAGES/django.po file_filter = mayan/apps/motd/locale/<lang>/LC_MESSAGES/django.po
source_lang = en source_lang = en
@@ -175,12 +151,6 @@ source_lang = en
source_file = mayan/apps/permissions/locale/en/LC_MESSAGES/django.po source_file = mayan/apps/permissions/locale/en/LC_MESSAGES/django.po
type = PO type = PO
[mayan-edms.platform-2-0]
file_filter = mayan/apps/platform/locale/<lang>/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] [mayan-edms.rest_api-2-0]
file_filter = mayan/apps/rest_api/locale/<lang>/LC_MESSAGES/django.po file_filter = mayan/apps/rest_api/locale/<lang>/LC_MESSAGES/django.po
source_lang = en source_lang = en
@@ -200,9 +170,9 @@ source_file = mayan/apps/sources/locale/en/LC_MESSAGES/django.po
type = PO type = PO
[mayan-edms.statistics-2-0] [mayan-edms.statistics-2-0]
file_filter = mayan/apps/mayan_statistics/locale/<lang>/LC_MESSAGES/django.po file_filter = mayan/apps/statistics/locale/<lang>/LC_MESSAGES/django.po
source_lang = en source_lang = en
source_file = mayan/apps/mayan_statistics/locale/en/LC_MESSAGES/django.po source_file = mayan/apps/statistics/locale/en/LC_MESSAGES/django.po
type = PO type = PO
[mayan-edms.storage-2-0] [mayan-edms.storage-2-0]
@@ -217,27 +187,8 @@ source_lang = en
source_file = mayan/apps/tags/locale/en/LC_MESSAGES/django.po source_file = mayan/apps/tags/locale/en/LC_MESSAGES/django.po
type = PO type = PO
[mayan-edms.task_manager-2-0]
file_filter = mayan/apps/task_manager/locale/<lang>/LC_MESSAGES/django.po
source_lang = en
source_file = mayan/apps/task_manager/locale/en/LC_MESSAGES/django.po
type = PO
[mayan-edms.templating-3-0]
file_filter = mayan/apps/templating/locale/<lang>/LC_MESSAGES/django.po
source_lang = en
source_file = mayan/apps/templating/locale/en/LC_MESSAGES/django.po
type = PO
[mayan-edms.user_management-2-0] [mayan-edms.user_management-2-0]
file_filter = mayan/apps/user_management/locale/<lang>/LC_MESSAGES/django.po file_filter = mayan/apps/user_management/locale/<lang>/LC_MESSAGES/django.po
source_lang = en source_lang = en
source_file = mayan/apps/user_management/locale/en/LC_MESSAGES/django.po source_file = mayan/apps/user_management/locale/en/LC_MESSAGES/django.po
type = PO type = PO
[mayan-edms.web_link-3-0]
file_filter = mayan/apps/web_links/locale/<lang>/LC_MESSAGES/django.po
source_lang = en
source_file = mayan/apps/web_links/locale/en/LC_MESSAGES/django.po
type = PO

View File

@@ -1,83 +0,0 @@
Contributing to Mayan EDMS
==========================
Issues
------
- The issue system is for reporting problems with the program code. For
questions use the forum at: https://forum.mayan-edms.com/
- Do not open issues asking for **support or consulting**. For paid support
and consultation visit: https://www.mayan-edms.com/support/
- The issue must be related to the code only, do not open issues for problems
with databases, deployments, webservers, cloud providers, etc.
- Before submitting a new issue, check for **existing issues** first and
join the discussion.
- If your issue is not attended in a while, **be patient**, the core team is
small and the codebase big.
- Try to reproduce the issue using a **separate, clean installation**,
sometimes the issue can be caused by an error in a configuration file and
not with the code itself.
- **Do not upload** sensitive, private or classified information or files
with your issue. If the issue is triggered by a user file, create a dummy
file with the same properties that can trigger the issue and upload that
file instead.
- Add steps that trigger the issue in a **repeatable manner**.
- **Screenshots** go a long way in helping understand problems.
Code
----
1. Complete and mail, or scan and email the corresponding Contributor Assignment Agreement: [Mayan EDMS Individual Contributor Assignment Agreement](https://gitlab.com/mayan-edms/mayan-edms/blob/master/docs/chapters/caa_individual.rst) or [Mayan EDMS Entity Contributor Assignment Agreement](https://gitlab.com/mayan-edms/mayan-edms/blob/master/docs/chapters/caa_entity.rst).
1. Fork [the repository](http://gitlab.com/mayan-edms/mayan-edms).
1. Choose the version for which you want to develop. The code is divided in the
following branches:
a. **master:** Current stable version.
a. **series/X.Y:** There will be a **series** branch for each major version
release (1.0, 2.0). The **master** branch will be in sync with the latest
**series** branch.
a. **development:** Unstable branch where the development for the next minor or
major release is happening.
a. **feature/X:** These are branches dealing with a specific bug or feature
that is not yet ready to be merged.
a. The **master** and **series** branches are stable and not braking changes
must be submitted or merged. The **development** and **feature** branches
are unstable and should not be used in production.
1. Start making your changes in your own separate branch.
1. Write a test which shows that the bug was fixed or that the feature works as
expected.
1. Sign your work. Your signature certifies your submission according to the
articles of the [Developer Certificate of Origin](https://gitlab.com/mayan-edms/mayan-edms/blob/master/DCO).
The sign-off should be in the form:
````
Signed-off-by: John Doe <john.doe@example.com>
````
You must use your real name and email, pseudonyms or anonymous contributions
are not allowed. If you set your user.name and user.email git configs, you can
sign your commit automatically with git commit -s.
1. Submit a merge request for your changes.
Feature requests
----------------
- Opening issues to start a discussion around a new feature or idea are welcomed.
- Be explicit about your idea and provide a simple scenario, others need to really
understand the concepts behind your idea if it is to be implemented.
- Be realistic in your expectation and scope of your idea.
Translations
------------
- Translations are handled using [Transifex](https://www.transifex.com/rosarior/mayan-edms/).
- Join an existing team for the language to which you wish to contribute,
if there is no team for your language, request for one to be created.
- Don't request the creation of a new language and expect others to do all the
work. If you request the creation of a new language try to do some of the
translation. Language teams that don't see activity for a while are deleted.
Code style
----------
- Refer to the [Development](https://docs.mayan-edms.com/topics/development.html)
chapter for information and examples of the code style.

36
DCO
View File

@@ -1,36 +0,0 @@
Developer Certificate of Origin
Version 1.1
Copyright (C) 2004, 2006 The Linux Foundation and its contributors.
660 York Street, Suite 102,
San Francisco, CA 94110 USA
Everyone is permitted to copy and distribute verbatim copies of this
license document, but changing it is not allowed.
Developer's Certificate of Origin 1.1
By making a contribution to this project, I certify that:
(a) The contribution was created in whole or in part by me and I
have the right to submit it under the open source license
indicated in the file; or
(b) The contribution is based upon previous work that, to the best
of my knowledge, is covered under an appropriate open source
license and I have the right under that license to submit that
work with modifications, whether created in whole or in part
by me, under the same open source license (unless I am
permitted to submit under a different license), as indicated
in the file; or
(c) The contribution was provided directly to me by some other
person who certified (a), (b) or (c) and I have not modified
it.
(d) I understand and agree that this project and the contribution
are public and that a record of the contribution (including all
personal information I submit with it, including my sign-off) is
maintained indefinitely and may be redistributed consistent with
this project or the open source license(s) involved.

File diff suppressed because it is too large Load Diff

View File

@@ -1,60 +0,0 @@
1.1.1 (2015-05-21)
==================
- Update to Django 1.6.11
- Fix make_dist.sh script
- Add test for issue #163
- Activate tests for the sources app
- Removal of the registration app
- New simplified official project description
- Improvements to the index admin interface
- Removal of installation statistics gathering
- Remove unused folder tag
- Fix usage of ugettext to ugettext_lazy
- Increase size of the lock name field
- New style documentation
1.1 (2015-02-10)
================
- Uses Celery for background tasks
- Removal of the splash screen
- Adds a home view with common function buttons
- Support for sending and receiving documents via email
- Removed custom logging app in favor of django-actvity-stream
- Adds watch folders
- Includes Vagrant file for unified development and testing environments
- Per user locale profile (language and timezone)
- Includes news document workflow app
- Optional and required metadata types
- Improved testings. Automated tests against SQLite, MySQL, PostgreSQL
- Many new REST API endpoints added
- Simplified text messages
- Improved method for custom settings
- Addition of CORS support to the REST API
- Per document language setting instead of per installation language setting
- Metadata validation and parsing support
- Start of code updates towards Python 3 support
- Simplified UI
- Stable PDF previews generation
- More technical documentation
1.0 (2014-08-27)
================
- New home @ https://github.com/mayan-edms/mayan-edms
- Updated to use Django 1.6
- Translation updates
- Custom model properties removal
- Source code improvements
- Removal of included 3rd party modules
- Automatic testing and code coverage check
- Update of required modules and libraries versions
- Database connection leaks fixes
- Support for deletion of detached signatures
- Removal of Fabric based installations script
- Pluggable OCR backends
- OCR improvements
- License change, Mayan EDMS in now licensed under the Apache 2.0 License
- PyPI package, Mayan EDMS in now available on PyPI: https://pypi.python.org/pypi/mayan-edms/
- New REST API

View File

@@ -1,435 +0,0 @@
2.7.3 (2017-09-11)
==================
- Fix task manager queue list view. Thanks to LeVon Smoker for
the report.
- Fix resolved link class URL mangling when the keep_query argument is
used. Thanks to Nick Douma(LordGaav) for the report and diagnostic
information. Fixes source navigation on the document upload wizard.
2.7.2 (2017-09-06)
==================
- Fix new mailer creation view. GitLab issue #431.
Thanks to Robert Schöftner(@robert.schoeftner) for the
report and the solution.
- Consolidate intial document created event and the first
document properties edited events. Preserve the user that
initially creates the document. GitLab issue #433. Thanks
to Jesaja Everling(@jeverling) for the report.
- Sort the list of root cabinets. Thanks to Thomas Plotkowiak
for the request.
- Sort the list of a document's cabinets.
- Display a document's cabinet list in italics. GitLab issue #435.
Thanks to LeVon Smoker for the request.
- Install mock by default to allow easier testing of deployed
instances.
2.7.1 (2017-09-03)
==================
- Support unicode in URL querystring. GitLab issue #423.
Thanks to Gustavo Teixeira (@gsteixei) for the find.
- Import errors during initialization are only ignored
if they are cause by a missing local.py. Thanks to
MacRobb Simpson for the report and solution.
- Make sure the local.py created used unicode for strings
by default. GitLab issue #424. Thanks to Gustavo Teixeira
(@gsteixei) for the find.
2.7 (2017-08-30)
================
- Add workaround for PDF with IndirectObject as the
rotation value. GitHub #261.
- Add ACL list link with icon and use it for the document facet menu.
- Fix mailing app permissions labels.
- Add ACLs link and ACLs permissions to the mailer profile model.
- Improve mailer URL regex.
- Add ordering support to the SourceColumn class. GitLab issue #417.
- Shows the cabinets in the document list. GitLab #417 @corneliusludmann
- Add workaround for pycountry versions without the bibliographical key.
GitHub issue #250.
- Skip UUID migration on Oracle backends. GitHub issue #251.
- Allow changing the output format, DPI of the pdftoppm command, and
the output format of the converter via the CONVERTER_GRAPHICS_BACKEND_CONFIG
setting. GitHub issues #256 #257 GitLab issue #416.
- Add support for workflow triggers.
- Add support for workflow actions.
- Add support for rendering workflows.
- Add support for unbinding sub menus.
- Fix mailing profile test view.
- Disregard the last 3 dots that mark the end of the YAML document.
- Add support for multiple dashboards.
- Add support for removing dashboard widgets.
- Convert document version view to item list view.
- Add support for browsing individual document versions.
- Add support for dropdown menus to the item list view template.
- Add support for preserving the file extension when downloading a document
version. GitLab #415.
- Split OCR app into OCR and parsing.
- Remove Folders app.
- Use the literal 'System' instead of the target name when
the action user in unknown.
- Remove the view to submit all document for OCR.
- When changing document types, don't delete the old metadata that is
also found in the new document type. GitLab issue #421.
- Add tag attach and tag remove events.
- Change the permission needed to attach and remove tags.
- Add HTTP POST workflow state action.
- Add access control grant workflow state action.
- Beta Python 3 support.
2.6.4 (2017-07-26)
==================
- Add missing replacements of reverse to resolve_url.
2.6.3 (2017-07-25)
==================
- Add makefile target to launch a PostgreSQL container.
- Use resolve_url instead of redirect to resolve the post login URL.
- Make the intialsetup and performupgrade management tasks work
with signals to allow customization from 3rd party apps.
- PEP8 cleanups.
- Add tag_ids keyword argument to the Source.handle_upload
model method. GitLab issue #413.
- Add overflow wrapping so wrap long titles in Firefox too.
- Makes Roles searchable. GitLab issue #402.
- Add line numbers to the debug and production loggers.
Add date and time to the production logger.
- Add support for generating setup.py from a template. GitLab
#149 #200.
- Add fade in animation to document images.
2.6.2 (2017-07-19)
==================
- Fix deprecation warning to prepare upgrade to Django 1.11 and 2.0.
- Fix document page zoom.
- Add support to run tests against a MySQL, Postgres or Oracle container.
- Improve tag widget customization by moving the markup to its own template.
- Fix document page widget appearance in the document page list view.
- Make document version order deterministic.
- Allow total page number instrospection of encrypted PDF with non ASCII user properties. GitLab issue #411.
- Oracle database compatibility update in the cabinets app. GitHub #258.
2.6.1 (2017-07-18)
==================
- Fix issue when editing or removing metadata from multiple documents.
2.6 (2017-07-18)
================
- Fix HTML mark up in window title. GitLab #397.
- Add support for emailing documents to a recipient list. GitLab #396.
- Backport metadata widget changes from @Macrobb. GitLab #377.
- Make users and group searchable.
- Add support for logging errors during in production mode.
Add COMMON_PRODUCTION_ERROR_LOG_PATH to control path of log file.
Defaults to mayan/error.log.
- Add support logging request exceptions.
- Add document list item view.
- Sort setting by namespace label and by global name second.
- Sort indexes by label.
- Fix cabinets permission and access control checking.
- The permission to add or remove documents to cabinets now applies to documents too.
- Equalize dashboard widgets heights.
- Switch the order of the DEFAULT_AUTHENTICATION_CLASSES of DRF. GitLab #400.
- Backport document's version list view permission.
- Improve code to unbind menu entries.
- Renamed the document type permission namespace from "Document setup" to "Document types".
- Add support for granting the document type edit, document type delete, and document type view
permissions to individual document type instances.
- Improved tests by testing for accesses.
- Increase the size of the mailing profile label field to 128 characters.
2.5.2 (2017-07-08)
==================
- Improve new document creation signal handling.
Fixes issue with duplicate scanning at upload.
2.5.1 (2017-07-08)
==================
- Update release target due to changes in PyPI.
2.5 (2017-07-07)
================
- Add view to download a document's OCR text. GitLab #215
- Add user configurable mailer. GitLab #286.
- Use Toasts library for screen messages.
- Reduce verbosity of some debug messages.
- Add new lineart transformation.
- Fix SANE source resolution field.
- About and Profile menu reorganization.
- PDF compatibility improvements.
- Office document coversion improvements.
- New metadata type setup UI.
- Duplicated document scan support.
- "Remember me" login support.
- Forgotten password restore via email.
- Document cache disabling.
- Translation improvements.
- Image loading improvements.
- Lower JavaScript memory utilization.
- HTML reponsive layout improvements.
- Make document deletion a background task.
- Unicode handling improvements.
- Python3 compatilibyt improvements.
- New screen messages using Toastr.
2.4 (2017-06-23)
================
- Add Django-mathfilters.
- Improve render of documents with no pages.
- Add SANE scanner document source.
- Added PDF orientation detection. GitLab issue #387.
- Fix repeated permission list API URL. GitLab issue #389.
- Fix role creation API endpoint not returning id. GitLab issue #390.
- Make tags, metadata types and cabinets searchable via the dynamic search API. GitLab issue #344.
- Add support for updating configuration options from environment variables.
- Add purgelocks management command. GitLab issue #221.
- Fix index rebuilding for multi value first levels. GitLab issue #391.
- Truncate views titles via the APPEARANCE_MAXIMUM_TITLE_LENGTH setting. GitLab issue #217.
- Add background task manager app. GitLab issue #132.
- Add link to show a document's OCR errors. GitLab issue #291.
2.3 (2017-06-08)
================
- Allow for bigger indexing expression templates.
- Auto select checkbox when updating metadata values. GitLab issue #371.
- Added support for passing the options allow-other and allow-root to the
FUSE index mirror. GitLab issue #385
- Add support for check for the latest released version of Mayan from the
About menu.
- Support for rebuilding specific indexes. GitLab issue #372.
- Rewrite document indexing code to be faster and use less locking.
- Use a predefined file path for the file lock.
- Catch documents with not document version when displaying their thumbnails.
- Document page navigation fix when using Mayan as a sub URL app.
- Add support for indexing on workflow state changes.
- Add search model list API endpoint.
2.2 (2017-04-26)
================
- Remove the installation app (GitLab #301).
- Add support for document page search
- Remove recent searches feature
- Remove dependency on the django-filetransfer library
- Fix height calculation in resize transformation
- Improve upgrade instructions
- New image caching pipeline
- New drop down menus for the documents, folders and tags app as well as for
the user links.
- New Dashboard view
- Moved licenses to their own module in every app
- Update project to work with Django 1.10.4.
- Tags are alphabetically ordered by label (GitLab #342).
- Stop loading theme fonts from the web (GitLab #343).
- Add support for attaching multiple tags (GitLab #307).
- Integrate the Cabinets app.
2.1.11 (2017-03-14)
===================
- Added a quick rename serializer to the document type API serializer.
- Added per document type, workflow list API view.
- Mayan EDMS was adopted a version 1.1 of the Linux Foundation Developer Certificate of Origin.
- Added the detail url of a permission in the permission serializer.
- Added endpoints for the ACL app API.
- Implemented document workflows transition ACLs. GitLab issue #321.
- Add document comments API endpoints. GitHub issue #249.
- Add support for overriding the Celery class.
- Changed the document upload view in source app to not use the HTTP referer
URL blindly, but instead recompose the URL using known view name. Needed
when integrating Mayan EDMS into other app via using iframes.
- Addes size field to the document version serializer.
- Removed the serializer from the deleted document restore API endpoint.
- Added support for adding or editing document types to smart links via the
API.
2.1.10 (2017-02-13)
===================
- Update Makefile to use twine for releases.
- Add Makefile target to make test releases.
2.1.9 (2017-02-13)
==================
- Update make file to Workaround long standing pypa wheel bug #99
2.1.8 (2017-02-12)
==================
- Fixes in the trashed document API endpoints.
- Improved tags API PUT and PATCH endpoints.
- Bulk document adding when creating and editing tags.
- The version of django-mptt is preserved in case mayan-cabinets is installed.
- Add Django GPG API endpoints for singing keys.
- Add API endpoints for the document states (workflows) app.
- Add API endpoints for the messsage of the day (MOTD) app.
- Add Smart link API endpoints.
- Add writable versions of the Document and Document Type serializers (GitLab issues #348 and #349).
- Close GitLab issue #310 "Metadata's lookup with chinese messages when new document"
2.1.7 (2017-02-01)
==================
- Improved user management API endpoints.
- Improved permissions API endpoints.
- Improvements in the API tests of a few apps.
- Addition Content type list API view to the common app.
- Add API endpoints to the events app.
- Enable the parser and validation fields of the metadata serializer.
2.1.6 (2016-11-23)
==================
- Fix variable name typo in the rotation transformation class.
- Update translations
2.1.5 (2016-11-08)
==================
- Backport resize transformation math operation fix (GitLab #319).
- Update Pillow to 3.1.2 (Security fix).
- Backport zoom transformation performance improvement (GitLab #334).
- Backport trash can navigation link resolution fix (GitLab #331).
- Improve documentation regarding the use of GPG version 1 (GitLab #333).
- Fix ACL create view HTML response type. (GitLab #335).
- Expland staging folder and watch folder explanation.
2.1.4 (2016-10-28)
==================
- Add missing link to the 2.1.3 release notes in the index file.
- Improve TempfileCheckMixin.
- Fix statistics namespace list display view.
- Fix events list display view.
- Update required Django version to 1.8.15.
- Update required python-gnupg version to 0.3.9.
- Improved orphaned temporary files test mixin.
- Re-enable and improve GitLab CI MySQL testing.
- Improved GPG handling.
- New GPG backend system.
- Minor documentation updates.
2.1.3 (2016-06-29)
==================
- Add help message when initialsetup migration phase fails. Relates to GitLab issue #296.
- Start using self.setdout instead of print as per documentation.
- Fix GitLab issue #295, "When editing a user the top bar jumps to the name of the user".
- Normalize handling of temporary file and directory creation.
- Fix GitLab issue #309, "Temp files quickly filling-up my /tmp (1GB tmpfs)".
- Explicitly check for residual temporary files in tests.
- Add missing temporary file cleanup for office documents.
- Fix file descriptor leak in the document signature download test.
2.1.2 (2016-05-20)
==================
- Sort document languages and user profile locale language lists. GitLab issue #292.
- Fix metadata lookup for {{ users }} and {{ group }}. Fixes GitLab #290.
- Add Makefile for common development tasks
2.1.1 (2016-05-17)
==================
- Fix navigation issue that make it impossible to add new sources. GitLab issue #288.
- The Tesseract OCR backend now reports if the requested language file is missing. GitLab issue #289.
- Ensure the automatic default index is created after the default document type.
2.1 (2016-05-14)
================
- Upgrade to use Django 1.8.13. Issue #246.
- Upgrade requirements.
- Remove remaining references to Django's User model. GitLab issue #225
- Rename 'Content' search box to 'OCR'.
- Remove included login required middleware using django-stronghold instead (http://mikegrouchy.com/django-stronghold/).
- Improve generation of success and error messages for class based views.
- Remove ownership concept from folders.
- Replace strip_spaces middleware with the spaceless template tag. GitLab issue #255
- Deselect the update checkbox for optional metadata by default.
- Silence all Django 1.8 model import warnings.
- Implement per document type document creation permission. Closes GitLab issue #232.
- Add icons to the document face menu links.
- Increase icon to text spacing to 3px.
- Make document type delete time period optional.
- Fixed date locale handling in document properties, checkout and user detail views.
- Add new permission: checkout details view.
- Add HTML5 upload widget. Issue #162.
- Add Message of the Day app. Issue #222
- Update Document model's uuid field to use Django's native UUIDField class.
- Add new split view index navigation
- Newly uploaded documents appear in the Recent document list of the user.
- Document indexes now have ACL support.
- Remove the document index setup permission.
- Status messages now display the object class on which they operate not just the word "Object".
- More tests added.
- Handle unicode filenames in staging folders.
- Add staging file deletion permission.
- New document_signature_view permission.
- Add support for signing documents.
- Instead of multiple keyservers only one keyserver is now supported.
- Replace document type selection widget with an opened selection list.
- Add mailing documentation chapter.
- Add roadmap documentation chapter.
- API updates.
2.0.2 (2016-02-09)
==================
- Install testing dependencies when installing development dependencies.
- Fix GitLab issue #250 "Empty optional lookup metadata trigger validation error".
- Fix OCR API test.
- Move metadata form value validation to .clean() method.
- Only extract validation error messages from ValidationError exception instances.
- Don't store empty metadata value if the update checkbox is not checked.
- Add 2 second delay to document version tests to workaround MySQL limitation.
- Strip HTML tags from the browser title.
- Remove Docker and Docker Compose files.
2.0.1 (2016-01-22)
==================
- Fix GitLab issue #243, "System allows a user to skip entering values for a required metadata field while uploading a new document"
- Fix GitLab issue #245, "Add multiple metadata not possible"
- Updated Vagrantfile to provision a production box too.
2.0 (2015-12-04)
================
- New source homepage: https://gitlab.com/mayan-edms/mayan-edms
- Update to Django 1.7
- New Bootstrap Frontend UI
- Easier theming and rebranding
- Improved page navigation interface
- Menu reorganization
- Removal of famfam icon set
- Improved document preview generation
- Document submission for OCR changed to POST
- New YAML based settings system
- Removal of auto admin creation as separate app
- Removal of dependencies
- ACL system refactor
- Object access control inheritance
- Removal of anonymous user support
- Metadata validators refactor
- Trash can support
- Retention policies
- Support for sharing indexes as FUSE filesystems
- Clickable preview images titles
- Removal of eval
- Smarter OCR, per page parsing or OCR fallback
- Improve failure tolerance (not all Operational Errors are critical now)
- RGB tags
- Default document type and default document source
- Link unbinding
- Statistics refactor
- Apps merge
- New signals
- Test improvements
- Indexes recalculation after document creation too
- Upgrade command
- OCR data moved to ocr app from documents app
- New internal document creation workflow return a document stub
- Auto console debug logging during development and info during production
- New class based and menu based navigation system
- New class based transformations
- Usage of Font Awesome icons set
- Management command to remove obsolete permissions: `purgepermissions`
- Normalization of 'title' and 'name' fields to 'label'
- Improved API, now at version 1
- Invert page title/project name order in browser title
- Django's class based views pagination
- Reduction of text strings
- Removal of the CombinedSource class
- Removal of default class ACLs
- Removal of the ImageMagick and GraphicsMagick converter backends
- Remove support for applying roles to new users automatically
- Removal of the DOCUMENT_RESTRICTIONS_OVERRIDE permission
- Removed the page_label field

View File

@@ -1,4 +1,4 @@
Copyright 2011 Roberto Rosario Copyright 2011-2015 Roberto Rosario
Licensed under the Apache License, Version 2.0 (the "License"); Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License. you may not use this file except in compliance with the License.

View File

@@ -1,6 +1,3 @@
include README.md LICENSE HISTORY.rst mayan/LICENSE include README.rst LICENSE HISTORY.rst
recursive-include mayan/apps *.txt *.html *.css *.ico *.png *.jpg *.js *.mo *.ttf *.woff *.woff2 *.gif *.eot *.svg *.doc *.pdf *.tiff *.sig *.asc *.gpg *.zip *.tar *.gz *.bz2 *.tmpl recursive-include mayan *.txt *.html *.css *.ico *.png *.jpg *.js *.po *.mo *.ttf *.woff *.woff2 LICENSE
global-exclude mayan/settings/local.py *.po global-exclude mayan/settings/local.py mayan/settings/travis/* mayan/media/*
prune mayan/apps/*/static/*/node_modules/*
prune mayan/settings/travis/*
prune mayan/media/*

377
Makefile
View File

@@ -1,358 +1,113 @@
#!make .PHONY: clean-pyc clean-build
include config.env
define BROWSER_PYSCRIPT
import sys, webbrowser
webbrowser.open(sys.argv[1])
endef
export BROWSER_PYSCRIPT
BROWSER := python -c "$$BROWSER_PYSCRIPT"
.PHONY: clean clean-pyc clean-build test
help: help:
@echo "Usage: make <target>\n" @echo
@awk 'BEGIN {FS = ":.*##"} /^[0-9a-zA-Z_-]+:.*?## / { printf " * %-40s -%s\n", $$1, $$2 }' $(MAKEFILE_LIST)|sort @echo "clean-build - Remove build artifacts."
@echo "clean-pyc - Remove Python artifacts."
@echo "clean - Remove Python and build artifacts."
@echo "test MODULE=<python module name> - Run tests for a single App, module or test class."
@echo "test-all - Run all tests."
@echo "docs_serve - Run the livehtml documentation generator."
@echo "translations_make - Refresh all translation files."
@echo "translations_compile - Compile all translation files."
@echo "translations_push - Upload all translation files to Transifex."
@echo "translations_pull - Download all translation files from Transifex."
@echo "requirements_dev - Install development requirements."
@echo "requirements_docs - Install documentation requirements."
@echo "requirements_testing - Install testing requirements."
@echo "sdist - Build the source distribution package."
@echo "wheel - Build the wheel distribution package."
@echo "release - Package (sdist and wheel) and upload a release."
@echo "runserver - Run the development server."
# Cleaning # Cleaning
clean: ## Remove Python and build artifacts.
clean: clean-build clean-pyc clean: clean-build clean-pyc
clean-build: ## Remove build artifacts. clean-build:
rm -fr build/ rm -fr build/
rm -fr dist/ rm -fr dist/
rm -fr *.egg-info rm -fr *.egg-info
clean-pyc: ## Remove Python artifacts. clean-pyc:
find . -name '*.pyc' -exec rm -f {} + find . -name '*.pyc' -exec rm -f {} +
find . -name '*.pyo' -exec rm -f {} + find . -name '*.pyo' -exec rm -f {} +
find . -name '*~' -exec rm -f {} + find . -name '*~' -exec rm -f {} +
find . -name '__pycache__' -exec rm -R -f {} +
# Testing # Testing
test: clean-pyc test:
test: ## MODULE=<python module name> - Run tests for a single app, module or test class. python -Wall ./manage.py test $(MODULE) --settings=mayan.settings.testing --nomigrations
./manage.py test $(MODULE) --settings=mayan.settings.testing.development --nomigrations $(ARGUMENTS)
test-debug: clean-pyc test-all:
test-debug: ## MODULE=<python module name> - Run tests for a single app, module or test class, in debug mode. python -Wall ./manage.py runtests --settings=mayan.settings.testing --nomigrations
./manage.py test $(MODULE) --settings=mayan.settings.testing.development --nomigrations --debug-mode $(ARGUMENTS)
test-all: ## Run all tests.
test-all: clean-pyc
./manage.py test --mayan-apps --settings=mayan.settings.testing.development --nomigrations $(ARGUMENTS)
test-all-debug: ## Run all tests in debug mode.
test-all-debug: clean-pyc
./manage.py test --mayan-apps --settings=mayan.settings.testing.development --nomigrations --debug-mode $(ARGUMENTS)
test-launch-postgres:
@docker rm -f test-postgres || true
@docker volume rm test-postgres || true
docker run -d --name test-postgres -p 5432:5432 -v test-postgres:/var/lib/postgresql/data $(DOCKER_POSTGRES_IMAGE_VERSION)
sudo apt-get install -q libpq-dev
pip install psycopg2==$(PYTHON_PSYCOPG2_VERSION)
while ! nc -z 127.0.0.1 5432; do sleep 1; done
test-with-postgres: ## MODULE=<python module name> - Run tests for a single app, module or test class against a Postgres database container.
test-with-postgres: test-launch-postgres
./manage.py test $(MODULE) --settings=mayan.settings.testing.docker.db_postgres --nomigrations
@docker rm -f test-postgres || true
@docker volume rm test-postgres || true
test-with-postgres-all: ## Run all tests against a Postgres database container.
test-with-postgres-all: test-launch-postgres
./manage.py test --mayan-apps --settings=mayan.settings.testing.docker.db_postgres --nomigrations
@docker rm -f test-postgres || true
@docker volume rm test-postgres || true
test-launch-mysql:
@docker rm -f test-mysql || true
@docker volume rm test-mysql || true
docker run -d --name test-mysql -p 3306:3306 -e MYSQL_ALLOW_EMPTY_PASSWORD=True -e MYSQL_DATABASE=mayan -v test-mysql:/var/lib/mysql $(DOCKER_MYSQL_IMAGE_VERSION)
sudo apt-get install -q libmysqlclient-dev mysql-client
pip install mysqlclient==$(PYTHON_MYSQL_VERSION)
while ! nc -z 127.0.0.1 3306; do sleep 1; done
mysql -h 127.0.0.1 -P 3306 -uroot -e "set global character_set_server=utf8mb4;"
test-with-mysql: ## MODULE=<python module name> - Run tests for a single app, module or test class against a MySQL database container.
test-with-mysql: test-launch-mysql
./manage.py test $(MODULE) --settings=mayan.settings.testing.docker.db_mysql --nomigrations
@docker rm -f test-mysql || true
@docker volume rm test-mysql || true
test-with-mysql-all: ## Run all tests against a MySQL database container.
test-with-mysql-all: test-launch-mysql
./manage.py test --mayan-apps --settings=mayan.settings.testing.docker.db_mysql --nomigrations
@docker rm -f test-mysql || true
@docker volume rm test-mysql || true
test-launch-oracle:
@docker rm -f test-oracle || true
@docker volume rm test-oracle || true
docker run -d --name test-oracle -p 49160:22 -p 49161:1521 -e ORACLE_ALLOW_REMOTE=true -v test-oracle:/u01/app/oracle $(DOCKER_ORACLE_IMAGE_VERSION)
# https://gist.github.com/kimus/10012910
pip install cx_Oracle==$(PYTHON_ORACLE_VERSION)
while ! nc -z 127.0.0.1 49161; do sleep 1; done
sleep 10
test-with-oracle: ## MODULE=<python module name> - Run tests for a single app, module or test class against a Oracle database container.
test-with-oracle: test-launch-oracle
./manage.py test $(MODULE) --settings=mayan.settings.testing.docker.db_oracle --nomigrations
@docker rm -f test-oracle || true
@docker volume rm test-oracle || true
test-with-oracle-all: ## Run all tests against a Oracle database container.
test-with-oracle-all: test-launch-oracle
./manage.py test --mayan-apps --settings=mayan.settings.testing.docker.db_oracle --nomigrations
@docker rm -f test-oracle || true
@docker volume rm test-oracle || true
# Documentation # Documentation
docs-serve: ## Run the livehtml documentation generator. docs_serve:
$(BROWSER) http://127.0.0.1:8000
cd docs;make livehtml cd docs;make livehtml
docs-spellcheck: ## Spellcheck the documentation.
sphinx-build -b spelling -d docs/_build/ docs docs/_build/spelling
# Translations # Translations
translations-make: ## Refresh all translation files. translations_make:
contrib/scripts/process_messages.py -m contrib/scripts/process_messages.py -m
translations-compile: ## Compile all translation files. translations_compile:
contrib/scripts/process_messages.py -c contrib/scripts/process_messages.py -c
translations-push: ## Upload all translation files to Transifex. translations_push:
tx push -s tx push -s
translations-pull: ## Download all translation files from Transifex. translations_pull:
tx pull -f tx pull
# Requirements
requirements_dev:
pip install -r requirements/development.txt
requirements_docs:
pip install -r requirements/documentation.txt
requirements_testing:
pip install -r requirements/testing.txt
translations-all: ## Execute all translations targets.
translations-all: translations-make translations-push translations-pull translations-compile
# Releases # Releases
increase-version: ## Increase the version number of the entire project's files. release: clean
@VERSION=`grep "__version__ =" mayan/__init__.py| cut -d\' -f 2|./increase_version.py - $(PART)`; \ python setup.py sdist bdist_wheel upload
BUILD=`echo $$VERSION|awk '{split($$VERSION,a,"."); printf("0x%02d%02d%02d\n", a[1],a[2], a[3])}'`; \
sed -i -e "s/__build__ = 0x[0-9]*/__build__ = $${BUILD}/g" mayan/__init__.py; \
sed -i -e "s/__version__ = '[0-9\.]*'/__version__ = '$${VERSION}'/g" mayan/__init__.py; \
echo $$VERSION > docker/rootfs/version
make generate-setup
python-test-release: ## Package (sdist and wheel) and upload to the PyPI test server. sdist: clean
python-test-release: clean wheel
twine upload dist/* -r testpypi
@echo "Test with: pip install -i https://testpypi.python.org/pypi mayan-edms"
python-release: ## Package (sdist and wheel) and upload a release.
python-release: clean python-wheel
twine upload dist/* -r pypi
python-sdist: ## Build the source distribution package.
python-sdist: clean
python setup.py sdist python setup.py sdist
ls -l dist ls -l dist
python-wheel: ## Build the wheel distribution package. wheel: clean
python-wheel: clean python-sdist python setup.py bdist_wheel
pip wheel --no-index --no-deps --wheel-dir dist dist/*.tar.gz
ls -l dist ls -l dist
python-release-test-via-docker-ubuntu: ## Package (sdist and wheel) and upload to the PyPI test server using an Ubuntu Docker builder.
docker run --rm --name mayan_release -v $(HOME):/host_home:ro -v `pwd`:/host_source -w /source ubuntu:16.04 /bin/bash -c "\
echo "LC_ALL=\"en_US.UTF-8\"" >> /etc/default/locale && \
locale-gen en_US.UTF-8 && \
update-locale LANG=en_US.UTF-8 && \
export LC_ALL=en_US.UTF-8 && \
cp -r /host_source/* . && \
apt-get update && \
apt-get install make python-pip -y && \
pip install -r requirements/build.txt && \
cp -r /host_home/.pypirc ~/.pypirc && \
make test-release"
python-release-via-docker-ubuntu: ## Package (sdist and wheel) and upload to PyPI using an Ubuntu Docker builder.
docker run --rm --name mayan_release -v $(HOME):/host_home:ro -v `pwd`:/host_source -w /source ubuntu:16.04 /bin/bash -c "\
apt-get update && \
apt-get -y install locales && \
echo "LC_ALL=\"en_US.UTF-8\"" >> /etc/default/locale && \
locale-gen en_US.UTF-8 && \
update-locale LANG=en_US.UTF-8 && \
export LC_ALL=en_US.UTF-8 && \
cp -r /host_source/* . && \
apt-get install make python-pip -y && \
pip install -r requirements/build.txt && \
cp -r /host_home/.pypirc ~/.pypirc && \
make release"
test-sdist-via-docker-ubuntu: ## Make an sdist package and test it using an Ubuntu Docker container.
docker run --rm --name mayan_sdist_test -v $(HOME):/host_home:ro -v `pwd`:/host_source -w /source ubuntu:16.04 /bin/bash -c "\
cp -r /host_source/* . && \
echo "LC_ALL=\"en_US.UTF-8\"" >> /etc/default/locale && \
locale-gen en_US.UTF-8 && \
update-locale LANG=en_US.UTF-8 && \
export LC_ALL=en_US.UTF-8 && \
apt-get update && \
apt-get install make python-pip libreoffice tesseract-ocr tesseract-ocr-deu poppler-utils -y && \
pip install -r requirements/development.txt && \
make sdist-test-suit \
"
test-wheel-via-docker-ubuntu: ## Make a wheel package and test it using an Ubuntu Docker container.
docker run --rm --name mayan_wheel_test -v $(HOME):/host_home:ro -v `pwd`:/host_source -w /source ubuntu:16.04 /bin/bash -c "\
cp -r /host_source/* . && \
echo "LC_ALL=\"en_US.UTF-8\"" >> /etc/default/locale && \
locale-gen en_US.UTF-8 && \
update-locale LANG=en_US.UTF-8 && \
export LC_ALL=en_US.UTF-8 && \
apt-get update && \
apt-get install make python-pip libreoffice tesseract-ocr tesseract-ocr-deu poppler-utils -y && \
pip install -r requirements/development.txt && \
make wheel-test-suit \
"
python-sdist-test-suit: sdist
rm -f -R _virtualenv
virtualenv _virtualenv
sh -c '\
. _virtualenv/bin/activate; \
pip install `ls dist/*.gz`; \
_virtualenv/bin/mayan-edms.py initialsetup; \
pip install mock==2.0.0; \
_virtualenv/bin/mayan-edms.py test --mayan-apps \
'
python-wheel-test-suit: wheel
rm -f -R _virtualenv
virtualenv _virtualenv
sh -c '\
. _virtualenv/bin/activate; \
pip install `ls dist/*.whl`; \
_virtualenv/bin/mayan-edms.py initialsetup; \
pip install mock==2.0.0; \
_virtualenv/bin/mayan-edms.py test --mayan-apps \
'
generate-setup: ## Create and update the setup.py file.
generate-setup: generate-requirements
@./generate_setup.py
@echo "Complete."
generate-requirements: ## Generate all requirements files from the project depedency declarations.
@./manage.py generaterequirements build > requirements/build.txt
@./manage.py generaterequirements development > requirements/development.txt
@./manage.py generaterequirements documentation > requirements/documentation.txt
@./manage.py generaterequirements production --only=pathlib2 >> requirements/documentation.txt
@./manage.py generaterequirements testing > requirements/testing-base.txt
@./manage.py generaterequirements production --exclude=django > requirements/base.txt
@./manage.py generaterequirements production --only=django > requirements/common.txt
gitlab-release-documentation: ## Trigger the documentation build and publication using GitLab CI
gitlab-release-documentation:
git push
git push --tags
git push origin :releases/documentation || true
git push origin HEAD:releases/documentation
gitlab-release-docker: ## Trigger the Docker image build and publication using GitLab CI
gitlab-release-docker:
git push
git push --tags
git push origin :releases/docker || true
git push origin HEAD:releases/docker
gitlab-release-python: ## Trigger the Python package build and publication using GitLab CI
gitlab-release-python:
git push
git push --tags
git push origin :releases/python || true
git push origin HEAD:releases/python
gitlab-release-all: ## Trigger the Python package, Docker image, and documentation build and publication using GitLab CI
gitlab-release-all:
git push
git push --tags
git push origin :releases/all || true
git push origin HEAD:releases/all
# Dev server # Dev server
runserver: ## Run the development server. runserver:
./manage.py runserver --nothreading --settings=mayan.settings.development $(ADDRPORT) $(BROWSER) http://127.0.0.1:8000
./manage.py runserver
runserver_plus: ## Run the Django extension's development server.
./manage.py runserver_plus --nothreading --settings=mayan.settings.development $(ADDRPORT)
shell_plus: ## Run the shell_plus command.
./manage.py shell_plus --settings=mayan.settings.development
test-with-docker-services-on: ## Launch and initialize production-like services using Docker (Postgres and Redis).
docker run -d --name redis -p 6379:6379 $(DOCKER_REDIS_IMAGE_VERSION)
docker run -d --name postgres -p 5432:5432 $(DOCKER_POSTGRES_IMAGE_VERSION)
while ! nc -z 127.0.0.1 6379; do sleep 1; done
while ! nc -z 127.0.0.1 5432; do sleep 1; done
sleep 4
pip install psycopg2==$(PYTHON_PSYCOPG2_VERSION) redis==$(PYTHON_REDIS_VERSION)
./manage.py initialsetup --settings=mayan.settings.staging.docker
test-with-docker-services-off: ## Stop and delete the Docker production-like services.
docker stop postgres redis
docker rm postgres redis
test-with-docker-frontend: ## Launch a front end instance that uses the production-like services.
./manage.py runserver --settings=mayan.settings.staging.docker
test-with-docker-worker: ## Launch a worker instance that uses the production-like services.
DJANGO_SETTINGS_MODULE=mayan.settings.staging.docker ./manage.py celery worker -A mayan -B -l INFO -O fair
docker-mysql-on: ## Launch and initialize a MySQL Docker container.
docker run -d --name mysql -p 3306:3306 -e MYSQL_ALLOW_EMPTY_PASSWORD=True -e MYSQL_DATABASE=mayan_edms $(DOCKER_MYSQL_IMAGE_VERSION)
while ! nc -z 127.0.0.1 3306; do sleep 1; done
docker-mysql-off: ## Stop and delete the MySQL Docker container.
docker stop mysql
docker rm mysql
docker-postgres-on: ## Launch and initialize a PostgreSQL Docker container.
docker run -d --name postgres -p 5432:5432 $(DOCKER_POSTGRES_IMAGE_VERSION)
while ! nc -z 127.0.0.1 5432; do sleep 1; done
docker-postgres-off: ## Stop and delete the PostgreSQL Docker container.
docker stop postgres
docker rm postgres
# Security
safety-check: ## Run a package safety check.
safety check
# Other
find-gitignores: ## Find stray .gitignore files.
@export FIND_GITIGNORES=`find -name '.gitignore'| wc -l`; \
if [ $${FIND_GITIGNORES} -gt 1 ] ;then echo "More than one .gitignore found."; fi
python-build:
docker rm -f mayan-edms-build || true && \
docker run --rm --name mayan-edms-build -v $(HOME):/host_home:ro -v `pwd`:/host_source -w /source python:2-slim sh -c "\
rm /host_source/dist -R || true && \
mkdir /host_source/dist || true && \
export LC_ALL=C.UTF-8 && \
cp -r /host_source/* . && \
apt-get update && \
apt-get install -y make && \
pip install -r requirements/build.txt && \
make wheel && \
cp dist/* /host_source/dist/"
check-readme: ## Checks validity of the README.rst file for PyPI publication.
python setup.py check -r -s
check-missing-migrations: ## Make sure all models have proper migrations.
./manage.py makemigrations --dry-run --noinput --check
setup-dev-environment: ## Bootstrap a virtualenv by install all dependencies to start developing.
pip install -r requirements.txt -r requirements/development.txt -r requirements/testing-base.txt -r requirements/documentation.txt -r requirements/build.txt
-include docker/Makefile

View File

@@ -1,83 +0,0 @@
[![Donation](https://img.shields.io/badge/donation-PayPal-brightgreen)](https://paypal.me/MayanEDMS)
[![pypi][pypi]][pypi-url]
![python][python]
![license][license]
[![Docker pulls](https://img.shields.io/docker/pulls/mayanedms/mayanedms.svg?maxAge=3600)](https://hub.docker.com/r/mayanedms/mayanedms/)
[![Docker Stars](https://img.shields.io/docker/stars/mayanedms/mayanedms.svg?maxAge=3600)](https://hub.docker.com/r/mayanedms/mayanedms/)
[pypi]: http://img.shields.io/pypi/v/mayan-edms.svg
[pypi-url]: http://badge.fury.io/py/mayan-edms
[builds]: https://gitlab.com/mayan-edms/mayan-edms/badges/master/build.svg
[builds-url]: https://gitlab.com/mayan-edms/mayan-edms/pipelines
[cover]: https://codecov.io/gitlab/mayan-edms/mayan-edms/coverage.svg?branch=master
[cover-url]: https://codecov.io/gitlab/mayan-edms/mayan-edms?branch=master
[python]: https://img.shields.io/pypi/pyversions/mayan-edms.svg
[python-url]: https://img.shields.io/pypi/l/mayan-edms.svg?style=flat
[license]: https://img.shields.io/pypi/l/mayan-edms.svg?style=flat
[license-url]: https://img.shields.io/pypi/l/mayan-edms.svg?style=flat
<div align="center">
<a href="http://www.mayan-edms.com">
<img width="200" heigth="200" src="https://gitlab.com/mayan-edms/mayan-edms/raw/master/docs/_static/mayan_logo.png">
</a>
<br>
<br>
<p>
Mayan EDMS is a document management system. Its main purpose is to store,
introspect, and categorize files, with a strong emphasis on preserving the
contextual and business information of documents. It can also OCR, preview,
label, sign, send, and receive thoses files. Other features of interest
are its workflow system, role based access control, and REST API.
<p>
<p align="center">
<img width="400" src="https://gitlab.com/mayan-edms/mayan-edms/raw/master/docs/_static/overview.gif">
</p>
</div>
<h2 align="center">Book</h2>
The final version of the book "Exploring Mayan EDMS" available now!
<p align="center">
<a href="https://sellfy.com/p/um2fkx/">
<img width="400" src="https://d12swbtw719y4s.cloudfront.net/images/v6RpxW40/aP0qKLjkPiAuXZhYuB45/wDAULAzFyx.jpeg?w=548">
</a>
</p>
The link is https://sellfy.com/p/um2fkx/
<h2 align="center">Installation</h2>
The easiest way to use Mayan EDMS is by using the official
[Docker](https://www.docker.com/) image. Make sure Docker is properly installed
and working before attempting to install Mayan EDMS.
For the complete set of installation instructions visit the Mayan EDMS documentation
at: https://docs.mayan-edms.com/topics/installation.html
<h2 align="center">Hardware requirements</h2>
- 2 Gigabytes of RAM (1 Gigabyte if OCR is turned off).
- Multiple core CPU (64 bit, faster than 1 GHz recommended).
<h2 align="center">Important links</h2>
- [Homepage](http://www.mayan-edms.com)
- [Documentation](https://docs.mayan-edms.com)
- [Wiki](https://wiki.mayan-edms.com/)
- [Contributing](https://gitlab.com/mayan-edms/mayan-edms/blob/master/CONTRIBUTING.md)
- [Forum](https://forum.mayan-edms.com/)
- [Source code, issues, bugs](https://gitlab.com/mayan-edms/mayan-edms)
- [Plug-ins, other related projects](https://gitlab.com/mayan-edms/)
- [Translations](https://www.transifex.com/rosarior/mayan-edms/)
- [Videos](https://www.youtube.com/channel/UCJOOXHP1MJ9lVA7d8ZTlHPw)

View File

@@ -1,71 +1,75 @@
|donation| |pypi| |coverage| |python| |license| |docker_pulls| |docker_stars| |docker_layers| |PyPI badge| |Build Status| |Coverage badge| |Installs badge| |License badge|
|Logo|
Description
-----------
Free Open Source Electronic Document Management System.
`Website`_
`Video demostration`_
`Documentation`_
`Translations`_
`Mailing list (via Google Groups)`_
|Animation|
License
-------
This project is open sourced under `Apache 2.0 License`_.
Installation
------------
To install Mayan EDMS, simply do:
.. code-block:: bash
$ virtualenv venv
$ source venv/bin/activate
$ pip install mayan-edms
$ mayan-edms.py initialsetup
$ mayan-edms.py runserver
Point your browser to 127.0.0.1:8000 and use the automatically created admin
account.
Contribute
----------
- Check for open issues or open a fresh issue to start a discussion around a feature idea or a bug.
- Fork `the repository`_ on GitLab to start making your changes to the **development** branch (or branch off of it).
- Write a test which shows that the bug was fixed or that the feature works as expected.
- Add yourself to the `contributors file`_.
- Send a merge request.
.. image:: https://gitlab.com/mayan-edms/mayan-edms/raw/master/docs/_static/mayan_logo.png .. _Website: http://www.mayan-edms.com
:align: center .. _Video demostration: http://bit.ly/pADNXv
:width: 200 .. _Documentation: http://readthedocs.org/docs/mayan/en/latest/
:height: 200 .. _Translations: https://www.transifex.com/projects/p/mayan-edms/
.. _Mailing list (via Google Groups): http://groups.google.com/group/mayan-edms
.. _Apache 2.0 License: https://www.apache.org/licenses/LICENSE-2.0.txt
.. _`the repository`: http://gitlab.com/mayan-edms/mayan-edms
.. _`contributors file`: https://gitlab.com/mayan-edms/mayan-edms/blob/master/docs/topics/contributors.rst
Mayan EDMS is a document management system. Its main purpose is to store, .. |Build Status| image:: https://gitlab.com/mayan-edms/mayan-edms/badges/master/build.svg
introspect, and categorize files, with a strong emphasis on preserving the :target: https://gitlab.com/mayan-edms/mayan-edms/commits/master
contextual and business information of documents. It can also OCR, preview, .. |Logo| image:: https://gitlab.com/mayan-edms/mayan-edms/raw/master/docs/_static/mayan_logo.png
label, sign, send, and receive thoses files. Other features of interest .. |Animation| image:: https://gitlab.com/mayan-edms/mayan-edms/raw/master/docs/_static/overview.gif
are its workflow system, role based access control, and REST API. .. |Installs badge| image:: http://img.shields.io/pypi/dm/mayan-edms.svg?style=flat
:target: https://crate.io/packages/mayan-edms/
.. image:: https://gitlab.com/mayan-edms/mayan-edms/raw/master/docs/_static/overview.gif .. |PyPI badge| image:: http://img.shields.io/pypi/v/mayan-edms.svg?style=flat
:align: center
:width: 300
The easiest way to use Mayan EDMS is by using the official Docker_ image.
Make sure Docker is properly installed and working before attempting to install
Mayan EDMS.
For the complete set of installation instructions visit the Mayan EDMS documentation
at: https://docs.mayan-edms.com/topics/installation.html
.. _Docker: https://www.docker.com/
The final version of the book "Exploring Mayan EDMS" available now!
.. image:: https://camo.githubusercontent.com/89d2fe787507c9247aa7bb406e2682b53eb7a5f9/68747470733a2f2f64313273776274773731397934732e636c6f756466726f6e742e6e65742f696d616765732f76365270785734302f615030714b4c6a6b50694175585a6859754234352f774441554c417a4679782e6a7065673f773d353438
:align: center
:width: 300
:target: https://sellfy.com/p/um2fkx/
Click the image or visit: https://sellfy.com/p/um2fkx/
Hardware requirements
- 2 Gigabytes of RAM (1 Gigabyte if OCR is turned off).
- Multiple core CPU (64 bit, faster than 1 GHz recommended).
Important links
- `Homepage <http://www.mayan-edms.com>`__
- `Documentation <https://docs.mayan-edms.com>`__
- `Wiki <https://wiki.mayan-edms.com>`__
- `Contributing <https://gitlab.com/mayan-edms/mayan-edms/blob/master/CONTRIBUTING.md>`__
- `Forum <https://forum.mayan-edms.com>`__
- `Source code, issues, bugs <https://gitlab.com/mayan-edms/mayan-edms>`__
- `Plug-ins, other related projects <https://gitlab.com/mayan-edms/>`__
- `Translations <https://www.transifex.com/rosarior/mayan-edms/>`__
- `Videos <https://www.youtube.com/channel/UCJOOXHP1MJ9lVA7d8ZTlHPw>`__
.. |donation| image:: https://img.shields.io/badge/donation-PayPal-brightgreen
:target: https://paypal.me/MayanEDMS
.. |pypi| image:: http://img.shields.io/pypi/v/mayan-edms.svg
:target: http://badge.fury.io/py/mayan-edms :target: http://badge.fury.io/py/mayan-edms
.. |builds| image:: https://gitlab.com/mayan-edms/mayan-edms/badges/master/build.svg .. |License badge| image:: http://img.shields.io/badge/license-Apache%202.0-green.svg?style=flat
:target: https://gitlab.com/mayan-edms/mayan-edms/pipelines .. |Analytics| image:: https://ga-beacon.appspot.com/UA-52965619-2/mayan-edms/readme?pixel
.. |coverage| image:: https://codecov.io/gitlab/mayan-edms/mayan-edms/coverage.svg?branch=master .. |Coverage badge| image:: https://codecov.io/gitlab/mayan-edms/mayan-edms/coverage.svg?branch=master
:target: https://codecov.io/gitlab/mayan-edms/mayan-edms?branch=master :target: https://codecov.io/gitlab/mayan-edms/mayan-edms?branch=master
.. |python| image:: https://img.shields.io/pypi/pyversions/mayan-edms.svg
.. |license| image:: https://img.shields.io/pypi/l/mayan-edms.svg?style=flat |Analytics|
.. |docker_pulls| image:: https://img.shields.io/docker/pulls/mayanedms/mayanedms.svg?maxAge=3600
:target: https://hub.docker.com/r/mayanedms/mayanedms/
.. |docker_stars| image:: https://img.shields.io/docker/stars/mayanedms/mayanedms.svg?maxAge=3600
:target: https://hub.docker.com/r/mayanedms/mayanedms/
.. |docker_layers| image:: https://images.microbadger.com/badges/image/mayanedms/mayanedms.svg
:target: https://microbadger.com/images/mayanedms/mayanedms

33
Vagrantfile vendored Normal file
View File

@@ -0,0 +1,33 @@
# -*- mode: ruby -*-
# vi: set ft=ruby :
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.box = "ubuntu/trusty64"
config.vm.provider :lxc do |v, override|
override.vm.box = "fgrehm/trusty64-lxc"
end
config.vm.provider :virtualbox do |vb|
vb.customize ["modifyvm", :id, "--memory", "1024"]
end
# Development box
config.vm.define "development", autostart: false do |development|
development.vm.network "forwarded_port", guest: 8000, host: 8000
development.vm.synced_folder ".", "/mayan-edms-repository"
development.vm.provision :shell, :path => "contrib/scripts/install/development.sh", privileged: false
development.vm.provision "file", destination: "/home/vagrant/mayan-edms/mayan/settings/celery_redis.py", source: "contrib/settings/celery_redis.py"
development.vm.provision "file", destination: "/home/vagrant/mayan-edms/mayan_edms_worker.sh", source: "contrib/misc/mayan_edms_worker.sh"
end
# Production box
config.vm.define "production", autostart: false do |production|
production.vm.network "forwarded_port", guest: 80, host: 8080
production.vm.provision :shell, :path => "contrib/scripts/install/production.sh", privileged: true
end
end

View File

@@ -1,14 +0,0 @@
from __future__ import unicode_literals
__title__ = 'Mayan EDMS'
__version__ = '{{ version }}'
__build__ = {{ build }}
__build_string__ = '{{ build_string }}'
__django_version__ = '1.11'
__author__ = 'Roberto Rosario'
__author_email__ = 'roberto.rosario@mayan-edms.com'
__description__ = 'Free Open Source Electronic Document Management System'
__license__ = 'Apache 2.0'
__copyright_short__ = '2011 Roberto Rosario'
__copyright__ = '{} {}'.format('Copyright', __copyright_short__)
__website__ = 'https://www.mayan-edms.com'

View File

@@ -1,16 +0,0 @@
DOCKER_MYSQL_IMAGE_VERSION=mysql:8.0
DOCKER_ORACLE_IMAGE_VERSION=wnameless/oracle-xe-11g
DOCKER_POSTGRES_IMAGE_VERSION=postgres:9.6-alpine
DOCKER_RABBITMQ_IMAGE_VERSION=rabbitmq:3-alpine
DOCKER_REDIS_IMAGE_VERSION=redis:5.0-alpine
PYTHON_AMQP_VERSION=2.5.2
PYTHON_FLOWER_VERSION=0.9.3
PYTHON_LIBRABBITMQ_VERSION=2.0.0
PYTHON_MYSQL_VERSION=1.4.4
PYTHON_ORACLE_VERSION=7.2.3
PYTHON_PSYCOPG2_VERSION=2.8.3
PYTHON_PSUTIL_VERSION=5.6.2
PYTHON_REDIS_VERSION=3.2.1
SOURCE_CODE_REPOSITORY=https://gitlab.com/mayan-edms/mayan-edms/
SOURCE_CODE_GIT=https://gitlab.com/mayan-edms/mayan-edms.git
SOURCE_CODE_ISSUES=https://gitlab.com/mayan-edms/mayan-edms/issues/

View File

@@ -0,0 +1,3 @@
#!/bin/sh
DJANGO_SETTINGS_MODULE='mayan.settings.celery_redis' celery -A mayan worker -l DEBUG -Ofair -B

22
contrib/nginx/mayan Normal file
View File

@@ -0,0 +1,22 @@
server {
listen 80;
server_name localhost;
location / {
include uwsgi_params;
uwsgi_pass unix:/usr/share/mayan-edms/uwsgi.sock;
client_max_body_size 30M; # Increse if your plan to upload bigger documents
proxy_read_timeout 30s; # Increase if your document uploads take more than 30 seconds
}
location /static {
alias /usr/share/mayan-edms/mayan/media/static;
expires 1h;
}
location /favicon.ico {
alias /usr/share/mayan-edms/mayan/media/static/appearance/images/favicon.ico;
expires 1h;
}
}

View File

Before

Width:  |  Height:  |  Size: 47 KiB

After

Width:  |  Height:  |  Size: 47 KiB

View File

Before

Width:  |  Height:  |  Size: 17 KiB

After

Width:  |  Height:  |  Size: 17 KiB

1
contrib/scripts/PEP8_check.sh Executable file
View File

@@ -0,0 +1 @@
flake8 --ignore=E501 mayan/apps | grep -v "F401 'models' imported but unused" | grep -v "F811 redefinition of unused 'models'"| grep -v "F401 'db' imported but unused" | grep -v "F812 list comprehension redefines 'user_id'" | grep -v "F812 list comprehension redefines 'document_id'" |less

View File

@@ -0,0 +1,25 @@
!/bin/bash
Directories[0]="."
# Setup find correctly.
export IFS=$'\n'
# Loop through our array.
for x in ${Directories[@]}
do
# Find all directories & subdirectories
for i in $(find $x -type d)
do
# Fix Permissions
chmod -c 775 $i
chown -c www-data:www-data $i
done
# Find all Files
for i in $(find $x -type f)
do
# Fix Permissions
chmod -c 664 $i
chown -c www-data:www-data $i
done
done

View File

@@ -0,0 +1,72 @@
#!/usr/bin/env bash
INSTALLATION_DIRECTORY=/home/vagrant/mayan-edms/
DB_NAME=mayan_edms
DB_PASSWORD=test123
cat << EOF | sudo tee -a /etc/motd.tail
**********************************sudo apt
Mayan EDMS Vagrant Development Box
**********************************
EOF
# Update sources
echo -e "\n -> Running apt-get update & upgrade \n"
sudo apt-get -qq update
sudo apt-get -y upgrade
echo -e "\n -> Installing core binaries \n"
sudo apt-get -y install git-core python-virtualenv gcc python-dev libjpeg-dev libpng-dev libtiff-dev tesseract-ocr poppler-utils libreoffice
echo -e "\n -> Cloning development branch of repository \n"
git clone /mayan-edms-repository/ $INSTALLATION_DIRECTORY
cd $INSTALLATION_DIRECTORY
git checkout development
git reset HEAD --hard
echo -e "\n -> Setting up virtual env \n"
virtualenv venv
source venv/bin/activate
echo -e "\n -> Installing python dependencies \n"
pip install -r requirements.txt
echo -e "\n -> Running Mayan EDMS initial setup \n"
./manage.py initialsetup
echo -e "\n -> Installing Redis server \n"
sudo apt-get install -y redis-server
pip install redis
echo -e "\n -> Installing testing software \n"
pip install coverage
echo -e "\n -> Installing MySQL \n"
sudo debconf-set-selections <<< 'mysql-server mysql-server/root_password password '$DB_PASSWORD
sudo debconf-set-selections <<< 'mysql-server mysql-server/root_password_again password '$DB_PASSWORD
sudo apt-get install -y mysql-server libmysqlclient-dev
# Create a passwordless root and travis users
mysql -u root -p$DB_PASSWORD -e "SET PASSWORD = PASSWORD('');"
mysql -u root -e "CREATE USER 'travis'@'localhost' IDENTIFIED BY '';GRANT ALL PRIVILEGES ON * . * TO 'travis'@'localhost';FLUSH PRIVILEGES;"
mysql -u travis -e "CREATE DATABASE $DB_NAME;"
pip install mysql-python
echo -e "\n -> Installing PostgreSQL \n"
sudo apt-get install -y postgresql postgresql-server-dev-all
sudo -u postgres psql -c 'create database mayan_edms;' -U postgres
sudo cat > /etc/postgresql/9.3/main/pg_hba.conf << EOF
local all postgres trust
# TYPE DATABASE USER ADDRESS METHOD
# "local" is for Unix domain socket connections only
local all all peer
# IPv4 local connections:
host all all 127.0.0.1/32 md5
# IPv6 local connections:
host all all ::1/128 md5
EOF
pip install -q psycopg2

View File

@@ -1,198 +0,0 @@
#!/bin/sh
set -e
# This script is meant for quick & easy install via:
# $ curl -fsSL get.mayan-edms.com -o get-mayan-edms.sh
# $ sh get-mayan-edms.sh
#
# NOTE: Before executing, make sure to verify the contents of the script
# you downloaded matches the contents of docker.sh
# located at https://gitlab.com/mayan-edms/mayan-edms/blob/master/contrib/scripts/install/docker.sh
: ${VERBOSE:=true}
: ${INSTALL_DOCKER:=false}
: ${DELETE_VOLUMES:=false}
: ${USE_DOCKER_NETWORK:=true}
: ${DOCKER_NETWORK_NAME:=mayan}
: ${DATABASE_USER:=mayan}
: ${DATABASE_NAME:=mayan}
: ${DATABASE_PASSWORD:=mayanuserpass}
: ${DOCKER_POSTGRES_IMAGE:=postgres:9.6-alpine}
: ${DOCKER_POSTGRES_CONTAINER:=mayan-edms-postgres}
: ${DOCKER_POSTGRES_VOLUME:=/docker-volumes/mayan-edms/postgres}
: ${DOCKER_POSTGRES_PORT:=5432}
: ${DOCKER_POSTGRES_DELAY:=10}
: ${DOCKER_REDIS_IMAGE:=redis:5.0-alpine}
: ${DOCKER_REDIS_CONTAINER:=mayan-edms-redis}
: ${DOCKER_REDIS_PORT:=6379}
: ${DOCKER_MAYAN_IMAGE:=mayanedms/mayanedms:latest}
: ${DOCKER_MAYAN_CONTAINER:=mayan-edms}
: ${DOCKER_MAYAN_VOLUME:=/docker-volumes/mayan-edms/media}
: ${DOCKER_MAYAN_PORT:=80}
cat << EOF
███╗ ███╗ █████╗ ██╗ ██╗ █████╗ ███╗ ██╗
████╗ ████║██╔══██╗╚██╗ ██╔╝██╔══██╗████╗ ██║
██╔████╔██║███████║ ╚████╔╝ ███████║██╔██╗ ██║
██║╚██╔╝██║██╔══██║ ╚██╔╝ ██╔══██║██║╚██╗██║
██║ ╚═╝ ██║██║ ██║ ██║ ██║ ██║██║ ╚████║
╚═╝ ╚═╝╚═╝ ╚═╝ ╚═╝ ╚═╝ ╚═╝╚═╝ ╚═══╝
Docker deploy script
NOTE: Make sure to verify the contents of this script
matches the contents of docker.sh located at https://gitlab.com/mayan-edms/mayan-edms/blob/master/contrib/scripts/install/docker.sh before executing.
EOF
if [ "$VERBOSE" = true ]; then
echo "Variable values to be used:"
echo "---------------------------"
echo "INSTALL_DOCKER: $INSTALL_DOCKER"
echo "DELETE_VOLUMES: $DELETE_VOLUMES"
echo "USE_DOCKER_NETWORK: $USE_DOCKER_NETWORK"
echo "DOCKER_NETWORK_NAME: $DOCKER_NETWORK_NAME"
echo "DATABASE_USER: $DATABASE_USER"
echo "DATABASE_NAME: $DATABASE_NAME"
echo "DATABASE_PASSWORD: $DATABASE_PASSWORD"
echo "DOCKER_POSTGRES_IMAGE: $DOCKER_POSTGRES_IMAGE"
echo "DOCKER_POSTGRES_CONTAINER: $DOCKER_POSTGRES_CONTAINER"
echo "DOCKER_POSTGRES_VOLUME: $DOCKER_POSTGRES_VOLUME"
echo "DOCKER_POSTGRES_PORT: $DOCKER_POSTGRES_PORT"
echo "DOCKER_POSTGRES_DELAY: $DOCKER_POSTGRES_DELAY"
echo "DOCKER_REDIS_IMAGE: $DOCKER_REDIS_IMAGE"
echo "DOCKER_REDIS_CONTAINER: $DOCKER_REDIS_CONTAINER"
echo "DOCKER_REDIS_PORT: $DOCKER_REDIS_PORT"
echo "DOCKER_MAYAN_IMAGE: $DOCKER_MAYAN_IMAGE"
echo "DOCKER_MAYAN_CONTAINER: $DOCKER_MAYAN_CONTAINER"
echo "DOCKER_MAYAN_VOLUME: $DOCKER_MAYAN_VOLUME"
echo "DOCKER_MAYAN_PORT: $DOCKER_MAYAN_PORT"
echo
echo "Override any of them by setting them before the script. "
echo "Example: INSTALL_DOCKER=true sh get-mayan-edms.sh"
echo "\nStarting in 10 seconds. Press CTRL+C to cancel."
sleep 10
fi
if [ "$INSTALL_DOCKER" = true ]; then
echo -n "* Installing Docker..."
curl -fsSL get.docker.com -o get-docker.sh >/dev/null
sh get-docker.sh >/dev/null 2>&1
rm get-docker.sh
echo "Done"
fi
if [ -z `which docker` ]; then
echo "Docker is not installed. Rerun this script with the variable INSTALL_DOCKER set to true."
exit 1
fi
echo -n "* Removing existing Mayan EDMS and PostgreSQL containers (no data will be lost)..."
docker rm -f $DOCKER_REDIS_CONTAINER >/dev/null 2>&1 || true
docker rm -f $DOCKER_POSTGRES_CONTAINER >/dev/null 2>&1 || true
docker rm -f $DOCKER_MAYAN_CONTAINER >/dev/null 2>&1 || true
echo "Done"
if [ "$DELETE_VOLUMES" = true ]; then
echo -n "* Deleting Docker volumes in 5 seconds (warning: this will delete all document data). Press CTRL+C to cancel..."
sleep 5
rm DOCKER_MAYAN_VOLUME -Rf || true
rm DOCKER_POSTGRES_VOLUME -Rf || true
echo "Done"
fi
echo -n "* Pulling (downloading) the Redis Docker image..."
docker pull $DOCKER_REDIS_IMAGE > /dev/null
echo "Done"
echo -n "* Pulling (downloading) the PostgreSQL Docker image..."
docker pull $DOCKER_POSTGRES_IMAGE > /dev/null
echo "Done"
echo -n "* Pulling (downloading) the Mayan EDMS Docker image..."
docker pull $DOCKER_MAYAN_IMAGE >/dev/null
echo "Done"
if [ "$USE_DOCKER_NETWORK" = true ]; then
echo -n "* Creating Docker network..."
docker network create $DOCKER_NETWORK_NAME 2> /dev/null || true
# Ignore error if the network already exists
echo "Done"
fi
if [ "$USE_DOCKER_NETWORK" = true ]; then
NETWORK_ARGUMENT="--network=$DOCKER_NETWORK_NAME"
POSTGRES_PORT_ARGUMENT=""
REDIS_PORT_ARGUMENT=""
MAYAN_DATABASE_PORT_ARGUMENT=""
MAYAN_DATABASE_HOST_ARGUMENT="-e MAYAN_DATABASE_HOST=$DOCKER_POSTGRES_CONTAINER"
MAYAN_CELERY_BROKER_URL_ARGUMENT="-e MAYAN_CELERY_BROKER_URL=redis://$DOCKER_REDIS_CONTAINER:6379/0"
MAYAN_CELERY_RESULT_BACKEND_ARGUMENT="-e MAYAN_CELERY_RESULT_BACKEND=redis://$DOCKER_REDIS_CONTAINER:6379/1"
else
NETWORK_ARGUMENT=""
POSTGRES_PORT_ARGUMENT="-e $DOCKER_POSTGRES_PORT:5432"
REDIS_PORT_ARGUMENT="-e $DOCKER_REDIS_PORT:6379"
MAYAN_DATABASE_PORT_ARGUMENT="-e MAYAN_DATABASE_PORT=$DOCKER_POSTGRES_PORT"
MAYAN_DATABASE_HOST_ARGUMENT="-e MAYAN_DATABASE_HOST=172.17.0.1"
MAYAN_CELERY_BROKER_URL_ARGUMENT="-e MAYAN_CELERY_BROKER_URL=redis://172.17.0.1:6379/0"
MAYAN_CELERY_RESULT_BACKEND_ARGUMENT="-e MAYAN_CELERY_RESULT_BACKEND=redis://172.17.0.1:6379/1"
fi
echo -n "* Deploying the PostgreSQL container..."
docker run -d \
--name $DOCKER_POSTGRES_CONTAINER \
$NETWORK_ARGUMENT \
--restart=always \
$POSTGRES_PORT_ARGUMENT \
-e POSTGRES_USER=$DATABASE_USER \
-e POSTGRES_DB=$DATABASE_NAME \
-e POSTGRES_PASSWORD=$DATABASE_PASSWORD \
-v $DOCKER_POSTGRES_VOLUME:/var/lib/postgresql/data \
$DOCKER_POSTGRES_IMAGE >/dev/null
echo "Done"
echo -n "* Deploying the Redis container..."
docker run -d \
--name $DOCKER_REDIS_CONTAINER \
$NETWORK_ARGUMENT \
--restart=always \
$REDIS_PORT_ARGUMENT \
$DOCKER_REDIS_IMAGE \
redis-server \
--appendonly no \
--databases 2 \
--maxmemory 100mb \
--maxmemory-policy allkeys-lru \
--maxclients 500 \
--save "" \
--tcp-backlog 256 \
>/dev/null
echo "Done"
echo -n "* Waiting for the PostgreSQL container to be ready (${DOCKER_POSTGRES_DELAY} seconds)..."
sleep $DOCKER_POSTGRES_DELAY
echo "Done"
echo -n "* Deploying Mayan EDMS container..."
docker run -d \
--name $DOCKER_MAYAN_CONTAINER \
$NETWORK_ARGUMENT \
--restart=always \
-p $DOCKER_MAYAN_PORT:8000 \
-e MAYAN_DATABASE_ENGINE=django.db.backends.postgresql \
$MAYAN_DATABASE_HOST_ARGUMENT \
$MAYAN_DATABASE_PORT_ARGUMENT \
-e MAYAN_DATABASE_NAME=$DATABASE_NAME \
-e MAYAN_DATABASE_PASSWORD=$DATABASE_PASSWORD \
-e MAYAN_DATABASE_USER=$DATABASE_USER \
-e MAYAN_DATABASE_CONN_MAX_AGE=0 \
$MAYAN_CELERY_BROKER_URL_ARGUMENT \
$MAYAN_CELERY_RESULT_BACKEND_ARGUMENT \
-v $DOCKER_MAYAN_VOLUME:/var/lib/mayan \
$DOCKER_MAYAN_IMAGE >/dev/null
echo "Done"
echo -n "* Waiting for the Mayan EDMS container to be ready (might take a few minutes)..."
while ! curl --output /dev/null --silent --head --fail http://localhost:$DOCKER_MAYAN_PORT; do sleep 1 && echo -n .; done;
echo "Done"

View File

@@ -0,0 +1,171 @@
#!/usr/bin/env bash
# ====== CONFIG ======
INSTALLATION_DIRECTORY=/usr/share/mayan-edms/
DB_NAME=mayan_edms
DB_USERNAME=mayan
DB_PASSWORD=test123
# ==== END CONFIG ====
cat << EOF | tee -a /etc/motd.tail
**********************************
Mayan EDMS Vagrant Production Box
**********************************
EOF
echo -e "\n -> Running apt-get update & upgrade \n"
apt-get -qq update
apt-get -y upgrade
echo -e "\n -> Installing core binaries \n"
apt-get install nginx supervisor redis-server postgresql libpq-dev libjpeg-dev libmagic1 libpng-dev libreoffice libtiff-dev gcc ghostscript gpgv python-dev python-virtualenv tesseract-ocr poppler-utils -y
echo -e "\n -> Setting up virtualenv \n"
rm -f ${INSTALLATION_DIRECTORY}
virtualenv ${INSTALLATION_DIRECTORY}
source ${INSTALLATION_DIRECTORY}bin/activate
echo -e "\n -> Installing Mayan EDMS from PyPI \n"
pip install mayan-edms
echo -e "\n -> Installing Python client for PostgreSQL, Redis, and uWSGI \n"
pip install psycopg2 redis uwsgi
echo -e "\n -> Creating the database for the installation \n"
echo "CREATE USER mayan WITH PASSWORD '$DB_PASSWORD';" | sudo -u postgres psql
sudo -u postgres createdb -O $DB_USERNAME $DB_NAME
echo -e "\n -> Creating the directories for the logs \n"
mkdir /var/log/mayan
echo -e "\n -> Making a convenience symlink \n"
cd ${INSTALLATION_DIRECTORY}
ln -s lib/python2.7/site-packages/mayan .
echo -e "\n -> Creating an initial settings file \n"
mayan-edms.py createsettings
echo -e "\n -> Updating the mayan/settings/local.py file \n"
cat >> mayan/settings/local.py << EOF
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql_psycopg2',
'NAME': '$DB_NAME',
'USER': '$DB_USERNAME',
'PASSWORD': '$DB_PASSWORD',
'HOST': 'localhost',
'PORT': '5432',
}
}
BROKER_URL = 'redis://127.0.0.1:6379/0'
CELERY_RESULT_BACKEND = 'redis://127.0.0.1:6379/0'
EOF
echo -e "\n -> Migrating the database or initialize the project \n"
mayan-edms.py initialsetup
echo -e "\n -> Disabling the default NGINX site \n"
rm -f /etc/nginx/sites-enabled/default
echo -e "\n -> Creating a uwsgi.ini file \n"
cat > uwsgi.ini << EOF
[uwsgi]
chdir = ${INSTALLATION_DIRECTORY}lib/python2.7/site-packages/mayan
chmod-socket = 664
chown-socket = www-data:www-data
env = DJANGO_SETTINGS_MODULE=mayan.settings.production
gid = www-data
logto = /var/log/uwsgi/%n.log
pythonpath = ${INSTALLATION_DIRECTORY}lib/python2.7/site-packages
master = True
max-requests = 5000
socket = ${INSTALLATION_DIRECTORY}uwsgi.sock
uid = www-data
vacuum = True
wsgi-file = ${INSTALLATION_DIRECTORY}lib/python2.7/site-packages/mayan/wsgi.py
EOF
echo -e "\n -> Creating the directory for the uWSGI log files \n"
mkdir -p /var/log/uwsgi
echo -e "\n -> Creating the NGINX site file for Mayan EDMS, /etc/nginx/sites-available/mayan \n"
cat > /etc/nginx/sites-available/mayan << EOF
server {
listen 80;
server_name localhost;
location / {
include uwsgi_params;
uwsgi_pass unix:${INSTALLATION_DIRECTORY}uwsgi.sock;
client_max_body_size 30M; # Increse if your plan to upload bigger documents
proxy_read_timeout 30s; # Increase if your document uploads take more than 30 seconds
}
location /static {
alias ${INSTALLATION_DIRECTORY}mayan/media/static;
expires 1h;
}
location /favicon.ico {
alias ${INSTALLATION_DIRECTORY}mayan/media/static/appearance/images/favicon.ico;
expires 1h;
}
}
EOF
echo -e "\n -> Enabling the NGINX site for Mayan EDMS \n"
ln -s /etc/nginx/sites-available/mayan /etc/nginx/sites-enabled/
echo -e "\n -> Creating the supervisor file for the uWSGI process, /etc/supervisor/conf.d/mayan-uwsgi.conf \n"
cat > /etc/supervisor/conf.d/mayan-uwsgi.conf << EOF
[program:mayan-uwsgi]
command = ${INSTALLATION_DIRECTORY}bin/uwsgi --ini ${INSTALLATION_DIRECTORY}uwsgi.ini
user = root
autostart = true
autorestart = true
redirect_stderr = true
EOF
echo -e "\n -> Creating the supervisor file for the Celery worker, /etc/supervisor/conf.d/mayan-celery.conf \n"
cat > /etc/supervisor/conf.d/mayan-celery.conf << EOF
[program:mayan-worker]
command = ${INSTALLATION_DIRECTORY}bin/python ${INSTALLATION_DIRECTORY}bin/mayan-edms.py celery --settings=mayan.settings.production worker -Ofair -l ERROR
directory = ${INSTALLATION_DIRECTORY}
user = www-data
stdout_logfile = /var/log/mayan/worker-stdout.log
stderr_logfile = /var/log/mayan/worker-stderr.log
autostart = true
autorestart = true
startsecs = 10
stopwaitsecs = 10
killasgroup = true
priority = 998
[program:mayan-beat]
command = ${INSTALLATION_DIRECTORY}bin/python ${INSTALLATION_DIRECTORY}bin/mayan-edms.py celery --settings=mayan.settings.production beat -l ERROR
directory = ${INSTALLATION_DIRECTORY}
user = www-data
numprocs = 1
stdout_logfile = /var/log/mayan/beat-stdout.log
stderr_logfile = /var/log/mayan/beat-stderr.log
autostart = true
autorestart = true
startsecs = 10
stopwaitsecs = 1
killasgroup = true
priority = 998
EOF
echo -e "\n -> Collecting the static files \n"
mayan-edms.py collectstatic --noinput
echo -e "\n -> Making the installation directory readable and writable by the webserver user \n"
chown www-data:www-data ${INSTALLATION_DIRECTORY} -R
echo -e "\n -> Restarting the services \n"
/etc/init.d/nginx restart
/etc/init.d/supervisor restart

4
contrib/scripts/make_dists.sh Executable file
View File

@@ -0,0 +1,4 @@
#!/bin/sh
python setup.py sdist
pip wheel --no-index --no-deps --wheel-dir dist dist/*.tar.gz

View File

@@ -0,0 +1,3 @@
#!/bin/sh
find 'fabfile' -depth -name '*.pyc' -exec rm {} \;
tar -czvf contrib/fabfile.tar.gz fabfile

View File

@@ -1,30 +1,23 @@
#!/usr/bin/env python #!/usr/bin/env python
from __future__ import print_function
import os import os
import optparse import optparse
import sh import sh
APP_LIST = ( APP_LIST = (
'acls', 'appearance', 'authentication', 'autoadmin', 'cabinets', 'acls', 'appearance', 'authentication', 'checkouts', 'common',
'checkouts', 'common', 'converter', 'dashboards', 'dependencies', 'converter', 'django_gpg', 'document_comments', 'document_indexing',
'django_gpg', 'document_comments', 'document_indexing', 'document_signatures', 'document_states', 'documents', 'dynamic_search',
'document_parsing', 'document_signatures', 'document_states', 'events', 'folders', 'installation', 'linking', 'lock_manager', 'mailer',
'documents', 'dynamic_search', 'events', 'file_caching', 'metadata', 'mirroring', 'motd', 'navigation', 'ocr', 'permissions',
'file_metadata', 'linking', 'lock_manager', 'mailer', 'rest_api', 'smart_settings', 'sources', 'statistics', 'storage', 'tags',
'mayan_statistics', 'metadata', 'mirroring', 'motd', 'navigation', 'user_management'
'ocr', 'permissions', 'platform', 'rest_api', 'smart_settings',
'sources', 'storage', 'tags', 'task_manager', 'templating',
'user_management', 'web_links'
) )
LANGUAGE_LIST = ( LANGUAGE_LIST = (
'ar', 'bg', 'bs_BA', 'cs', 'da_DK', 'de_DE', 'en', 'es', 'el', 'fa', 'fr', 'ar', 'bg', 'bs_BA', 'da', 'de_DE', 'en', 'es', 'fa', 'fr', 'hu', 'id',
'hu', 'id', 'it', 'lv', 'nl_NL', 'pl', 'pt', 'pt_BR', 'ro_RO', 'ru', 'sl_SI', 'it', 'nl_NL', 'pl', 'pt', 'pt_BR', 'ro_RO', 'ru', 'sl_SI', 'vi_VN',
'tr_TR', 'vi_VN', 'zh', 'zh_CN',
) )
makemessages = sh.Command('django-admin.py') makemessages = sh.Command('django-admin.py')
@@ -44,29 +37,29 @@ BASE_DIR = os.path.abspath(
def process(command, app_list, language_list): def process(command, app_list, language_list):
if command == makemessages: if command == makemessages:
print('Making messages') print 'Making messages'
elif command == compilemessages: elif command == compilemessages:
print('Compiling messages') print 'Compiling messages'
elif command == pull_translations: elif command == pull_translations:
print('Pulling translation files') print 'Pulling translation files'
elif command == push_translations: elif command == push_translations:
print('Pushing translation files') print 'Pushing translation files'
if command in [compilemessages, makemessages]: if command in [compilemessages, makemessages]:
for app in app_list: for app in app_list:
print('Processing app: %s...' % app) print 'Processing app: %s...' % app
app_path = os.path.join(BASE_DIR, 'apps', app) app_path = os.path.join(BASE_DIR, 'apps', app)
os.chdir(app_path) os.chdir(app_path)
for lang in language_list: for lang in language_list:
print('Doing language: %s' % lang) print 'Doing language: %s' % lang
command(locale=lang) command(locale=lang)
elif command == pull_translations: elif command == pull_translations:
for lang in language_list: for lang in language_list:
print('Doing language: %s' % lang) print 'Doing language: %s' % lang
command('-f', '-l', lang) command('-f', '-l', lang)
elif command == push_translations: elif command == push_translations:
for lang in language_list: for lang in language_list:
print('Doing language: %s' % lang) print 'Doing language: %s' % lang
command('-s', '-l', lang) command('-s', '-l', lang)

View File

@@ -0,0 +1,35 @@
#!/bin/bash
NAME="mayan-edms"
DJANGODIR=/usr/share/mayan-edms
SOCKFILE=/var/tmp/filesystem.sock
USER=www-data
GROUP=www-data
NUM_WORKERS=3
DJANGO_SETTINGS_MODULE=mayan.settings.production
DJANGO_WSGI_MODULE=mayan.wsgi
TIMEOUT=600
echo "Starting $NAME as `whoami`"
# Activate the virtual environment
cd $DJANGODIR
source bin/activate
export DJANGO_SETTINGS_MODULE=$DJANGO_SETTINGS_MODULE
export PYTHONPATH=$DJANGODIR:$PYTHONPATH
# Create the run directory if it doesn't exist
RUNDIR=$(dirname $SOCKFILE)
test -d $RUNDIR || mkdir -p $RUNDIR
# Start your Django Unicorn
# Programs meant to be run under supervisor should not daemonize themselves (do not use --daemon)
exec bin/gunicorn ${DJANGO_WSGI_MODULE}:application \
--name $NAME \
--workers $NUM_WORKERS \
--user=$USER --group=$GROUP \
--log-level=debug \
--bind=unix:$SOCKFILE \
--timeout=$TIMEOUT

View File

@@ -1,105 +0,0 @@
#!/usr/bin/env python
from __future__ import print_function
import os
BASE_PATH = 'mayan/apps'
def print_views_summary(module_filename):
with open(module_filename) as file_object:
print(' module:', module_filename)
count_class_based_views = 0
count_function_based_views = 0
for line in file_object:
if line.startswith('class') and 'View' in line:
count_class_based_views += 1
if line.startswith('def') and 'request' in line:
count_function_based_views += 1
print(' class based views: {}'.format(count_class_based_views))
print(' function based views: {}'.format(count_function_based_views))
return count_class_based_views, count_function_based_views
def print_tests_summary(module_filename):
with open(module_filename) as file_object:
print(' module:', module_filename)
count_tests = 0
for line in file_object:
if line.startswith(' def test'):
count_tests += 1
print(' tests: {}'.format(count_tests))
return count_tests
if __name__ == '__main__':
count_totals = {
'Apps': 0,
'Class based views': 0,
'Function based views': 0,
'Class based API views': 0,
'Function based API views': 0,
'Tests': 0,
}
for app_name in sorted(os.listdir(BASE_PATH)):
if app_name != '__init__.py':
count_totals['Apps'] += 1
print('\n\nApp name: {}'.format(app_name))
app_path = os.path.join(BASE_PATH, app_name)
print('\n Views')
try:
module_filename = os.path.join(app_path, 'views.py')
count_class_based_views, count_function_based_views = print_views_summary(module_filename=module_filename)
count_totals['Class based views'] += count_class_based_views
count_totals['Function based views'] += count_function_based_views
except IOError:
# Check for multiple view files inside a view directory
try:
module_path = os.path.join(app_path, 'views')
for module_name in os.listdir(module_path):
if not module_name.startswith('__init__.py') and not module_name.endswith('.pyc'):
module_filename = os.path.join(module_path, module_name)
count_class_based_views, count_function_based_views = print_views_summary(module_filename=module_filename)
count_totals['Class based views'] += count_class_based_views
count_totals['Function based views'] += count_function_based_views
except OSError:
# No views directory, skip app
print(' No views')
print('\n API Views')
try:
module_filename = os.path.join(app_path, 'api_views.py')
count_class_based_views, count_function_based_views = print_views_summary(module_filename=module_filename)
count_totals['Class based API views'] += count_class_based_views
count_totals['Function based API views'] += count_function_based_views
except IOError:
# No API views directory, skip app
print(' No API views')
print('\n Tests')
module_path = os.path.join(app_path, 'tests')
try:
for module_name in os.listdir(module_path):
if not module_name.startswith('__init__.py') and not module_name.endswith('.pyc'):
module_filename = os.path.join(module_path, module_name)
if module_name.startswith('test'):
count_tests = print_tests_summary(module_filename=module_filename)
count_totals['Tests'] += count_tests
except OSError:
# No tests directory, skip app
print(' No tests')
print('-' * 10)
print('Totals:')
for key, value in count_totals.items():
print(' {}: {}'.format(key, value))

View File

@@ -0,0 +1,5 @@
from .local import *
CELERY_ALWAYS_EAGER = False
BROKER_URL = 'redis://127.0.0.1:6379/0'
CELERY_RESULT_BACKEND = 'redis://127.0.0.1:6379/0'

View File

@@ -1,139 +0,0 @@
from __future__ import absolute_import
# Install Python LDAP with:
# $ pip install python-ldap
# or if using Docker, pass the environment variable MAYAN_PIP_INSTALLS:
# -e MAYAN_PIP_INSTALLS=python-ldap
import ldap
from django_auth_ldap.config import (
LDAPSearch, LDAPSearchUnion, NestedActiveDirectoryGroupType
)
from mayan.settings.production import *
# Makes sure this works in Active Directory
ldap.set_option(ldap.OPT_REFERRALS, False)
# Turn of debug output, turn this off when everything is working as expected
ldap.set_option(ldap.OPT_DEBUG_LEVEL, 1)
# Default: True
AUTH_LDAP_ALWAYS_UPDATE_USER = True
# Use TLS to talk to the LDAP server
# Requires acquiring the server's certificate
# $ openssl s_client -connect <LDAP server>:636
# Part of the output of this file will be the Base-64 encoded .cer file
# that was presented for LDAPS. Cut and paste into a file beginning at
# "-Begin Certificate" through "-End Certificate--" and save as a .crt, for
# example: ldapserver.crt
# $ CERT=ldapserver.crt
# $ cp /root/$CERT /usr/share/ca-certificates/$CERT
# # notice the + sign which tells to activate the certificate.
# $ echo "+$CERT" >/etc/ca-certificates/update.d/activate_my_cert
# $ dpkg-reconfigure ca-certificates;
AUTH_LDAP_START_TLS = False
LDAP_ADDITIONAL_USER_DN = 'dc=people'
LDAP_ADMIN_DN = ''
LDAP_BASE_DN = 'dc=<top level dc>,dc=co,dc=in'
LDAP_PASSWORD = ''
LDAP_USER_AUTO_CREATION = 'False'
LDAP_URL = 'ldap://<LDAP server>:389/'
AUTH_LDAP_BIND_DN = LDAP_ADMIN_DN
AUTH_LDAP_BIND_PASSWORD = LDAP_PASSWORD
AUTH_LDAP_SERVER_URI = LDAP_URL
# Simple search
AUTH_LDAP_USER_SEARCH = LDAPSearch(
'%s,%s' % (LDAP_ADDITIONAL_USER_DN, LDAP_BASE_DN),
ldap.SCOPE_SUBTREE, '(uid=%(user)s)'
)
# If you need to search in more than one place for a user, you can use
# LDAPSearchUnion. This takes multiple LDAPSearch objects and returns the
# union of the results. The precedence of the underlying searches is
# unspecified.
# https://django-auth-ldap.readthedocs.io/en/latest/authentication.html
# AUTH_LDAP_USER_SEARCH = LDAPSearchUnion(
# LDAPSearch(
# 'ou=Users,ou=Admin,dc=<top level DC>,dc=local', ldap.SCOPE_SUBTREE,
# '(samaccountname=%(user)s)'
# ),
# LDAPSearch(
# 'ou=Users,ou=<second OU>,dc=<top level DC>,dc=local',
# ldap.SCOPE_SUBTREE, '(samaccountname=%(user)s)'
# ),
# LDAPSearch(
# 'ou=Users,ou=<third OU>,dc=<top level DC>,dc=local',
# ldap.SCOPE_SUBTREE, '(samaccountname=%(user)s)'
# ),
# )
# User attributes to map from LDAP to Mayan's user model.
AUTH_LDAP_USER_ATTR_MAP = {
'first_name': 'cn',
'last_name': 'sn',
'email': 'mail'
}
# Another example map
# AUTH_LDAP_USER_ATTR_MAP = {
# 'username': 'sAMAccountName',
# 'first_name': 'givenName',
# 'last_name': 'sn',
# 'email': 'mail'
# }
# Only string fields can be mapped to attributes. Boolean fields can be
# defined by group membership:
# AUTH_LDAP_USER_FLAGS_BY_GROUP = {
# 'is_active': 'cn=active,ou=groups,dc=example,dc=com',
# 'is_staff': (
# LDAPGroupQuery('cn=staff,ou=groups,dc=example,dc=com')
# | LDAPGroupQuery('cn=admin,ou=groups,dc=example,dc=com')
# ),
# 'is_superuser': 'cn=superuser,ou=groups,dc=example,dc=com',
# }
# Simple group search
# AUTH_LDAP_GROUP_SEARCH = LDAPSearch(
# 'ou=groups,dc=example,dc=com', ldap.SCOPE_SUBTREE, '(objectClass=groupOfNames)'
# )
# AUTH_LDAP_GROUP_TYPE = GroupOfNamesType()
# Advanced group search
# AUTH_LDAP_GROUP_SEARCH = LDAPSearchUnion(
# LDAPSearch(
# 'ou=Domain Global,OU=Security,OU=Groups,OU=<OU>,dc=<top level DC>,dc=local',
# ldap.SCOPE_SUBTREE,
# '(&(objectClass=group)(groupType:1.2.840.113556.1.4.803:=2147483648))'
# ),
# LDAPSearch(
# 'ou=Domain Global,OU=Security,OU=Groups,OU=<OU>,dc=<top level DC>,dc=local',
# ldap.SCOPE_SUBTREE,
# '(&(objectClass=group)(groupType:1.2.840.113556.1.4.803:=2147483648))'
# ),
# )
# AUTH_LDAP_CACHE_GROUPS = True
# AUTH_LDAP_FIND_GROUP_PERMS = False
# AUTH_LDAP_GROUP_TYPE = NestedActiveDirectoryGroupType()
# AUTH_LDAP_MIRROR_GROUPS = True
# To minimize traffic to the LDAP server, LDAPBackend can make use of
# Djangos cache framework to keep a copy of a users LDAP group memberships.
# To enable this feature, set AUTH_LDAP_CACHE_TIMEOUT, which determines
# the timeout of cache entries in seconds.
# AUTH_LDAP_GROUP_CACHE_TIMEOUT = 3600
# Limiting Access
# The simplest use of groups is to limit the users who are allowed to log in.
# If AUTH_LDAP_REQUIRE_GROUP is set, then only users who are members of that
# group will successfully authenticate. AUTH_LDAP_DENY_GROUP is the reverse:
# if given, members of this group will be rejected.
# AUTH_LDAP_REQUIRE_GROUP = 'cn=enabled,ou=groups,dc=example,dc=com'
# AUTH_LDAP_DENY_GROUP = 'cn=disabled,ou=groups,dc=example,dc=com'
AUTHENTICATION_BACKENDS = (
'django_auth_ldap.backend.LDAPBackend',
)

View File

@@ -0,0 +1,26 @@
[program:mayan-worker]
command = /usr/share/mayan-edms/bin/python /usr/share/mayan-edms/bin/mayan-edms.py celery --settings=mayan.settings.production worker -Ofair -l ERROR
directory = /usr/share/mayan-edms
user = www-data
stdout_logfile = /var/log/mayan/worker-stdout.log
stderr_logfile = /var/log/mayan/worker-stderr.log
autostart = true
autorestart = true
startsecs = 10
stopwaitsecs = 10
killasgroup = true
priority = 998
[program:mayan-beat]
command = /usr/share/mayan-edms/bin/python /usr/share/mayan-edms/bin/mayan-edms.py celery --settings=mayan.settings.production beat -l ERROR
directory = /usr/share/mayan-edms
user = www-data
numprocs = 1
stdout_logfile = /var/log/mayan/beat-stdout.log
stderr_logfile = /var/log/mayan/beat-stderr.log
autostart = true
autorestart = true
startsecs = 10
stopwaitsecs = 1
killasgroup = true
priority = 998

View File

@@ -0,0 +1,6 @@
[program:mayan-uwsgi]
command = /usr/share/mayan-edms/bin/uwsgi --ini /usr/share/mayan-edms/uwsgi.ini
user = root
autostart = true
autorestart = true
redirect_stderr = true

View File

@@ -1,165 +0,0 @@
# vim:set ft=dockerfile:
####
# BASE_IMAGE - Bare bones image with the base packages needed to run Mayan EDMS
####
FROM debian:10.0-slim as BASE_IMAGE
LABEL maintainer="Roberto Rosario roberto.rosario@mayan-edms.com"
COPY config.env /config.env
ENV PYTHONUNBUFFERED=1 \
LC_ALL=C.UTF-8 \
PROJECT_INSTALL_DIR=/opt/mayan-edms
# Debian package caching
ARG APT_PROXY
RUN set -x \
&& if [ "${APT_PROXY}" ]; \
then echo "Acquire::http { Proxy \"http://${APT_PROXY}\"; };" > /etc/apt/apt.conf.d/01proxy \
; fi \
# Install base OS packages to run Mayan EDMS
&& DEBIAN_FRONTEND=noninteractive \
apt-get update \
&& apt-get install -y --no-install-recommends \
ca-certificates \
exiftool \
fonts-arphic-uming \
fonts-arphic-ukai \
ghostscript \
gpgv \
gnupg1 \
graphviz \
libfuse2 \
libmagic1 \
libmariadb3 \
libreoffice \
libpq5 \
poppler-utils \
python3-distutils \
sane-utils \
sudo \
supervisor \
tesseract-ocr tesseract-ocr-deu \
# Remove make and build dependencies
&& apt-get remove make libproxy-tools libreoffice-avmedia-backend-vlc libvlc-bin libvlc5 libvlccore9 adwaita-icon-theme gsettings-desktop-schemas libgstreamer-plugins-base1.0-0 -y \
&& apt-get autoremove -y --purge \
# Add mayan user
&& adduser mayan --disabled-password --disabled-login --no-create-home --gecos "" \
# Pillow can't find zlib or libjpeg on aarch64 (ODROID C2)
&& if [ "$(uname -m)" = "aarch64" ]; then \
ln -s /usr/lib/aarch64-linux-gnu/libz.so /usr/lib/ \
&& ln -s /usr/lib/aarch64-linux-gnu/libjpeg.so /usr/lib/ \
; fi \
# Pillow can't find zlib or libjpeg on armv7l (ODROID HC1)
&& if [ "$(uname -m)" = "armv7l" ]; then \
ln -s /usr/lib/arm-linux-gnueabihf/libz.so /usr/lib/ \
&& ln -s /usr/lib/arm-linux-gnueabihf/libjpeg.so /usr/lib/ \
; fi
####
# BUILDER_IMAGE - This image builds the Python package and is discarded afterwards
# only the build artifact is carried over to the next image.
####
# Reuse image
FROM BASE_IMAGE as BUILDER_IMAGE
# Python libraries caching
ARG PIP_INDEX_URL
ARG PIP_TRUSTED_HOST
WORKDIR /src
# Copy the source files needed to build the Python package
COPY --chown=mayan:mayan requirements /src/requirements
COPY --chown=mayan:mayan \
HISTORY.rst \
LICENSE \
MANIFEST.in \
README.md \
README.rst \
setup.py \
/src/
COPY --chown=mayan:mayan mayan /src/mayan
# Install development packages needed to build the Python packages
RUN DEBIAN_FRONTEND=noninteractive \
apt-get install -y --no-install-recommends \
default-libmysqlclient-dev \
libffi-dev \
libjpeg-dev \
libpng-dev \
libpq-dev \
libtiff-dev \
zlib1g-dev \
libssl-dev \
g++ \
gcc \
python3-dev \
python3-venv \
&& mkdir -p "${PROJECT_INSTALL_DIR}" \
&& chown -R mayan:mayan "${PROJECT_INSTALL_DIR}" \
&& chown -R mayan:mayan /src
USER mayan
RUN set -a \
&& . /config.env \
&& set +a \
&& python3 -m venv "${PROJECT_INSTALL_DIR}" \
&& . "${PROJECT_INSTALL_DIR}/bin/activate" \
&& pip install --no-cache-dir \
amqp==$PYTHON_AMQP_VERSION \
mysqlclient==$PYTHON_MYSQL_VERSION \
psycopg2==$PYTHON_PSYCOPG2_VERSION \
redis==$PYTHON_REDIS_VERSION \
flower==$PYTHON_FLOWER_VERSION \
# psutil is needed by ARM builds otherwise gevent and gunicorn fail to start
&& UNAME=`uname -m` && if [ "${UNAME#*arm}" != $UNAME ]; then \
pip install --no-cache-dir \
psutil==$PYTHON_PSUTIL_VERSION \
; fi \
# Install the Python packages needed to build Mayan EDMS
&& pip install --no-cache-dir -r /src/requirements/build.txt \
# Build Mayan EDMS
&& python3 setup.py sdist \
# Install the built Mayan EDMS package
&& pip install --no-cache-dir dist/mayan* \
# Install the static content
&& mayan-edms.py installdependencies \
&& MAYAN_STATIC_ROOT=${PROJECT_INSTALL_DIR}/static mayan-edms.py preparestatic --link --noinput
COPY --chown=mayan:mayan requirements/testing-base.txt "${PROJECT_INSTALL_DIR}"
####
# Final image - BASE_IMAGE + BUILDER_IMAGE artifact (Mayan install directory)
####
FROM BASE_IMAGE
COPY --from=BUILDER_IMAGE --chown=mayan:mayan "${PROJECT_INSTALL_DIR}/" "${PROJECT_INSTALL_DIR}/"
USER root
COPY docker/rootfs /
VOLUME ["/var/lib/mayan"]
ENTRYPOINT ["entrypoint.sh"]
EXPOSE 8000
CMD ["run_all"]
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 \
# Remove temporary files owned by root from the platformtemplate step
&& rm /tmp/* \
# Keep displaying log messages to stdout
&& find /var/log -type f | while read f; do echo -ne '' > $f; done;

View File

@@ -1,130 +0,0 @@
#!make
include config.env
HOST_IP = `/sbin/ip route|awk '/docker0/ { print $$9 }'`
APT_PROXY ?= $(HOST_IP):3142
CONSOLE_COLUMNS ?= `echo $$(tput cols)`
CONSOLE_LINES ?= `echo $$(tput lines)`
IMAGE_VERSION ?= `cat docker/rootfs/version`
PIP_INDEX_URL ?= http://$(HOST_IP):3141/root/pypi/+simple/
PIP_TRUSTED_HOST ?= $(HOST_IP)
docker-build: ## Build a new image locally.
docker build -t mayanedms/mayanedms:$(IMAGE_VERSION) -f docker/Dockerfile .
docker-build-with-proxy: ## Build a new image locally using an APT proxy as APT_PROXY.
docker-build-with-proxy: devpi-start
docker build -t mayanedms/mayanedms:$(IMAGE_VERSION) -f docker/Dockerfile --build-arg APT_PROXY=$(APT_PROXY) --build-arg PIP_INDEX_URL=$(PIP_INDEX_URL) --build-arg PIP_TRUSTED_HOST=$(PIP_TRUSTED_HOST) --build-arg HTTP_PROXY=$(HTTP_PROXY) --build-arg HTTPS_PROXY=$(HTTPS_PROXY) .
$(MAKE) devpi-stop
docker-shell: ## Launch a bash instance inside a running container. Pass the container name via DOCKER_CONTAINER.
docker exec -e TERM=$(TERM) -e "COLUMNS=$(CONSOLE_COLUMNS)" -e "LINES=$(CONSOLE_LINES)" -it $(DOCKER_CONTAINER) /bin/bash
docker-runtest-container: ## Run a test container.
docker-runtest-container: docker-test-cleanup
docker run \
-d \
--name test-mayan-edms \
-p 80:8000 \
-v test-mayan_data:/var/lib/mayan \
mayanedms/mayanedms:$(IMAGE_VERSION)
docker-runtest-cleanup: ## Delete the test container and the test volume.
@docker rm -f test-mayan-edms || true
@docker volume rm test-mayan_data || true
docker-runtest-all: ## Executed the test suite in a test container.
docker run --rm mayanedms/mayanedms:$(IMAGE_VERSION) run_tests
docker-compose-build:
docker-compose -f docker/docker-compose.yml -p mayan-edms build
docker-compose-build-with-proxy: devpi-start
docker-compose -f docker/docker-compose.yml -p mayan-edms build --build-arg APT_PROXY=$(APT_PROXY) --build-arg PIP_INDEX_URL=$(PIP_INDEX_URL) --build-arg PIP_TRUSTED_HOST=$(PIP_TRUSTED_HOST) --build-arg HTTP_PROXY=$(HTTP_PROXY) --build-arg HTTPS_PROXY=$(HTTPS_PROXY)
$(MAKE) devpi-stop
docker-compose-up:
docker-compose -f docker/docker-compose.yml -p mayan-edms up
docker-staging-network-create:
@docker network rm mayan-staging || true
docker network create mayan-staging
docker-staging-container-postgresql-start:
docker run \
-d \
--name mayan-staging-postgres \
--network=mayan-staging \
-e POSTGRES_USER=mayan \
-e POSTGRES_DB=mayan \
-e POSTGRES_PASSWORD=mayanuserpass \
-v mayan-staging-postgres:/var/lib/postgresql/data \
$(DOCKER_POSTGRES_IMAGE_VERSION)
docker-staging-container-redis-start:
docker run \
-d \
--name mayan-staging-redis \
--network=mayan-staging \
-v mayan-staging-redis:/data \
$(DOCKER_REDIS_IMAGE_VERSION) \
redis-server \
--databases \
"2" \
--maxmemory-policy \
allkeys-lru \
--save \
""
docker-staging-container-rabbitmq-start:
docker run \
-d \
--name mayan-staging-rabbitmq \
--network=mayan-staging \
-v mayan-staging-rabbitmq:/var/lib/rabbitmq \
$(DOCKER_RABBITMQ_IMAGE_VERSION) \
docker-staging-container-mayan-start:
sleep 5 && docker run \
-d \
--name mayan-staging-app \
--network=mayan-staging \
-p 80:8000 \
-e MAYAN_DATABASE_ENGINE=django.db.backends.postgresql \
-e MAYAN_DATABASE_HOST=mayan-staging-postgres \
-e MAYAN_DATABASE_NAME=mayan \
-e MAYAN_DATABASE_PASSWORD=mayanuserpass \
-e MAYAN_DATABASE_USER=mayan \
-e MAYAN_CELERY_BROKER_URL=$(MAYAN_CELERY_BROKER_URL) \
-e MAYAN_CELERY_RESULT_BACKEND="redis://mayan-staging-redis:6379/1" \
-v mayan-staging-app:/var/lib/mayan \
mayanedms/mayanedms:$(IMAGE_VERSION)
docker-staging-start-with-rabbitmq: MAYAN_CELERY_BROKER_URL="amqp://guest:guest@mayan-staging-rabbitmq:5672/"
docker-staging-start-with-rabbitmq: docker-staging-start
docker-staging-start-with-redis: MAYAN_CELERY_BROKER_URL="redis://mayan-staging-redis:6379/0"
docker-staging-start-with-redis: docker-staging-start
docker-staging-start: docker-staging-cleanup docker-staging-network-create docker-staging-container-postgresql-start docker-staging-container-rabbitmq-start docker-staging-container-redis-start docker-staging-container-mayan-start
docker logs -f mayan-staging-app
docker-staging-cleanup: ## Delete the test container and the test volume.
@docker rm -f mayan-staging-app || true
@docker rm -f mayan-staging-redis || true
@docker rm -f mayan-staging-rabbitmq || true
@docker rm -f mayan-staging-postgres || true
@docker volume rm mayan-staging-app || true
@docker volume rm mayan-staging-postgres || true
@docker volume rm mayan-staging-rabbitmq || true
@docker volume rm mayan-staging-redis || true
@docker network rm mayan-staging || true
devpi-init:
devpi-server --init || true
devpi-start: devpi-init
devpi-server --start --host=0.0.0.0 || true
devpi-stop:
devpi-server --stop || true

View File

@@ -1,130 +0,0 @@
version: '3.7'
networks:
mayan-bridge:
driver: bridge
services:
app:
build:
context: ..
dockerfile: ./docker/Dockerfile
depends_on:
- postgresql
- redis
# Enable to use RabbitMQ
#- rabbitmq
environment: &mayan_env
# Enable to use RabbitMQ
# MAYAN_CELERY_BROKER_URL: amqp://mayan:mayanrabbitpass@broker:5672/mayan
# Disable Redis Broker to use RabbitMQ as Broker
MAYAN_CELERY_BROKER_URL: redis://redis:6379/0
MAYAN_CELERY_RESULT_BACKEND: redis://redis:6379/1
MAYAN_DATABASES: "{'default':{'ENGINE':'django.db.backends.postgresql','NAME':'mayan','PASSWORD':'mayandbpass','USER':'mayan','HOST':'postgresql'}}"
image: mayanedms/mayanedms:3.3
networks:
- mayan-bridge
ports:
- "80:8000"
restart: unless-stopped
volumes:
- /docker-volumes/mayan-edms/media:/var/lib/mayan
postgresql:
environment:
POSTGRES_DB: mayan
POSTGRES_PASSWORD: mayandbpass
POSTGRES_USER: mayan
image: postgres:9.6-alpine
networks:
- mayan-bridge
restart: unless-stopped
volumes:
- /docker-volumes/mayan-edms/postgres:/var/lib/postgresql/data
redis:
command:
- redis-server
- --databases
- "2"
- --maxmemory-policy
- allkeys-lru
- --save
- ""
image: redis:5.0-alpine
networks:
- mayan-bridge
restart: unless-stopped
# Optional services
# celery_flower:
# command:
# - run_celery
# - flower
# depends_on:
# - postgresql
# - redis
# # Enable to use RabbitMQ
# # - rabbitmq
# environment:
# <<: *mayan_env
# image: mayanedms/mayanedms:3.3
# networks:
# - mayan-bridge
# ports:
# - "5555:5555"
# restart: unless-stopped
# Enable to use RabbitMQ
# rabbitmq:
# container_name: mayan-edms-rabbitmq
# image: healthcheck/rabbitmq
# environment:
# RABBITMQ_DEFAULT_USER: mayan
# RABBITMQ_DEFAULT_PASS: mayanrabbitpass
# RABBITMQ_DEFAULT_VHOST: mayan
# networks:
# - mayan-bridge
# restart: unless-stopped
# volumes:
# - /docker-volumes/mayan-edms/rabbitmq:/var/lib/rabbitmq
# Enable to run standalone workers
# worker_fast:
# command:
# - run_worker
# - fast
# depends_on:
# - postgresql
# - redis
# # Enable to use RabbitMQ
# # - rabbitmq
# environment:
# <<: *mayan_env
# image: mayanedms/mayanedms:3.3
# networks:
# - mayan-bridge
# restart: unless-stopped
# volumes:
# - /docker-volumes/mayan-edms/media:/var/lib/mayan
# Enable to run frontend gunicorn
# frontend:
# command:
# - run_frontend
# depends_on:
# - postgresql
# - redis
# # Enable to use RabbitMQ
# # - rabbitmq
# environment:
# <<: *mayan_env
# image: mayanedms/mayanedms:3.3
# networks:
# - mayan-bridge
# ports:
# - "81:8000"
# restart: unless-stopped
# volumes:
# - /docker-volumes/mayan-edms/media:/var/lib/mayan

View File

@@ -1,169 +0,0 @@
#!/bin/bash
# Use bash and not sh to support argument slicing "${@:2}"
# sh defaults to dash instead of bash.
set -e
echo "mayan: starting entrypoint.sh"
INSTALL_FLAG=/var/lib/mayan/system/SECRET_KEY
CONCURRENCY_ARGUMENT=--concurrency=
DEFAULT_USER_UID=1000
DEFAULT_USER_GID=1000
MAYAN_USER_UID=${MAYAN_USER_UID:-${DEFAULT_USER_UID}}
MAYAN_USER_GID=${MAYAN_USER_GID:-${DEFAULT_USER_GID}}
export MAYAN_ALLOWED_HOSTS='["*"]'
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 DJANGO_SETTINGS_MODULE=${MAYAN_SETTINGS_MODULE}
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
MAYAN_WORKER_FAST_CONCURRENCY=${MAYAN_WORKER_FAST_CONCURRENCY:-0}
MAYAN_WORKER_MEDIUM_CONCURRENCY=${MAYAN_WORKER_MEDIUM_CONCURRENCY:-0}
MAYAN_WORKER_SLOW_CONCURRENCY=${MAYAN_WORKER_SLOW_CONCURRENCY:-1}
update_uid_gid() {
echo "mayan: update_uid_gid()"
groupmod mayan -g ${MAYAN_USER_GID} 2>/dev/null || true
usermod mayan -u ${MAYAN_USER_UID} -g ${MAYAN_USER_GID} 2>/dev/null
if [ ${MAYAN_USER_UID} -ne ${DEFAULT_USER_UID} ] || [ ${MAYAN_USER_GID} -ne ${DEFAULT_USER_GID} ]; then
echo "mayan: Updating file ownership. This might take a while if there are many documents."
chown -R mayan:mayan ${MAYAN_INSTALL_DIR} ${MAYAN_STATIC_ROOT} ${MAYAN_MEDIA_ROOT}
fi
}
update_uid_gid
if [ "$MAYAN_WORKER_FAST_CONCURRENCY" -eq 0 ]; then
MAYAN_WORKER_FAST_CONCURRENCY=
else
MAYAN_WORKER_FAST_CONCURRENCY="${CONCURRENCY_ARGUMENT}${MAYAN_WORKER_FAST_CONCURRENCY}"
fi
export MAYAN_WORKER_FAST_CONCURRENCY
if [ "$MAYAN_WORKER_MEDIUM_CONCURRENCY" -eq 0 ]; then
MAYAN_WORKER_MEDIUM_CONCURRENCY=
else
MAYAN_WORKER_MEDIUM_CONCURRENCY="${CONCURRENCY_ARGUMENT}${MAYAN_WORKER_MEDIUM_CONCURRENCY}"
fi
export MAYAN_WORKER_MEDIUM_CONCURRENCY
if [ "$MAYAN_WORKER_SLOW_CONCURRENCY" -eq 0 ]; then
MAYAN_WORKER_SLOW_CONCURRENCY=
else
MAYAN_WORKER_SLOW_CONCURRENCY="${CONCURRENCY_ARGUMENT}${MAYAN_WORKER_SLOW_CONCURRENCY}"
fi
export MAYAN_WORKER_SLOW_CONCURRENCY
# Allow importing of user setting modules
export PYTHONPATH=$PYTHONPATH:$MAYAN_MEDIA_ROOT
apt_get_install() {
apt-get -q update
apt-get install -y --force-yes --no-install-recommends --auto-remove "$@"
apt-get -q clean
rm -rf /var/lib/apt/lists/*
}
initialsetup() {
echo "mayan: initialsetup()"
su mayan -c "${MAYAN_BIN} initialsetup --force --no-dependencies"
}
os_package_installs() {
echo "mayan: os_package_installs()"
if [ "${MAYAN_APT_INSTALLS}" ]; then
DEBIAN_FRONTEND=noninteractive apt_get_install $MAYAN_APT_INSTALLS
fi
}
pip_installs() {
echo "mayan: pip_installs()"
if [ "${MAYAN_PIP_INSTALLS}" ]; then
su mayan -c "${MAYAN_PIP_BIN} install $MAYAN_PIP_INSTALLS"
fi
}
run_all() {
echo "mayan: start()"
rm -rf /var/run/supervisor.sock
exec /usr/bin/supervisord -nc /etc/supervisor/supervisord.conf
}
performupgrade() {
echo "mayan: performupgrade()"
su mayan -c "${MAYAN_BIN} performupgrade --no-dependencies"
}
make_ready() {
# Check if this is a new install, otherwise try to upgrade the existing
# installation on subsequent starts
if [ ! -f $INSTALL_FLAG ]; then
initialsetup
else
performupgrade
fi
}
set_uid_guid() {
echo "mayan: changing uid/guid"
usermod mayan -u ${MAYAN_USER_UID:-${DEFAULT_USER_UID}}
groupmod mayan -g ${MAYAN_USER_GID:-${DEFAULT_USER_GID}}
}
os_package_installs || true
pip_installs || true
chown mayan:mayan /var/lib/mayan -R
case "$1" in
run_initialsetup)
initialsetup
;;
run_performupgrade)
performupgrade
;;
run_all)
make_ready
run_all
;;
run_celery)
run_celery.sh "${@:2}"
;;
run_command)
su mayan -c "${MAYAN_BIN} ${@:2}"
;;
run_frontend)
run_frontend.sh
;;
run_tests)
make_ready
run_tests.sh "${@:2}"
;;
run_worker)
run_worker.sh "${@:2}"
;;
*)
su mayan -c "$@"
;;
esac

View File

@@ -1,5 +0,0 @@
#!/bin/bash
# Use -A and not --app. Both are the same but behave differently
# -A can be located before the command while --app cannot.
su mayan -c "${MAYAN_PYTHON_BIN_DIR}celery -A mayan $@"

View File

@@ -1,7 +0,0 @@
#!/bin/bash
MAYAN_GUNICORN_MAX_REQUESTS=${MAYAN_GUNICORN_MAX_REQUESTS:-500}
MAYAN_GUNICORN_MAX_REQUESTS_JITTERS=${MAYAN_GUNICORN_MAX_REQUESTS_JITTERS:-50}
MAYAN_GUNICORN_WORKER_CLASS=${MAYAN_GUNICORN_WORKER_CLASS:-sync}
su mayan -c "${MAYAN_PYTHON_BIN_DIR}gunicorn -w ${MAYAN_GUNICORN_WORKERS} mayan.wsgi --max-requests ${MAYAN_GUNICORN_MAX_REQUESTS} --max-requests-jitter ${MAYAN_GUNICORN_MAX_REQUESTS_JITTERS} --worker-class ${MAYAN_GUNICORN_WORKER_CLASS} --bind 0.0.0.0:8000 --timeout ${MAYAN_GUNICORN_TIMEOUT}"

View File

@@ -1,11 +0,0 @@
#!/bin/bash
export DEBIAN_FRONTEND=noninteractive
TEST_ARGUMENT=${@:-"--mayan-apps"}
apt-get update
apt-get install -y --no-install-recommends gcc python3-dev tesseract-ocr-deu
su mayan -c "${MAYAN_PIP_BIN} install -r ${MAYAN_INSTALL_DIR}/testing-base.txt"
su mayan -c "${MAYAN_BIN} test ${TEST_ARGUMENT} --settings=mayan.settings.testing"

View File

@@ -1,12 +0,0 @@
#!/bin/bash
export MAYAN_WORKER_NAME=${MAYAN_WORKER_NAME:-$1}
QUEUE_LIST_DEFAULT=`su mayan -c "${MAYAN_PYTHON_BIN_DIR}mayan-edms.py platformtemplate worker_queues"`
MAYAN_QUEUE_LIST=${MAYAN_QUEUE_LIST:-${QUEUE_LIST_DEFAULT}}
# Use -A and not --app. Both are the same but behave differently
# -A can be located before the command while --app cannot.
# Pass ${@:2} to allow overriding the defaults arguments
su mayan -c "${MAYAN_PYTHON_BIN_DIR}celery -A mayan worker -Ofair -l ERROR -Q ${MAYAN_QUEUE_LIST} ${@:2}"

View File

@@ -1 +0,0 @@
3.3.6

View File

@@ -1,40 +0,0 @@
version: '3.1'
volumes:
app:
driver: local
db:
driver: local
services:
db:
environment:
POSTGRES_DB: mayan
POSTGRES_PASSWORD: mayandbpass
POSTGRES_USER: mayan
image: postgres
volumes:
- db:/var/lib/postgresql/data
app:
environment:
MAYAN_CELERY_BROKER_URL: redis://redis:6379/1
MAYAN_CELERY_RESULT_BACKEND: redis://redis:6379/0
MAYAN_DATABASES: "{'default':{'ENGINE':'django.db.backends.postgresql','NAME':'mayan','PASSWORD':'mayandbpass','USER':'mayan','HOST':'db'}}"
image: mayanedms/mayanedms:latest
ports:
- 80:8000
volumes:
- app:/var/lib/mayan
redis:
command:
- redis-server
- --databases
- "2"
- --maxmemory-policy
- allkeys-lru
- --save
- ""
image: redis:5.0

229
docs/_ext/djangodocs.py Normal file
View File

@@ -0,0 +1,229 @@
"""
Sphinx plugins for Django documentation.
"""
import os
import re
from docutils import nodes, transforms
try:
import json
except ImportError:
try:
import simplejson as json
except ImportError:
try:
from django.utils import simplejson as json
except ImportError:
json = None
from sphinx import addnodes, roles, __version__ as sphinx_ver
from sphinx.builders.html import StandaloneHTMLBuilder
from sphinx.writers.html import SmartyPantsHTMLTranslator
from sphinx.util.console import bold
from sphinx.util.compat import Directive
# RE for option descriptions without a '--' prefix
simple_option_desc_re = re.compile(
r'([-_a-zA-Z0-9]+)(\s*.*?)(?=,\s+(?:/|-|--)|$)')
def setup(app):
app.add_crossref_type(
directivename = "setting",
rolename = "setting",
indextemplate = "pair: %s; setting",
)
app.add_crossref_type(
directivename = "templatetag",
rolename = "ttag",
indextemplate = "pair: %s; template tag"
)
app.add_crossref_type(
directivename = "templatefilter",
rolename = "tfilter",
indextemplate = "pair: %s; template filter"
)
app.add_crossref_type(
directivename = "fieldlookup",
rolename = "lookup",
indextemplate = "pair: %s; field lookup type",
)
app.add_description_unit(
directivename = "django-admin",
rolename = "djadmin",
indextemplate = "pair: %s; django-admin command",
parse_node = parse_django_admin_node,
)
app.add_description_unit(
directivename = "django-admin-option",
rolename = "djadminopt",
indextemplate = "pair: %s; django-admin command-line option",
parse_node = parse_django_adminopt_node,
)
app.add_config_value('django_next_version', '0.0', True)
app.add_directive('versionadded', VersionDirective)
app.add_directive('versionchanged', VersionDirective)
app.add_builder(DjangoStandaloneHTMLBuilder)
class VersionDirective(Directive):
has_content = True
required_arguments = 1
optional_arguments = 1
final_argument_whitespace = True
option_spec = {}
def run(self):
env = self.state.document.settings.env
arg0 = self.arguments[0]
is_nextversion = env.config.django_next_version == arg0
ret = []
node = addnodes.versionmodified()
ret.append(node)
if not is_nextversion:
if len(self.arguments) == 1:
linktext = 'Please see the release notes </releases/%s>' % (arg0)
xrefs = roles.XRefRole()('doc', linktext, linktext, self.lineno, self.state)
node.extend(xrefs[0])
node['version'] = arg0
else:
node['version'] = "Development version"
node['type'] = self.name
if len(self.arguments) == 2:
inodes, messages = self.state.inline_text(self.arguments[1], self.lineno+1)
node.extend(inodes)
if self.content:
self.state.nested_parse(self.content, self.content_offset, node)
ret = ret + messages
env.note_versionchange(node['type'], node['version'], node, self.lineno)
return ret
class DjangoHTMLTranslator(SmartyPantsHTMLTranslator):
"""
Django-specific reST to HTML tweaks.
"""
# Don't use border=1, which docutils does by default.
def visit_table(self, node):
self._table_row_index = 0 # Needed by Sphinx
self.body.append(self.starttag(node, 'table', CLASS='docutils'))
# <big>? Really?
def visit_desc_parameterlist(self, node):
self.body.append('(')
self.first_param = 1
self.param_separator = node.child_text_separator
def depart_desc_parameterlist(self, node):
self.body.append(')')
if sphinx_ver < '1.0.8':
#
# Don't apply smartypants to literal blocks
#
def visit_literal_block(self, node):
self.no_smarty += 1
SmartyPantsHTMLTranslator.visit_literal_block(self, node)
def depart_literal_block(self, node):
SmartyPantsHTMLTranslator.depart_literal_block(self, node)
self.no_smarty -= 1
#
# Turn the "new in version" stuff (versionadded/versionchanged) into a
# better callout -- the Sphinx default is just a little span,
# which is a bit less obvious that I'd like.
#
# FIXME: these messages are all hardcoded in English. We need to change
# that to accomodate other language docs, but I can't work out how to make
# that work.
#
version_text = {
'deprecated': 'Deprecated in Django %s',
'versionchanged': 'Changed in Django %s',
'versionadded': 'New in Django %s',
}
def visit_versionmodified(self, node):
self.body.append(
self.starttag(node, 'div', CLASS=node['type'])
)
title = "%s%s" % (
self.version_text[node['type']] % node['version'],
len(node) and ":" or "."
)
self.body.append('<span class="title">%s</span> ' % title)
def depart_versionmodified(self, node):
self.body.append("</div>\n")
# Give each section a unique ID -- nice for custom CSS hooks
def visit_section(self, node):
old_ids = node.get('ids', [])
node['ids'] = ['s-' + i for i in old_ids]
node['ids'].extend(old_ids)
SmartyPantsHTMLTranslator.visit_section(self, node)
node['ids'] = old_ids
def parse_django_admin_node(env, sig, signode):
command = sig.split(' ')[0]
env._django_curr_admin_command = command
title = "django-admin.py %s" % sig
signode += addnodes.desc_name(title, title)
return sig
def parse_django_adminopt_node(env, sig, signode):
"""A copy of sphinx.directives.CmdoptionDesc.parse_signature()"""
from sphinx.domains.std import option_desc_re
count = 0
firstname = ''
for m in option_desc_re.finditer(sig):
optname, args = m.groups()
if count:
signode += addnodes.desc_addname(', ', ', ')
signode += addnodes.desc_name(optname, optname)
signode += addnodes.desc_addname(args, args)
if not count:
firstname = optname
count += 1
if not count:
for m in simple_option_desc_re.finditer(sig):
optname, args = m.groups()
if count:
signode += addnodes.desc_addname(', ', ', ')
signode += addnodes.desc_name(optname, optname)
signode += addnodes.desc_addname(args, args)
if not count:
firstname = optname
count += 1
if not firstname:
raise ValueError
return firstname
class DjangoStandaloneHTMLBuilder(StandaloneHTMLBuilder):
"""
Subclass to add some extra things we need.
"""
name = 'djangohtml'
def finish(self):
super(DjangoStandaloneHTMLBuilder, self).finish()
if json is None:
self.warn("cannot create templatebuiltins.js due to missing simplejson dependency")
return
self.info(bold("writing templatebuiltins.js..."))
xrefs = self.env.domaindata["std"]["objects"]
templatebuiltins = {
"ttags": [n for ((t, n), (l, a)) in xrefs.items()
if t == "templatetag" and l == "ref/templates/builtins"],
"tfilters": [n for ((t, n), (l, a)) in xrefs.items()
if t == "templatefilter" and l == "ref/templates/builtins"],
}
outfilename = os.path.join(self.outdir, "templatebuiltins.js")
f = open(outfilename, 'wb')
f.write('var django_template_builtins = ')
json.dump(templatebuiltins, f)
f.write(';\n')
f.close();

BIN
docs/_static/api.png vendored Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 78 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 73 KiB

View File

@@ -1,17 +0,0 @@
.menuselection {
color: white;
background: #2c3e50;
padding: 3px;
}
.document a.internal {
text-decoration: none;
border-bottom: 1px dotted #707070;
}
.document a.internal:visited {
color: #2980B9;
text-decoration: none;
border-bottom: 1px dotted #707070;
}

BIN
docs/_static/document_view.png vendored Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 67 KiB

BIN
docs/_static/main.png vendored Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 32 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.6 MiB

After

Width:  |  Height:  |  Size: 628 KiB

BIN
docs/_static/page_view.png vendored Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 69 KiB

BIN
docs/_static/setup.png vendored Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 61 KiB

BIN
docs/_static/statistics.png vendored Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 28 KiB

BIN
docs/_static/tools.png vendored Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 67 KiB

4
docs/_templates/donate.html vendored Normal file
View File

@@ -0,0 +1,4 @@
<h3>Support</h3>
<p>
Consulting, support, customization, rebranding, and plug-in development are available. Email for information to: <a href='mailto:info@mayan-edms.com'>info@mayan-edms.com</a>
</p>

View File

@@ -1,41 +0,0 @@
<style>
.wy-body-for-nav #message-area {
color: #b3b3b3;
margin: 1em 2em 1em 1em;
}
#message-area {
border: 1px dotted #2980B9;
padding: .5em;
margin: 1em 0;
text-align: center;
}
</style>
<div id="message-area">
<h3>Get the book!</h3>
<a href="https://www.mayan-edms.com/book/">
<img src="{{ pathto('_static/book_cover.jpg', 1) }}" />
</a>
<hr />
<p>
On-site consulting and support plans are available, <a href='https://www.mayan-edms.com/support/'>click here</a>.
</p>
<hr />
<p>
Or consider donating to support the continued development of the project.
</p>
<form action="https://www.paypal.com/cgi-bin/webscr" method="post" target="_top">
<input type="hidden" name="cmd" value="_s-xclick">
<input type="hidden" name="hosted_button_id" value="3PXN336XFXQNN">
<input type="image" src="https://www.paypalobjects.com/en_US/i/btn/btn_donateCC_LG.gif" border="0" name="submit" alt="PayPal - The safer, easier way to pay online!">
<img alt="" border="0" src="https://www.paypalobjects.com/en_US/i/scr/pixel.gif" width="1" height="1" style="display: none !important;">
</form>
</div>

View File

@@ -1,8 +0,0 @@
from __future__ import unicode_literals
def get_source_read_callback(substitutions):
def global_substitution_function(app, docname, source):
for old, new in substitutions:
source[0] = source[0].replace(old, new)
return global_substitution_function

View File

@@ -1,84 +0,0 @@
====================
Access control lists
====================
Besides the permissions system explained in :doc:`../chapters/permissions`,
Mayan EDMS provides per object permission granting. This feature is used to
grant a permission to a role, but this permission can only be executed for a
limited number of objects (documents, folders, tags) instead of being
effective system-wide.
.. blockdiag::
blockdiag {
default_shape = roundedbox
document [ label = 'Document' ];
role [ label = 'Role' ];
permission [ label = 'Permission' ];
role -> permission -> document;
}
Example:
.. blockdiag::
blockdiag {
default_shape = roundedbox
document [ label = '2015 Payroll report.txt', width=200 ];
role [ label = 'Accountants' ];
permission [ label = 'View document' ];
role -> permission -> document;
}
In this scenario only users in groups belonging to the ``Accountants`` role
would be able to view the ``2015 Payroll report.txt`` document.
Inherited access control
========================
It is also possible to grant a permission to a role for a specific document
type (:doc:`../chapters/document_types`). Under this scheme all users in
groups belonging to that role will inherit that permission for all documents
of that type.
.. blockdiag::
blockdiag {
default_shape = roundedbox
document_type [ label = 'Document type' ];
role [ label = 'Role' ];
permission [ label = 'Permission' ];
documents [shape = "note", stacked];
role -> permission -> document_type ;
document_type -> documents [folded, label = "inherit" ];
}
Example:
.. blockdiag::
blockdiag {
default_shape = roundedbox
document_type [ label = 'Payroll reports', width=200 ];
role [ label = 'Accountants' ];
permission [ label = 'View document' ];
documents [shape = "note", stacked, label="payroll_report*.pdf" ];
role -> permission -> document_type ;
document_type -> documents [folded, label = "inherit" ];
}
The role ``Accountants`` is given the permission ``document view`` for the
document type ``Payroll reports``. Now all users in groups belonging to the
``Accountants`` role can view all documents of the type ``Payroll reports``
without needing to have that permissions granted for each particular
``Payroll reports`` type document.
If access control for the ``Payroll reports`` documents needs to be updated it
only needs to be done for the document type and not for each document of the type
``Payroll reports``.

View File

@@ -1,18 +0,0 @@
=======
Backups
=======
To backup your install of Mayan EDMS just copy the ``media`` folder and
the database content.
If you are using the default storage backend, the ``media`` should be located
at |MAYAN_MEDIA_ROOT|::
sudo tar -zcvf backup.tar.gz |MAYAN_MEDIA_ROOT|
To dump the content of your database manager refer to the documentation chapter
regarding database data "dumping".
- PostgreSQL: https://www.postgresql.org/docs/current/backup-dump.html
- MySQL: https://dev.mysql.com/doc/refman/5.7/en/mysqldump.html

View File

@@ -1,12 +0,0 @@
========
Cabinets
========
Cabinets are a multi-level method to organize documents. Each cabinet can
contain documents as well as other sub level cabinets.
With a cabinet structure created, the next step is to add documents to them.
Documents can also be added in bulk to one or more cabinets from any view
that lists documents.

View File

@@ -1,273 +0,0 @@
.. _deployment_basic:
=================
Direct deployment
=================
Mayan EDMS should be deployed like any other Django_ project and
preferably using virtualenv_. Below are some ways to deploy and use Mayan EDMS.
Being a Django_ and a Python_ project, familiarity with these technologies is
recommended to better understand why Mayan EDMS does some of the things it
does.
Compilers and development libraries will be installed to compile runtime
libraries. LibreOffice and Poppler utils will also be installed as they are
used to convert document files. Supervisor (https://supervisord.org/), a
Process Control System, will be used to monitor and keep all Mayan processes
running.
Basic deployment
================
This setup uses less memory and CPU resources at the expense of some speed.
For another setup that offers more performance and scalability refer to the
`Advanced deployment`_ below.
#. Install binary dependencies:
If using a Debian_ or Ubuntu_ based Linux distribution, get the executable
requirements using:
.. code-block:: bash
sudo apt-get install exiftool g++ gcc ghostscript gnupg1 graphviz \
libfuse2 libjpeg-dev libmagic1 libpq-dev libpng-dev libreoffice \
libtiff-dev poppler-utils postgresql python3-dev python3-virtualenv
redis-server sane-utils supervisor tesseract-ocr zlib1g-dev -y
.. note::
Platforms with the ARM CPU might also need additional requirements:
.. code-block:: bash
sudo apt-get install libffi-dev libssl-dev -y
#. Create the user account for the installation:
This will create an unprivileged user account that is also unable to login:
.. code-block:: bash
sudo adduser mayan --disabled-password --disabled-login --gecos ""
#. Create the parent directory where the project will be deployed:
``/opt/`` is a good choice as it is meant is for "software and add-on packages
that are not part of the default installation". (https://www.tldp.org/LDP/Linux-Filesystem-Hierarchy/html/opt.html).
Create the ``/opt`` directory if it doesn't already exists:
.. code-block:: bash
sudo mkdir /opt
#. Create the Python virtual environment:
This will keep all the Python packages installed here isolated from the rest
of the Python packages in the system:
.. code-block:: bash
sudo virtualenv |MAYAN_INSTALLATION_DIRECTORY| -p /usr/bin/python3
#. Make the mayan user the owner of the installation directory:
.. code-block:: bash
sudo chown mayan:mayan |MAYAN_INSTALLATION_DIRECTORY| -R
#. Install Mayan EDMS from PyPI:
.. code-block:: bash
sudo -u mayan |MAYAN_PIP_BIN| install --no-use-pep517 mayan-edms
#. Install the Python client for PostgreSQL and Redis:
.. code-block:: bash
sudo -u mayan |MAYAN_PIP_BIN| install --no-use-pep517 psycopg2==|PYTHON_PSYCOPG2_VERSION| redis==|PYTHON_REDIS_VERSION|
.. note::
Platforms with the ARM CPU might also need additional requirements:
.. code-block:: bash
sudo -u mayan |MAYAN_PIP_BIN| install --no-use-pep517 psutil==|PYTHON_PSUTIL_VERSION|
#. Create the database for the installation:
.. code-block:: bash
sudo -u postgres psql -c "CREATE USER mayan WITH password 'mayanuserpass';"
sudo -u postgres createdb -O mayan mayan
#. Initialize the project:
This step will create all the database structures, download static media files
like JavaScript libraries and HTML frameworks, and create and initial admin
account with a random password.
.. note::
For simplicity, the ``MAYAN_MEDIA_ROOT`` folder is set to be a subfolder
of the installation. If you want to keep your files separated from
the installation files, change the value of the ``MAYAN_MEDIA_ROOT``
variable in this and all subsequent steps. Be sure to first create the
folder and give ownership of it to the ``mayan`` user with the ``chown``
command.
.. warning::
If this step is interrupted, even if it is later resumed, will
cause the automatic admin user to not be created in some cases. Make
sure all environment variables and values are correct. If this
happens, refer to the troubleshooting chapters:
:ref:`troubleshooting-autoadmin-account` and
:ref:`troubleshooting-admin-password`.
.. code-block:: bash
sudo -u mayan MAYAN_DATABASES="{'default':{'ENGINE':'django.db.backends.postgresql','NAME':'mayan','PASSWORD':'mayanuserpass','USER':'mayan','HOST':'127.0.0.1'}}" \
MAYAN_MEDIA_ROOT=|MAYAN_MEDIA_ROOT| \
|MAYAN_BIN| initialsetup
#. Collect the static files:
This step merges and compressed static media files so they can be served more
effectively.
.. code-block:: bash
sudo -u mayan MAYAN_MEDIA_ROOT=|MAYAN_MEDIA_ROOT| \
|MAYAN_BIN| preparestatic --noinput
#. Create the supervisor file at ``|MAYAN_SUPERVISOR_CONF|``:
.. code-block:: bash
sudo -u mayan MAYAN_DATABASES="{'default':{'ENGINE':'django.db.backends.postgresql','NAME':'mayan','PASSWORD':'mayanuserpass','USER':'mayan','HOST':'127.0.0.1'}}" \
MAYAN_MEDIA_ROOT=|MAYAN_MEDIA_ROOT| \
|MAYAN_BIN| platformtemplate supervisord | sudo sh -c "cat > |MAYAN_SUPERVISOR_CONF|"
#. Configure Redis:
Configure Redis to discard data when it runs out of memory, not save its
database and only keep 2 database:
.. code-block:: bash
sudo echo "maxmemory-policy allkeys-lru" >> /etc/redis/redis.conf
sudo echo "save \"\"" >> /etc/redis/redis.conf
sudo echo "databases 2" >> /etc/redis/redis.conf
sudo systemctl restart redis
#. Enable and restart the services [1_]:
.. code-block:: bash
sudo systemctl enable supervisor
sudo systemctl restart supervisor
#. Cleaning up:
The following operating system dependencies are only needed during
installation and can be removed.
.. code-block:: bash
sudo apt-get remove --purge libjpeg-dev libpq-dev libpng-dev libtiff-dev zlib1g-dev
.. _deployment_advanced:
Advanced deployment
===================
This variation uses RabbitMQ as the message broker. RabbitMQ consumes more
memory but scales to thousands of messages per second. RabbitMQ messages are also
persistent by default, this means that pending tasks are not lost in the case
of a restart or power failure. The Gunicorn workers are increased to 3.
#. Install RabbitMQ:
If using a Debian_ or Ubuntu_ based Linux distribution, get the executable
requirements using:
.. code-block:: bash
sudo apt-get install rabbitmq-server -y
#. Install the Python client for RabbitMQ:
.. code-block:: bash
sudo -u mayan |MAYAN_PIP_BIN| install --no-use-pep517 amqp==|PYTHON_AMQP_VERSION|
#. Create the RabbitMQ user and vhost:
.. code-block:: bash
sudo rabbitmqctl add_user mayan mayanrabbitmqpassword
sudo rabbitmqctl add_vhost mayan
sudo rabbitmqctl set_permissions -p mayan mayan ".*" ".*" ".*"
#. Edit the supervisor file at ``|MAYAN_SUPERVISOR_CONF|``:
Replace (paying attention to the comma at the end):
.. code-block:: ini
MAYAN_CELERY_BROKER_URL="redis://127.0.0.1:6379/0",
with:
.. code-block:: ini
MAYAN_CELERY_BROKER_URL="amqp://mayan:mayanrabbitmqpassword@localhost:5672/mayan",
increase the number of Gunicorn workers to 3 in the line (``-w 2`` section):
.. code-block:: ini
command = |MAYAN_GUNICORN_BIN| -w 2 mayan.wsgi --max-requests 1000 --max-requests-jitter 50 --worker-class gevent --bind 0.0.0.0:8000 --timeout 120
remove the concurrency limit (or increase it) of the fast worker (remove ``--concurrency=1``).
#. Restart the services:
.. code-block:: bash
sudo supervisorctl reread
sudo supervisorctl restart all
[1]: https://bugs.launchpad.net/ubuntu/+source/supervisor/+bug/1594740
.. _Debian: https://www.debian.org/
.. _Django: https://www.djangoproject.com/
.. _Python: https://www.python.org/
.. _SQLite: https://www.sqlite.org/
.. _Ubuntu: http://www.ubuntu.com/
.. _virtualenv: http://www.virtualenv.org/en/latest/index.html
.. _1: https://bugs.launchpad.net/ubuntu/+source/supervisor/+bug/1594740

View File

@@ -1,247 +0,0 @@
==================================================
Mayan EDMS Entity Contributor Assignment Agreement
==================================================
Thank you for your interest in contributing to Mayan EDMS ("We" or "Us").
This contributor agreement ("Agreement") documents the rights granted by
contributors to Us. To make this document effective, please print it, sign it
(by copyright holder or authorized party) and send it to Us by email to
caa@mayan-edms.com. This is a legally binding document, so please read it
carefully before agreeing to it. The Agreement may cover more than one
software project managed by Us.
1. Definitions
==============
"You" means any Legal Entity on behalf of whom a Contribution has been received
by Us. "Legal Entity" means an entity which is not a natural person.
"Affiliates" means other Legal Entities that control, are controlled by, or
under common control with that Legal Entity. For the purposes of this
definition, "control" means (i) the power, direct or indirect, to cause the
direction or management of such Legal Entity, whether by contract or otherwise,
(ii) ownership of fifty percent (50%) or more of the outstanding shares or
securities which vote to elect the management or other persons who direct such
Legal Entity or (iii) beneficial ownership of such entity.
"Contribution" means any work of authorship that is Submitted by You to Us in
which You own or assert ownership of the Copyright. We cannot accept
contributions for which you do not own the Copyright or for which you don't
have the necessary legal power to transfer.
"Copyright" means all rights protecting works of authorship owned or controlled
by You or Your Affiliates, including copyright, moral and neighboring rights,
as appropriate, for the full term of their existence including any extensions
by You.
"Material" means the work of authorship which is made available by Us to third
parties. When this Agreement covers more than one software project, the
Material means the work of authorship to which the Contribution was Submitted.
After You Submit the Contribution, it may be included in the Material.
"Submit" means any form of electronic, verbal, or written communication sent
to Us or our representatives, including but not limited to electronic mailing
lists, source code control systems, and issue tracking systems that are managed
by, or on behalf of, Us for the purpose of discussing and improving the
Material, but excluding communication that is conspicuously marked or otherwise
designated in writing by You as "Not a Contribution."
"Submission Date" means the date on which You Submit a Contribution to Us.
"Effective Date" means the date You execute this Agreement or the date You
first Submit a Contribution to Us, whichever is earlier.
2. Grant of Rights
==================
2.1 Copyright Assignment
------------------------
a. At the time the Contribution is Submitted, You assign to Us all right, title,
and interest worldwide in all Copyright covering the Contribution; provided
that this transfer is conditioned upon compliance with Section 2.3.
b. To the extent that any of the rights in Section 2.1(a) cannot be assigned by
You to Us, You grant to Us a perpetual, worldwide, exclusive, royalty-free,
transferable, irrevocable license under such non-assigned rights, with rights
to sublicense through multiple tiers of sublicensees, to practice such
non-assigned rights, including, but not limited to, the right to reproduce,
modify, display, perform and distribute the Contribution; provided that this
license is conditioned upon compliance with Section 2.3.
c. To the extent that any of the rights in Section 2.1(a) can neither be
assigned nor licensed by You to Us, You irrevocably waive and agree never to
assert such rights against Us, any of our successors in interest, or any of
our licensees, either direct or indirect; provided that this agreement not
to assert is conditioned upon compliance with Section 2.3.
d. Upon such transfer of rights to Us, the Contribution will be licenses under
the terms of the Material.
2.2 Patent License
------------------
For patent claims including, without limitation, method, process, and apparatus
claims which You or Your Affiliates own, control or have the right to grant,
now or in the future, You grant to Us a perpetual, worldwide, non-exclusive,
transferable, royalty-free, irrevocable patent license, with the right to
sublicense these rights to multiple tiers of sublicensees, to make, have made,
use, sell, offer for sale, import and otherwise transfer the Contribution and
the Contribution in combination with the Material (and portions of such
combination). This license is granted only to the extent that the exercise of
the licensed rights infringes such patent claims; and provided that this license
is conditioned upon compliance with Section 2.3.
2.3 Outbound License
--------------------
As a condition on the grant of rights in Sections 2.1 and 2.2, We agree to
license the Contribution only under the terms of the license or licenses which
We are using on the Submission Date for the Material (including any rights to
adopt any future version of a license if permitted).
2.4 Moral Rights
----------------
If moral rights apply to the Contribution, to the maximum extent permitted by
law, You waive and agree not to assert such moral rights against Us or our
successors in interest, or any of our licensees, either direct or indirect.
2.5 Our Rights
--------------
You acknowledge that We are not obligated to use Your Contribution as part of
the Material and may decide to include any Contribution We consider appropriate.
2.6 Reservation of Rights
-------------------------
Any rights not expressly assigned or licensed under this section are expressly
reserved by You.
3. Agreement
============
You confirm that:
a. You have the legal authority to enter into this Agreement.
b. You or Your Affiliates own the Copyright and patent claims covering the
Contribution which are required to grant the rights under Section 2.
c. The grant of rights under Section 2 does not violate any grant of rights
which You or Your Affiliates have made to third parties.
4. Disclaimer
=============
EXCEPT FOR THE EXPRESS WARRANTIES IN SECTION 3, THE CONTRIBUTION IS PROVIDED
"AS IS". MORE PARTICULARLY, ALL EXPRESS OR IMPLIED WARRANTIES INCLUDING,
WITHOUT LIMITATION, ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE EXPRESSLY DISCLAIMED BY YOU TO US
AND BY US TO YOU. TO THE EXTENT THAT ANY SUCH WARRANTIES CANNOT BE DISCLAIMED,
SUCH WARRANTY IS LIMITED IN DURATION TO THE MINIMUM PERIOD PERMITTED BY LAW.
5. Consequential Damage Waiver
==============================
TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW, IN NO EVENT WILL YOU OR US
BE LIABLE FOR ANY LOSS OF PROFITS, LOSS OF ANTICIPATED SAVINGS, LOSS OF DATA,
INDIRECT, SPECIAL, INCIDENTAL, CONSEQUENTIAL AND EXEMPLARY DAMAGES ARISING OUT
OF THIS AGREEMENT REGARDLESS OF THE LEGAL OR EQUITABLE THEORY (CONTRACT, TORT
OR OTHERWISE) UPON WHICH THE CLAIM IS BASED.
6. Miscellaneous
================
6.1 Jurisdiction
----------------
This Agreement will be governed by and construed in accordance with the laws of
Puerto Rico excluding its conflicts of law provisions. Under certain circumstances,
the governing law in this section might be superseded by the United Nations
Convention on Contracts for the International Sale of Goods ("UN Convention")
and the parties intend to avoid the application of the UN Convention to this
Agreement and, thus, exclude the application of the UN Convention in its
entirety to this Agreement.
6.2 Acceptance
--------------
This Agreement sets out the entire agreement between You and Us for Your
Contributions to Us and overrides all other agreements or understandings.
6.3 Third parties
-----------------
If You or We assign the rights or obligations received through this Agreement
to a third party, as a condition of the assignment, that third party must
agree in writing to abide by all the rights and obligations in the Agreement.
6.4 Unmet responsibilities
--------------------------
The failure of either party to require performance by the other party of any
provision of this Agreement in one situation shall not affect the right of a
party to require such performance at any time in the future. A waiver of
performance under a provision in one situation shall not be considered a
waiver of the performance of the provision in the future or a waiver of the
provision in its entirety.
6.5 Continuation
----------------
If any provision of this Agreement is found void and unenforceable, such
provision will be replaced to the extent possible with a provision that comes
closest to the meaning of the original provision and which is enforceable.
The terms and conditions set forth in this Agreement shall apply
notwithstanding any failure of essential purpose of this Agreement or any
limited remedy to the maximum extent possible under law.
::
Name: _________________________________________________
Email: ________________________________________________
Address: ______________________________________________
Address (cont): _______________________________________
Country: ______________________________________________
Phone number: _________________________________________
Fax number: ___________________________________________
_______________________________________________________
Signature
Mayan EDMS Entity CAA Version 1.0 April 8, 2018

View File

@@ -1,243 +0,0 @@
======================================================
Mayan EDMS Individual Contributor Assignment Agreement
======================================================
Thank you for your interest in contributing to Mayan EDMS ("We" or "Us").
This contributor agreement ("Agreement") documents the rights granted by
contributors to Us. To make this document effective, please print it, sign it
(by copyright holder or authorized party) and send it to Us by email to
caa@mayan-edms.com. This is a legally binding document, so please read it
carefully before agreeing to it. The Agreement may cover more than one
software project managed by Us.
1. Definitions
==============
"You" means the individual who Submits a Contribution to Us.
"Contribution" means any work of authorship that is Submitted by You to Us
in which You own or assert ownership of the Copyright. We cannot accept
contributions for which you do not own the Copyright or for which you don't
have the necessary legal power to transfer.
"Copyright" means all rights protecting works of authorship owned or
controlled by You, including copyright, moral and neighboring rights,
as appropriate, for the full term of their existence including any extensions
by You.
"Material" means the work of authorship which is made available by Us to third
parties. When this Agreement covers more than one software project, the Material
means the work of authorship to which the Contribution was Submitted. After
You Submit the Contribution, it may be included in the Material.
"Submit" means any form of electronic, verbal, or written communication
sent to Us or our representatives, including but not limited to
electronic mailing lists, source code control systems, and issue tracking systems
that are managed by, or on behalf of, Us for the purpose of discussing and
improving the Material, but excluding communication that is conspicuously marked
or otherwise designated in writing by You as "Not a Contribution."
"Submission Date" means the date on which You Submit a Contribution to Us.
"Effective Date" means the date You execute this Agreement or the date You first
Submit a Contribution to Us, whichever is earlier.
2. Grant of Rights
==================
2.1 Copyright Assignment
------------------------
a. At the time the Contribution is Submitted, You assign to Us all right,
title, and interest worldwide in all Copyright covering the Contribution;
provided that this transfer is conditioned upon compliance with Section 2.3.
b. To the extent that any of the rights in Section 2.1(a) cannot be assigned
by You to Us, You grant to Us a perpetual, worldwide, exclusive, royalty-free,
transferable, irrevocable license under such non-assigned rights, with rights
to sublicense through multiple tiers of sublicensees, to practice such
non-assigned rights, including, but not limited to, the right to reproduce,
modify, display, perform and distribute the Contribution; provided that
this license is conditioned upon compliance with Section 2.3.
c. To the extent that any of the rights in Section 2.1(a) can neither be
assigned nor licensed by You to Us, You irrevocably waive and agree never to
assert such rights against Us, any of our successors in interest, or any of
our licensees, either direct or indirect; provided that this agreement not
to assert is conditioned upon compliance with Section 2.3.
d. Upon such transfer of rights to Us, the Contribution will be licenses under
the terms of the Material.
2.2 Patent License
------------------
For patent claims including, without limitation, method, process, and apparatus
claims which You own, control or have the right to grant, now or in the future,
You grant to Us a perpetual, worldwide, non-exclusive, transferable, royalty-free,
irrevocable patent license, with the right to sublicense these rights to multiple
tiers of sublicensees, to make, have made, use, sell, offer for sale, import and
otherwise transfer the Contribution and the Contribution in combination with
the Material (and portions of such combination). This license is granted only
to the extent that the exercise of the licensed rights infringes such patent claims;
and provided that this license is conditioned upon compliance with Section 2.3.
2.3 Outbound License
--------------------
As a condition on the grant of rights in Sections 2.1 and 2.2, We agree to
license the Contribution only under the terms of the license or licenses which
We are using on the Submission Date for the Material (including any rights to
adopt any future version of a license if permitted).
2.4 Moral Rights
----------------
If moral rights apply to the Contribution, to the maximum extent permitted by law,
You waive and agree not to assert such moral rights against Us or our successors
in interest, or any of our licensees, either direct or indirect.
2.5 Our Rights
--------------
You acknowledge that We are not obligated to use Your Contribution as part of
the Material and may decide to include any Contribution We consider appropriate.
2.6 Reservation of Rights
-------------------------
Any rights not expressly assigned or licensed under this section are expressly
reserved by You.
3. Agreement
============
You confirm that:
a. You have the legal authority to enter into this Agreement.
b. You own the Copyright and patent claims covering the Contribution which are
required to grant the rights under Section 2.
c. The grant of rights under Section 2 does not violate any grant of rights
which You have made to third parties, including Your employer. If You are an
employee, You have had Your employer approve this Agreement or sign the Entity
version of this document. If You are less than eighteen years old, please have
Your parents or guardian sign the Agreement.
4. Disclaimer
=============
EXCEPT FOR THE EXPRESS WARRANTIES IN SECTION 3, THE CONTRIBUTION IS PROVIDED
"AS IS". MORE PARTICULARLY, ALL EXPRESS OR IMPLIED WARRANTIES INCLUDING, WITHOUT
LIMITATION, ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
PURPOSE AND NON-INFRINGEMENT ARE EXPRESSLY DISCLAIMED BY YOU TO US AND BY US
TO YOU. TO THE EXTENT THAT ANY SUCH WARRANTIES CANNOT BE DISCLAIMED, SUCH
WARRANTY IS LIMITED IN DURATION TO THE MINIMUM PERIOD PERMITTED BY LAW.
5. Consequential Damage Waiver
==============================
TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW, IN NO EVENT WILL YOU OR US
BE LIABLE FOR ANY LOSS OF PROFITS, LOSS OF ANTICIPATED SAVINGS, LOSS OF DATA,
INDIRECT, SPECIAL, INCIDENTAL, CONSEQUENTIAL AND EXEMPLARY DAMAGES ARISING OUT
OF THIS AGREEMENT REGARDLESS OF THE LEGAL OR EQUITABLE THEORY (CONTRACT, TORT
OR OTHERWISE) UPON WHICH THE CLAIM IS BASED.
6. Miscellaneous
================
6.1 Jurisdiction
----------------
This Agreement will be governed by and construed in accordance with the laws of
Puerto Rico excluding its conflicts of law provisions. Under certain circumstances,
the governing law in this section might be superseded by the United Nations
Convention on Contracts for the International Sale of Goods ("UN Convention")
and the parties intend to avoid the application of the UN Convention to this
Agreement and, thus, exclude the application of the UN Convention in its
entirety to this Agreement.
6.2 Acceptance
--------------
This Agreement sets out the entire agreement between You and Us for Your
Contributions to Us and overrides all other agreements or understandings.
6.3 Third parties
-----------------
If You or We assign the rights or obligations received through this Agreement
to a third party, as a condition of the assignment, that third party must
agree in writing to abide by all the rights and obligations in the Agreement.
6.4 Unmet responsibilities
--------------------------
The failure of either party to require performance by the other party of any
provision of this Agreement in one situation shall not affect the right of a
party to require such performance at any time in the future. A waiver of
performance under a provision in one situation shall not be considered a
waiver of the performance of the provision in the future or a waiver of the
provision in its entirety.
6.5 Continuation
----------------
If any provision of this Agreement is found void and unenforceable,
such provision will be replaced to the extent possible with a provision that
comes closest to the meaning of the original provision and which is enforceable.
The terms and conditions set forth in this Agreement shall apply notwithstanding
any failure of essential purpose of this Agreement or any limited remedy to
the maximum extent possible under law.
::
Name: _________________________________________________
Email: ________________________________________________
Address: ______________________________________________
Address (cont): _______________________________________
Country: ______________________________________________
Phone number: _________________________________________
Fax number: ___________________________________________
_______________________________________________________
Signature
Mayan EDMS Individual CAA Version 1.0 April 8, 2018

View File

@@ -1,243 +0,0 @@
==============
Code structure
==============
Follow PEP8
-----------
Whenever possible, but don't obsess over things like line length:
.. code-block:: bash
$ flake8 --ignore=E501,E128,E122 |less
To perform automatic PEP8 checks, install flake8's git hook using:
.. code-block:: bash
$ flake8 --install-hook git
Imports
-------
Import order should be:
- Standard Python modules
- Installed Python modules
- Core Django modules
- Installed Django modules
- Mayan EDMS modules
- Local imports
Example:
.. code-block:: bash
from __future__ import absolute_import
# Standard Python library
import base64
# 3rd party installed Python libraries
import requests
# Django core modules
from django.db.models import Q
from django.template.defaultfilters import slugify
from django.utils.translation import ugettext
from django.utils.translation import ugettext_lazy as _
# 3rd party installed Django libraries
from rest_framework import APIView
# Mayan apps
from metadata.classes import MetadataClass
# Local app imports (relative)
from .conf.settings import (
AVAILABLE_INDEXING_FUNCTIONS,
MAX_SUFFIX_COUNT, SLUGIFY_PATHS
)
from .exceptions import MaxSuffixCountReached
from .filesystem import (
fs_create_index_directory, fs_create_document_link,
fs_delete_document_link, fs_delete_index_directory,
assemble_suffixed_filename
)
from .models import Index, IndexInstanceNode, DocumentRenameCount
All local app module imports are in relative form. Local app module name is to
be referenced as little as possible, unless required by a specific feature,
trick, restriction (e.g., Runtime modification of the module's attributes).
Incorrect:
.. code-block:: bash
# documents app views.py model
from documents.models import Document
Correct:
.. code-block:: bash
# documents app views.py model
from .models import Document
Dependencies
------------
Mayan EDMS apps follow a hierarchical model of dependency. Apps import from
their parents or siblings, never from their children. Think plugins. A parent
app must never assume anything about a possible existing child app. The
documents app and the Document model are the basic entities; they must never
import anything else. The common and main apps are the base apps.
Variables
---------
Naming of variables should follow a Major to Minor convention, usually
including the purpose of the variable as the first piece of the name, using
underscores as spaces. camelCase is not used in Mayan EDMS.
Examples:
Links:
.. code-block:: bash
link_document_page_transformation_list = ...
link_document_page_transformation_create = ...
link_document_page_transformation_edit = ...
link_document_page_transformation_delete = ...
Constants:
.. code-block:: bash
PERMISSION_SMART_LINK_VIEW = ...
PERMISSION_SMART_LINK_CREATE = ...
PERMISSION_SMART_LINK_DELETE = ...
PERMISSION_SMART_LINK_EDIT = ...
Classes:
.. code-block:: bash
class Document(models.Model):
class DocumentPage(models.Model):
class DocumentPageTransformation(models.Model):
class DocumentType(models.Model):
class DocumentTypeFilename(models.Model):
Strings
-------
Quotation character used in Mayan EDMS for strings is the single quote.
Double quote is used for multiple line comments or HTML markup.
Migrations
----------
Migrations should do only one thing (example: either create a table, move data
to a new table or remove an old table) to aid retrying on failure.
General
-------
Code should appear in their modules in alphabetic order or in their order of
importance if it makes more sense for the specific application. This makes
visual scanning easier on modules with a large number of imports, views or
classes. Class methods that return a value should be pretended with a
``get_`` to differentiate from an objects properties. When a variable refers
to a file it should be named as follows:
- filename: The files name and extension only.
- filepath: The entire path to the file including the filename.
- path: A path to a directory.
Flash messages should end with a period as applicable for the language.
Only exception is when the tail of the message contains an exceptions message
as passed directly from the exception object.
Steps to deploy a development version
=====================================
.. code-block:: bash
$ git clone |SOURCE_CODE_GIT|
$ cd mayan-edms
$ git checkout <Corresponding branch>
$ virtualenv venv
$ source venv/bin/activate
$ pip install -r requirements.txt
$ ./manage.py initialsetup
$ ./manage.py preparestatic
$ ./manage.py runserver
Debugging
=========
Mayan EDMS makes extensive use of Django's new
:django-docs:`logging capabilities <topics/logging>`.
By default debug logging for all apps is turned on. If you wish to customize
how logging is managed turn off automatic logging by setting
`COMMON_AUTO_LOGGING` to ``False`` and add the following lines to your
``settings/local.py`` file::
LOGGING = {
'version': 1,
'disable_existing_loggers': True,
'formatters': {
'verbose': {
'format': '%(levelname)s %(asctime)s %(name)s %(process)d %(thread)d %(message)s'
},
'intermediate': {
'format': '%(name)s <%(process)d> [%(levelname)s] "%(funcName)s() %(message)s"'
},
'simple': {
'format': '%(levelname)s %(message)s'
},
},
'handlers': {
'console':{
'level':'DEBUG',
'class':'logging.StreamHandler',
'formatter': 'intermediate'
}
},
'loggers': {
'documents': {
'handlers':['console'],
'propagate': True,
'level':'DEBUG',
},
'common': {
'handlers':['console'],
'propagate': True,
'level':'DEBUG',
},
}
}
Likewise, to see the debug output of the ``tags`` app, just add the following inside the ``loggers`` block::
'tags': {
'handlers':['console'],
'propagate': True,
'level':'DEBUG',
},

View File

@@ -1,18 +0,0 @@
============
Contributing
============
Mayan EDMS is under active development, and contributions are welcome.
If you have a feature request, suggestion or bug report, please open a new
issue on the `GitLab issue tracker`_. To submit patches, please send a merge
request on GitLab_.
.. _GitLab: |SOURCE_CODE_REPOSITORY|
.. _`GitLab issue tracker`: |SOURCE_CODE_ISSUES|
Contributing changes
====================
Follow the latest contributing guidelines outlined here:
|SOURCE_CODE_REPOSITORY|blob/master/CONTRIBUTING.md

View File

@@ -1,24 +0,0 @@
=============
Documentation
=============
The documentation is written in `reStructured Text`_ format, processed with
Sphinx_, and resides in the ``docs`` directory. In order to build it, you will
first need to install the documentation editing dependencies with::
$ pip install -r requirements/documentation.txt
Then, to build an HTML version of the documentation, run the following command
from the **docs** directory::
$ make docs-serve
The generated documentation can be viewed by browsing to http://127.0.0.1:8000
or by browsing to the ``docs/_build/html`` directory.
You can also generate the documentation in formats other than HTML. Consult the
Sphinx_ documentation for more details.
.. _`reStructured Text`: http://docutils.sourceforge.net/rst.html
.. _Sphinx: http://sphinx.pocoo.org

View File

@@ -1,29 +0,0 @@
==============
For developers
==============
- :doc:`philosophies`
- :doc:`code_structure`
- :doc:`documentation`
- :doc:`source_control`
- :doc:`contributing`
- :doc:`releases`
- :doc:`translations`
- :doc:`../../mercs/index`
- :doc:`caa_entity`
- :doc:`caa_individual`
.. toctree::
:hidden:
philosophies
code_structure
documentation
source_control
contributing
releases
translations
../../mercs/index
caa_entity
caa_individual

View File

@@ -1,29 +0,0 @@
====================
Project philosophies
====================
How to think about Mayan EDMS when doing changes or adding new features;
why things are the way they are in Mayan EDMS:
- Functionality must be as market/sector independent as possible, code for the
95% of use cases.
- Each user must be able to configure and customize it to their needs after
install.
- Abstract as much as possible, each app must be an expert in just one thing,
for other things they should use the API/classes/functions of other apps.
- Assume as little as possible about anything outside the project
(hardware, OS, storage).
- Provide Python based abstraction so that a default install runs with a single
step.
- No hard dependencies on binaries unless there is no other choice.
- Provide “drivers” or switchable backends to allow users to fine tune the
installation.
- Call to binaries only when there is no other choice or the Python choices are
not viable/mature/efficient.
- Each app is as independent and self contained as possible. Exceptions, the
basic requirements: navigation, permissions, common, main.
- If an app is meant to be used by more than one other app, it should be as
generic as possible in regard to the project and another app will bridge the functionality.
- Example: since indexing (document_indexing) only applies to documents, the
app is specialized and depends on the documents app.

View File

@@ -1,173 +0,0 @@
===================
Installable package
===================
Source file package
-------------------
This is the sequence of step used to produce an installable package:
1. Generate the packaged version (will produce dist/mayan-edms-x.y.z.tar.gz)::
$ make sdist
2. Do a test install::
$ cd /tmp
$ virtualenv venv
$ source venv/bin/activate
$ pip install <path of the Git repository>/dist/mayan-edms-x.y.z.tar.gz
$ mayan-edms.py initialsetup
$ mayan-edms.py preparestatic
$ mayan-edms.py runserver
Wheel package
-------------
1. Install the development requirements::
$ pip install -r requirements/development.txt
2. Create wheel package using the makefile::
$ make wheel
3. Do a test install::
$ cd /tmp
$ virtualenv venv
$ source venv/bin/activate
$ pip install <path of the Git repository>/dist/mayan_edms-x.y.z-py2-none-any.whl
$ mayan-edms.py initialsetup
$ mayan-edms.py preparestatic
$ mayan-edms.py runserver
Version numbering
=================
Mayan EDMS uses the Semantic Versioning (http://semver.org/) method to choose
version numbers along with Python's PEP-0440 (https://www.python.org/dev/peps/pep-0440/)
to format them.
X.YaN # Alpha release
X.YbN # Beta release
X.YrcN # Release Candidate
X.Y # Final release
Release checklist
=================
#. Check for missing migrations::
make check-missing-migrations
#. Synchronize translations::
make translations-pull
#. Compile translations::
make translations-compile
#. Update changelog.
#. Write release notes.
#. Scan the code with flake8 for simple style warnings.
#. Check README.rst format with::
python setup.py check -r -s
or with::
make check-readme
#. Bump version in ``mayan/__init__.py`` and ``docker/rootfs/version``::
make increase-version PART=<major, minor or micro>
#. Update requirements version in ``setup.py`` using:
::
make generate-setup
#. Commit as version bump.
#. Build source package and test:
::
make test-sdist-via-docker-ubuntu
#. Build wheel package and test:
::
make test-wheel-via-docker-ubuntu
#. Tag version:
::
git tag -a vX.Y.Z -m "Version X.Y.Z"
#. Generate set ``setup.py`` again to update the build number::
make generate-setup
#. Commit the new ``setup.py`` file.
#. Release the version using one of the two following methods: GitLab CI or
manual
Release using GitLab CI using the makefile
------------------------------------------
#. Use of the GitLab makefile targets: ``gitlab-release-all``,
``gitlab-release-docker``, ``gitlab-release-documentation``,
``gitlab-release-python``.
Release using GitLab CI manually
--------------------------------
#. Push the current brach:
::
git push
#. Push the new tags:
::
git push --tags
#. Delete the corresponding ``releases/`` branch:
::
git push origin :releases/<branch>
#. Push the current branch to the corresponding origin ``releases/`` branch:
::
git push origin <local branch>:releases/<branch>
Manual release
--------------
#. Build and upload a test release:
::
make release-test-via-docker-ubuntu
#. Build and upload a final release:
::
make release-via-docker-ubuntu
Other steps
-----------
#. Update the contrib/scripts/install/docker.sh values
#. Upload contrib/scripts/install/docker.sh to https://get.mayan-edms.com

View File

@@ -1,99 +0,0 @@
==============
Source Control
==============
Mayan EDMS source is controlled with Git_.
The project is publicly accessible, hosted and can be cloned from **GitLab** using::
$ git clone |SOURCE_CODE_GIT|
Git branch structure
--------------------
Mayan EDMS follows a simplified model layout based on Vincent Driessen's
`Successful Git Branching Model`_ blog post.
``/versions/micro``
Working branch for the next bugfix release. Micro increment (third digit).
Only bug fixes, minor features, back-ported urgent features. This
branch is stable and safe for production.
``/versions/minor``
Working branch for the next minor release (second digit). New features,
occasional breakage. Not for production but should run in test
environment most of the time. This is the branch you will want to
try out if you want to check out new features.
``/versions/major``
Working branch for the next major release (first digit). New features,
incompatible changes to the user facing interfaces. Broken most of the
time, not for production and should only be cloned by developers
with experience with Mayan's development.
``master``
Current production release (|version|). Points to the latest version of
the latest series. Production quality code.
``features/``
Working branches for unfinished and unmerged feature. Likely unstable,
don't use in production. Once the feature is complete, it is merged
into one of the versions branches and deleted.
Special branches:
``releases/all``
Pushing code to this branch will trigger the build and release
a new Docker image, Documentation and Python package.
``releases/docker``
Pushing code to this branch will trigger the build and release
of a new Docker image to Docker Hub.
``releases/documentation``
Pushing code to this branch will trigger the build and release
of new documentation.
``releases/python``
Pushing code to this branch will trigger the build and release
of a new Python package to PyPI.
``nightly``
Pushing code to this branch will trigger the build and release
of a new Docker image based on development code to the GitLab image
repository only. The image will not be published to Docker Hub.
Each release is tagged separately using annotated Git tags.
When submitting patches, please place your code in its own ``feature/`` branch
prior to opening a Merge Request on |SOURCE_CODE_ISSUES|.
.. _Git: http://git-scm.org
.. _`Successful Git Branching Model`: http://nvie.com/posts/a-successful-git-branching-model/
Commit messages
---------------
#. Use English as the language for the commit messages.
#. Provide a subject line composed of a tag and a short explanation::
Indexing: Add document base property reindex
#. Keep the subject line to 50 or less characters.
#. Capitalize the subject line.
#. Don't end the subject line with a period, leave like a phrase in English.
#. Use active voice in the. Say what the commit will do when applied not what
you did::
Add new properties to the model.
Vs.
::
Added new properties to the model.
#. Limit the body of the commit to 72 characters.
#. When a commit fixes or improves an issue add the issue number in the commit
message. Either in the subject or in the body.
#. Sign commit messages.
#. Use explicit language even for minor commits. Don't do::
Fix typo
Use::
Document: Fix typo in label description

View File

@@ -1,30 +0,0 @@
.. _docker-accessing-outside-data:
======================
Accessing outside data
======================
To use Mayan EDMS's staging folders or watch folders from Docker, the data
for these source must be made accessible to the container. This is done by
mounting the folders in the host computer to folders inside the container.
This is necessary because Docker containers do not have access to host data
on purpose. For example, to make a folder in the host accessible as a watch
folder, add the following to the Docker command line when starting the
container::
-v /opt/scanned_files:/scanned_files
The command line would look like this::
docker run ... -v /opt/scanned_files:/scanned_files mayanedms/mayanedms:latest
Now create a watch folder in Mayan EDMS using the path ``/scanned_files``
and the documents from the host folder ``/opt/scanned_files`` will be
automatically available. Use the same procedure to mount host folders to be
used as staging folders. In this example ``/scanned_files`` was used as the
container directory, but any path can be used as long as:
- the path not an already existing path
- the path is not used by any other program
- the path is a single level path

View File

@@ -1,47 +0,0 @@
.. _docker_backups:
==================
Performing backups
==================
#. Document files
To backup the existing data, stop the image and copy the content of the volume.
For the example::
docker run -d --name mayan-edms --restart=always -p 80:8000 \
-v /docker-volumes/mayan:/var/lib/mayan \
-v /opt/scanned_files:/scanned_files mayanedms/mayanedms:|DOCKER_MAYAN_IMAGE_VERSION|
That would be the ``/docker-volumes/mayan folder``::
sudo tar -zcvf backup.tar.gz /docker-volumes/mayan
sudo chown `whoami` backup.tar.gz
#. Database
If using an external PostgreSQL or MySQL database or database containers, these
too need to be backed up using their respective procedures. A simple solution
is to copy the entire database container volume after the container has
been stopped.
- PostgreSQL: https://www.postgresql.org/docs/current/backup-dump.html
- MySQL: https://dev.mysql.com/doc/refman/5.7/en/mysqldump.html
=======================
Restoring from a backup
=======================
#. Document files
Uncompress the backup archive in the original docker volume using::
sudo tar -xvzf backup.tar.gz -C /
#. Database
- PostgreSQL: https://www.postgresql.org/docs/current/backup-dump.html
- MySQL: https://dev.mysql.com/doc/refman/5.7/en/mysqldump.html

View File

@@ -1,25 +0,0 @@
.. _docker_building:
==================
Building the image
==================
Clone the repository with::
git clone |SOURCE_CODE_GIT|
Change to the directory of the cloned repository::
cd mayan-edms
Execute Docker's build command using the provided makefile::
make docker-build
Or using an APT cache to speed up the build::
make docker-build-with-proxy APT_PROXY=172.17.0.1:3142
Replace the IP address `172.17.0.1` with the IP address of the computer
running the APT proxy and caching service.

View File

@@ -1,10 +0,0 @@
.. _docker_commands:
=================================
Executing commands on a container
=================================
To perform Mayan EDMS commands in a running container that will take all the
settings from the container, use the following command::
docker exec -ti <container name> /usr/local/bin/entrypoint.sh "/opt/mayan-edms/bin/mayan-edms.py <command>"

View File

@@ -1,21 +0,0 @@
=====================
Customizing the image
=====================
If you just need to add a few Ubuntu or Python packages to your installation,
you can use the following environment variables:
``MAYAN_APT_INSTALLS``
Specifies a list of Ubuntu .deb packages to be installed via APT when the
container is first created. The installed packages are not lost when the image
is stopped. Example: To install the Tesseract OCR language packs for German
and Spanish add the following in your ``docker start`` command line::
-e MAYAN_APT_INSTALLS="tesseract-ocr-deu tesseract-ocr-spa"
``MAYAN_PIP_INSTALLS``
Specifies a list of Python packages to be installed via ``pip``. Packages will
be downloaded from the Python Package Index (https://pypi.python.org) by
default.

View File

@@ -1,30 +0,0 @@
.. _docker_compose:
====================
Using Docker compose
====================
To deploy a complete production stack using the included Docker compose file
execute::
docker-compose -f docker-compose.yml up -d
This Docker compose file will provision four containers:
- Postgres as the database
- Redis as the Celery result storage
- RabbitMQ as the Celery broker
- Mayan EDMS using the above service containers
To stop the stack use::
docker-compose -f docker-compose.yml stop
The stack will also create four volumes to store the data of each container.
These are:
- mayan_app - The Mayan EDMS data container, normally called `mayan_data` when not using Docker compose.
- mayan_broker - The broker volume, in this case RabbitMQ.
- mayan_db - The database volume, in this case Postgres.
- mayan_results - The celery result backend volume, in this case Redis.

View File

@@ -1,12 +0,0 @@
.. _docker_image_drivers:
================
Included drivers
================
The Docker image supports using Redis and RabbitMQ as result backends. For
databases, the image includes support for PostgreSQL and MySQL/MariaDB.
Support for additional brokers or databases may be added using the
``MAYAN_APT_INSTALL`` environment variable.

View File

@@ -1,63 +0,0 @@
.. index:: Docker environment variables
.. _docker_environment_variables:
=====================
Environment Variables
=====================
The common set of settings can also be modified via environment variables when
using the Docker image. In addition to the common set of settings, some Docker
image specific environment variables are available.
``MAYAN_SETTINGS_MODULE``
Optional. Allows loading an alternate settings file.
``MAYAN_GUNICORN_TIMEOUT``
Optional. Changes the amount of time the frontend worker will wait for a
request to finish before raising a timeout error. The default is 120
seconds.
``MAYAN_GUNICORN_WORKERS``
Optional. This environment variable controls the number of frontend workers
that will be executed. If not specified the default is 2. For heavier loads,
user a higher number. A formula recommended for this setting is the number
of CPU cores + 1.
``MAYAN_WORKER_FAST_CONCURRENCY``
Optional. Changes the concurrency (number of child processes) of the Celery
worker consuming the queues in the fast (low latency, short tasks) category.
Default is 1. Use 0 to disable hardcoded concurrency and allow the Celery
worker to launch its default number of child processes (equal to the number
of CPUs detected).
``MAYAN_WORKER_MEDIUM_CONCURRENCY``
Optional. Changes the concurrency (number of child processes) of the Celery
worker consuming the queues in the medium (medium latency, long running tasks)
category. Default is 1. Use 0 to disable hardcoded concurrency and allow the
Celery worker to launch its default number of child processes (equal to the
number of CPUs detected).
``MAYAN_WORKER_SLOW_CONCURRENCY``
Optional. Changes the concurrency (number of child processes) of the Celery
worker consuming the queues in the slow (high latency, very long running tasks)
category. Default is 1. Use 0 to disable hardcoded concurrency and allow the
Celery worker to launch its default number of child processes (equal to the
number of CPUs detected).
``MAYAN_USER_UID``
Optional. Changes the UID of the ``mayan`` user internal to the Docker
container. Defaults to 1000.
``MAYAN_USER_GID``
Optional. Changes the GID of the ``mayan`` user internal to the Docker
container. Defaults to 1000.

View File

@@ -1,35 +0,0 @@
.. index:: Docker
======
Docker
======
Docker is a container technology. Containers are a standard unit of software
that packages up code and all its dependencies.
- Installation: :doc:`install_simple` | :doc:`install_docker_network` | :doc:`docker_compose` | :doc:`start_stop`
- Setup: :doc:`environment_variables` | :doc:`drivers`
- Integration: :doc:`accessing_data`
- Development: :doc:`building` | :doc:`customizing` | :doc:`nightly`
- Administration: :doc:`backups` | :doc:`upgrading` | :doc:`commands`
.. toctree::
:hidden:
install_simple
install_docker_network
start_stop
environment_variables
drivers
accessing_data
backups
upgrading
building
customizing
docker_compose
nightly
commands

View File

@@ -1,67 +0,0 @@
.. _docker_install_networked:
================================
Using a dedicated Docker network
================================
Use this method to avoid having to expose PostreSQL port to the host's network
or if you have other PostgreSQL instances but still want to use the default
port of 5432 for this installation.
#. Create the network:
.. code-block:: bash
docker network create mayan
#. Launch the PostgreSQL container with the network option and remove the
port binding (``-p 5432:5432``):
.. code-block:: bash
docker run \
-d \
--name mayan-edms-postgres \
--network=mayan \
--restart=always \
-e POSTGRES_USER=mayan \
-e POSTGRES_DB=mayan \
-e POSTGRES_PASSWORD=mayanuserpass \
-v /docker-volumes/mayan-edms/postgres:/var/lib/postgresql/data \
|DOCKER_POSTGRES_IMAGE_VERSION|
#. Launch the Redis container with the network option and remove the port
binding (``-p 6379:6379``):
.. code-block:: bash
docker run \
-d \
--name mayan-edms-redis \
--network=mayan \
|DOCKER_REDIS_IMAGE_VERSION| \
redis-server \
--databases \
"2" \
--maxmemory-policy \
allkeys-lru \
--save \
""
#. Launch the Mayan EDMS container with the network option and change the
database hostname to the PostgreSQL container name (``mayan-edms-postgres``)
instead of the IP address of the Docker host (``172.17.0.1``):
.. code-block:: bash
docker run \
-d \
--name mayan-edms \
--network=mayan \
--restart=always \
-p 80:8000 \
-e MAYAN_DATABASES="{'default':{'ENGINE':'django.db.backends.postgresql','NAME':'mayan','PASSWORD':'mayanuserpass','USER':'mayan','HOST':'mayan-edms-postgres'}}" \
-e MAYAN_CELERY_BROKER_URL="redis://mayan-edms-redis:6379/0" \
-e MAYAN_CELERY_RESULT_BACKEND="redis://mayan-edms-redis:6379/1" \
-v /docker-volumes/mayan-edms/media:/var/lib/mayan \
mayanedms/mayanedms:|DOCKER_MAYAN_IMAGE_VERSION|

View File

@@ -1,117 +0,0 @@
.. _docker_install:
==========================
Simple Docker installation
==========================
#. Install Docker:
.. code-block:: bash
wget -qO- https://get.docker.com/ | sh
If you don't want run an automated script, follow the instructions outlined
in their documentation: https://docs.docker.com/install/
Once the Docker installation is finished, proceed to the link below to install
the Docker image for Mayan EDMS.
#. Download the Mayan EDMS Docker image:
With Docker properly installed, proceed to download the Mayan EDMS Docker
image using the command:
.. code-block:: bash
docker pull mayanedms/mayanedms:|DOCKER_MAYAN_IMAGE_VERSION|
#. Download the PostgreSQL Docker image:
.. code-block:: bash
docker pull |DOCKER_POSTGRES_IMAGE_VERSION|
#. Download the Redis Docker image:
.. code-block:: bash
docker pull |DOCKER_REDIS_IMAGE_VERSION|
#. Create and run a PostgreSQL container:
.. code-block:: bash
docker run \
-d \
--name mayan-edms-postgres \
--restart=always \
-p 5432:5432 \
-e POSTGRES_USER=mayan \
-e POSTGRES_DB=mayan \
-e POSTGRES_PASSWORD=mayanuserpass \
-v /docker-volumes/mayan-edms/postgres:/var/lib/postgresql/data \
|DOCKER_POSTGRES_IMAGE_VERSION|
The PostgreSQL container will have one database named ``mayan``, with an user
named ``mayan`` too, with a password of ``mayanuserpass``. The container will
expose its internal 5432 port (PostgreSQL's default port) via the host's
5432 port. The data of this container will reside on the host's
``/docker-volumes/mayan-edms/postgres`` folder.
#. Create and run a Redis container:
.. code-block:: bash
docker run \
-d \
--name mayan-edms-redis \
--restart=always \
-p 6379:6379 \
|DOCKER_REDIS_IMAGE_VERSION| \
redis-server \
--databases \
"2" \
--maxmemory-policy \
allkeys-lru \
--save \
""
The Redis container will have two databases, one for background task messages,
and the other to hold the results of those background tasks. Redis is
configure to not save its content to disk and to automatically clear up
memory.
#. Create and run a Mayan EDMS container:
.. code-block:: bash
docker run \
-d \
--name mayan-edms \
--restart=always \
-p 80:8000 \
-e MAYAN_DATABASES="{'default':{'ENGINE':'django.db.backends.postgresql','NAME':'mayan','PASSWORD':'mayanuserpass','USER':'mayan','HOST':'172.17.0.1'}}" \
-e MAYAN_CELERY_BROKER_URL="redis://172.17.0.1:6379/0" \
-e MAYAN_CELERY_RESULT_BACKEND="redis://172.17.0.1:6379/1" \
-v /docker-volumes/mayan-edms/media:/var/lib/mayan \
mayanedms/mayanedms:|DOCKER_MAYAN_IMAGE_VERSION|
The Mayan EDMS container will connect to the PostgreSQL container via the
``172.17.0.1`` IP address (the Docker host's default IP address). It will
connect using the ``django.db.backends.postgresql`` database driver and
connect to the ``mayan`` database using the ``mayan`` user with the password
``mayanuserpass``. The files of the container will be store in the
host's ``/docker-volumes/mayan-edms/media`` folder. The container will
expose its web service running on port 8000 on the host's port 80.
The container will be available by browsing to ``http://localhost`` or to
the IP address of the computer running the container.
If another web server is running on port 80 use a different port in the
``-p`` option. For example: ``-p 81:8000``.

View File

@@ -1,12 +0,0 @@
==============
Nightly images
==============
The continuous integration pipeline used for testing development builds also
produces a resulting Docker image. These are build automatically and their
stability is not guaranteed. They should never be used in production.
If you want to try out the Docker images the development uses or want a sneak
peek at the new features being worked on checkout the container registry at:
|SOURCE_CODE_REPOSITORY|container_registry

View File

@@ -1,13 +0,0 @@
===================================
Stopping and starting the container
===================================
To stop the container use::
docker stop mayan-edms
To start the container again::
docker start mayan-edms

View File

@@ -1,30 +0,0 @@
=========
Upgrading
=========
Upgrading a Mayan EDMS Docker container is actually a matter of stopping and
deleting the container, downloading the most recent version of the image and
starting a container again. The container will take care of updating the
database structure to the newest version if necessary.
**IMPORTANT!** Do not delete the volume storing the data, only the container.
Stop the container to be upgraded::
docker stop mayan-edms
Remove the container::
docker rm mayan-edms
Pull the new image version::
docker pull mayanedms/mayanedms:latest
Start the container again with the new image version::
docker run -d --name mayan-edms --restart=always -p 80:8000 -v /docker-volumes/mayan:/var/lib/mayan mayanedms/mayanedms:latest

Some files were not shown because too many files have changed in this diff Show More