mirror of
https://github.com/alexbelgium/hassio-addons.git
synced 2026-06-01 13:24:04 +02:00
hadolint
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
#!/usr/bin/with-contenv bashio
|
||||
# shellcheck shell=bash
|
||||
if [ -e "/PORTFILE" ]; then
|
||||
echo "Installing portainer..."
|
||||
echo "Installing portainer..."
|
||||
BUILD_UPSTREAM=$(</PORTFILE)
|
||||
BUILD_ARCH=$(uname -m)
|
||||
|
||||
@@ -14,9 +15,9 @@ if [ -e "/PORTFILE" ]; then
|
||||
if [[ "${BUILD_ARCH}" == *armv7* ]]; then ARCH="arm"; fi
|
||||
if [[ "${BUILD_ARCH}" == arm ]]; then ARCH="arm"; fi
|
||||
if [[ "${BUILD_ARCH}" == *x86* ]]; then ARCH="amd64"; fi
|
||||
|
||||
|
||||
curl -L -s \
|
||||
"https://github.com/portainer/portainer/releases/download/${BUILD_UPSTREAM}/portainer-${BUILD_UPSTREAM}-linux-${ARCH}.tar.gz" \
|
||||
| tar zxvf - -C /opt/
|
||||
echo "... success!"
|
||||
fi
|
||||
"https://github.com/portainer/portainer/releases/download/${BUILD_UPSTREAM}/portainer-${BUILD_UPSTREAM}-linux-${ARCH}.tar.gz" |
|
||||
tar zxvf - -C /opt/
|
||||
echo "... success!"
|
||||
fi
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
#!/usr/bin/with-contenv bashio
|
||||
# shellcheck shell=bash
|
||||
|
||||
#################
|
||||
# NGINX SETTING #
|
||||
@@ -9,14 +10,14 @@ declare portainer_protocol=http
|
||||
|
||||
# Generate Ingress configuration
|
||||
if bashio::config.true 'ssl'; then
|
||||
bashio::config.require.ssl
|
||||
portainer_protocol=https
|
||||
sed -i "s|9000|9443|g" /etc/nginx/includes/upstream.conf
|
||||
sed -i "s|9000|9443|g" /etc/services.d/nginx/run
|
||||
sed -i "s|9099 default_server|9099 ssl|g" /etc/nginx/templates/ingress.gtpl
|
||||
sed -i '7 i ssl_certificate /ssl/{{ .certfile }};' /etc/nginx/templates/ingress.gtpl
|
||||
sed -i '7 i ssl_certificate_key /ssl/{{ .keyfile }};' /etc/nginx/templates/ingress.gtpl
|
||||
bashio::log.info "Ssl enabled, please use https for connection"
|
||||
bashio::config.require.ssl
|
||||
portainer_protocol=https
|
||||
sed -i "s|9000|9443|g" /etc/nginx/includes/upstream.conf
|
||||
sed -i "s|9000|9443|g" /etc/services.d/nginx/run
|
||||
sed -i "s|9099 default_server|9099 ssl|g" /etc/nginx/templates/ingress.gtpl
|
||||
sed -i '7 i ssl_certificate /ssl/{{ .certfile }};' /etc/nginx/templates/ingress.gtpl
|
||||
sed -i '7 i ssl_certificate_key /ssl/{{ .keyfile }};' /etc/nginx/templates/ingress.gtpl
|
||||
bashio::log.info "Ssl enabled, please use https for connection"
|
||||
fi
|
||||
|
||||
bashio::var.json \
|
||||
@@ -25,8 +26,7 @@ bashio::var.json \
|
||||
protocol "${portainer_protocol}" \
|
||||
certfile "$(bashio::config 'certfile')" \
|
||||
keyfile "$(bashio::config 'keyfile')" \
|
||||
ssl "^$(bashio::config 'ssl')" \
|
||||
| tempio \
|
||||
ssl "^$(bashio::config 'ssl')" |
|
||||
tempio \
|
||||
-template /etc/nginx/templates/ingress.gtpl \
|
||||
-out /etc/nginx/servers/ingress.conf
|
||||
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
#!/usr/bin/with-contenv bashio
|
||||
# shellcheck shell=bash
|
||||
# ==============================================================================
|
||||
# Home Assistant Community Add-on: Portainer
|
||||
# Runs some initializations for Portainer
|
||||
|
||||
Reference in New Issue
Block a user