From 74deb0b9b5764301bbffdd975abc5abce7c6f3e8 Mon Sep 17 00:00:00 2001 From: GilbN Date: Mon, 27 Sep 2021 21:56:39 +0000 Subject: [PATCH] deploy: b66cd4ebe36fa13edaead9f413b741846faf95aa --- README.md | 4 +- docker-mods/mylar3/Dockerfile | 7 +++ .../mylar3/root/etc/cont-init.d/98-themepark | 54 +++++++++++++++++++ 3 files changed, 63 insertions(+), 2 deletions(-) create mode 100644 docker-mods/mylar3/Dockerfile create mode 100644 docker-mods/mylar3/root/etc/cont-init.d/98-themepark diff --git a/README.md b/README.md index 462bf378..960ed919 100644 --- a/README.md +++ b/README.md @@ -264,8 +264,8 @@

Uptime Kuma

-

-

Mylar 3

+

+

Mylar 3

diff --git a/docker-mods/mylar3/Dockerfile b/docker-mods/mylar3/Dockerfile new file mode 100644 index 00000000..72ac169f --- /dev/null +++ b/docker-mods/mylar3/Dockerfile @@ -0,0 +1,7 @@ +FROM scratch + + +LABEL maintainer="GilbN" +LABEL app="Mylar3" +#copy local files. +COPY root/ / \ No newline at end of file diff --git a/docker-mods/mylar3/root/etc/cont-init.d/98-themepark b/docker-mods/mylar3/root/etc/cont-init.d/98-themepark new file mode 100644 index 00000000..e5896255 --- /dev/null +++ b/docker-mods/mylar3/root/etc/cont-init.d/98-themepark @@ -0,0 +1,54 @@ +#!/usr/bin/with-contenv bash + +echo '-------------------------' +echo '| Mylar3 theme.park Mod |' +echo '-------------------------' + +APP_FILEPATH='/app/mylar3/data/interfaces/default' +if [ "${TP_HOTIO}" = true ]; then + echo 'Changing to Hotio file path!' + APP_FILEPATH='/app/data/interfaces/default' +fi + +# Display variables for troubleshooting +echo -e "Variables set:\\n\ +'APP_FILEPATH'=${APP_FILEPATH}\\n\ +'TP_HOTIO'=${TP_HOTIO}\\n\ +'TP_DOMAIN'=${TP_DOMAIN}\\n\ +'TP_THEME'=${TP_THEME}\\n" + +# 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 + +sed_file(){ + sed -i "s/<\/head>/<\/head> /g" $1 + sed -i "s/<\/head>/<\/head> /g" $1 + printf 'Stylesheet set to %s on %s\n\n' "${TP_THEME}" "$1" +} + +# Adding stylesheets +echo '---------------------------------------' +echo '| Adding the stylesheet to html files |' +echo '---------------------------------------' + +if ! grep -q "${TP_DOMAIN}" "${APP_FILEPATH}/index.html"; then + find ${APP_FILEPATH} -type f -iname *.html | while read fname + do + sed_file $fname + done +fi