Infrastructure Setup Roadmap

A detailed walkthrough for deploying OpenVolMgr manually on Debian/Ubuntu systems.

1

OS & User Environment

Update the system and create a dedicated service user. Do not run the application as root.

sudo apt-get update && sudo apt-get upgrade -y
sudo apt install -y \
python3-venv \
python3-dev \
git \
redis-server \
libmysqlclient-dev \
build-essential \
libcairo2-dev \
pkg-config

# Setup Dedicated Service User
sudo adduser --system --group openvolmgr
git clone -b Master [YOUR_GIT_REPO_URL] /opt/openvolmgr

sudo mkdir -p /opt/openvolmgr/media/profile_pics /var/log/celery/
sudo chown -R openvolmgr:openvolmgr /opt/openvolmgr /var/log/celery/
2

Application & Virtual Env

Clone the repository and install all required Python modules into a virtual environment.

cd /opt/openvolmgr
sudo -u openvolmgr python3 -m venv venv
source venv/bin/activate

# Install all required packages
pip install \
django-mysql \
django-celery-beat \
celery \
redis \
mysqlclient \
django-select2 \
django-mathfilters \
chardet \
beautifulsoup4 \
lxml \
openpyxl \
python-dotenv \
dj-database-url \
whitenoise \
mozilla-django-oidc \
cryptography \
django-widget-tweaks \
pytz \
xhtml2pdf

#deactivate the virtual environment
deactivate
3

Environment Configuration (.env)

Create the configuration file at /opt/openvolmgr/openvolmgr/.env. The SECRET_KEY and FERNET_KEY must be generated before you start. the SITE_URL needs to be domain only do not include the scheme (http/https).

Action Required: Generate Security Keys

1. Generate Django SECRET_KEY:
./venv/bin/python -c "from django.core.management.utils import get_random_secret_key; print(get_random_secret_key())"
2. Generate FerNet Key (Required):
./venv/bin/python -c "from cryptography.fernet import Fernet; print(Fernet.generate_key().decode())"
# --- CORE SECURITY --- SECRET_KEY=[Insert Key 1] FERNET_KEY=[Insert Key 2] DATABASE_URL=mysql://db_user:db_pass@localhost:3306/db_name SITE_URL=your-domain.com DEBUG=False # --- OPTIONAL SSO (OpenID Connect) --- # OIDC is fully supported. If not used, leave these blank or commented. OIDC_RP_CLIENT_ID=... OIDC_RP_CLIENT_SECRET=... OIDC_RP_PROVIDER_URL=... OIDC_RP_SCOPES=openid profile email LOGIN_REDIRECT_URL=/ OIDC_OP_AUTHORIZATION_ENDPOINT='...' OIDC_OP_TOKEN_ENDPOINT='...' OIDC_OP_USER_ENDPOINT='...' OIDC_OP_JWKS_ENDPOINT='...' # --- EMAIL SETTINGS --- EMAIL_HOST='smtp.yourserver.com' EMAIL_PORT=587 EMAIL_USE_TLS=True EMAIL_HOST_USER='...' EMAIL_HOST_PASSWORD='...' DEFAULT_FROM_EMAIL='...'
4

Systemd Service Units

To ensure the application persists after reboots and handles background tasks, create the following files in /etc/systemd/system/. Replace $USER and $GROUP with openvolmgr.

/etc/systemd/system/openvolmgr.service WEB SERVER
[Unit] Description=OpenVolMgr Runserver After=network.target [Service] Type=simple User=openvolmgr Group=openvolmgr WorkingDirectory=/opt/openvolmgr ExecStart=/opt/openvolmgr/venv/bin/python manage.py runserver 0.0.0.0:8000 Restart=on-failure [Install] WantedBy=multi-user.target
/etc/systemd/system/celery-worker.service TASK WORKER
[Unit] Description=Celery Worker After=network.target redis.service [Service] Type=simple User=openvolmgr Group=openvolmgr WorkingDirectory=/opt/openvolmgr ExecStart=/opt/openvolmgr/venv/bin/celery -A openvolmgr worker -l info Restart=on-failure StandardOutput=append:/var/log/celery/openvolmgr-celery-worker.log StandardError=append:/var/log/celery/openvolmgr-celery-worker_error.log [Install] WantedBy=multi-user.target
/etc/systemd/system/celery-beat.service SCHEDULER
[Unit] Description=Celery Beat After=network.target redis.service [Service] Type=simple User=openvolmgr Group=openvolmgr WorkingDirectory=/opt/openvolmgr ExecStart=/opt/openvolmgr/venv/bin/celery -A openvolmgr beat -l info --scheduler django_celery_beat.schedulers:DatabaseScheduler Restart=on-failure StandardOutput=append:/var/log/celery/openvolmgr-celery-beat.log StandardError=append:/var/log/celery/openvolmgr-celery-beat_error.log [Install] WantedBy=multi-user.target
5

Migrations & Startup

# Database Initialization
sudo -u openvolmgr ./venv/bin/python manage.py makemigrations core
sudo -u openvolmgr ./venv/bin/python manage.py makemigrations
sudo -u openvolmgr ./venv/bin/python manage.py migrate core
sudo -u openvolmgr ./venv/bin/python manage.py migrate
sudo -u openvolmgr ./venv/bin/python manage.py collectstatic --no-input
sudo -u openvolmgr ./venv/bin/python manage.py createsuperuser

# Style Consistency Fix
cp -r /opt/openvolmgr/staticfiles/admin/ /opt/openvolmgr/core/static

# Enable and Start Everything
sudo systemctl daemon-reload
sudo systemctl enable --now openvolmgr celery-worker celery-beat redis-server