Browse Source

duplicati docker mod

pull/270/head
GilbN 4 years ago
parent
commit
0156ed765b
  1. 7
      docker-mods/duplicati/Dockerfile
  2. 49
      docker-mods/duplicati/root/etc/cont-init.d/98-themepark

7
docker-mods/duplicati/Dockerfile

@ -0,0 +1,7 @@
FROM scratch
LABEL maintainer="GilbN"
LABEL app="Duplicati"
#copy local files.
COPY root/ /

49
docker-mods/duplicati/root/etc/cont-init.d/98-themepark

@ -0,0 +1,49 @@
#!/usr/bin/with-contenv bash
echo '----------------------------'
echo '| Duplicati theme.park Mod |'
echo '----------------------------'
APP_FILEPATH='/app/duplicati/webroot'
# Display variables for troubleshooting
echo -e "Variables set:\\n\
'APP_FILEPATH'=${APP_FILEPATH}\\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>/<link rel='stylesheet' href='https:\/\/${TP_DOMAIN}\/CSS\/themes\/duplicati\/duplicati-base.css'><\/head> /g" $1
sed -i "s/<\/head>/<link rel='stylesheet' href='https:\/\/${TP_DOMAIN}\/CSS\/variables\/${TP_THEME}.css'><\/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
Loading…
Cancel
Save