Compare commits

...

7 Commits
1.0.3 ... 1.0.5

Author SHA1 Message Date
github-actions[bot]
be3e2b4e01 feat(backend): Improve error message on INVE-7 (#10518) (#10523)
* feat(backend): Improve error message on INVE-7

* change wording

* fix test

* another fix

(cherry picked from commit 13845c69da)

Co-authored-by: Matthias Mair <code@mjmair.com>
2025-10-07 11:35:25 +11:00
github-actions[bot]
3fc2db6c3a fix: correct admin credential msg (#10521) (#10522)
* fix installers final message

* adjust text

(cherry picked from commit ac6028b871)

Co-authored-by: Matthias Mair <code@mjmair.com>
2025-10-07 11:25:15 +11:00
github-actions[bot]
79325c96d0 [docs] BOM import (#10517) (#10520)
- Add brief section about importing BOM data

(cherry picked from commit 492613952c)

Co-authored-by: Oliver <oliver.henry.walters@gmail.com>
2025-10-07 11:10:12 +11:00
github-actions[bot]
62425f1f3b fix: package distribution (#10515) (#10519)
* show warning text

* fix formatting

* try to gather site-url correctly

* protect envs that are set in the config

* raise issue if they appear

* prefer app setting over file config

* preserve setting if injected via envs

(cherry picked from commit c83a9b01ce)

Co-authored-by: Matthias Mair <code@mjmair.com>
2025-10-07 09:13:33 +11:00
Oliver
200c1dfe06 Bump software version to 1.0.5 (#10509) 2025-10-06 22:19:19 +11:00
Oliver
8c0b35ba69 Bump InvenTree software version to 1.0.4 (#10508) 2025-10-06 22:10:48 +11:00
github-actions[bot]
b1d0f3cb9e fix(backend): ensure internal notifications are created in a valid format (#10502) (#10506)
Closes #10435

(cherry picked from commit 96a5291766)

Co-authored-by: Matthias Mair <code@mjmair.com>
2025-10-06 22:10:26 +11:00
10 changed files with 66 additions and 21 deletions

View File

@@ -166,6 +166,18 @@ function detect_envs() {
export INVENTREE_DB_PASSWORD=$(jq -r '.[].database.PASSWORD' <<< ${INVENTREE_CONF_DATA})
export INVENTREE_DB_HOST=$(jq -r '.[].database.HOST' <<< ${INVENTREE_CONF_DATA})
export INVENTREE_DB_PORT=$(jq -r '.[].database.PORT' <<< ${INVENTREE_CONF_DATA})
# Parse site URL if not already set
if [ -z "${INVENTREE_SITE_URL}" ]; then
# Try to read out the app config
if [ -n "$(inventree config:get INVENTREE_SITE_URL)" ]; then
echo "# POI03| Getting site URL from app config"
export INVENTREE_SITE_URL=$(inventree config:get INVENTREE_SITE_URL)
else
echo "# POI03| Getting site URL from config file"
export INVENTREE_SITE_URL=$(jq -r '.[].site_url' <<< ${INVENTREE_CONF_DATA})
fi
fi
else
echo "# POI03| No config file found: ${INVENTREE_CONFIG_FILE}, using envs or defaults"
@@ -190,6 +202,8 @@ function detect_envs() {
export INVENTREE_DB_HOST=${INVENTREE_DB_HOST:-samplehost}
export INVENTREE_DB_PORT=${INVENTREE_DB_PORT:-123456}
export INVENTREE_SITE_URL=${INVENTREE_SITE_URL}
export SETUP_CONF_LOADED=true
fi
@@ -209,6 +223,7 @@ function detect_envs() {
fi
echo "# POI03| INVENTREE_DB_HOST=${INVENTREE_DB_HOST}"
echo "# POI03| INVENTREE_DB_PORT=${INVENTREE_DB_PORT}"
echo "# POI03| INVENTREE_SITE_URL=${INVENTREE_SITE_URL}"
}
function create_initscripts() {
@@ -313,7 +328,7 @@ function update_or_install() {
# Run update as app user
echo "# POI12| Updating InvenTree"
sudo -u ${APP_USER} --preserve-env=$SETUP_ENVS bash -c "cd ${APP_HOME} && pip install wheel"
sudo -u ${APP_USER} --preserve-env=$SETUP_ENVS bash -c "cd ${APP_HOME} && invoke update | sed -e 's/^/# POI12| u | /;'"
sudo -u ${APP_USER} --preserve-env=$SETUP_ENVS bash -c "cd ${APP_HOME} && set -e && invoke update | sed -e 's/^/# POI12| u | /;'"
# Make sure permissions are correct again
echo "# POI12| Set permissions for data dir and media: ${DATA_DIR}"
@@ -373,10 +388,15 @@ function set_site() {
# Check if INVENTREE_SITE_URL in inventree config
if [ -z "$(inventree config:get INVENTREE_SITE_URL)" ]; then
echo "# POI14| Setting up InvenTree site URL"
inventree config:set INVENTREE_SITE_URL=http://${INVENTREE_IP}
# Prefer current INVENTREE_SITE_URL if set
if [ -n "${INVENTREE_SITE_URL}" ]; then
inventree config:set INVENTREE_SITE_URL=${INVENTREE_SITE_URL}
else
echo "# POI14| Setting up InvenTree site URL"
inventree config:set INVENTREE_SITE_URL=http://${INVENTREE_IP}
fi
else
echo "# POI14| Site URL already set - skipping"
echo "# POI14| Site URL already set to '$INVENTREE_SITE_URL' - skipping"
fi
}
@@ -385,11 +405,16 @@ function final_message() {
echo -e "####################################################################################"
echo -e "This InvenTree install uses nginx, the settings for the webserver can be found in"
echo -e "${SETUP_NGINX_FILE}"
echo -e "Try opening InvenTree with either\nhttp://localhost/ or http://${INVENTREE_IP}/\n"
echo -e "Admin user data:"
echo -e " Email: ${INVENTREE_ADMIN_EMAIL}"
echo -e " Username: ${INVENTREE_ADMIN_USER}"
echo -e " Password: ${INVENTREE_ADMIN_PASSWORD}"
echo -e "Try opening InvenTree with any of \n${INVENTREE_SITE_URL} , http://localhost/ or http://${INVENTREE_IP}/ \n"
# Print admin user data only if set
if ["${INVENTREE_ADMIN_USER}" ]; then
echo -e "Admin user data:"
echo -e " Email: ${INVENTREE_ADMIN_EMAIL}"
echo -e " Username: ${INVENTREE_ADMIN_USER}"
echo -e " Password: ${INVENTREE_ADMIN_PASSWORD}"
else
echo -e "No admin set during this operation - depending on the deployment method a admin user might have been created with an initial password saved in `${SETUP_ADMIN_PASSWORD_FILE}`"
fi
echo -e "####################################################################################"
}

View File

@@ -14,7 +14,7 @@ echo "# POI01| Importing functions"
echo "# POI01| Functions imported"
# Envs that should be passed to setup commands
export SETUP_ENVS=PATH,APP_HOME,INVENTREE_MEDIA_ROOT,INVENTREE_STATIC_ROOT,INVENTREE_BACKUP_DIR,INVENTREE_SITE_URL,INVENTREE_PLUGINS_ENABLED,INVENTREE_PLUGIN_FILE,INVENTREE_CONFIG_FILE,INVENTREE_SECRET_KEY_FILE,INVENTREE_DB_ENGINE,INVENTREE_DB_NAME,INVENTREE_DB_USER,INVENTREE_DB_PASSWORD,INVENTREE_DB_HOST,INVENTREE_DB_PORT,INVENTREE_ADMIN_USER,INVENTREE_ADMIN_EMAIL,INVENTREE_ADMIN_PASSWORD,SETUP_NGINX_FILE,SETUP_ADMIN_PASSWORD_FILE,SETUP_NO_CALLS,SETUP_DEBUG,SETUP_EXTRA_PIP,SETUP_PYTHON,SETUP_ADMIN_NOCREATION
export SETUP_ENVS=PATH,APP_HOME,INVENTREE_MEDIA_ROOT,INVENTREE_STATIC_ROOT,INVENTREE_BACKUP_DIR,INVENTREE_PLUGINS_ENABLED,INVENTREE_PLUGIN_FILE,INVENTREE_CONFIG_FILE,INVENTREE_SECRET_KEY_FILE,INVENTREE_DB_ENGINE,INVENTREE_DB_NAME,INVENTREE_DB_USER,INVENTREE_DB_PASSWORD,INVENTREE_DB_HOST,INVENTREE_DB_PORT,INVENTREE_ADMIN_USER,INVENTREE_ADMIN_EMAIL,INVENTREE_ADMIN_PASSWORD,INVENTREE_SITE_URL,SETUP_NGINX_FILE,SETUP_ADMIN_PASSWORD_FILE,SETUP_NO_CALLS,SETUP_DEBUG,SETUP_EXTRA_PIP,SETUP_PYTHON,SETUP_ADMIN_NOCREATION
# Get the envs
detect_local_env

View File

@@ -6,7 +6,7 @@ echo "# PRI01| Running preinstall script - start - $(date)"
PATH=${APP_HOME}/env/bin:${APP_HOME}/:/sbin:/bin:/usr/sbin:/usr/bin:
# Envs that should be passed to setup commands
export SETUP_ENVS=PATH,APP_HOME,INVENTREE_MEDIA_ROOT,INVENTREE_STATIC_ROOT,INVENTREE_BACKUP_DIR,INVENTREE_PLUGINS_ENABLED,INVENTREE_PLUGIN_FILE,INVENTREE_CONFIG_FILE,INVENTREE_SECRET_KEY_FILE,INVENTREE_DB_ENGINE,INVENTREE_DB_NAME,INVENTREE_DB_USER,INVENTREE_DB_PASSWORD,INVENTREE_DB_HOST,INVENTREE_DB_PORT,INVENTREE_ADMIN_USER,INVENTREE_ADMIN_EMAIL,INVENTREE_ADMIN_PASSWORD,SETUP_NGINX_FILE,SETUP_ADMIN_PASSWORD_FILE,SETUP_NO_CALLS,SETUP_DEBUG,SETUP_EXTRA_PIP,SETUP_PYTHON
export SETUP_ENVS=PATH,APP_HOME,INVENTREE_MEDIA_ROOT,INVENTREE_STATIC_ROOT,INVENTREE_BACKUP_DIR,INVENTREE_PLUGINS_ENABLED,INVENTREE_PLUGIN_FILE,INVENTREE_CONFIG_FILE,INVENTREE_SECRET_KEY_FILE,INVENTREE_DB_ENGINE,INVENTREE_DB_NAME,INVENTREE_DB_USER,INVENTREE_DB_PASSWORD,INVENTREE_DB_HOST,INVENTREE_DB_PORT,INVENTREE_ADMIN_USER,INVENTREE_ADMIN_EMAIL,INVENTREE_ADMIN_PASSWORD,INVENTREE_SITE_URL,SETUP_NGINX_FILE,SETUP_ADMIN_PASSWORD_FILE,SETUP_NO_CALLS,SETUP_DEBUG,SETUP_EXTRA_PIP,SETUP_PYTHON
if test -f "${APP_HOME}/env/bin/pip"; then
# Check if clear-generated is available

View File

@@ -88,11 +88,17 @@ Note that inherited BOM Line Items only flow "downwards" in the variant inherita
## BOM Creation
BOMs can be created manually, by adjusting individual line items, or by upload an existing BOM file.
BOMs can be created manually, by adjusting individual line items, or by uploading (importing) an existing BOM file.
### Importing a BOM
BOM data can be imported from an existing file (such as CSV or Excel) from the *BOM* panel for a particular part/assembly. This process is a special case of the more general [data import process](../settings/import.md).
At the top of the *BOM* panel, click on the {{ icon("file-arrow-left", color="green", title="Import BOM Data") }} icon to open the import dialog.
### Add BOM Item
To manually add a BOM item, navigate to the part/assembly detail page then click on the "BOM" tab. On top of the tab view, click on the {{ icon("edit", color="blue", title="Edit") }} icon then, after the page reloads, click on the {{ icon("plus-circle") }} icon.
To manually add a BOM item, navigate to the part/assembly detail page then click on the *BOM* panel tab. On top of the *BOM* view, click on the {{ icon("edit", color="blue", title="Edit") }} icon then, after the page reloads, click on the {{ icon("plus-circle") }} icon.
The `Create BOM Item` form will be displayed:

View File

@@ -9,9 +9,12 @@ Errors - These are critical errors which should be addressed as soon as possible
#### INVE-E1
**No frontend included - Backend/web**
Only stable / production releases of InvenTree include the frontend panel. This is both a measure of resource-saving and attack surface reduction. If you want to use the frontend panel, you can either:″
Only stable / production releases of InvenTree include the frontend panel. This is both a measure of resource-saving and attack surface reduction.
If you want to use the frontend panel, you can either:
- use a docker image that is version-tagged or the stable version
- use a package version that is from the stable or version stream
- use a package version that is from the stable or version stream - if you are and it is not working, run `sudo inventree run cli update` to re-run the upgrade
- install node and yarn on the server to build the frontend with the [invoke](../start/invoke.md) task `int.frontend-build`
Raise an issue if none of these options work.

View File

@@ -17,6 +17,7 @@ from error_report.middleware import ExceptionProcessor
from common.settings import get_global_setting
from InvenTree.AllUserRequire2FAMiddleware import AllUserRequire2FAMiddleware
from InvenTree.cache import create_session_cache, delete_session_cache
from InvenTree.config import CONFIG_LOOKUPS, inventreeInstaller
from users.models import ApiToken
logger = structlog.get_logger('inventree')
@@ -252,7 +253,11 @@ class InvenTreeHostSettingsMiddleware(MiddlewareMixin):
# The used url might not be the primary url - next check determines if in a trusted origins
pass
else:
msg = f'INVE-E7: The used path `{accessed_scheme}` does not match the SITE_URL `{settings.SITE_URL}`'
source = CONFIG_LOOKUPS.get('INVENTREE_SITE_URL', {}).get(
'source', 'unknown'
)
dpl_method = inventreeInstaller()
msg = f'INVE-E7: The visited path `{accessed_scheme}` does not match the SITE_URL `{settings.SITE_URL}`. The INVENTREE_SITE_URL is set via `{source}` config method - deployment method `{dpl_method}`'
logger.error(msg)
return render(
request, 'config_error.html', {'error_message': msg}, status=500

View File

@@ -126,7 +126,7 @@ class MiddlewareTests(InvenTreeTestCase):
SITE_LAX_PROTOCOL_CHECK=False,
):
response = self.client.get(reverse('web'))
self.assertContains(response, 'INVE-E7: The used path', status_code=500)
self.assertContains(response, 'INVE-E7: The visited path', status_code=500)
def test_site_url_checks_multi(self):
"""Test that the site URL check is correctly working in a multi-site setup."""
@@ -194,7 +194,9 @@ class MiddlewareTests(InvenTreeTestCase):
):
response = self.client.get(reverse('web'))
self.assertContains(
response, 'INVE-E7: The used path `http://testserver` ', status_code=500
response,
'INVE-E7: The visited path `http://testserver` ',
status_code=500,
)
self.assertNotContains(
response, 'window.INVENTREE_SETTINGS', status_code=500
@@ -212,6 +214,6 @@ class MiddlewareTests(InvenTreeTestCase):
# Check that the correct step triggers the error message
self.assertContains(
response,
'INVE-E7: The used path `http://testserver` does not match',
'INVE-E7: The visited path `http://testserver` does not match',
status_code=500,
)

View File

@@ -18,7 +18,7 @@ from django.conf import settings
from .api_version import INVENTREE_API_TEXT, INVENTREE_API_VERSION
# InvenTree software version
INVENTREE_SW_VERSION = '1.0.3'
INVENTREE_SW_VERSION = '1.0.5'
logger = logging.getLogger('inventree')

View File

@@ -38,6 +38,10 @@ class InvenTreeUINotifications(NotificationMixin, InvenTreePlugin):
if not users:
return False
# Ensure that there is always target object - see https://github.com/inventree/InvenTree/issues/10435
if not target:
target = self.plugin_config()
# Bulk create notification messages for all provided users
for user in users:
entries.append(

View File

@@ -13,7 +13,7 @@
</head>
<body>
<div id="root"></div>
<div id="root">If you see this text there might be an Issue with your update - see <a href="https://docs.inventree.org/en/stable/settings/error_codes/#inve-e1">INVE-E1</a> in the docs for help</div>
<div id="spa_settings">{% spa_settings %}</div>
{% if bundle == "NOT_FOUND" %}
<div id="spa_bundle_error">