ssh: Update CLI & Web terminal (#1068)

This commit is contained in:
Franck Nijhof
2020-02-12 00:10:46 +01:00
committed by GitHub
parent 6725b3f7da
commit 75ce67fc5e
8 changed files with 24 additions and 12 deletions

View File

@@ -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

View File

@@ -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/

View File

@@ -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"
}
}

View File

@@ -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",

3
ssh/data/hassio Executable file
View File

@@ -0,0 +1,3 @@
#!/usr/bin/env bashio
bashio::log.yellow "The 'hassio' command is deprecated, please use 'ha' instead!"
ha "$@"

View File

@@ -7,5 +7,5 @@
Our command line:
$ hassio help
$ ha help

View File

@@ -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