1
0
mirror of https://github.com/gilbN/theme.park.git synced 2024-11-20 10:02:32 +01:00
theme.park/docker/root/etc/cont-init.d/50-config

66 lines
2.4 KiB
Plaintext
Raw Normal View History

2022-03-20 21:26:59 +01:00
#!/usr/bin/with-contenv bash
echo '
----------------------------------------------------------------------------------------
dP dP dP
88 88 88
d8888P 88d888b. .d8888b. 88d8b.d8b. .d8888b. 88d888b. .d8888b. 88d888b. 88 .dP
88 88 `88 88ooood8 88 88 88 88ooood8 88. `88 88 `88 88 `88 88888.
88 88 88 88. ... 88 88 88 88. ... 88. .88 88 88 88 88 `8b.
dP dP dP `88888P dP dP dP `88888P 88 88Y888P `88888P8 dP dP `YP
88
dP
Made by @gilbN
https://theme-park.dev
----------------------------------------------------------------------------------------'
2022-03-20 21:26:59 +01:00
# Display variables for troubleshooting
echo -e "[theme.park-init] Variables set:\\n\
2022-03-22 10:05:36 +01:00
PUID=${PUID}\\n\
PGID=${PGID}\\n\
TZ=${TZ}\\n\
TP_DOMAIN=${TP_DOMAIN}\\n\
TP_URLBASE=${TP_URLBASE}\\n"
2022-03-29 21:33:17 +02:00
# Remove forward slash
case ${TP_URLBASE} in
*"/"*)
TP_URLBASE=$(echo "${TP_URLBASE}" | sed 's/\///g')
;;
esac
2022-03-26 20:44:34 +01:00
DEFAULT='/defaults/default'
2022-03-29 21:33:17 +02:00
if [[ ${TP_URLBASE} ]]; then
if ! grep -q "${TP_URLBASE}" "${DEFAULT}"; then
sed -i "s/themepark/${TP_URLBASE}/g" ${DEFAULT}
fi
2022-03-29 21:33:17 +02:00
fi
2022-03-23 18:50:24 +01:00
cp /defaults/default /config/nginx/site-confs
2022-03-22 10:05:36 +01:00
# make our folders and links
mkdir -p \
/config/www/{css,resources} \
/config/docker-mods
2022-03-22 10:05:36 +01:00
echo '[theme.park-init] Copying theme files'
2022-03-22 10:05:36 +01:00
# copy theme files
cp -R /app/themepark/css /config/www
cp -R /app/themepark/resources /config/www
cp /app/themepark/index.html /config/www
cp /app/themepark/themes.py /config/www
2022-03-22 21:22:10 +01:00
cp /app/themepark/CNAME /config/www
2022-03-22 10:05:36 +01:00
echo '[theme.park-init] Copying mods into /config/docker-mods'
# copy mods
for folder in /app/themepark/docker-mods/*; do \
cp /app/themepark/docker-mods/"${folder##*/}"/root/etc/cont-init.d/98-themepark /config/docker-mods/98-themepark-"${folder##*/}"; \
done
echo '[theme.park-init] Running themes.py and creating CSS files'
2022-03-28 18:12:13 +02:00
python3 /config/www/themes.py
2022-03-22 10:05:36 +01:00
# permissions
chown -R abc:abc \
/config