From bfaacbe0e62b276549cb5561e6a0b8a919ff0a11 Mon Sep 17 00:00:00 2001 From: Steven Kreitzer Date: Sun, 6 Aug 2023 17:34:21 -0500 Subject: [PATCH] feat: arr theme env variables --- apps/lidarr/config.xml.tmpl | 1 + apps/lidarr/entrypoint.sh | 2 ++ apps/prowlarr/config.xml.tmpl | 1 + apps/prowlarr/entrypoint.sh | 2 ++ apps/radarr/config.xml.tmpl | 1 + apps/radarr/entrypoint.sh | 2 ++ apps/radarr/zeus/config.xml.tmpl | 1 + apps/radarr/zeus/entrypoint.sh | 2 ++ apps/readarr/config.xml.tmpl | 1 + apps/readarr/entrypoint.sh | 2 ++ apps/sonarr/config.xml.tmpl | 1 + apps/sonarr/develop/config.xml.tmpl | 1 + apps/sonarr/develop/entrypoint.sh | 2 ++ apps/sonarr/entrypoint.sh | 2 ++ 14 files changed, 21 insertions(+) diff --git a/apps/lidarr/config.xml.tmpl b/apps/lidarr/config.xml.tmpl index 5e0efcbe..f93528c4 100644 --- a/apps/lidarr/config.xml.tmpl +++ b/apps/lidarr/config.xml.tmpl @@ -21,4 +21,5 @@ BuiltIn ${LIDARR__ANALYTICS_ENABLED} + ${LIDARR__THEME:-auto} diff --git a/apps/lidarr/entrypoint.sh b/apps/lidarr/entrypoint.sh index 86000bde..149497e7 100755 --- a/apps/lidarr/entrypoint.sh +++ b/apps/lidarr/entrypoint.sh @@ -19,6 +19,7 @@ if [[ -f /config/config.xml ]]; then current_postgres_host="$(xmlstarlet sel -t -v "//PostgresHost" -nl /config/config.xml)" current_postgres_main_db="$(xmlstarlet sel -t -v "//PostgresMainDb" -nl /config/config.xml)" current_postgres_log_db="$(xmlstarlet sel -t -v "//PostgresLogDb" -nl /config/config.xml)" + current_theme="$(xmlstarlet sel -t -v "//Theme" -nl /config/config.xml)" fi # Update config.xml with environment variables @@ -39,6 +40,7 @@ envsubst < /app/config.xml.tmpl > /config/config.xml [[ -z "${LIDARR__POSTGRES_HOST}" && -n "${current_postgres_host}" ]] && xmlstarlet edit --inplace --update //PostgresHost -v "${current_postgres_host}" /config/config.xml [[ -z "${LIDARR__POSTGRES_MAIN_DB}" && -n "${current_postgres_main_db}" ]] && xmlstarlet edit --inplace --update //PostgresMainDb -v "${current_postgres_main_db}" /config/config.xml [[ -z "${LIDARR__POSTGRES_LOG_DB}" && -n "${current_postgres_log_db}" ]] && xmlstarlet edit --inplace --update //PostgresLogDb -v "${current_postgres_log_db}" /config/config.xml +[[ -z "${LIDARR__THEME}" && -n "${current_theme}" ]] && xmlstarlet edit --inplace --update //Theme -v "${current_theme}" /config/config.xml # BindAddress, LaunchBrowser, Port, EnableSsl, SslPort, SslCertPath, SslCertPassword, UpdateMechanism # have been omited because their configuration is not really needed in a container environment diff --git a/apps/prowlarr/config.xml.tmpl b/apps/prowlarr/config.xml.tmpl index 7056187a..aac35be4 100644 --- a/apps/prowlarr/config.xml.tmpl +++ b/apps/prowlarr/config.xml.tmpl @@ -21,4 +21,5 @@ BuiltIn ${PROWLARR__ANALYTICS_ENABLED} + ${PROWLARR__THEME:-auto} diff --git a/apps/prowlarr/entrypoint.sh b/apps/prowlarr/entrypoint.sh index 22974258..69a7041d 100755 --- a/apps/prowlarr/entrypoint.sh +++ b/apps/prowlarr/entrypoint.sh @@ -19,6 +19,7 @@ if [[ -f /config/config.xml ]]; then current_postgres_host="$(xmlstarlet sel -t -v "//PostgresHost" -nl /config/config.xml)" current_postgres_main_db="$(xmlstarlet sel -t -v "//PostgresMainDb" -nl /config/config.xml)" current_postgres_log_db="$(xmlstarlet sel -t -v "//PostgresLogDb" -nl /config/config.xml)" + current_theme="$(xmlstarlet sel -t -v "//Theme" -nl /config/config.xml)" fi # Update config.xml with environment variables @@ -39,6 +40,7 @@ envsubst < /app/config.xml.tmpl > /config/config.xml [[ -z "${PROWLARR__POSTGRES_HOST}" && -n "${current_postgres_host}" ]] && xmlstarlet edit --inplace --update //PostgresHost -v "${current_postgres_host}" /config/config.xml [[ -z "${PROWLARR__POSTGRES_MAIN_DB}" && -n "${current_postgres_main_db}" ]] && xmlstarlet edit --inplace --update //PostgresMainDb -v "${current_postgres_main_db}" /config/config.xml [[ -z "${PROWLARR__POSTGRES_LOG_DB}" && -n "${current_postgres_log_db}" ]] && xmlstarlet edit --inplace --update //PostgresLogDb -v "${current_postgres_log_db}" /config/config.xml +[[ -z "${PROWLARR__THEME}" && -n "${current_theme}" ]] && xmlstarlet edit --inplace --update //Theme -v "${current_theme}" /config/config.xml # BindAddress, LaunchBrowser, Port, EnableSsl, SslPort, SslCertPath, SslCertPassword, UpdateMechanism # have been omited because their configuration is not really needed in a container environment diff --git a/apps/radarr/config.xml.tmpl b/apps/radarr/config.xml.tmpl index a09ace62..70c0becc 100644 --- a/apps/radarr/config.xml.tmpl +++ b/apps/radarr/config.xml.tmpl @@ -21,4 +21,5 @@ BuiltIn ${RADARR__ANALYTICS_ENABLED} + ${RADARR__THEME:-auto} diff --git a/apps/radarr/entrypoint.sh b/apps/radarr/entrypoint.sh index 05705c2a..3730bf9c 100755 --- a/apps/radarr/entrypoint.sh +++ b/apps/radarr/entrypoint.sh @@ -19,6 +19,7 @@ if [[ -f /config/config.xml ]]; then current_postgres_host="$(xmlstarlet sel -t -v "//PostgresHost" -nl /config/config.xml)" current_postgres_main_db="$(xmlstarlet sel -t -v "//PostgresMainDb" -nl /config/config.xml)" current_postgres_log_db="$(xmlstarlet sel -t -v "//PostgresLogDb" -nl /config/config.xml)" + current_theme="$(xmlstarlet sel -t -v "//Theme" -nl /config/config.xml)" fi # Update config.xml with environment variables @@ -39,6 +40,7 @@ envsubst < /app/config.xml.tmpl > /config/config.xml [[ -z "${RADARR__POSTGRES_HOST}" && -n "${current_postgres_host}" ]] && xmlstarlet edit --inplace --update //PostgresHost -v "${current_postgres_host}" /config/config.xml [[ -z "${RADARR__POSTGRES_MAIN_DB}" && -n "${current_postgres_main_db}" ]] && xmlstarlet edit --inplace --update //PostgresMainDb -v "${current_postgres_main_db}" /config/config.xml [[ -z "${RADARR__POSTGRES_LOG_DB}" && -n "${current_postgres_log_db}" ]] && xmlstarlet edit --inplace --update //PostgresLogDb -v "${current_postgres_log_db}" /config/config.xml +[[ -z "${RADARR__THEME}" && -n "${current_theme}" ]] && xmlstarlet edit --inplace --update //Theme -v "${current_theme}" /config/config.xml # BindAddress, LaunchBrowser, Port, EnableSsl, SslPort, SslCertPath, SslCertPassword, UpdateMechanism # have been omited because their configuration is not really needed in a container environment diff --git a/apps/radarr/zeus/config.xml.tmpl b/apps/radarr/zeus/config.xml.tmpl index ec998d05..021c1043 100644 --- a/apps/radarr/zeus/config.xml.tmpl +++ b/apps/radarr/zeus/config.xml.tmpl @@ -21,4 +21,5 @@ 6969 BuiltIn ${RADARR__URL_BASE} + ${RADARR__THEME:-auto} diff --git a/apps/radarr/zeus/entrypoint.sh b/apps/radarr/zeus/entrypoint.sh index 668e94df..8f4c11cb 100755 --- a/apps/radarr/zeus/entrypoint.sh +++ b/apps/radarr/zeus/entrypoint.sh @@ -19,6 +19,7 @@ if [[ -f /config/config.xml ]]; then current_postgres_port="$(xmlstarlet sel -t -v "//PostgresPort" -nl /config/config.xml)" current_postgres_user="$(xmlstarlet sel -t -v "//PostgresUser" -nl /config/config.xml)" current_url_base="$(xmlstarlet sel -t -v "//UrlBase" -nl /config/config.xml)" + current_theme="$(xmlstarlet sel -t -v "//Theme" -nl /config/config.xml)" fi # Update config.xml with environment variables @@ -39,6 +40,7 @@ envsubst < /app/config.xml.tmpl > /config/config.xml [[ -z "${RADARR__POSTGRES_PORT}" && -n "${current_postgres_port}" ]] && xmlstarlet edit --inplace --update //PostgresPort -v "${current_postgres_port}" /config/config.xml [[ -z "${RADARR__POSTGRES_USER}" && -n "${current_postgres_user}" ]] && xmlstarlet edit --inplace --update //PostgresUser -v "${current_postgres_user}" /config/config.xml [[ -z "${RADARR__URL_BASE}" && -n "${current_url_base}" ]] && xmlstarlet edit --inplace --update //UrlBase -v "${current_url_base}" /config/config.xml +[[ -z "${RADARR__THEME}" && -n "${current_theme}" ]] && xmlstarlet edit --inplace --update //Theme -v "${current_theme}" /config/config.xml # BindAddress, LaunchBrowser, Port, EnableSsl, SslPort, SslCertPath, SslCertPassword, UpdateMechanism # have been omited because their configuration is not really needed in a container environment diff --git a/apps/readarr/config.xml.tmpl b/apps/readarr/config.xml.tmpl index a8e1d9bd..544fe5cb 100644 --- a/apps/readarr/config.xml.tmpl +++ b/apps/readarr/config.xml.tmpl @@ -22,4 +22,5 @@ BuiltIn ${READARR__ANALYTICS_ENABLED} + ${READARR__THEME:-auto} diff --git a/apps/readarr/entrypoint.sh b/apps/readarr/entrypoint.sh index 0642f77f..309fca7d 100755 --- a/apps/readarr/entrypoint.sh +++ b/apps/readarr/entrypoint.sh @@ -20,6 +20,7 @@ if [[ -f /config/config.xml ]]; then current_postgres_main_db="$(xmlstarlet sel -t -v "//PostgresMainDb" -nl /config/config.xml)" current_postgres_log_db="$(xmlstarlet sel -t -v "//PostgresLogDb" -nl /config/config.xml)" current_postgres_cache_db="$(xmlstarlet sel -t -v "//PostgresCacheDb" -nl /config/config.xml)" + current_theme="$(xmlstarlet sel -t -v "//Theme" -nl /config/config.xml)" fi # Update config.xml with environment variables @@ -41,6 +42,7 @@ envsubst < /app/config.xml.tmpl > /config/config.xml [[ -z "${READARR__POSTGRES_MAIN_DB}" && -n "${current_postgres_main_db}" ]] && xmlstarlet edit --inplace --update //PostgresMainDb -v "${current_postgres_main_db}" /config/config.xml [[ -z "${READARR__POSTGRES_LOG_DB}" && -n "${current_postgres_log_db}" ]] && xmlstarlet edit --inplace --update //PostgresLogDb -v "${current_postgres_log_db}" /config/config.xml [[ -z "${READARR__POSTGRES_CACHE_DB}" && -n "${current_postgres_cache_db}" ]] && xmlstarlet edit --inplace --update //PostgresCacheDb -v "${current_postgres_cache_db}" /config/config.xml +[[ -z "${READARR__THEME}" && -n "${current_theme}" ]] && xmlstarlet edit --inplace --update //Theme -v "${current_theme}" /config/config.xml # BindAddress, LaunchBrowser, Port, EnableSsl, SslPort, SslCertPath, SslCertPassword, UpdateMechanism # have been omited because their configuration is not really needed in a container environment diff --git a/apps/sonarr/config.xml.tmpl b/apps/sonarr/config.xml.tmpl index acab4a6b..d024c4c3 100644 --- a/apps/sonarr/config.xml.tmpl +++ b/apps/sonarr/config.xml.tmpl @@ -21,4 +21,5 @@ BuiltIn ${SONARR__ANALYTICS_ENABLED} + ${SONARR__THEME:-auto} diff --git a/apps/sonarr/develop/config.xml.tmpl b/apps/sonarr/develop/config.xml.tmpl index 064e93db..d0d7eef3 100644 --- a/apps/sonarr/develop/config.xml.tmpl +++ b/apps/sonarr/develop/config.xml.tmpl @@ -21,4 +21,5 @@ BuiltIn ${SONARR__ANALYTICS_ENABLED} + ${SONARR__THEME:-auto} diff --git a/apps/sonarr/develop/entrypoint.sh b/apps/sonarr/develop/entrypoint.sh index 18328a5e..22e6ca7a 100755 --- a/apps/sonarr/develop/entrypoint.sh +++ b/apps/sonarr/develop/entrypoint.sh @@ -19,6 +19,7 @@ if [[ -f /config/config.xml ]]; then current_postgres_host="$(xmlstarlet sel -t -v "//PostgresHost" -nl /config/config.xml)" current_postgres_main_db="$(xmlstarlet sel -t -v "//PostgresMainDb" -nl /config/config.xml)" current_postgres_log_db="$(xmlstarlet sel -t -v "//PostgresLogDb" -nl /config/config.xml)" + current_theme="$(xmlstarlet sel -t -v "//Theme" -nl /config/config.xml)" fi # Update config.xml with environment variables @@ -39,6 +40,7 @@ envsubst < /app/config.xml.tmpl > /config/config.xml [[ -z "${SONARR__POSTGRES_HOST}" && -n "${current_postgres_host}" ]] && xmlstarlet edit --inplace --update //PostgresHost -v "${current_postgres_host}" /config/config.xml [[ -z "${SONARR__POSTGRES_MAIN_DB}" && -n "${current_postgres_main_db}" ]] && xmlstarlet edit --inplace --update //PostgresMainDb -v "${current_postgres_main_db}" /config/config.xml [[ -z "${SONARR__POSTGRES_LOG_DB}" && -n "${current_postgres_log_db}" ]] && xmlstarlet edit --inplace --update //PostgresLogDb -v "${current_postgres_log_db}" /config/config.xml +[[ -z "${SONARR__THEME}" && -n "${current_theme}" ]] && xmlstarlet edit --inplace --update //Theme -v "${current_theme}" /config/config.xml # BindAddress, LaunchBrowser, Port, EnableSsl, SslPort, SslCertPath, SslCertPassword, UpdateMechanism # have been omited because their configuration is not really needed in a container environment diff --git a/apps/sonarr/entrypoint.sh b/apps/sonarr/entrypoint.sh index e1ba7b32..4503d71d 100755 --- a/apps/sonarr/entrypoint.sh +++ b/apps/sonarr/entrypoint.sh @@ -19,6 +19,7 @@ if [[ -f /config/config.xml ]]; then current_postgres_host="$(xmlstarlet sel -t -v "//PostgresHost" -nl /config/config.xml)" current_postgres_main_db="$(xmlstarlet sel -t -v "//PostgresMainDb" -nl /config/config.xml)" current_postgres_log_db="$(xmlstarlet sel -t -v "//PostgresLogDb" -nl /config/config.xml)" + current_theme="$(xmlstarlet sel -t -v "//Theme" -nl /config/config.xml)" fi # Update config.xml with environment variables @@ -39,6 +40,7 @@ envsubst < /app/config.xml.tmpl > /config/config.xml [[ -z "${SONARR__POSTGRES_HOST}" && -n "${current_postgres_host}" ]] && xmlstarlet edit --inplace --update //PostgresHost -v "${current_postgres_host}" /config/config.xml [[ -z "${SONARR__POSTGRES_MAIN_DB}" && -n "${current_postgres_main_db}" ]] && xmlstarlet edit --inplace --update //PostgresMainDb -v "${current_postgres_main_db}" /config/config.xml [[ -z "${SONARR__POSTGRES_LOG_DB}" && -n "${current_postgres_log_db}" ]] && xmlstarlet edit --inplace --update //PostgresLogDb -v "${current_postgres_log_db}" /config/config.xml +[[ -z "${SONARR__THEME}" && -n "${current_theme}" ]] && xmlstarlet edit --inplace --update //Theme -v "${current_theme}" /config/config.xml # BindAddress, LaunchBrowser, Port, EnableSsl, SslPort, SslCertPath, SslCertPassword, UpdateMechanism # have been omited because their configuration is not really needed in a container environment