For the complete documentation index, see llms.txt. Markdown versions of documentation pages are available by appending .md to page URLs.
Skip to content

Advanced settings

You may need to adjust backend settings to match your environment. The following files hold the values described below:

  • .env for SECRET_KEY, DEBUG, and FRONTEND_REDIRECT

  • ocsinventory_backend/settings.py for LOGGING, MEDIA_ROOT, and MEDIA_URL

Both files can be found at /usr/share/ocsinventory-backend/ on a package install. Any changes will require a server restart to be effective:

sudo systemctl restart uwsgi

Environment variables

Setting
Description
Production value

SECRET_KEY

A random value used to sign session cookies and authentication tokens.

Unique value. Keep it secret.

DEBUG

Shows detailed technical information on error pages.

False. True exposes internal details after an error.

FRONTEND_REDIRECT

The OCS interface URL. OCS redirects users here after they sign in through SSO.

http://ocs.example.com:3000. Required for SSO sign-in.

Logging

The backend writes these files to the logs/ directory:

File
Contents

ocs_auth.log

Sign-ins, including SSO events

ocs_collection.log

Inventory data received from agents

ocs_backend.log

General backend activity

ocs_django.log

Django framework messages

ocs_management.log

Scheduled and manual maintenance activities

Each file rotates every Sunday (when="W6"). Two previous files are retained (backupCount=2). About three weeks of history are available.

when and backupCount are TimedRotatingFileHandler options. See Django logging for the LOGGING structure.

Logging sample

Media files

Media settings control where OCS stores deployment packages.

Setting
Description
Default value

MEDIA_ROOT

Server directory where package files are stored.

media/ under the installation directory

MEDIA_URL

URL prefix used to serve package files.

/media/

Deployment packages can be large. Ensure this directory has sufficient space. Include it in your backup plan with the database.

Last updated