feat(immich_frame): add multi-account support via Accounts list option

- Add Accounts list schema to config.yaml for multi-account support
- Make ApiKey and ImmichServerUrl optional when using Accounts list
- Generate Settings.yaml from addon options in 99-run.sh
- Fix /app/Config symlink direction for proper config persistence
- Set IMMICHFRAME_CONFIG_PATH for reliable config discovery
- Update README with multi-account documentation and examples
- Bump version to 1.0.32.0-2

Co-authored-by: alexbelgium <44178713+alexbelgium@users.noreply.github.com>
This commit is contained in:
copilot-swe-agent[bot]
2026-03-16 06:00:59 +00:00
parent c8cf6e0953
commit dcb1a08a8f
4 changed files with 72 additions and 9 deletions

View File

@@ -3,9 +3,45 @@
bashio::log.info "Starting Immich Frame"
mkdir -p /config/Config
if [ -f /app/Config ]; then
rm -r /app/Config
if [ -d /app/Config ] && [ ! -L /app/Config ]; then
cp -n /app/Config/* /config/Config/ 2>/dev/null || true
rm -rf /app/Config
fi
if [ ! -e /app/Config ]; then
ln -sf /config/Config /app/Config
fi
ln -sf /app/Config /config/Config
# Generate Settings.yaml from addon options for multi-account support
SETTINGS_FILE="/config/Config/Settings.yaml"
ACCOUNT_COUNT=$(jq '.Accounts | length' /data/options.json 2>/dev/null || echo 0)
if [ "$ACCOUNT_COUNT" -gt 0 ]; then
bashio::log.info "Configuring ${ACCOUNT_COUNT} account(s) from Accounts list"
{
echo "Accounts:"
for i in $(seq 0 $((ACCOUNT_COUNT - 1))); do
SERVER_URL=$(jq -r ".Accounts[${i}].ImmichServerUrl" /data/options.json)
API_KEY=$(jq -r ".Accounts[${i}].ApiKey" /data/options.json)
echo " - ImmichServerUrl: '${SERVER_URL}'"
echo " ApiKey: '${API_KEY}'"
bashio::log.info " Account $((i + 1)): ${SERVER_URL}"
done
} > "${SETTINGS_FILE}"
bashio::log.info "Settings.yaml generated at ${SETTINGS_FILE}"
elif bashio::config.has_value 'ApiKey' && bashio::config.has_value 'ImmichServerUrl'; then
bashio::log.info "Using single account configuration"
SERVER_URL=$(bashio::config 'ImmichServerUrl')
API_KEY=$(bashio::config 'ApiKey')
{
echo "Accounts:"
echo " - ImmichServerUrl: '${SERVER_URL}'"
echo " ApiKey: '${API_KEY}'"
} > "${SETTINGS_FILE}"
bashio::log.info "Settings.yaml generated at ${SETTINGS_FILE}"
else
bashio::log.fatal "No accounts configured! Set either 'Accounts' list or both 'ApiKey' and 'ImmichServerUrl'"
exit 1
fi
export IMMICHFRAME_CONFIG_PATH=/config/Config
exec dotnet ImmichFrame.WebApi.dll