From b52ad3bdac080c85a3ee077bc7962dbc2d9ed22e Mon Sep 17 00:00:00 2001 From: retr0 Date: Sun, 5 Apr 2026 12:08:40 +0200 Subject: [PATCH] fix: read add-on options via bashio instead of broken env substitution --- config.yaml | 7 ----- .../s6-overlay/s6-rc.d/svc-foldingathome/run | 31 ++++++++++--------- 2 files changed, 17 insertions(+), 21 deletions(-) diff --git a/config.yaml b/config.yaml index f746b32..2134034 100644 --- a/config.yaml +++ b/config.yaml @@ -20,13 +20,6 @@ options: power: "medium" account_token: "" machine_name: "" -environment: - FAH_USER: "{user}" - TEAM: "{team}" - PASSKEY: "{passkey}" - POWER: "{power}" - ACCOUNT_TOKEN: "{account_token}" - MACHINE_NAME: "{machine_name}" schema: user: str? team: str diff --git a/root/etc/s6-overlay/s6-rc.d/svc-foldingathome/run b/root/etc/s6-overlay/s6-rc.d/svc-foldingathome/run index 0bcfa3a..853200a 100755 --- a/root/etc/s6-overlay/s6-rc.d/svc-foldingathome/run +++ b/root/etc/s6-overlay/s6-rc.d/svc-foldingathome/run @@ -1,4 +1,4 @@ -#!/usr/bin/with-contenv bash +#!/usr/bin/with-contenv bashio # shellcheck shell=bash declare -a args @@ -8,37 +8,40 @@ args+=(--http-addresses "0.0.0.0:7396") args+=(--allow "0/0") # 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}") fi -if [[ -n "${TEAM}" ]]; then +if bashio::config.has_value 'team'; then args+=(--team "${TEAM}") fi -if [[ -n "${PASSKEY}" ]]; then +if bashio::config.has_value 'passkey'; then args+=(--passkey "${PASSKEY}") fi -# Power level (light, medium, full) -if [[ -n "${POWER}" ]]; then - args+=(--power "${POWER}") -fi +args+=(--power "${POWER}") -# Online account token (new FAH 8 account system) -if [[ -n "${ACCOUNT_TOKEN}" ]]; then +if bashio::config.has_value 'account_token'; then args+=(--account-token "${ACCOUNT_TOKEN}") - if [[ -n "${MACHINE_NAME}" ]]; then + if bashio::config.has_value 'machine_name'; then args+=(--machine-name "${MACHINE_NAME}") fi fi -if [[ -z "${FAH_USER}" ]] && [[ -z "${ACCOUNT_TOKEN}" ]]; then - echo "INFO: No FAH_USER or ACCOUNT_TOKEN set — folding anonymously." +if ! bashio::config.has_value 'user' && ! bashio::config.has_value 'account_token'; then + bashio::log.info "No user or account_token set — folding anonymously." fi # Run from /config so fah-client stores its data there mkdir -p /config cd /config || exit 1 -exec /app/fah-client "${args[@]}" ${CLI_ARGS} +exec /app/fah-client "${args[@]}"