🔨 Updates for upstream Supervisor changes

This commit is contained in:
Franck Nijhof 2020-02-15 16:16:33 +01:00
parent 2d6d5be963
commit 3c50dd9548
No known key found for this signature in database
GPG key ID: D62583BA8AB11CA3
5 changed files with 12 additions and 12 deletions

View file

@ -5,7 +5,7 @@
# ============================================================================== # ==============================================================================
declare port declare port
declare certfile declare certfile
declare hassio_dns declare dns_host
declare ingress_interface declare ingress_interface
declare ingress_port declare ingress_port
declare keyfile declare keyfile
@ -32,5 +32,5 @@ ingress_interface=$(bashio::addon.ip_address)
sed -i "s/%%port%%/${ingress_port}/g" /etc/nginx/servers/ingress.conf sed -i "s/%%port%%/${ingress_port}/g" /etc/nginx/servers/ingress.conf
sed -i "s/%%interface%%/${ingress_interface}/g" /etc/nginx/servers/ingress.conf sed -i "s/%%interface%%/${ingress_interface}/g" /etc/nginx/servers/ingress.conf
hassio_dns=$(bashio::dns.host) dns_host=$(bashio::dns.host)
sed -i "s/%%hassio_dns%%/${hassio_dns}/g" /etc/nginx/includes/resolver.conf sed -i "s/%%dns_host%%/${dns_host}/g" /etc/nginx/includes/resolver.conf

View file

@ -1 +1 @@
resolver %%hassio_dns%%; resolver %%dns_host%%;

View file

@ -36,7 +36,7 @@ function authenticate()
body = ngx.encode_args({["username"]=username, ["password"]=password}), body = ngx.encode_args({["username"]=username, ["password"]=password}),
headers = { headers = {
["Content-Type"] = "application/x-www-form-urlencoded", ["Content-Type"] = "application/x-www-form-urlencoded",
["X-HASSIO-KEY"] = os.getenv("HASSIO_TOKEN"), ["X-Supervisor-Token"] = os.getenv("SUPERVISOR_TOKEN"),
}, },
keepalive_timeout = 60, keepalive_timeout = 60,
keepalive_pool = 10 keepalive_pool = 10

View file

@ -17,7 +17,7 @@ pcre_jit on;
error_log /proc/1/fd/1 error; error_log /proc/1/fd/1 error;
# Load allowed environment vars # Load allowed environment vars
env HASSIO_TOKEN; env SUPERVISOR_TOKEN;
env DISABLE_HA_AUTHENTICATION; env DISABLE_HA_AUTHENTICATION;
# Load dynamic modules. # Load dynamic modules.
@ -31,11 +31,11 @@ events {
http { http {
include /etc/nginx/includes/mime.types; include /etc/nginx/includes/mime.types;
log_format hassio '[$time_local] $status ' log_format homeassistant '[$time_local] $status '
'$http_x_forwarded_for($remote_addr) ' '$http_x_forwarded_for($remote_addr) '
'$request ($http_user_agent)'; '$request ($http_user_agent)';
access_log /proc/1/fd/1 hassio; access_log /proc/1/fd/1 homeassistant;
client_max_body_size 4G; client_max_body_size 4G;
default_type application/octet-stream; default_type application/octet-stream;
gzip on; gzip on;

View file

@ -20,8 +20,8 @@ fi
options+=(--auth none) options+=(--auth none)
# Export env variables for the Home Assistant extension # Export env variables for the Home Assistant extension
export HASS_SERVER="http://hassio/homeassistant" export HASS_SERVER="http://supervisor/core"
export HASS_TOKEN="${HASSIO_TOKEN:-}" export HASS_TOKEN="${SUPERVISOR_TOKEN:-}"
# Run the code server # Run the code server
exec code-server "${options[@]}" /config exec code-server "${options[@]}" /config