| 152 | === REDIS === |
| 153 | Redis is a in-memory key-value store used by NetBox for caching and background task queuing. Redis typically requires minimal configuration; the values below should suffice for most installations. |
| 154 | |
| 155 | Note that NetBox requires the specification of two separate Redis databases: ''' tasks and caching.''' These may both be provided by the same Redis service, however each should have a unique numeric database ID. |
| 156 | {{{ |
| 157 | REDIS = { |
| 158 | 'tasks': { |
| 159 | 'HOST': 'localhost', # Redis server |
| 160 | 'PORT': 6379, # Redis port |
| 161 | 'PASSWORD': '', # Redis password (optional) |
| 162 | 'DATABASE': 0, # Database ID |
| 163 | 'SSL': False, # Use SSL (optional) |
| 164 | }, |
| 165 | 'caching': { |
| 166 | 'HOST': 'localhost', |
| 167 | 'PORT': 6379, |
| 168 | 'PASSWORD': '', |
| 169 | 'DATABASE': 1, # Unique ID for second database |
| 170 | 'SSL': False, |
| 171 | } |
| 172 | } |
| 173 | }}} |
| 174 | === SECRET_KEY === |
| 175 | This parameter must be assigned a randomly-generated key employed as a salt for hashing and related cryptographic functions. (Note, however, that it is never directly used in the encryption of secret data.) This key must be unique to this installation and is recommended to be at least 50 characters long. It should not be shared outside the local system. |
| 176 | |
| 177 | A simple Python script named ''' generate_secret_key.py ''' is provided in the parent directory to assist in generating a suitable key: |
| 178 | {{{ |
| 179 | # python3 ../generate_secret_key.py |
| 180 | }}} |
| 181 | When you have finished modifying the configuration, remember to save the file. |
| 182 | |
| 183 | === Run the Upgrade Script === |
| 184 | Once NetBox has been configured, we're ready to proceed with the actual installation. We'll run the packaged upgrade script (upgrade.sh) to perform the following actions: |
| 185 | |
| 186 | * Create a Python virtual environment |
| 187 | * Installs all required Python packages |
| 188 | * Run database schema migrations |
| 189 | * Builds the documentation locally (for offline use) |
| 190 | * Aggregate static resource files on disk |
| 191 | {{{ |
| 192 | # sudo /opt/netbox/upgrade.sh |
| 193 | }}} |