Compare commits
3 commits
b0459af78f
...
68bbebae2a
| Author | SHA1 | Date | |
|---|---|---|---|
| 68bbebae2a | |||
| 22c0929b5b | |||
| beb4a7fa6b |
3 changed files with 11 additions and 25 deletions
9
Makefile
9
Makefile
|
|
@ -7,6 +7,7 @@ COMPOSE := DOCKER_HOST=$(DOCKER_HOST) $(COMPOSE_CMD)
|
|||
psql:
|
||||
$(COMPOSE) exec inventree-db sh -c 'psql $$POSTGRES_USER $$POSTGRES_DB'
|
||||
|
||||
.PHONY: update
|
||||
update:
|
||||
read -p "Update will cause downtime of the server. Are you sure you want to continue? Press Ctrl+c to abort!" _
|
||||
$(COMPOSE) pull
|
||||
|
|
@ -17,6 +18,14 @@ update:
|
|||
data: # podman does not autocreate data folder
|
||||
mkdir data
|
||||
|
||||
.PHONY: caddy-check
|
||||
caddy-check:
|
||||
docker run --rm --env-file .env -v ./Caddyfile:/etc/caddy/Caddyfile:ro,Z caddy:alpine caddy validate --config /etc/caddy/Caddyfile
|
||||
|
||||
.PHONY: caddy-print
|
||||
caddy-print:
|
||||
docker run --rm --env-file .env -v ./Caddyfile:/etc/caddy/Caddyfile:ro,Z caddy:alpine caddy adapt --config /etc/caddy/Caddyfile --pretty
|
||||
|
||||
# pass all commands to compose cli
|
||||
%: data
|
||||
$(COMPOSE) $@
|
||||
|
|
|
|||
|
|
@ -113,6 +113,8 @@ services:
|
|||
- 443:443
|
||||
env_file:
|
||||
- .env
|
||||
environment:
|
||||
INVENTREE_SERVER: http://inventree-server:${INVENTREE_WEB_PORT}
|
||||
volumes:
|
||||
- ./Caddyfile:/etc/caddy/Caddyfile:ro,z
|
||||
- ${INVENTREE_EXT_VOLUME}/static:/var/www/static:z
|
||||
|
|
|
|||
|
|
@ -1,25 +0,0 @@
|
|||
from plugin import InvenTreePlugin
|
||||
from plugin.mixins import BarcodeMixin
|
||||
from part.models import Part
|
||||
import structlog
|
||||
|
||||
logger = structlog.get_logger("ctbk.barcode")
|
||||
|
||||
|
||||
class CtbkBarcodePlugin(BarcodeMixin, InvenTreePlugin):
|
||||
TITLE = "CTBK IPN Barcode Plugin"
|
||||
NAME = "ctbk-ipn-barcode-plugin"
|
||||
DESCRIPTION = "Supports the CTBK IPN format directly in barcodes"
|
||||
VERSION = "0.0.1"
|
||||
AUTHOR = "kleines Filmröllchen"
|
||||
|
||||
def scan(self, barcode_data):
|
||||
if barcode_data.startswith("963e5440-"):
|
||||
try:
|
||||
instance = Part.objects.get(IPN=barcode_data.strip())
|
||||
label = Part.barcode_model_type()
|
||||
|
||||
return {label: instance.format_matched_response()}
|
||||
except Part.DoesNotExist:
|
||||
logger.error("could not find a part for barcode %s", barcode_data)
|
||||
pass
|
||||
Loading…
Add table
Add a link
Reference in a new issue