From 383e8e026f4e8c9e45cb14f855ab64f4ebc17289 Mon Sep 17 00:00:00 2001 From: Matheson Steplock Date: Fri, 18 Feb 2022 00:16:14 -0500 Subject: [PATCH 1/5] hide window and change image name --- tdm/config.yaml | 4 ++-- tdm/rootfs/etc/services.d/tdm/run | 6 +++++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/tdm/config.yaml b/tdm/config.yaml index 236f5c2..ac02901 100644 --- a/tdm/config.yaml +++ b/tdm/config.yaml @@ -1,5 +1,5 @@ name: Tasmota Device Manager -version: '2021.12.0' +version: '2022.2.0' slug: tdm description: GUI application to discover and monitor devices flashed with Tasmota arch: @@ -11,7 +11,7 @@ init: false ingress: true panel_icon: mdi:application-cog ingress_entry: novnc/vnc_lite.html?resize=scale -image: ikifar/tdm-ha-addon +image: ikifar/tdm-ha-addon-{arch} map: - share:rw ports: diff --git a/tdm/rootfs/etc/services.d/tdm/run b/tdm/rootfs/etc/services.d/tdm/run index aee7e89..fd53dc6 100644 --- a/tdm/rootfs/etc/services.d/tdm/run +++ b/tdm/rootfs/etc/services.d/tdm/run @@ -5,8 +5,12 @@ TMP_FOLDER=$(mktemp -d) VNC_PORT="$(bashio::addon.port 5900)" ARCH="$(bashio::info.arch)" -mkdir -p /share/tdm DEBUG=$(bashio::config "debug") +mkdir -p /share/tdm/.vnc +( + echo "vncconfig --nowin &" + echo "exec i3" +) > /share/tdm/.vnc/xstartup # ln -s /usr/lib/x86_64-linux-gnu/libxcb-util.so.0.0.0 /usr/lib/x86_64-linux-gnu/libxcb-util.so.1 export HOME=/share/tdm # Run it only on localhost if not expose From 9387c5c3be6cf88756f88508749008d35e9b839c Mon Sep 17 00:00:00 2001 From: Matheson Steplock Date: Fri, 18 Feb 2022 00:20:03 -0500 Subject: [PATCH 2/5] remove useless arg --- tdm/Dockerfile | 1 - tdm/config.yaml | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/tdm/Dockerfile b/tdm/Dockerfile index 96ce64e..438895e 100644 --- a/tdm/Dockerfile +++ b/tdm/Dockerfile @@ -5,7 +5,6 @@ FROM $BUILD_FROM SHELL ["/bin/bash", "-o", "pipefail", "-c"] # Install dependencies -ARG BUILD_ARCH RUN apt-get update \ && apt-get install -y --no-install-recommends \ curl \ diff --git a/tdm/config.yaml b/tdm/config.yaml index ac02901..d5d25a0 100644 --- a/tdm/config.yaml +++ b/tdm/config.yaml @@ -11,7 +11,7 @@ init: false ingress: true panel_icon: mdi:application-cog ingress_entry: novnc/vnc_lite.html?resize=scale -image: ikifar/tdm-ha-addon-{arch} +image: ikifar/tdm-ha-addon map: - share:rw ports: From 6c515e1cb7604602324c59a06f76784fe15f0229 Mon Sep 17 00:00:00 2001 From: Matheson Steplock Date: Fri, 18 Feb 2022 00:25:01 -0500 Subject: [PATCH 3/5] fix workflows --- .github/workflows/publish.yaml | 2 +- .github/workflows/test.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/publish.yaml b/.github/workflows/publish.yaml index 2ceda46..5d0a29d 100644 --- a/.github/workflows/publish.yaml +++ b/.github/workflows/publish.yaml @@ -23,7 +23,7 @@ jobs: uses: home-assistant/builder@master with: args: | - --all \ + --amd64 \ --target tdm \ --docker-user ${{ secrets.DOCKERHUB_USERNAME }} \ --docker-password ${{ secrets.DOCKERHUB_TOKEN }} \ No newline at end of file diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 7667fd6..bacdff7 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -14,6 +14,6 @@ jobs: with: args: | --test \ - --all \ + --amd64 \ --target tdm \ --docker-hub ikifar \ No newline at end of file From 2ed508ac2a4587b1e4473991388e8569c777c99e Mon Sep 17 00:00:00 2001 From: Matheson Steplock Date: Fri, 18 Feb 2022 00:30:20 -0500 Subject: [PATCH 4/5] add i3 status to remove error --- tdm/Dockerfile | 1 + 1 file changed, 1 insertion(+) diff --git a/tdm/Dockerfile b/tdm/Dockerfile index 438895e..4db689d 100644 --- a/tdm/Dockerfile +++ b/tdm/Dockerfile @@ -28,6 +28,7 @@ RUN apt-get update \ tigervnc-standalone-server \ wget \ i3 \ + i3status \ xfonts-base \ xfonts-scalable \ firefox-esr From 73cdc55e695b4b70ca3329f5572df69be642e0c8 Mon Sep 17 00:00:00 2001 From: Matheson Steplock Date: Mon, 21 Feb 2022 21:27:00 -0500 Subject: [PATCH 5/5] 2022.2.0 --- tdm/CHANGELOG.md | 7 +++++++ tdm/Dockerfile | 2 +- tdm/config.yaml | 5 +++-- tdm/rootfs/etc/services.d/tdm/run | 23 ++++++++++++++++++++--- 4 files changed, 31 insertions(+), 6 deletions(-) diff --git a/tdm/CHANGELOG.md b/tdm/CHANGELOG.md index 187297a..a230267 100644 --- a/tdm/CHANGELOG.md +++ b/tdm/CHANGELOG.md @@ -1,3 +1,10 @@ +# 2022.2.0 + +- Added MQTT auto configuration +- Added `i3status` +- Switch to `${HOME}` variable +- Solves issue VNC config window always showing #12 + # 2021.12.0 - Switch to i3 window manager diff --git a/tdm/Dockerfile b/tdm/Dockerfile index 4db689d..616b899 100644 --- a/tdm/Dockerfile +++ b/tdm/Dockerfile @@ -34,7 +34,7 @@ RUN apt-get update \ firefox-esr RUN apt-get install libqt5x11extras5 python3 python3-pip git -y --no-install-recommends -RUN apt-get install libqt5gui5 zlib1g-dev gcc g++ make -y && rm -rf /var/lib/apt/lists/* +RUN apt-get install libqt5gui5 zlib1g-dev gcc g++ make -y && rm -rf /var/lib/apt/lists/* RUN python3 -m pip install --upgrade pip RUN python3 -m pip install wheel RUN python3 -m pip install pyqt5==5.14.2 diff --git a/tdm/config.yaml b/tdm/config.yaml index d5d25a0..b7dd83b 100644 --- a/tdm/config.yaml +++ b/tdm/config.yaml @@ -5,8 +5,10 @@ description: GUI application to discover and monitor devices flashed with Tasmot arch: - amd64 url: https://github.com/ikifar2012/tasmota-device-manager-addon -startup: services +startup: application boot: auto +services: + - mqtt:want init: false ingress: true panel_icon: mdi:application-cog @@ -18,7 +20,6 @@ ports: 5900/tcp: ports_description: 5900/tcp: TDM via VNC (Not required for Ingress. Not secure!) -host_network: true options: debug: false schema: diff --git a/tdm/rootfs/etc/services.d/tdm/run b/tdm/rootfs/etc/services.d/tdm/run index fd53dc6..c6dbcd4 100644 --- a/tdm/rootfs/etc/services.d/tdm/run +++ b/tdm/rootfs/etc/services.d/tdm/run @@ -6,13 +6,30 @@ TMP_FOLDER=$(mktemp -d) VNC_PORT="$(bashio::addon.port 5900)" ARCH="$(bashio::info.arch)" DEBUG=$(bashio::config "debug") -mkdir -p /share/tdm/.vnc +export HOME='/share/tdm' +mkdir -p ${HOME}/.vnc ( echo "vncconfig --nowin &" echo "exec i3" -) > /share/tdm/.vnc/xstartup +) > ${HOME}/.vnc/xstartup +chmod 755 ${HOME}/.vnc/xstartup # ln -s /usr/lib/x86_64-linux-gnu/libxcb-util.so.0.0.0 /usr/lib/x86_64-linux-gnu/libxcb-util.so.1 -export HOME=/share/tdm + +# Get MQTT config +if bashio::services.available "mqtt"; then + MQTT_HOST=$(bashio::services "mqtt" "host") + MQTT_PASSWORD=$(bashio::services "mqtt" "password") + MQTT_PORT=$(bashio::services "mqtt" "port") + MQTT_USER=$(bashio::services "mqtt" "username") + ( + echo "[General]" + echo "connect_on_startup=true" + echo "hostname=${MQTT_HOST}" + echo "password=${MQTT_PASSWORD}" + echo "port=${MQTT_PORT}" + echo "username=${MQTT_USER}" + ) > ${HOME}/TDM/tdm.cfg +fi # Run it only on localhost if not expose if bashio::var.has_value "${VNC_PORT}"; then bashio::log.warning "Your direct VNC access is not protected!"