#!/usr/bin/with-contenv bash echo '------------------' echo '| theme.park |' echo '------------------' # Display variables for troubleshooting echo -e "Variables set:\\n\ PUID=${PUID}\\n\ PGID=${PGID}\\n\ TZ=${TZ}\\n\ TP_SCHEME=${TP_SCHEME}\\n\ TP_DOMAIN=${TP_DOMAIN}\\n" if [[ -z ${TP_DOMAIN} ]]; then echo 'No domain set, defaulting to $http_host' TP_DOMAIN='$http_host' fi if [[ -z ${TP_SCHEME} ]]; then echo 'No scheme set, defaulting to https' TP_SCHEME='https' fi DEFAULT='/defaults/default' sed -i "s/sub_filter 'https:\/\/theme-park.dev' https:\/\/TP_DOMAIN;/sub_filter 'https:\/\/theme-park.dev' ${TP_SCHEME}:\/\/${TP_DOMAIN}; /g" ${DEFAULT} sed -i "s/sub_filter 'http:\/\/theme-park.dev' http:\/\/TP_DOMAIN;/sub_filter 'http:\/\/theme-park.dev' ${TP_SCHEME}:\/\/${TP_DOMAIN}; /g" ${DEFAULT} sed -i "s/sub_filter 'https:\/\/develop.theme-park.dev' https:\/\/TP_DOMAIN;/sub_filter 'https:\/\/develop.theme-park.dev' ${TP_SCHEME}:\/\/${TP_DOMAIN}; /g" ${DEFAULT} sed -i "s/sub_filter 'http:\/\/develop.theme-park.dev' http:\/\/TP_DOMAIN;/sub_filter 'http:\/\/develop.theme-park.dev' ${TP_SCHEME}:\/\/${TP_DOMAIN}; /g" ${DEFAULT} cp /defaults/default /config/nginx/site-confs # make our folders and links mkdir -p \ /config/www/{css,resources} # 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 cp /app/themepark/CNAME /config/www # permissions chown -R abc:abc \ /config