diff --git a/prowlarr/Dockerfile b/prowlarr/Dockerfile new file mode 100644 index 00000000..a66c908c --- /dev/null +++ b/prowlarr/Dockerfile @@ -0,0 +1,7 @@ +FROM scratch + + LABEL maintainer="GilbN" + LABEL app="Prowlarr" + +#copy local files. +COPY root/ / \ No newline at end of file diff --git a/prowlarr/root/etc/cont-init.d/98-themepark b/prowlarr/root/etc/cont-init.d/98-themepark new file mode 100644 index 00000000..fd88d9ed --- /dev/null +++ b/prowlarr/root/etc/cont-init.d/98-themepark @@ -0,0 +1,48 @@ +#!/usr/bin/with-contenv bash + +echo '---------------------------' +echo '| Prowlarr theme.park Mod |' +echo '---------------------------' + +# Display variables for troubleshooting +echo -e "Variables set:\\n\ +'TP_DOMAIN'=${TP_DOMAIN}\\n\ +'TP_ADDON'=${TP_ADDON}\\n\ +'TP_THEME'=${TP_THEME}\\n" + +APP_FILEPATH='/app/prowlarr/bin/UI/index.html' +if [ "${TP_HOTIO}" = true ]; then + echo 'Changing to Hotio file path!' + APP_FILEPATH='/app/bin/UI/index.html' +fi + +# Set default +if [[ -z ${TP_DOMAIN} ]]; then + echo 'No domain set, defaulting to theme-park.dev' + TP_DOMAIN='theme-park.dev' +fi + +case ${TP_DOMAIN} in + *"github.io"*) + echo "Switching to github.io URL style" + TP_DOMAIN="${TP_DOMAIN}\/theme.park" + ;; +esac + +if [[ -z ${TP_THEME} ]]; then + echo 'No theme set, defaulting to organizr-dark' + TP_THEME='organizr-dark' +fi + +# Adding stylesheets +if ! grep -q "${TP_DOMAIN}" "${APP_FILEPATH}"; then + echo '---------------------------' + echo '| Adding the stylesheet |' + echo '---------------------------' + sed -i "s/<\/head>/<\/head> /g" "${APP_FILEPATH}" + printf 'Stylesheet set to %s\n' "${TP_THEME}" + if [[ -n ${TP_ADDON} ]]; then + sed -i "s/<\/head>/<\/head> /g" "${APP_FILEPATH}" + printf 'Added custom addon: %s\n\n' "${TP_ADDON}" + fi +fi \ No newline at end of file