InvenTree/InvenTree/config_template.yaml
Oliver 679b49b4f7
Frontend server settings (#5765)
* Update ApiToken model

- Add metadata
- Remove unique_together requirement
- Add last_seen field

* Update admin page for token

* Store metadata against token on creation

* Track last-seen date

* Allow match against existing valid token

- If token is expired or revoked, create a new one
- Prevents duplication of tokens

* Update unit tests

* Fix default server

* Improve functionality for extracting frontend settings

* Update default server list

* Use f-strings

* Revert logger name

* Remove mark_safe warning
2023-10-23 22:33:16 +11:00

312 lines
10 KiB
YAML

# Secret key for backend
# Use the environment variable INVENTREE_SECRET_KEY_FILE
#secret_key_file: '/etc/inventree/secret_key.txt'
# Database backend selection - Configure backend database settings
# Documentation: https://docs.inventree.org/en/latest/start/config/
# Note: Database configuration options can also be specified from environmental variables,
# with the prefix INVENTREE_DB_
# e.g INVENTREE_DB_NAME / INVENTREE_DB_USER / INVENTREE_DB_PASSWORD
database:
# Uncomment (and edit) one of the database configurations below,
# or specify database options using environment variables
# Refer to the django documentation for full list of options
# --- Available options: ---
# ENGINE: Database engine. Selection from:
# - mysql
# - postgresql
# - sqlite3
# NAME: Database name
# USER: Database username (if required)
# PASSWORD: Database password (if required)
# HOST: Database host address (if required)
# PORT: Database host port (if required)
# --- Database settings ---
#ENGINE: sampleengine
#NAME: '/path/to/database'
#USER: sampleuser
#PASSWORD: samplepassword
#HOST: samplehost
#PORT: 123456
# --- Example Configuration - MySQL ---
#ENGINE: mysql
#NAME: inventree
#USER: inventree
#PASSWORD: inventree_password
#HOST: 'localhost'
#PORT: '3306'
# --- Example Configuration - Postgresql ---
#ENGINE: postgresql
#NAME: inventree
#USER: inventree
#PASSWORD: inventree_password
#HOST: 'localhost'
#PORT: '5432'
# --- Example Configuration - sqlite3 ---
# ENGINE: sqlite3
# NAME: '/home/inventree/database.sqlite3'
# Set debug to False to run in production mode
# Use the environment variable INVENTREE_DEBUG
debug: True
# Set to False to disable the admin interface (default = True)
# Or, use the environment variable INVENTREE_ADMIN_ENABLED
#admin_enabled: True
# Set the admin URL (default is 'admin')
# Or, use the environment variable INVENTREE_ADMIN_URL
#admin_url: 'admin'
# Set enabled frontends
# Use the environment variable INVENTREE_CLASSIC_FRONTEND
# classic_frontend: True
# Use the environment variable INVENTREE_PLATFORM_FRONTEND
# platform_frontend: True
# Configure the system logging level
# Use environment variable INVENTREE_LOG_LEVEL
# Options: DEBUG / INFO / WARNING / ERROR / CRITICAL
log_level: WARNING
# Enable database-level logging
# Use the environment variable INVENTREE_DB_LOGGING
db_logging: False
# Select default system language (default is 'en-us')
# Use the environment variable INVENTREE_LANGUAGE
language: en-us
# System time-zone (default is UTC)
# Reference: https://en.wikipedia.org/wiki/List_of_tz_database_time_zones
timezone: UTC
# Base URL for the InvenTree server
# Use the environment variable INVENTREE_BASE_URL
# base_url: 'http://localhost:8000'
# Base currency code (or use env var INVENTREE_BASE_CURRENCY)
base_currency: USD
# Add new user on first startup
#admin_user: admin
#admin_email: info@example.com
#admin_password: inventree
# List of currencies supported by default. Add other currencies here to allow use in InvenTree
currencies:
- AUD
- CAD
- CNY
- EUR
- GBP
- JPY
- NZD
- USD
# Email backend configuration
# Ref: https://docs.djangoproject.com/en/dev/topics/email/
# Alternatively, these options can all be set using environment variables,
# with the INVENTREE_EMAIL_ prefix:
# e.g. INVENTREE_EMAIL_HOST / INVENTREE_EMAIL_PORT / INVENTREE_EMAIL_USERNAME
# Refer to the InvenTree documentation for more information
email:
# backend: 'django.core.mail.backends.smtp.EmailBackend'
host: ''
port: 25
username: ''
password: ''
sender: ''
tls: False
ssl: False
# Set sentry_enabled to True to report errors back to the maintainers
# Set sentry,dsn to your custom DSN if you want to use your own instance for error reporting
sentry_enabled: False
#sentry_sample_rate: 0.1
#sentry_dsn: https://custom@custom.ingest.sentry.io/custom
# Set this variable to True to enable InvenTree Plugins
# Alternatively, use the environment variable INVENTREE_PLUGINS_ENABLED
plugins_enabled: False
#plugin_file: '/path/to/plugins.txt'
#plugin_dir: '/path/to/plugins/'
# Set this variable to True to enable auto-migrations
# Alternatively, use the environment variable INVENTREE_AUTO_UPDATE
auto_update: False
# Allowed hosts (see ALLOWED_HOSTS in Django settings documentation)
# A list of strings representing the host/domain names that this Django site can serve.
# Default behaviour is to allow all hosts (THIS IS NOT SECURE!)
allowed_hosts:
- '*'
# Cross Origin Resource Sharing (CORS) settings (see https://github.com/ottoyiu/django-cors-headers)
# Following parameters are
cors:
# CORS_ORIGIN_ALLOW_ALL - If True, the whitelist will not be used and all origins will be accepted.
allow_all: True
# CORS_ORIGIN_WHITELIST - A list of origins that are authorized to make cross-site HTTP requests. Defaults to []
# whitelist:
# - https://example.com
# - https://sub.example.com
# MEDIA_ROOT is the local filesystem location for storing uploaded files
#media_root: '/home/inventree/data/media'
# STATIC_ROOT is the local filesystem location for storing static files
#static_root: '/home/inventree/data/static'
### Backup configuration options ###
# INVENTREE_BACKUP_DIR is the local filesystem location for storing backups
backup_storage: django.core.files.storage.FileSystemStorage
#backup_dir: '/home/inventree/data/backup'
#backup_options:
# Background worker options
background:
workers: 4
timeout: 90
max_attempts: 5
# Optional URL schemes to allow in URL fields
# By default, only the following schemes are allowed: ['http', 'https', 'ftp', 'ftps']
# Uncomment the lines below to allow extra schemes
#extra_url_schemes:
# - mailto
# - git
# - ssh
# Login configuration
login_confirm_days: 3
login_attempts: 5
login_default_protocol: http
# Remote / proxy login
# These settings can introduce security problems if configured incorrectly. Please read
# https://docs.djangoproject.com/en/4.0/howto/auth-remote-user/ for more details
# The header name should be prefixed by `HTTP`. Please read the docs for more details
# https://docs.djangoproject.com/en/stable/ref/request-response/#django.http.HttpRequest.META
remote_login_enabled: False
remote_login_header: HTTP_REMOTE_USER
# JWT tokens
# JWT can be used optionally to authenticate users. Turned off by default.
# Alternatively, use the environment variable INVENTREE_USE_JWT
# use_jwt: True
# Logout redirect configuration
# This setting may be required if using remote / proxy login to redirect requests
# during the logout process (default is 'index'). Please read the docs for more details
# https://docs.djangoproject.com/en/stable/ref/settings/#logout-redirect-url
#logout_redirect_url: 'index'
# Permit custom authentication backends
#authentication_backends:
# - 'django.contrib.auth.backends.ModelBackend'
# Custom middleware, sometimes needed alongside an authentication backend change.
#middleware:
# - 'django.middleware.security.SecurityMiddleware'
# - 'django.contrib.sessions.middleware.SessionMiddleware'
# - 'django.middleware.locale.LocaleMiddleware'
# - 'django.middleware.common.CommonMiddleware'
# - 'django.middleware.csrf.CsrfViewMiddleware'
# - 'corsheaders.middleware.CorsMiddleware'
# - 'django.contrib.auth.middleware.AuthenticationMiddleware'
# - 'django.contrib.messages.middleware.MessageMiddleware'
# - 'django.middleware.clickjacking.XFrameOptionsMiddleware'
# - 'InvenTree.middleware.AuthRequiredMiddleware'
# Add SSO login-backends (see examples below)
# social_backends:
# - 'allauth.socialaccount.providers.google'
# - 'allauth.socialaccount.providers.github'
# - 'allauth.socialaccount.providers.keycloak'
# Add specific settings for social account providers (if required)
# social_providers:
# keycloak:
# KEYCLOAK_URL: 'https://keycloak.custom/auth'
# KEYCLOAK_REALM: 'master'
# Add LDAP support
# ldap:
# enabled: false
# debug: false # enable debug mode to troubleshoot ldap configuration
# server_uri: ldaps://example.org
# bind_dn: cn=admin,dc=example,dc=org
# bind_password: admin_password
# search_base_dn: cn=Users,dc=example,dc=org
# # enable TLS encryption over the standard LDAP port,
# # see: https://django-auth-ldap.readthedocs.io/en/latest/reference.html#auth-ldap-start-tls
# # start_tls: false
# # uncomment if you want to use direct bind, bind_dn and bin_password is not necessary then
# # user_dn_template: "uid=%(user)s,dc=example,dc=org"
# # uncomment to set advanced global options, see https://www.python-ldap.org/en/latest/reference/ldap.html#ldap-options
# # for all available options (keys and values starting with OPT_ get automatically converted to python-ldap keys)
# # global_options:
# # OPT_X_TLS_REQUIRE_CERT: OPT_X_TLS_NEVER
# # OPT_X_TLS_CACERTFILE: /opt/inventree/ldapca.pem
# # uncomment for advanced filter search, default: uid=%(user)s
# # search_filter_str:
# # uncomment for advanced user attribute mapping (in the format <InvenTree attribute>: <LDAP attribute>)
# # user_attr_map:
# # first_name: givenName
# # last_name: sn
# # email: mail
# # always update the user on each login, default: true
# # always_update_user: true
# # cache timeout to reduce traffic with LDAP server, default: 3600 (1h)
# # cache_timeout: 3600
# Customization options
# Add custom messages to the login page or main interface navbar or exchange the logo
# Use environment variable INVENTREE_CUSTOMIZE or INVENTREE_CUSTOM_LOGO
# Logo and splash paths and filenames must be relative to the static_root directory
# customize:
# login_message: InvenTree demo instance - <a href='https://inventree.org/demo.html'> Click here for login details</a>
# navbar_message: <h6>InvenTree demo mode <a href='https://inventree.org/demo.html'><span class='fas fa-info-circle'></span></a></h6>
# hide_admin_link: true
# hide_password_reset: true
# logo: img/custom_logo.png
# splash: img/custom_splash.jpg
# Frontend UI settings
# frontend_settings:
# base_url: 'frontend'
# server_list:
# my_server1:
# host: https://demo.inventree.org/
# name: InvenTree Demo
# default_server: my_server1
# show_server_selector: false
# sentry_dsn: https://84f0c3ea90c64e5092e2bf5dfe325725@o1047628.ingest.sentry.io/4504160008273920
# environment: development
# Custom flags
# InvenTree uses django-flags; read more in their docs at https://cfpb.github.io/django-flags/conditions/
# Use environment variable INVENTREE_FLAGS or the settings below
# flags:
# MY_FLAG:
# - condition: 'parameter'
# value: 'my_flag_param1'