From 5c040a0e449a7914894ee90b56d19d5e530faec7 Mon Sep 17 00:00:00 2001 From: Fredrik Baberg Date: Thu, 19 Jan 2023 23:13:16 +0100 Subject: [PATCH] Add socat to 3dprinter-octoprint --- 3dprinter-octoprint/CHANGELOG.md | 3 +++ 3dprinter-octoprint/Dockerfile | 1 + 3dprinter-octoprint/config.yaml | 4 +++- 3dprinter-octoprint/rootfs/etc/services.d/socat/run | 9 +++++++++ 4 files changed, 16 insertions(+), 1 deletion(-) create mode 100644 3dprinter-octoprint/rootfs/etc/services.d/socat/run diff --git a/3dprinter-octoprint/CHANGELOG.md b/3dprinter-octoprint/CHANGELOG.md index 816d4eb..2b49594 100644 --- a/3dprinter-octoprint/CHANGELOG.md +++ b/3dprinter-octoprint/CHANGELOG.md @@ -1,3 +1,6 @@ +## 2023.01.3 + * Add `socat` + ## 2023.01.2 * Disable AppArmor profile. diff --git a/3dprinter-octoprint/Dockerfile b/3dprinter-octoprint/Dockerfile index 23dc61a..7b746bb 100644 --- a/3dprinter-octoprint/Dockerfile +++ b/3dprinter-octoprint/Dockerfile @@ -34,6 +34,7 @@ RUN apt update \ # dfu-util \ # dfu-programmer \ # stm32flash \ + socat \ # Development/testing vim \ && \ diff --git a/3dprinter-octoprint/config.yaml b/3dprinter-octoprint/config.yaml index b91f0d8..4d39bd4 100644 --- a/3dprinter-octoprint/config.yaml +++ b/3dprinter-octoprint/config.yaml @@ -1,5 +1,5 @@ name: "3DPrinter-OctoPrint" -version: "2023.01.2" +version: "2023.01.3-RC0" slug: "3dprinter-octoprint" description: "OctoPrint as an addon, no additional bells and whistles." arch: @@ -26,10 +26,12 @@ options: trusted_proxies: "" # camera_url: "http://b7aa59c4-camera-mjpg-streamer" # mode: normal + socat_target: "" schema: trusted_proxies: "str?" # camera_url: "url?" # mode: "list(normal|recovery|reverse_proxy_test|camera)?" + socat_target: "url?" image: ghcr.io/fredrikbaberg/ha-addon-3dprinter-octoprint-{arch} # codenotary: tmpfs: true diff --git a/3dprinter-octoprint/rootfs/etc/services.d/socat/run b/3dprinter-octoprint/rootfs/etc/services.d/socat/run new file mode 100644 index 0000000..7cea94b --- /dev/null +++ b/3dprinter-octoprint/rootfs/etc/services.d/socat/run @@ -0,0 +1,9 @@ +#!/usr/bin/with-contenv bashio +# ============================================================================== +# Add-on: 3dprinter-octoprint +# Runs socat +# ============================================================================== + +bashio::log.info "Starting socat..." + +exec socat pty,wait-slave,link=/dev/ttyACM0 tcp:%(ENV_SOCAT_TARGET)s