2
0
mirror of https://github.com/inventree/inventree-docs.git synced 2025-04-27 21:26:43 +00:00

Merge pull request #204 from inventree/stable

Improvements to installation instructions
This commit is contained in:
Oliver 2021-11-05 10:38:21 +11:00 committed by GitHub
commit cafc97848a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
10 changed files with 69 additions and 103 deletions

View File

@ -68,19 +68,6 @@ currencies:
# Email backend configuration
# Ref: https://docs.djangoproject.com/en/dev/topics/email/
# Available options:
# host: Email server host address
# port: Email port
# username: Account username
# password: Account password
# prefix: Email subject prefix
# tls: Enable TLS support
# ssl: Enable SSL support
# 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'
@ -96,33 +83,11 @@ email:
# Use the environment variable INVENTREE_DEBUG
debug: True
# Set debug_toolbar to True to enable a debugging toolbar for InvenTree
# Note: This will only be displayed if DEBUG mode is enabled,
# and only if InvenTree is accessed from a local IP (127.0.0.1)
debug_toolbar: False
# Configure the system logging level
# Use environment variable INVENTREE_LOG_LEVEL
# Options: DEBUG / INFO / WARNING / ERROR / CRITICAL
log_level: WARNING
# 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
# By default, it is stored under /home/inventree/data/media
# Use environment variable INVENTREE_MEDIA_ROOT
@ -132,28 +97,3 @@ media_root: '/home/inventree/data/media'
# By default, it is stored under /home/inventree/data/static
# Use environment variable INVENTREE_STATIC_ROOT
static_root: '/home/inventree/data/static'
# 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
# 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'

View File

@ -19,7 +19,7 @@ The default InvenTree config file is located at `./InvenTree/config.yaml`
However, the config file can be placed elsewhere, and specified with the `INVENTREE_CONFIG_FILE` environment variable.
The default configuration file file is shown below:
A short snippet from an example configuration file file is shown below. The entire default configuration file can be found on [GitHub](https://github.com/inventree/InvenTree/blob/master/InvenTree/config_template.yaml)
``` yaml
{% include 'config.yaml' %}
@ -32,10 +32,10 @@ In addition to specifying InvenTree options via the `config.yaml` file, these op
- Environment variable settings use the `INVENTREE_` prefix, and are all uppercase.
- Config file settings do not use this prefix, and are all lowercase
!!! info Priotity
!!! info "Configuration Priority"
Configuration options set via environment variables will take priority over the values set in the `config.yaml` file.
!!! warning Available Variables
!!! warning "Available Variables"
Some configuration options cannot be set via environment variables. Refer to the documentation below.
## Basic Options
@ -101,7 +101,13 @@ The following email settings are available:
## Allowed Hosts / CORS
By default, all hosts are allowed, and CORS requests are enabled from any origin. **This is not secure and should be adjusted for your installation**. These options can be changed in the configuration file.
By default, all hosts are allowed, and CORS requests are enabled from any origin.
!!! danger "Not Secure"
Allowing access from any host is not secure, and should be adjusted for your installation.
!!! info "Configuration File"
Allowed hosts and CORS options must be changed in the configuration file, and cannot be set via environment variables
For further information, refer to the following documentation:
@ -124,13 +130,15 @@ Alternatively this location can be specified with the `INVENTREE_MEDIA_ROOT` env
## Authentication
InvenTree provides allowance for additional sign-in options. The following options are not enabled by default, and care must be taken by the system administrator when configuring these settings.
### Single Sign on
SSO backends for all wanted providers need to be added to the config file as a list under the key `social_backends`. The correct backend-name can be found in django-allauths [configuration documentation](https://django-allauth.readthedocs.io/en/latest/installation.html#django).
SSO backends for all required authentication providers need to be added to the config file as a list under the key `social_backends`. The correct backend-name can be found in django-allauths [configuration documentation](https://django-allauth.readthedocs.io/en/latest/installation.html#django).
If the selected providers need additional settings they must be added as dicts under the key `social_providers`. The correct settings can be found in the django-allauths [provider documentation](https://django-allauth.readthedocs.io/en/latest/providers.html).
!!! note "You are not done"
!!! warning "You are not done"
SSO still needs credentials for all providers and has to be enabled in the [global settings](../settings/global.md)!

View File

@ -17,7 +17,7 @@ InvenTree includes a simple server application, suitable for use in a developmen
To run the development server on a local machine, run the command:
```
(env) inv server
(env) invoke server
```
This will launch the InvenTree web interface at `http://127.0.0.1:8000`.
@ -25,7 +25,7 @@ This will launch the InvenTree web interface at `http://127.0.0.1:8000`.
A different port can be specified using the `-a` flag:
```
(env) inv server -a 127.0.0.1:8123
(env) invoke server -a 127.0.0.1:8123
```
Serving on the address `127.0.0.1` means that InvenTree will only be available *on that computer*. The server will be accessible from a web browser on the same computer, but not from any other computers on the local network.
@ -35,7 +35,7 @@ Serving on the address `127.0.0.1` means that InvenTree will only be available *
To enable access to the InvenTree server from other computers on a local network, you need to know the IP of the computer running the server. For example, if the server IP address is `192.168.120.1`:
```
(env) inv server -a 192.168.120.1:8000
(env) invoke server -a 192.168.120.1:8000
```
## Background Worker

View File

@ -12,14 +12,17 @@ The InvenTree docker image contains all the required system packages, python mod
Docker images are available with the following tags:
- **inventree:stable** - represents the most recent stable release version of InvenTree
- **inventree:latest** - represents the most up-to-date *development* version of InvenTree.
- **inventree:tag** - specific tagged images are built for each tagged release of InvenTree
| Tag | Description |
| --- | --- |
| **inventree:stable** | The most recent *stable* release version of InvenTree |
| **inventree:latest** | The most up-to-date *development* version of InvenTree. |
| **inventree:tag** | Specific tagged images are built for each tagged release of InvenTree |
### Docker Compose
InvenTree provides sample docker-compose files to get you up and running.
| Compose File | Target | Description |
- A *production* compose file is intended to be used in a production environment, running the web server behind a nginx proxy.
- A *development* compose file provides a simple way to spin up a development environment

View File

@ -13,8 +13,13 @@ Using the [InvenTree docker image](./docker.md) streamlines the setup process fo
It is strongly recommended that you use a [docker-compose](https://docs.docker.com/compose/) script to manage your InvenTree docker image.
### Example Script
An example docker compose file can be [found here](https://github.com/inventree/InvenTree/blob/master/docker/docker-compose.yml) - the documentation below will be using this docker compose file.
!!! info "Stable Version"
The example docker-compose file targets `inventree:stable` docker image by default
### Containers
The example docker-compose file launches the following containers:
@ -46,9 +51,10 @@ Nginx working as a reverse proxy, separating requests for static and media files
This container uses the official [nginx image](https://hub.docker.com/_/nginx).
An nginx configuration file must be provided to the image. Use the [example configuration file](https://github.com/inventree/InvenTree/blob/master/docker/nginx.conf) as a starting point.
!!! info "Configuration File"
An nginx configuration file must be provided to the image. Use the [example configuration file](https://github.com/inventree/InvenTree/blob/master/docker/nginx.conf) as a starting point.
*__Note__: You must save this conf file in the same directory as your docker-compose.yml file*
*__Note__: You must save the `nginx.conf` file in the same directory as your docker-compose.yml file*
!!! info "Proxy Pass"
If you change the name (or port) of the InvenTree web server container, you will need to also adjust the `proxy_pass` setting in the nginx.conf file!

View File

@ -63,6 +63,9 @@ Download InvenTree source code, into the `./src` directory:
git clone https://github.com/inventree/inventree src
```
!!! info "Main Branch = Development"
The "main" branch of the InvenTree code base represents the "latest" (development) code. If you would like to use most recent "stable" release, target the `stable` branch.
### Create Virtual Environment
Create a python virtual environment for installing required Python packages and binaries:
@ -89,24 +92,6 @@ This installs all required Python packages using pip package manager. It also cr
As part of the initial setup, an empty database needs to be created. Follow the instructions below particular to your database engine of choice:
### SQLite
SQLite uses a simple portable database file which is easy to use for debug and testing purposes.
Install required packages as follows:
!!! info "Sudo Actions"
Perform sudo actions from a separate shell, as 'inventree' user does not have sudo access
```
sudo apt-get install sqlite3
```
A `.sqlite3` database file will be automatically created, at the location specified in the configuration options. No further steps necessary.
!!! warning "SQLite Case Sensitivity"
SQLite has a known [string matching limitation](https://docs.djangoproject.com/en/dev/ref/databases/#substring-matching-and-case-sensitivity) for non ASCII characters. If you are using non ASCII characters (e.g. Cyrillic text), it is recommended that you do not use SQLite, as search functionality will not work correctly.
### PostgreSQL
#### Install PostgreSQL
@ -205,6 +190,24 @@ mysql> EXIT;
!!! info "Username / Password"
You should change the username and password from the values specified above. This username and password will also be for the InvenTree database connection configuration.
### SQLite
SQLite uses a simple portable database file which is easy to use for debug and testing purposes.
Install required packages as follows:
!!! info "Sudo Actions"
Perform sudo actions from a separate shell, as 'inventree' user does not have sudo access
```
sudo apt-get install sqlite3
```
A `.sqlite3` database file will be automatically created, at the location specified in the configuration options. No further steps necessary.
!!! warning "SQLite Case Sensitivity"
SQLite has a known [string matching limitation](https://docs.djangoproject.com/en/dev/ref/databases/#substring-matching-and-case-sensitivity) for non ASCII characters. If you are using non ASCII characters (e.g. Cyrillic text), it is recommended that you do not use SQLite, as search functionality will not work correctly.
## Configure InvenTree Options
Once the required software packages are installed and the database has been created, the InvenTree server options must be configured.

View File

@ -10,14 +10,14 @@ The InvenTree server ecosystem consists of the following components:
### Database
A persistent database is required to store stock information. The database backend must be installed and configured separately to the InvenTree application.
A persistent database is required for data storage. InvenTree can be used with any of the following database backends:
InvenTree can be used with any of the following database backends:
* SQLite
* PostgreSQL
* MariaDB
* MySQL
* MySQL / MariaDB
* SQLite
!!! warning "SQLite"
While SQLite provides a simpler setup and is useful for a development environment, we strongly recommend against using it for a production environment. Use PostgreSQL or MySQL instead
Database selection should be determined by your particular installation requirements.
@ -44,6 +44,9 @@ The InvenTree documentation assumes that the operating system is a debian based
!!! warning "Installing on Windows"
Installation on Windows is *not guaranteed* to work (at all). To install on a Windows system, it is highly recommended that you [install WSL](https://docs.microsoft.com/en-us/windows/wsl/install-win10#manual-installation-steps), and then follow installation procedure from within the WSL environment.
!!! success "Docker"
Installation on any OS is simplified by following the [docker setup guide](../docker).
## Python Requirements
InvenTree runs on [Python](https://python.org).

View File

@ -19,7 +19,7 @@ For example, if you wish to migrate from an SQLite database backend to a MySQL d
Export the database contents to a JSON file using the following command:
```
inv export-records -f data.json
invoke export-records -f data.json
```
This will create JSON file at the specified location which contains all database records.
@ -34,7 +34,7 @@ Configure the new database using the normal processes (see [Configuration](./con
Then, ensure that the database schema are correctly initialized in the new database:
```
inv migrate
invoke migrate
```
This ensures that the required database tables exist, which must be the case before data can be imported.
@ -47,7 +47,7 @@ The new database should now be correctly initialized with the correct table stru
If the database is not *empty* (i.e. it contains data records) then the data import process will fail. If errors occur during the import process, run `invoke delete-data` to clear all existing data from the database.
```
inv import-records -f data.json
invoke import-records -f data.json
```
!!! info "Import Filename"

View File

@ -26,12 +26,15 @@ For example, pull down the latest InvenTree sourcecode using Git:
git pull origin master
```
!!! info "Release Versions"
If you are using a particular version of InvenTree, you may wish to target a specific code branch or tag, instead of just pulling down latest master
### Perform Database Migrations
Updating the database is as simple as calling the `update` script:
```
inv update
invoke update
```
This command performs the following steps:

View File

@ -169,4 +169,4 @@ extra:
name: InvenTree on Docker
use_directory_urls: true
strict: true
strict: false