mirror of
https://github.com/alexbelgium/hassio-addons.git
synced 2026-01-09 17:31:03 +01:00
Merge pull request #2333 from alexbelgium/codex/add-automatic-fields-prefill-for-joal-server
Prefill Joal ingress credentials
This commit is contained in:
@@ -73,6 +73,12 @@ UIPATH=$(bashio::config 'ui_path')
|
|||||||
#port=$(bashio::addon.port 80)
|
#port=$(bashio::addon.port 80)
|
||||||
ingress_port=$(bashio::addon.ingress_port)
|
ingress_port=$(bashio::addon.ingress_port)
|
||||||
ingress_interface=$(bashio::addon.ip_address)
|
ingress_interface=$(bashio::addon.ip_address)
|
||||||
|
ui_credentials_json=$(jq -n --arg host "${host_ip}:${host_port}${ingress_url}/" \
|
||||||
|
--arg port "${host_port}" \
|
||||||
|
--arg pathPrefix "${UIPATH}" \
|
||||||
|
--arg secretToken "${TOKEN}" \
|
||||||
|
'{host:$host,port:$port,pathPrefix:$pathPrefix,secretToken:$secretToken}')
|
||||||
|
ui_credentials_encoded=$(printf '%s' "$ui_credentials_json" | jq -sRr @uri)
|
||||||
|
|
||||||
#################
|
#################
|
||||||
# NGINX SETTING #
|
# NGINX SETTING #
|
||||||
@@ -90,6 +96,7 @@ 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
|
||||||
sed -i "s/%%path%%/${UIPATH}/g" /etc/nginx/servers/ingress.conf
|
sed -i "s/%%path%%/${UIPATH}/g" /etc/nginx/servers/ingress.conf
|
||||||
|
sed -i "s|%%ui_credentials%%|${ui_credentials_encoded}|g" /etc/nginx/servers/ingress.conf
|
||||||
mkdir -p /var/log/nginx && touch /var/log/nginx/error.log
|
mkdir -p /var/log/nginx && touch /var/log/nginx/error.log
|
||||||
|
|
||||||
###############
|
###############
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ server {
|
|||||||
proxy_connect_timeout 30m;
|
proxy_connect_timeout 30m;
|
||||||
proxy_send_timeout 30m;
|
proxy_send_timeout 30m;
|
||||||
proxy_read_timeout 30m;
|
proxy_read_timeout 30m;
|
||||||
proxy_pass http://backend/%%path%%/ui/;
|
proxy_pass http://backend/%%path%%/ui?ui_credentials=%%ui_credentials%%;
|
||||||
}
|
}
|
||||||
|
|
||||||
location /:8123/ {
|
location /:8123/ {
|
||||||
|
|||||||
Reference in New Issue
Block a user