DocCyblade / tkl-mayan-edms

Turnkey Linux - Mayan EDMS
https://www.turnkeylinux.org/mayan-edms
Other
4 stars 12 forks source link

Review Requirements for new EDMS version #67

Open DocCyblade opened 3 years ago

DocCyblade commented 3 years ago

Recommended

RAM: 4 GB or more. CPU: more than 2 cores, 2 GHz or faster, Intel Core i3 or better. Debian 10. Python version 3.8. Storage: solid state storage. PostgreSQL 12 or later.

DocCyblade commented 3 years ago

From https://docs.mayan-edms.com/chapters/deploying.html

# Install binary dependencies:
apt-get install exiftool g++ gcc coreutils 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

# Create the user account for the installation:
adduser mayan --disabled-password --disabled-login --gecos ""

# Create the parent directory where the project will be deployed:
mkdir /opt

# Create the Python virtual environment:
virtualenv /opt/mayan-edms -p /usr/bin/python3

# Upgrade to the latest pip version:
su -u mayan /opt/mayan-edms/bin/pip install -U pip

# Install Mayan EDMS from PyPI:
su -u mayan /opt/mayan-edms/bin/pip install mayan-edms==3.5.5

# Install the Python client for PostgreSQL and Redis:
su -u mayan /opt/mayan-edms/bin/pip install psycopg2==2.8.6 redis==3.5.3

# Create the database for the installation:
su -u postgres psql -c "CREATE USER mayan WITH password 'mayanuserpass';"
su -u postgres createdb -O mayan mayan

# Initialize the project:
su -u mayan MAYAN_DATABASES="{'default':{'ENGINE':'django.db.backends.postgresql','NAME':'mayan','PASSWORD':'mayanuserpass','USER':'mayan','HOST':'127.0.0.1'}}" \
MAYAN_MEDIA_ROOT=/opt/mayan-edms/media \
/opt/mayan-edms/bin/mayan-edms.py initialsetup
'

# Create the supervisor file at /etc/supervisor/conf.d/mayan.conf
su -u mayan MAYAN_DATABASES="{'default':{'ENGINE':'django.db.backends.postgresql','NAME':'mayan','PASSWORD':'mayanuserpass','USER':'mayan','HOST':'127.0.0.1'}}" \
MAYAN_MEDIA_ROOT=/opt/mayan-edms/media \
/opt/mayan-edms/bin/mayan-edms.py platformtemplate supervisord | sudo sh -c "cat > /etc/supervisor/conf.d/mayan.conf"

# Configure Redis:
echo "maxmemory-policy allkeys-lru" | sudo tee -a /etc/redis/redis.conf
echo "save \"\"" | sudo tee -a /etc/redis/redis.conf
echo "databases 2" | sudo tee -a /etc/redis/redis.conf
echo "requirepass mayanredispassword" | sudo tee -a /etc/redis/redis.conf
sudo systemctl restart redis

# Enable and restart the services
su systemctl enable supervisor
su systemctl restart supervisor

# Cleaning up:
su apt-get remove --purge libjpeg-dev libpq-dev libpng-dev libtiff-dev zlib1g-dev
DocCyblade commented 3 years ago

virtualenv - depends on python3 and python3-virtualenv

unpaper

JedMeister commented 3 years ago

Python version 3.8.

FWIW, when I saw that I had a moment of concern! v16.x only has python 3.7!

But then I realised that is recommended. The minimum requiremen is v3.5...

So we're all good... :smile:


More notes...

From a quick glance over what you've copy/pasted from Mayan docs vs the build code, it looks like the only thing required is an update of the relevant psycopg2 & redis py module versions. Everything else looks good to go! :smile: :tada: :+1:

Although obviously I might have missed some detail...


Aside 1

You'll notice that I create a env file (ENV_CONF). This is designed to ease usage and allow the user to load the environment easily when interacting with Mayan via CLI (see readme).


Aside 2 (somewhat related to aside 1) (added extra - not required)

For v16.1 I've made a few wrapper scripts for commands that ideally should not be run as root. Including something like that for Mayan might be of value too perhaps? Here's what I've done so far:

Perhaps a turnkey-mayan-edms command that pre-loads the env and runs /opt/mayan-edms/bin/mayan-edms.py as the mayan user.

I'm not sure, but perhaps there is even value in a turnkey-mayan-pip command too?