mirror of
https://github.com/alexbelgium/hassio-addons.git
synced 2026-10-21 15:30:11 +02:00
Compare commits
7 Commits
a2a3583a1d
...
278eeb931b
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
278eeb931b | ||
|
|
83aa854206 | ||
|
|
885b055768 | ||
|
|
79fb5a93ef | ||
|
|
b1f238a024 | ||
|
|
041356e68b | ||
|
|
85bc9c723d |
14
.github/workflows/daily_ai_fix.yaml
vendored
14
.github/workflows/daily_ai_fix.yaml
vendored
@@ -50,7 +50,6 @@ permissions:
|
|||||||
contents: write
|
contents: write
|
||||||
issues: write
|
issues: write
|
||||||
pull-requests: write
|
pull-requests: write
|
||||||
id-token: write # claude-code-action fetches a GitHub OIDC token to auth the OAuth flow
|
|
||||||
|
|
||||||
concurrency:
|
concurrency:
|
||||||
group: ai-fix-sweep
|
group: ai-fix-sweep
|
||||||
@@ -129,9 +128,16 @@ jobs:
|
|||||||
uses: anthropics/claude-code-action@44423bdec74b97d67543eb16c110546762c110b2 # v1
|
uses: anthropics/claude-code-action@44423bdec74b97d67543eb16c110546762c110b2 # v1
|
||||||
with:
|
with:
|
||||||
claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }}
|
claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }}
|
||||||
# One sticky, auto-updating status comment per run instead of the
|
# Skip the OIDC -> Claude App token exchange. The scheduled path
|
||||||
# model narrating its own progress in scattered comments.
|
# happens to pass it (github.actor is the maintainer), but
|
||||||
track_progress: true
|
# workflow_dispatch by anyone else would 401. AI_PR_TOKEN, not
|
||||||
|
# GITHUB_TOKEN, so a PR Claude opens triggers CI.
|
||||||
|
github_token: ${{ secrets.AI_PR_TOKEN }}
|
||||||
|
# No track_progress here. It needs an issue or PR to hang its sticky
|
||||||
|
# comment on, and the action hard-fails validation without one; this
|
||||||
|
# workflow only ever runs on schedule/workflow_dispatch. Per-issue
|
||||||
|
# progress still gets reported — issue-fix.md has Claude comment on
|
||||||
|
# each issue directly via gh.
|
||||||
prompt: |
|
prompt: |
|
||||||
The batch of issues to work through is /tmp/ai-fix/batch.json.
|
The batch of issues to work through is /tmp/ai-fix/batch.json.
|
||||||
Follow .github/prompts/issue-fix.md exactly. Do not deviate from
|
Follow .github/prompts/issue-fix.md exactly. Do not deviate from
|
||||||
|
|||||||
10
.github/workflows/on_issue_approved.yaml
vendored
10
.github/workflows/on_issue_approved.yaml
vendored
@@ -32,7 +32,6 @@ permissions:
|
|||||||
contents: write
|
contents: write
|
||||||
issues: write
|
issues: write
|
||||||
pull-requests: write
|
pull-requests: write
|
||||||
id-token: write # claude-code-action fetches a GitHub OIDC token to auth the OAuth flow
|
|
||||||
|
|
||||||
concurrency:
|
concurrency:
|
||||||
group: ai-approve-${{ github.event.issue.number || inputs.issue }}
|
group: ai-approve-${{ github.event.issue.number || inputs.issue }}
|
||||||
@@ -139,7 +138,14 @@ jobs:
|
|||||||
uses: anthropics/claude-code-action@44423bdec74b97d67543eb16c110546762c110b2 # v1
|
uses: anthropics/claude-code-action@44423bdec74b97d67543eb16c110546762c110b2 # v1
|
||||||
with:
|
with:
|
||||||
claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }}
|
claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }}
|
||||||
track_progress: true
|
# Skip the OIDC -> Claude App token exchange, which 401s whenever
|
||||||
|
# github.actor lacks write access. AI_PR_TOKEN, not GITHUB_TOKEN, so
|
||||||
|
# a PR Claude opens triggers CI.
|
||||||
|
github_token: ${{ secrets.AI_PR_TOKEN }}
|
||||||
|
# Only the `issues` path has a comment thread to track progress in.
|
||||||
|
# On workflow_dispatch there is none, and passing true there fails
|
||||||
|
# the action's input validation outright.
|
||||||
|
track_progress: ${{ github.event_name == 'issues' }}
|
||||||
prompt: |
|
prompt: |
|
||||||
The approved plan is /tmp/ai-exec/plan.md and the issue it belongs
|
The approved plan is /tmp/ai-exec/plan.md and the issue it belongs
|
||||||
to is /tmp/ai-exec/issue.json. Follow .github/prompts/issue-execute-plan.md
|
to is /tmp/ai-exec/issue.json. Follow .github/prompts/issue-execute-plan.md
|
||||||
|
|||||||
7
.github/workflows/on_issues_ai_triage.yaml
vendored
7
.github/workflows/on_issues_ai_triage.yaml
vendored
@@ -41,7 +41,6 @@ on:
|
|||||||
permissions:
|
permissions:
|
||||||
contents: read
|
contents: read
|
||||||
issues: write
|
issues: write
|
||||||
id-token: write # claude-code-action fetches a GitHub OIDC token to auth the OAuth flow
|
|
||||||
|
|
||||||
concurrency:
|
concurrency:
|
||||||
group: ai-triage-${{ github.event.issue.number || inputs.issue || github.run_id }}
|
group: ai-triage-${{ github.event.issue.number || inputs.issue || github.run_id }}
|
||||||
@@ -148,6 +147,12 @@ jobs:
|
|||||||
uses: anthropics/claude-code-action@44423bdec74b97d67543eb16c110546762c110b2 # v1
|
uses: anthropics/claude-code-action@44423bdec74b97d67543eb16c110546762c110b2 # v1
|
||||||
with:
|
with:
|
||||||
claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }}
|
claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }}
|
||||||
|
# Without this the action falls back to the OIDC -> Claude App token
|
||||||
|
# exchange, which 401s ("User does not have write access on this
|
||||||
|
# repository") whenever github.actor is the outside reporter who
|
||||||
|
# opened the issue or replied to a needs-info request. Same token the
|
||||||
|
# step already exports as GH_TOKEN; classify only reads.
|
||||||
|
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
show_full_output: true
|
show_full_output: true
|
||||||
prompt: |
|
prompt: |
|
||||||
Read /tmp/ai-triage/context.md, then follow the instructions in
|
Read /tmp/ai-triage/context.md, then follow the instructions in
|
||||||
|
|||||||
6
.github/workflows/on_pr_coderabbit.yml
vendored
6
.github/workflows/on_pr_coderabbit.yml
vendored
@@ -25,7 +25,6 @@ permissions:
|
|||||||
contents: write
|
contents: write
|
||||||
pull-requests: write
|
pull-requests: write
|
||||||
issues: write
|
issues: write
|
||||||
id-token: write # claude-code-action fetches a GitHub OIDC token to auth the OAuth flow
|
|
||||||
|
|
||||||
concurrency:
|
concurrency:
|
||||||
group: ai-coderabbit-${{ github.event.pull_request.number }}
|
group: ai-coderabbit-${{ github.event.pull_request.number }}
|
||||||
@@ -83,6 +82,11 @@ jobs:
|
|||||||
uses: anthropics/claude-code-action@44423bdec74b97d67543eb16c110546762c110b2 # v1
|
uses: anthropics/claude-code-action@44423bdec74b97d67543eb16c110546762c110b2 # v1
|
||||||
with:
|
with:
|
||||||
claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }}
|
claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }}
|
||||||
|
# Skip the OIDC -> Claude App token exchange, which 401s whenever
|
||||||
|
# github.actor lacks write access — here github.actor is
|
||||||
|
# coderabbitai[bot], the review submitter. AI_PR_TOKEN, not
|
||||||
|
# GITHUB_TOKEN, so the pushed fixes re-trigger CI on the PR.
|
||||||
|
github_token: ${{ secrets.AI_PR_TOKEN }}
|
||||||
prompt: |
|
prompt: |
|
||||||
CodeRabbit has reviewed pull request #${{ github.event.pull_request.number }}
|
CodeRabbit has reviewed pull request #${{ github.event.pull_request.number }}
|
||||||
on ${{ github.repository }}. You are on that PR's branch. Follow
|
on ${{ github.repository }}. You are on that PR's branch. Follow
|
||||||
|
|||||||
@@ -3,6 +3,160 @@
|
|||||||
|
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
|
################################################################################
|
||||||
|
# Block markers, temp helper, quoting and export-block builders
|
||||||
|
#
|
||||||
|
# Everything here is free of side effects and defined before the Supervisor
|
||||||
|
# guard, so that the self-test below can exercise the whole value path outside a
|
||||||
|
# container, where bashio is not available.
|
||||||
|
################################################################################
|
||||||
|
BLOCK_BEGIN="# --- BEGIN ADDON ENV (generated) ---"
|
||||||
|
BLOCK_END="# --- END ADDON ENV (generated) ---"
|
||||||
|
|
||||||
|
mktemp_safe() {
|
||||||
|
local tmpdir="${TMPDIR:-/tmp}"
|
||||||
|
mkdir -p "$tmpdir"
|
||||||
|
mktemp "$tmpdir/tmp.XXXXXXXXXX"
|
||||||
|
}
|
||||||
|
|
||||||
|
dotenv_quote() {
|
||||||
|
# For /.env and /etc/environment: double quotes + minimal escaping.
|
||||||
|
#
|
||||||
|
# These files are read back by sourcing them from a shell, so every
|
||||||
|
# character that is still special inside double quotes has to be escaped.
|
||||||
|
# $ and ` used to be left alone, which meant a value was expanded instead of
|
||||||
|
# being read literally: a password like pa$$w0rd came back with the shell
|
||||||
|
# PID spliced into it, and a value containing backticks ran as a command.
|
||||||
|
#
|
||||||
|
# Backslash must be doubled first, so that the backslashes added below are
|
||||||
|
# not doubled in turn.
|
||||||
|
local v="$1"
|
||||||
|
v="${v//\\/\\\\}"
|
||||||
|
v="${v//\"/\\\"}"
|
||||||
|
v="${v//\$/\\\$}"
|
||||||
|
v="${v//\`/\\\`}"
|
||||||
|
v="${v//$'\n'/\\n}"
|
||||||
|
v="${v//$'\r'/\\r}"
|
||||||
|
printf '"%s"' "$v"
|
||||||
|
}
|
||||||
|
|
||||||
|
shell_quote() {
|
||||||
|
# Single-quote for safe injection into shell code.
|
||||||
|
#
|
||||||
|
# Inside single quotes every character is literal, so the only thing a value
|
||||||
|
# needs escaping for is the quote character itself: close the quote, emit an
|
||||||
|
# escaped quote, reopen it. Backslashes must be left untouched.
|
||||||
|
#
|
||||||
|
# This used to double every backslash and to replace ' with '"'"' followed by
|
||||||
|
# a stray space. The stray space corrupted every value containing a quote
|
||||||
|
# (O'Brien pass arrived as O' Brien pass); the doubling was undone further
|
||||||
|
# down the path by the "awk -v" in append_export, so backslashes survived by
|
||||||
|
# accident. Both halves are fixed together -- see the note in append_export.
|
||||||
|
local s="$1"
|
||||||
|
printf "'%s'" "${s//\'/\'\\\'\'}"
|
||||||
|
}
|
||||||
|
|
||||||
|
append_export() {
|
||||||
|
# Plain append, deliberately not awk: "awk -v q=$value" runs the value
|
||||||
|
# through awk's escape processing, which turns \t into a tab, \b into a
|
||||||
|
# backspace and \\ into a single backslash. That used to be cancelled out by
|
||||||
|
# shell_quote doubling every backslash, so the two bugs hid each other --
|
||||||
|
# fixing only one of them corrupts the value.
|
||||||
|
printf 'export %s=%s\n' "$1" "$(shell_quote "$2")" >> "$EXPORT_BODY"
|
||||||
|
}
|
||||||
|
|
||||||
|
compose_export_block() {
|
||||||
|
{
|
||||||
|
echo "$BLOCK_BEGIN"
|
||||||
|
echo "# Generated from $JSONSOURCE"
|
||||||
|
cat "$EXPORT_BODY"
|
||||||
|
echo "$BLOCK_END"
|
||||||
|
} > "$EXPORT_BLOCK"
|
||||||
|
}
|
||||||
|
|
||||||
|
################################################################################
|
||||||
|
# Self-test: bash .templates/00-global_var.sh --self-test
|
||||||
|
#
|
||||||
|
# Builds a real export block and sources it, which is exactly what happens once
|
||||||
|
# the block is injected at the top of a service run script, then checks that
|
||||||
|
# every value came back byte for byte. Testing the whole path matters: the two
|
||||||
|
# defects this guards against (shell_quote doubling backslashes and append_export
|
||||||
|
# passing values through "awk -v") cancelled each other out, so a test of either
|
||||||
|
# helper alone reported success while the pair was wrong.
|
||||||
|
#
|
||||||
|
# Runs before the Supervisor guard and exits, so it never affects startup.
|
||||||
|
################################################################################
|
||||||
|
if [[ "${1:-}" == "--self-test" ]]; then
|
||||||
|
# Literal test data: the single quotes and metacharacters are the point.
|
||||||
|
# shellcheck disable=SC2016
|
||||||
|
self_test_values=(
|
||||||
|
'plain.host'
|
||||||
|
'next\.duckdns\.org' # regex, dots escaped once
|
||||||
|
'next\\.duckdns\\.org' # regex, dots escaped twice by the user
|
||||||
|
'C:\Users\bob\share' # windows path, \U and \b are awk escapes
|
||||||
|
'\\server\share' # UNC path
|
||||||
|
'col\tsep' # \t is an awk escape
|
||||||
|
"O'Brien pass" # embedded quote
|
||||||
|
"it's a 'quoted' word" # several embedded quotes
|
||||||
|
"'leading"
|
||||||
|
"trailing'"
|
||||||
|
'a$b`c"d' # shell metacharacters
|
||||||
|
'*.example.com|^foo\d+$'
|
||||||
|
$'sp ace\ttab'
|
||||||
|
''
|
||||||
|
)
|
||||||
|
|
||||||
|
JSONSOURCE="self-test"
|
||||||
|
EXPORT_BODY="$(mktemp_safe)"
|
||||||
|
EXPORT_BLOCK="$(mktemp_safe)"
|
||||||
|
self_test_env="$(mktemp_safe)"
|
||||||
|
trap 'rm -f "$EXPORT_BODY" "$EXPORT_BLOCK" "$self_test_env"' EXIT
|
||||||
|
self_test_rc=0
|
||||||
|
|
||||||
|
self_test_check() {
|
||||||
|
# $1 name of the variable that was read back, $2 expected value, $3 how
|
||||||
|
local self_test_got="${!1}"
|
||||||
|
[[ "$self_test_got" == "$2" ]] && return 0
|
||||||
|
printf 'FAIL (%s): <%s> came back as <%s>\n' "$3" "$2" "$self_test_got"
|
||||||
|
self_test_rc=1
|
||||||
|
}
|
||||||
|
|
||||||
|
# 1. The export block, sourced the way an injected run script would
|
||||||
|
for self_test_i in "${!self_test_values[@]}"; do
|
||||||
|
append_export "SELFTEST_${self_test_i}" "${self_test_values[$self_test_i]}"
|
||||||
|
done
|
||||||
|
compose_export_block
|
||||||
|
# shellcheck source=/dev/null
|
||||||
|
. "$EXPORT_BLOCK"
|
||||||
|
for self_test_i in "${!self_test_values[@]}"; do
|
||||||
|
self_test_check "SELFTEST_${self_test_i}" "${self_test_values[$self_test_i]}" "export block"
|
||||||
|
done
|
||||||
|
|
||||||
|
# 2. /.env, sourced the way browserless_chrome and wger read it back.
|
||||||
|
# Values holding a newline are out of scope: dotenv_quote writes them as a
|
||||||
|
# literal \n, which a dotenv parser unescapes but a shell does not.
|
||||||
|
for self_test_i in "${!self_test_values[@]}"; do
|
||||||
|
printf 'DOTENVTEST_%s=%s\n' \
|
||||||
|
"$self_test_i" "$(dotenv_quote "${self_test_values[$self_test_i]}")"
|
||||||
|
done > "$self_test_env"
|
||||||
|
if ! bash -n "$self_test_env"; then
|
||||||
|
# An unescaped backtick or quote leaves the file unparseable, which would
|
||||||
|
# abort the sourcing shell instead of just yielding a wrong value.
|
||||||
|
echo "FAIL (dotenv): generated env file is not valid shell"
|
||||||
|
self_test_rc=1
|
||||||
|
else
|
||||||
|
# shellcheck source=/dev/null
|
||||||
|
. "$self_test_env"
|
||||||
|
for self_test_i in "${!self_test_values[@]}"; do
|
||||||
|
self_test_check "DOTENVTEST_${self_test_i}" "${self_test_values[$self_test_i]}" "dotenv"
|
||||||
|
done
|
||||||
|
fi
|
||||||
|
|
||||||
|
[[ "$self_test_rc" -eq 0 ]] &&
|
||||||
|
echo "${#self_test_values[@]} values round-tripped unchanged (export block + dotenv)"
|
||||||
|
exit "$self_test_rc"
|
||||||
|
fi
|
||||||
|
|
||||||
################################################################################
|
################################################################################
|
||||||
# Guard: only run inside Supervisor-managed add-ons
|
# Guard: only run inside Supervisor-managed add-ons
|
||||||
################################################################################
|
################################################################################
|
||||||
@@ -30,15 +184,6 @@ command -v jq >/dev/null || bashio::exit.nok "jq is required"
|
|||||||
mkdir -p /etc
|
mkdir -p /etc
|
||||||
touch "$ETC_ENV_FILE"
|
touch "$ETC_ENV_FILE"
|
||||||
|
|
||||||
################################################################################
|
|
||||||
# Temp helper
|
|
||||||
################################################################################
|
|
||||||
mktemp_safe() {
|
|
||||||
local tmpdir="${TMPDIR:-/tmp}"
|
|
||||||
mkdir -p "$tmpdir"
|
|
||||||
mktemp "$tmpdir/tmp.XXXXXXXXXX"
|
|
||||||
}
|
|
||||||
|
|
||||||
################################################################################
|
################################################################################
|
||||||
# Secrets support
|
# Secrets support
|
||||||
################################################################################
|
################################################################################
|
||||||
@@ -68,54 +213,13 @@ resolve_secret() {
|
|||||||
printf '%s' "$line"
|
printf '%s' "$line"
|
||||||
}
|
}
|
||||||
|
|
||||||
################################################################################
|
|
||||||
# Quoting
|
|
||||||
################################################################################
|
|
||||||
dotenv_quote() {
|
|
||||||
# For /.env and /etc/environment: double quotes + minimal escaping
|
|
||||||
local v="$1"
|
|
||||||
v="${v//\\/\\\\}"
|
|
||||||
v="${v//\"/\\\"}"
|
|
||||||
v="${v//$'\n'/\\n}"
|
|
||||||
v="${v//$'\r'/\\r}"
|
|
||||||
printf '"%s"' "$v"
|
|
||||||
}
|
|
||||||
|
|
||||||
shell_quote() {
|
|
||||||
# Single-quote for safe injection in shell code
|
|
||||||
local s="$1"
|
|
||||||
s="${s//\\/\\\\}"
|
|
||||||
s="${s//\'/\'\"\'\"\' }"
|
|
||||||
s="${s% }"
|
|
||||||
printf "'%s'" "$s"
|
|
||||||
}
|
|
||||||
|
|
||||||
################################################################################
|
################################################################################
|
||||||
# S6 + script injection block
|
# S6 + script injection block
|
||||||
################################################################################
|
################################################################################
|
||||||
BLOCK_BEGIN="# --- BEGIN ADDON ENV (generated) ---"
|
|
||||||
BLOCK_END="# --- END ADDON ENV (generated) ---"
|
|
||||||
|
|
||||||
EXPORT_BLOCK="$(mktemp_safe)"
|
EXPORT_BLOCK="$(mktemp_safe)"
|
||||||
|
EXPORT_BODY="$(mktemp_safe)"
|
||||||
KV_FILE="$(mktemp_safe)"
|
KV_FILE="$(mktemp_safe)"
|
||||||
trap 'rm -f "$EXPORT_BLOCK" "$KV_FILE"' EXIT
|
trap 'rm -f "$EXPORT_BLOCK" "$EXPORT_BODY" "$KV_FILE"' EXIT
|
||||||
|
|
||||||
{
|
|
||||||
echo "$BLOCK_BEGIN"
|
|
||||||
echo "# Generated from $JSONSOURCE"
|
|
||||||
echo "$BLOCK_END"
|
|
||||||
} > "$EXPORT_BLOCK"
|
|
||||||
|
|
||||||
append_export() {
|
|
||||||
local k="$1" v="$2" q
|
|
||||||
q="$(shell_quote "$v")"
|
|
||||||
|
|
||||||
awk -v k="$k" -v q="$q" -v e="$BLOCK_END" '
|
|
||||||
$0==e { print "export " k "=" q }
|
|
||||||
{ print }
|
|
||||||
' "$EXPORT_BLOCK" > "$EXPORT_BLOCK.tmp"
|
|
||||||
mv "$EXPORT_BLOCK.tmp" "$EXPORT_BLOCK"
|
|
||||||
}
|
|
||||||
|
|
||||||
inject_block() {
|
inject_block() {
|
||||||
local f="$1" tmp
|
local f="$1" tmp
|
||||||
@@ -235,6 +339,8 @@ cp "$ENV_FILE" "$ETC_ENV_FILE"
|
|||||||
################################################################################
|
################################################################################
|
||||||
# Inject into scripts and shells (best-effort)
|
# Inject into scripts and shells (best-effort)
|
||||||
################################################################################
|
################################################################################
|
||||||
|
compose_export_block
|
||||||
|
|
||||||
for f in /etc/services.d/*/run /etc/s6-overlay/s6-rc.d/*/run /etc/cont-init.d/*.sh /entrypoint.sh /etc/bash.bashrc "${GLOBAL_VAR_FILES:-}"; do
|
for f in /etc/services.d/*/run /etc/s6-overlay/s6-rc.d/*/run /etc/cont-init.d/*.sh /entrypoint.sh /etc/bash.bashrc "${GLOBAL_VAR_FILES:-}"; do
|
||||||
[[ -f "$f" ]] && inject_block "$f"
|
[[ -f "$f" ]] && inject_block "$f"
|
||||||
done
|
done
|
||||||
|
|||||||
@@ -1,4 +1,9 @@
|
|||||||
|
|
||||||
|
## 1.6.0.1 (2026-07-27)
|
||||||
|
|
||||||
|
- Fix ingress: nginx rewrote Bazarr's redirects into an absolute `http://<host>:8099/...` URL, which the browser blocked as mixed content when Home Assistant is served over HTTPS. Redirects now stay relative and point at the ingress path
|
||||||
|
- Fix fallback base_url in the nginx service script missing its leading `/`, which crashed Bazarr on startup
|
||||||
|
|
||||||
## 1.6.0 (2026-07-08)
|
## 1.6.0 (2026-07-08)
|
||||||
|
|
||||||
- Update to latest version from linuxserver/docker-bazarr (changelog : https://github.com/linuxserver/docker-bazarr/releases)
|
- Update to latest version from linuxserver/docker-bazarr (changelog : https://github.com/linuxserver/docker-bazarr/releases)
|
||||||
|
|||||||
@@ -112,4 +112,4 @@ schema:
|
|||||||
slug: bazarr_nas
|
slug: bazarr_nas
|
||||||
udev: true
|
udev: true
|
||||||
url: https://github.com/alexbelgium/hassio-addons/tree/master/bazarr
|
url: https://github.com/alexbelgium/hassio-addons/tree/master/bazarr
|
||||||
version: "1.6.0"
|
version: "1.6.0.1"
|
||||||
|
|||||||
@@ -19,6 +19,19 @@ server {
|
|||||||
proxy_set_header Connection $http_connection;
|
proxy_set_header Connection $http_connection;
|
||||||
#auth_basic off;
|
#auth_basic off;
|
||||||
|
|
||||||
|
# Adjust Location headers in backend redirects
|
||||||
|
# Bazarr is Flask-based and answers /bazarr with a redirect to /bazarr/,
|
||||||
|
# made absolute against the Host nginx sends upstream, so it reads
|
||||||
|
# http://127.0.0.1:6767/bazarr/. proxy_redirect strips that prefix, and
|
||||||
|
# nginx then re-absolutises the result as $scheme://$host:$server_port/...
|
||||||
|
# i.e. http://<ha_host>:8099/bazarr/ -- blocked by the browser as mixed
|
||||||
|
# content inside the ingress iframe. absolute_redirect off keeps it
|
||||||
|
# relative; the proxy_redirect rules re-prefix it with the ingress entry
|
||||||
|
# (the second rule also covers a redirect that was relative already).
|
||||||
|
absolute_redirect off; # Do not add port to redirect
|
||||||
|
proxy_redirect http://127.0.0.1:6767/ %%ingress_entry%%/;
|
||||||
|
proxy_redirect / %%ingress_entry%%/;
|
||||||
|
|
||||||
# Correct base_url
|
# Correct base_url
|
||||||
proxy_set_header Accept-Encoding "";
|
proxy_set_header Accept-Encoding "";
|
||||||
sub_filter_once off;
|
sub_filter_once off;
|
||||||
|
|||||||
@@ -15,9 +15,10 @@ bashio::net.wait_for "$port" localhost 900
|
|||||||
if [ -f "$CONFIG_LOCATION" ]; then
|
if [ -f "$CONFIG_LOCATION" ]; then
|
||||||
if ! bashio::config.true "ingress_disabled"; then
|
if ! bashio::config.true "ingress_disabled"; then
|
||||||
if ! bashio::config.has_value "connection_mode" || [ "$(bashio::config 'connection_mode')" != "noingress_auth" ]; then
|
if ! bashio::config.has_value "connection_mode" || [ "$(bashio::config 'connection_mode')" != "noingress_auth" ]; then
|
||||||
if ! grep -q "base_url.*$slug" "$CONFIG_LOCATION"; then
|
if ! grep -q "base_url: /$slug" "$CONFIG_LOCATION"; then
|
||||||
bashio::log.warning "BaseUrl not set properly, restarting"
|
bashio::log.warning "BaseUrl not set properly, restarting"
|
||||||
sed -i "s/ base_url:.*/ base_url: $slug/" "$CONFIG_LOCATION"
|
# Must start with / for Flask blueprint registration
|
||||||
|
sed -i "s| base_url:.*| base_url: /$slug|" "$CONFIG_LOCATION"
|
||||||
bashio::addon.restart
|
bashio::addon.restart
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|||||||
Reference in New Issue
Block a user