Skip to content

A continuation of HomeBox the inventory and organization system built for the Home User

Added documentation for the external label service feature. (#1018)

Dan0f4f398b5a0d
diff --git a/docs/.vitepress/menus/en.mts b/docs/.vitepress/menus/en.mts
index 41257424..024dcd84 100644
--- a/docs/.vitepress/menus/en.mts
+++ b/docs/.vitepress/menus/en.mts
@@ -21,7 +21,8 @@ export default [
{
text: 'Advanced',
items: [
- {text: 'Import CSV', link: '/en/import-csv'},
+ {text: 'Import CSV', link: '/en/advanced/import-csv'},
+ {text: 'External Label Service', link: '/en/advanced/external-label-service'},
]
},
{
diff --git a/docs/en/advanced/external-label-service.md b/docs/en/advanced/external-label-service.md
new file mode 100644
index 00000000..55bdd451
--- /dev/null
+++ b/docs/en/advanced/external-label-service.md
@@ -0,0 +1,53 @@
+# External Label Service
+
+You can use an external web service to generate asset and location labels in homebox. This is useful if you have custom requirements for your labels and are happy to spin up a web service that can accept incoming requests and return an image file for homebox to use.
+
+::: info "Note"
+
+This service is not called to generate sheets of labels accessed via the label generator function. It is used when creating labels from an item or location.
+
+:::
+
+## Configuration
+
+The extenal service is configured using the `HBOX_LABEL_MAKER_LABEL_SERVICE_URL` enviroment variable.
+
+## Request
+
+The service is called using an **HTTP `GET` request**. All parameters are passed as part of the **query string**.
+
+#### Headers
+
+- **User-Agent**: Homebox-LabelMaker/1.0
+
+- **Accept**: image/*
+
+#### Parameters
+
+| Parameter | Type | Description | Value |
+| --------------------- | ------ | -------------------------------------------- | --------------------------------------------------------------------- |
+| AdditionalInformation | string | Extra free text to include on the label. | `HBOX_LABEL_MAKER_ADDITIONAL_INFORMATION` |
+| ComponentPadding | int | Padding around label components (pixels). | `HBOX_LABEL_MAKER_PADDING` |
+| DescriptionFontSize | float | Font size for the description text. | |
+| DescriptionText | string | Descriptive text, can be multi-line. | Item name or "Homebox Location" |
+| Dpi | float | Rendering resolution (dots per inch). | |
+| DynamicLength | bool | Whether the label length should auto-adjust. | `HBOX_LABEL_MAKER_DYNAMIC_LENGTH` |
+| Height | int | Label height in pixels. | `HBOX_LABEL_MAKER_HEIGHT` |
+| Margin | int | Margin around the label in pixels. | `HBOX_LABEL_MAKER_MARGIN` |
+| QrSize | int | Size of the QR code element in pixels. | |
+| TitleFontSize | float | Font size for the title text. | |
+| TitleText | string | Main label title (e.g. product code). | Asset ID or Location Name |
+| URL | string | URL to be encoded into the QR code. | Generated based on the configured homebox URL and Asset / Location ID |
+| Width | int | Label width in pixels. | `HBOX_LABEL_MAKER_WIDTH` |
+
+## Response
+
+The external service should respond with the following specifications;
+
+- **Size:** Less than or equal to `HBOX_WEB_MAX_UPLOAD_SIZE` (Default: 10Mb)
+
+- **Content-Type**: Specified in the response header should be of the type image/*
+
+- **Time**: Within the time specified in `HBOX_LABEL_MAKER_LABEL_SERVICE_TIMEOUT` (Default 30s)
+
+
diff --git a/docs/en/import-csv.md b/docs/en/advanced/import-csv.md
similarity index 100%
rename from docs/en/import-csv.md
rename to docs/en/advanced/import-csv.md
diff --git a/docs/en/configure/index.md b/docs/en/configure/index.md
index b643d83c..20fd3869 100644
--- a/docs/en/configure/index.md
+++ b/docs/en/configure/index.md
@@ -153,7 +153,7 @@ Options:
### HBOX_WEB_HOST examples
| Value | Notes |
-|-----------------------------|------------------------------------------------------------|
+| --------------------------- | ---------------------------------------------------------- |
| 0.0.0.0 | Visible all interfaces (default behaviour) |
| 127.0.0.1 | Only visible on same host |
| 100.64.0.1 | Only visible on a specific interface (e.g., VPN in a VPS). |
@@ -187,6 +187,7 @@ the webserver (Caddy) can access it. Other processes/containers on the host
cannot connect to Homebox directly, bypassing the webserver.
File: homebox.socket
+
```systemd
# /usr/local/lib/systemd/system/homebox.socket
[Unit]
@@ -202,6 +203,7 @@ WantedBy=sockets.target
```
File: homebox.service
+
```systemd
# /usr/local/lib/systemd/system/homebox.service
[Unit]
@@ -222,6 +224,7 @@ CapabilityBoundingSet=
RestrictNamespaces=true
SystemCallFilter=@system-service
```
+
Usage:
```bash