fix: read add-on options via bashio instead of broken env substitution
This commit is contained in:
@@ -20,13 +20,6 @@ options:
|
|||||||
power: "medium"
|
power: "medium"
|
||||||
account_token: ""
|
account_token: ""
|
||||||
machine_name: ""
|
machine_name: ""
|
||||||
environment:
|
|
||||||
FAH_USER: "{user}"
|
|
||||||
TEAM: "{team}"
|
|
||||||
PASSKEY: "{passkey}"
|
|
||||||
POWER: "{power}"
|
|
||||||
ACCOUNT_TOKEN: "{account_token}"
|
|
||||||
MACHINE_NAME: "{machine_name}"
|
|
||||||
schema:
|
schema:
|
||||||
user: str?
|
user: str?
|
||||||
team: str
|
team: str
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
#!/usr/bin/with-contenv bash
|
#!/usr/bin/with-contenv bashio
|
||||||
# shellcheck shell=bash
|
# shellcheck shell=bash
|
||||||
|
|
||||||
declare -a args
|
declare -a args
|
||||||
@@ -8,37 +8,40 @@ args+=(--http-addresses "0.0.0.0:7396")
|
|||||||
args+=(--allow "0/0")
|
args+=(--allow "0/0")
|
||||||
|
|
||||||
# FAH account credentials
|
# FAH account credentials
|
||||||
if [[ -n "${FAH_USER}" ]]; then
|
FAH_USER=$(bashio::config 'user')
|
||||||
|
TEAM=$(bashio::config 'team')
|
||||||
|
PASSKEY=$(bashio::config 'passkey')
|
||||||
|
POWER=$(bashio::config 'power')
|
||||||
|
ACCOUNT_TOKEN=$(bashio::config 'account_token')
|
||||||
|
MACHINE_NAME=$(bashio::config 'machine_name')
|
||||||
|
|
||||||
|
if bashio::config.has_value 'user'; then
|
||||||
args+=(--user "${FAH_USER}")
|
args+=(--user "${FAH_USER}")
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ -n "${TEAM}" ]]; then
|
if bashio::config.has_value 'team'; then
|
||||||
args+=(--team "${TEAM}")
|
args+=(--team "${TEAM}")
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ -n "${PASSKEY}" ]]; then
|
if bashio::config.has_value 'passkey'; then
|
||||||
args+=(--passkey "${PASSKEY}")
|
args+=(--passkey "${PASSKEY}")
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Power level (light, medium, full)
|
args+=(--power "${POWER}")
|
||||||
if [[ -n "${POWER}" ]]; then
|
|
||||||
args+=(--power "${POWER}")
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Online account token (new FAH 8 account system)
|
if bashio::config.has_value 'account_token'; then
|
||||||
if [[ -n "${ACCOUNT_TOKEN}" ]]; then
|
|
||||||
args+=(--account-token "${ACCOUNT_TOKEN}")
|
args+=(--account-token "${ACCOUNT_TOKEN}")
|
||||||
if [[ -n "${MACHINE_NAME}" ]]; then
|
if bashio::config.has_value 'machine_name'; then
|
||||||
args+=(--machine-name "${MACHINE_NAME}")
|
args+=(--machine-name "${MACHINE_NAME}")
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ -z "${FAH_USER}" ]] && [[ -z "${ACCOUNT_TOKEN}" ]]; then
|
if ! bashio::config.has_value 'user' && ! bashio::config.has_value 'account_token'; then
|
||||||
echo "INFO: No FAH_USER or ACCOUNT_TOKEN set — folding anonymously."
|
bashio::log.info "No user or account_token set — folding anonymously."
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Run from /config so fah-client stores its data there
|
# Run from /config so fah-client stores its data there
|
||||||
mkdir -p /config
|
mkdir -p /config
|
||||||
cd /config || exit 1
|
cd /config || exit 1
|
||||||
|
|
||||||
exec /app/fah-client "${args[@]}" ${CLI_ARGS}
|
exec /app/fah-client "${args[@]}"
|
||||||
|
|||||||
Reference in New Issue
Block a user