From ec24f77da8b1027e02fe882df8ad8fd10afe10ca Mon Sep 17 00:00:00 2001 From: Oliver Walters Date: Tue, 12 Oct 2021 21:29:55 +1100 Subject: [PATCH 1/5] remove 'repository' arg from docker builds --- .github/workflows/docker_latest.yaml | 1 - .github/workflows/docker_stable.yaml | 1 - .github/workflows/docker_tag.yaml | 1 - 3 files changed, 3 deletions(-) diff --git a/.github/workflows/docker_latest.yaml b/.github/workflows/docker_latest.yaml index 355afa5b87..6b248fe0b9 100644 --- a/.github/workflows/docker_latest.yaml +++ b/.github/workflows/docker_latest.yaml @@ -34,7 +34,6 @@ jobs: platforms: linux/amd64,linux/arm64,linux/arm/v7 push: true target: production - repository: inventree/inventree tags: inventree/inventree:latest - name: Image Digest run: echo ${{ steps.docker_build.outputs.digest }} diff --git a/.github/workflows/docker_stable.yaml b/.github/workflows/docker_stable.yaml index 1f3c7749c7..65c31dd9dc 100644 --- a/.github/workflows/docker_stable.yaml +++ b/.github/workflows/docker_stable.yaml @@ -37,7 +37,6 @@ jobs: target: production build-args: branch: stable - repository: inventree/inventree tags: inventree/inventree:stable - name: Image Digest run: echo ${{ steps.docker_build.outputs.digest }} diff --git a/.github/workflows/docker_tag.yaml b/.github/workflows/docker_tag.yaml index 90b8f72505..5de27f48be 100644 --- a/.github/workflows/docker_tag.yaml +++ b/.github/workflows/docker_tag.yaml @@ -35,5 +35,4 @@ jobs: target: production build-args: tag: ${{ github.event.release.tag_name }} - repository: inventree/inventree tags: inventree/inventree:${{ github.event.release.tag_name }} From ac242c01c181908771df229ab8dd01b5963c91af Mon Sep 17 00:00:00 2001 From: Oliver Walters Date: Wed, 13 Oct 2021 00:46:46 +1100 Subject: [PATCH 2/5] Updates for building cryptography lib --- docker/Dockerfile | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/docker/Dockerfile b/docker/Dockerfile index f2aa590ad1..dd78d6234d 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -9,6 +9,9 @@ ARG tag="" ENV PYTHONUNBUFFERED 1 +# Ref: https://github.com/pyca/cryptography/issues/5776 +ENV CRYPTOGRAPHY_DONT_BUILD_RUST 1 + # InvenTree key settings # The INVENTREE_HOME directory is where the InvenTree source repository will be located @@ -70,7 +73,7 @@ RUN apk add --no-cache git make bash \ # MySQL/MariaDB support mariadb-connector-c mariadb-dev mariadb-client \ # Required for python cryptography support - rust cargo + openssl-dev musl-dev libffi-dev rust cargo # Install required base-level python packages COPY requirements.txt requirements.txt From c3e0c9378f3529763f6433d3ed5282a84cf6d687 Mon Sep 17 00:00:00 2001 From: Oliver Walters Date: Wed, 13 Oct 2021 00:52:48 +1100 Subject: [PATCH 3/5] Upgrade pip as part of dockerfile --- docker/Dockerfile | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/docker/Dockerfile b/docker/Dockerfile index dd78d6234d..959d333d52 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -75,6 +75,9 @@ RUN apk add --no-cache git make bash \ # Required for python cryptography support openssl-dev musl-dev libffi-dev rust cargo +# Update pip +RUN pip install --upgrade pip + # Install required base-level python packages COPY requirements.txt requirements.txt RUN pip install --no-cache-dir -U -r requirements.txt @@ -133,4 +136,3 @@ ENTRYPOINT ["/bin/bash", "./docker/init.sh"] # Launch the development server CMD ["invoke", "server", "-a", "${INVENTREE_WEB_ADDR}:${INVENTREE_WEB_PORT}"] - From 1832a6f1facb0e8df07e3a19ce290fe42d85b066 Mon Sep 17 00:00:00 2001 From: Oliver Walters Date: Wed, 13 Oct 2021 00:53:41 +1100 Subject: [PATCH 4/5] Run APK upgrade Ref: --- docker/Dockerfile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docker/Dockerfile b/docker/Dockerfile index 959d333d52..be8479724e 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -54,6 +54,8 @@ LABEL org.label-schema.schema-version="1.0" \ # Create user account RUN addgroup -S inventreegroup && adduser -S inventree -G inventreegroup +RUN apk -U upgrade + # Install required system packages RUN apk add --no-cache git make bash \ gcc libgcc g++ libstdc++ \ From 4f985ae225b6004f915ee6d3ea990b189451588c Mon Sep 17 00:00:00 2001 From: Oliver Date: Wed, 13 Oct 2021 09:40:17 +1100 Subject: [PATCH 5/5] Revert 1fb76b9 Removes global functions to enable / disable entire sections of functionality --- InvenTree/common/models.py | 38 ------------------- .../company/templates/company/navbar.html | 10 +---- InvenTree/part/templates/part/navbar.html | 18 ++------- InvenTree/part/templates/part/part_base.html | 11 +----- .../templates/InvenTree/settings/build.html | 2 - .../templates/InvenTree/settings/po.html | 3 -- .../templates/InvenTree/settings/so.html | 3 -- .../templates/InvenTree/settings/stock.html | 2 - InvenTree/templates/navbar.html | 18 ++------- 9 files changed, 10 insertions(+), 95 deletions(-) diff --git a/InvenTree/common/models.py b/InvenTree/common/models.py index b9b7d9e20d..d0dfc7b014 100644 --- a/InvenTree/common/models.py +++ b/InvenTree/common/models.py @@ -793,44 +793,6 @@ class InvenTreeSetting(BaseInvenTreeSetting): 'default': 'PO', }, - # enable/diable ui elements - 'BUILD_FUNCTION_ENABLE': { - 'name': _('Enable build'), - 'description': _('Enable build functionality in InvenTree interface'), - 'default': True, - 'validator': bool, - }, - 'BUY_FUNCTION_ENABLE': { - 'name': _('Enable buy'), - 'description': _('Enable buy functionality in InvenTree interface'), - 'default': True, - 'validator': bool, - }, - 'SELL_FUNCTION_ENABLE': { - 'name': _('Enable sell'), - 'description': _('Enable sell functionality in InvenTree interface'), - 'default': True, - 'validator': bool, - }, - 'STOCK_FUNCTION_ENABLE': { - 'name': _('Enable stock'), - 'description': _('Enable stock functionality in InvenTree interface'), - 'default': True, - 'validator': bool, - }, - 'SO_FUNCTION_ENABLE': { - 'name': _('Enable SO'), - 'description': _('Enable SO functionality in InvenTree interface'), - 'default': True, - 'validator': bool, - }, - 'PO_FUNCTION_ENABLE': { - 'name': _('Enable PO'), - 'description': _('Enable PO functionality in InvenTree interface'), - 'default': True, - 'validator': bool, - }, - # login / SSO 'LOGIN_ENABLE_PWD_FORGOT': { 'name': _('Enable password forgot'), diff --git a/InvenTree/company/templates/company/navbar.html b/InvenTree/company/templates/company/navbar.html index 3c307704e6..b652d6b603 100644 --- a/InvenTree/company/templates/company/navbar.html +++ b/InvenTree/company/templates/company/navbar.html @@ -2,10 +2,6 @@ {% load static %} {% load inventree_extras %} -{% settings_value 'STOCK_FUNCTION_ENABLE' as enable_stock %} -{% settings_value 'SO_FUNCTION_ENABLE' as enable_so %} -{% settings_value 'PO_FUNCTION_ENABLE' as enable_po %} -