Add Portainer Addon v1.5.2

This commit is contained in:
Max Winterstein
2021-09-27 10:11:56 +02:00
parent 199e6f20a2
commit 5daf9bda73
12 changed files with 374 additions and 0 deletions
@@ -0,0 +1,6 @@
#!/usr/bin/with-contenv bashio
# ==============================================================================
# Home Assistant Community Add-on: Portainer
# Runs some initializations for Portainer
# ==============================================================================
bashio::require.unprotected
@@ -0,0 +1,9 @@
#!/usr/bin/execlineb -S0
# ==============================================================================
# Home Assistant Community Add-on: Portainer
# Take down the S6 supervision tree when Portainer fails
# ==============================================================================
if { s6-test ${1} -ne 0 }
if { s6-test ${1} -ne 256 }
s6-svscanctl -t /var/run/s6/services
@@ -0,0 +1,50 @@
#!/usr/bin/with-contenv bashio
# ==============================================================================
# Home Assistant Community Add-on: Portainer
# Runs portainer
# ==============================================================================
declare -a options
export AGENT_SECRET
bashio::log.info 'Starting Portainer...'
options+=(--data /data)
options+=(--bind 0.0.0.0:1337)
options+=(--no-auth)
options+=(--template-file /opt/portainer/templates.json)
options+=(--no-analytics)
options+=(--host unix:///var/run/docker.sock)
# Hide Hassio containers by default, but only eforce on first run
if ! bashio::fs.file_exists "/data/hidden"; then
# shellcheck disable=SC2191
options+=(--hide-label io.hass.type=supervisor)
# shellcheck disable=SC2191
options+=(--hide-label io.hass.type=homeassistant)
# shellcheck disable=SC2191
options+=(--hide-label io.hass.type=base)
# shellcheck disable=SC2191
options+=(--hide-label io.hass.type=core)
# shellcheck disable=SC2191
options+=(--hide-label io.hass.type=addon)
# shellcheck disable=SC2191
options+=(--hide-label io.hass.type=audio)
# shellcheck disable=SC2191
options+=(--hide-label io.hass.type=cli)
# shellcheck disable=SC2191
options+=(--hide-label io.hass.type=dns)
# shellcheck disable=SC2191
options+=(--hide-label io.hass.type=multicast)
# shellcheck disable=SC2191
options+=(--hide-label io.hass.type=observer)
touch /data/hidden
fi
# Export agent secret, if defined
if bashio::config.has_value 'agent_secret' ; then
AGENT_SECRET=$(bashio::config 'agent_secret')
fi
# Run Portainer
exec /opt/portainer/portainer "${options[@]}"