From 75ce67fc5e6e47695044349528e559159895e54c Mon Sep 17 00:00:00 2001 From: Franck Nijhof Date: Wed, 12 Feb 2020 00:10:46 +0100 Subject: [PATCH] ssh: Update CLI & Web terminal (#1068) --- ssh/CHANGELOG.md | 7 +++++++ ssh/Dockerfile | 12 +++++++----- ssh/build.json | 6 +++--- ssh/config.json | 2 +- ssh/data/hassio | 3 +++ ssh/data/{hassio.sh => homeassistant.sh} | 0 ssh/data/motd | 2 +- ssh/data/run.sh | 4 ++-- 8 files changed, 24 insertions(+), 12 deletions(-) create mode 100755 ssh/data/hassio rename ssh/data/{hassio.sh => homeassistant.sh} (100%) diff --git a/ssh/CHANGELOG.md b/ssh/CHANGELOG.md index 1db91ae..287c9ee 100644 --- a/ssh/CHANGELOG.md +++ b/ssh/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +## 8.3 + +- Update Home Assistant CLI to 4.0.1 +- Add backward compatibility with the hassio command +- Update Web terminal to ttyd 1.6.0 with Libwebsockets 3.2.2 +- Rename HASSIO_TOKEN to SUPERVISOR_TOKEN in shell profile + ## 8.2 - Fix creation of new tmux terminal windows diff --git a/ssh/Dockerfile b/ssh/Dockerfile index feca4e9..85ce623 100644 --- a/ssh/Dockerfile +++ b/ssh/Dockerfile @@ -12,6 +12,7 @@ RUN \ json-c-dev \ libuv-dev \ openssl-dev \ + zlib-dev \ \ && apk add --no-cache \ bash-completion \ @@ -70,14 +71,15 @@ RUN sed -i 's/^#[[:space:]]*\(include "\/usr\/share\/nano\/\*\.nanorc".*\)/\1/' # Home Assistant CLI ARG BUILD_ARCH ARG CLI_VERSION -RUN curl -Lso /usr/bin/hassio \ - "https://github.com/home-assistant/hassio-cli/releases/download/${CLI_VERSION}/hassio_${BUILD_ARCH}" \ - && chmod a+x /usr/bin/hassio \ - && /usr/bin/hassio completion > /usr/share/bash-completion/completions/hassio +RUN curl -Lso /usr/bin/ha \ + "https://github.com/home-assistant/cli/releases/download/${CLI_VERSION}/ha_${BUILD_ARCH}" \ + && chmod a+x /usr/bin/ha \ + && /usr/bin/ha completion > /usr/share/bash-completion/completions/ha # Copy data COPY data/.tmux.conf /root/ -COPY data/hassio.sh /etc/profile.d/ +COPY data/hassio /usr/bin/ +COPY data/homeassistant.sh /etc/profile.d/ COPY data/motd /etc/ COPY data/run.sh / COPY data/sshd_config /etc/ssh/ diff --git a/ssh/build.json b/ssh/build.json index 5965c52..53ff014 100644 --- a/ssh/build.json +++ b/ssh/build.json @@ -7,8 +7,8 @@ "i386": "homeassistant/i386-base:3.11" }, "args": { - "CLI_VERSION": "3.1.2", - "LIBWEBSOCKETS_VERSION": "v3.2.1", - "TTYD_VERSION": "aed3faa38dd20e8b377484ff7ac3da1826f21524" + "CLI_VERSION": "4.0.1", + "LIBWEBSOCKETS_VERSION": "v3.2.2", + "TTYD_VERSION": "1.6.0" } } diff --git a/ssh/config.json b/ssh/config.json index 2875f5d..7258db4 100644 --- a/ssh/config.json +++ b/ssh/config.json @@ -1,6 +1,6 @@ { "name": "SSH server", - "version": "8.2", + "version": "8.3", "slug": "ssh", "description": "Allow logging in remotely to Home Assistant using SSH", "url": "https://github.com/home-assistant/hassio-addons/tree/master/ssh", diff --git a/ssh/data/hassio b/ssh/data/hassio new file mode 100755 index 0000000..e38eb86 --- /dev/null +++ b/ssh/data/hassio @@ -0,0 +1,3 @@ +#!/usr/bin/env bashio +bashio::log.yellow "The 'hassio' command is deprecated, please use 'ha' instead!" +ha "$@" diff --git a/ssh/data/hassio.sh b/ssh/data/homeassistant.sh similarity index 100% rename from ssh/data/hassio.sh rename to ssh/data/homeassistant.sh diff --git a/ssh/data/motd b/ssh/data/motd index 8180c6a..0b13fd4 100644 --- a/ssh/data/motd +++ b/ssh/data/motd @@ -7,5 +7,5 @@ Our command line: -$ hassio help +$ ha help diff --git a/ssh/data/run.sh b/ssh/data/run.sh index 2942d9b..69e549c 100755 --- a/ssh/data/run.sh +++ b/ssh/data/run.sh @@ -52,7 +52,7 @@ chmod 600 /data/.bash_history ln -s -f /data/.bash_history /root/.bash_history # Make Home Assistant TOKEN available on the CLI -echo "export HASSIO_TOKEN=${HASSIO_TOKEN}" >> /etc/profile.d/hassio.sh +echo "export SUPERVISOR_TOKEN=${SUPERVISOR_TOKEN}" >> /etc/profile.d/homeassistant.sh # Remove old HASSIO_TOKEN from bash profile (if exists) if bashio::fs.file_exists /data/.bash_profile; then @@ -100,7 +100,7 @@ WAIT_PIDS+=($!) # Start ttyd server bashio::log.info "Starting Web Terminal..." cd /root -ttyd -p 8099 tmux -u new -A -s hassio bash -l & +ttyd -p 8099 tmux -u new -A -s homeassistant bash -l & WAIT_PIDS+=($!) # Wait until all is done