configurator: Version 5.0.0 (#1229)

This commit is contained in:
Franck Nijhof
2020-04-16 19:54:12 +02:00
committed by GitHub
parent ac4582b639
commit 529ac8f930
8 changed files with 50 additions and 31 deletions

View File

@@ -1,5 +1,10 @@
# Changelog # Changelog
## 5.0.0
- Rewrite add-on to S6 Overlay
- Reduced add-on size
## 4.7 ## 4.7
- Fix file history width - Fix file history width

View File

@@ -2,15 +2,23 @@ ARG BUILD_FROM
FROM $BUILD_FROM FROM $BUILD_FROM
# Setup base # Setup base
ARG BUILD_ARCH
ARG CONFIGURATOR_VERSION ARG CONFIGURATOR_VERSION
RUN apk add --no-cache \ RUN \
apk add --no-cache \
git \ git \
openssh-client \ openssh-client \
&& pip install --no-cache-dir \ python3 \
hass-configurator==${CONFIGURATOR_VERSION} && pip3 install \
--no-cache-dir \
--prefer-binary \
--find-links "https://wheels.home-assistant.io/alpine-3.11/${BUILD_ARCH}/" \
hass-configurator=="${CONFIGURATOR_VERSION}" \
\
&& find /usr/local \
\( -type d -a -name test -o -name tests -o -name '__pycache__' \) \
-o \( -type f -a -name '*.pyc' -o -name '*.pyo' \) \
-exec rm -rf '{}' +
# Copy data # Copy data
COPY data/configurator.conf /etc/ COPY rootfs /
COPY data/run.sh /
CMD ["/run.sh"]

View File

@@ -1,10 +1,10 @@
{ {
"build_from": { "build_from": {
"aarch64": "homeassistant/aarch64-base-python:3.7", "aarch64": "homeassistant/aarch64-base:3.11",
"amd64": "homeassistant/amd64-base-python:3.7", "amd64": "homeassistant/amd64-base:3.11",
"armhf": "homeassistant/armhf-base-python:3.7", "armhf": "homeassistant/armhf-base:3.11",
"armv7": "homeassistant/armv7-base-python:3.7", "armv7": "homeassistant/armv7-base:3.11",
"i386": "homeassistant/i386-base-python:3.7" "i386": "homeassistant/i386-base:3.11"
}, },
"args": { "args": {
"CONFIGURATOR_VERSION": "0.4.0" "CONFIGURATOR_VERSION": "0.4.0"

View File

@@ -1,12 +1,13 @@
{ {
"name": "File editor", "name": "File editor",
"version": "4.7", "version": "5.0.0",
"slug": "configurator", "slug": "configurator",
"description": "Simple browser-based file editor for Home Assistant", "description": "Simple browser-based file editor for Home Assistant",
"url": "https://github.com/home-assistant/hassio-addons/tree/master/configurator", "url": "https://github.com/home-assistant/hassio-addons/tree/master/configurator",
"arch": ["armhf", "armv7", "aarch64", "amd64", "i386"], "arch": ["armhf", "armv7", "aarch64", "amd64", "i386"],
"homeassistant": "0.91.1", "homeassistant": "0.91.1",
"startup": "application", "startup": "application",
"init": false,
"ingress": true, "ingress": true,
"panel_icon": "mdi:wrench", "panel_icon": "mdi:wrench",
"homeassistant_api": true, "homeassistant_api": true,

View File

@@ -7,7 +7,7 @@
"SSL_CERTIFICATE": null, "SSL_CERTIFICATE": null,
"SSL_KEY": null, "SSL_KEY": null,
"IGNORE_SSL": false, "IGNORE_SSL": false,
"HASS_API": "http://hassio/homeassistant/api/", "HASS_API": "http://supervisor/homeassistant/api/",
"HASS_WS_API": null, "HASS_WS_API": null,
"HASS_API_PASSWORD": null, "HASS_API_PASSWORD": null,
"USERNAME": null, "USERNAME": null,

View File

@@ -0,0 +1,8 @@
#!/usr/bin/execlineb -S1
# ==============================================================================
# Take down the S6 supervision tree based on service exit code
# ==============================================================================
if { s6-test ${1} -ne 0 }
if { s6-test ${1} -ne 256 }
s6-svscanctl -t /var/run/s6/services

View File

@@ -1,9 +1,11 @@
#!/usr/bin/env bashio #!/usr/bin/with-contenv bashio
set -e # ==============================================================================
# Start Configurator service
DIRSFIRST=$(bashio::config 'dirsfirst') # ==============================================================================
ENFORCE_BASEPATH=$(bashio::config 'enforce_basepath') export HC_DIRSFIRST
IGNORE_PATTERN="$(bashio::config 'ignore_pattern | join(",")')" export HC_ENFORCE_BASEPATH
export HC_HASS_API_PASSWORD
export HC_IGNORE_PATTERN
# If any SSH key files are defined in the configuration options, add them for use by git # If any SSH key files are defined in the configuration options, add them for use by git
if bashio::config.has_value "ssh_keys"; then if bashio::config.has_value "ssh_keys"; then
@@ -20,19 +22,12 @@ if bashio::config.has_value "ssh_keys"; then
bashio::log.error "SSH key file \"${filename}\" not found" bashio::log.error "SSH key file \"${filename}\" not found"
fi fi
done <<< "$(bashio::config 'ssh_keys')" done <<< "$(bashio::config 'ssh_keys')"
# Disable strict host key checking
mkdir -p ~/.ssh
{
echo "Host *"
echo " StrictHostKeyChecking no"
} > ~/.ssh/config
fi fi
# Setup and run configurator # Setup and run configurator
export HC_HASS_API_PASSWORD="${HASSIO_TOKEN}" HC_DIRSFIRST=$(bashio::config 'dirsfirst')
export HC_DIRSFIRST="${DIRSFIRST}" HC_ENFORCE_BASEPATH=$(bashio::config 'enforce_basepath')
export HC_ENFORCE_BASEPATH="${ENFORCE_BASEPATH}" HC_HASS_API_PASSWORD="${SUPERVISOR_TOKEN}"
export HC_IGNORE_PATTERN="${IGNORE_PATTERN}" HC_IGNORE_PATTERN="$(bashio::config 'ignore_pattern | join(",")')"
exec hass-configurator /etc/configurator.conf exec hass-configurator /etc/configurator.conf

View File

@@ -0,0 +1,2 @@
Host *
StrictHostKeyChecking no