Files
docker-sigal/run.sh

32 lines
1.0 KiB
Bash
Raw Normal View History

2016-08-29 15:51:09 +02:00
#!/bin/bash
2023-08-13 23:11:46 +02:00
if [[ -n "$HTPASSWD" ]]
2016-08-29 15:51:09 +02:00
then
cp auth.conf /etc/nginx/conf.d/default.conf
envsubst < auth.htpasswd > /etc/nginx/auth.htpasswd
fi
2023-08-13 23:11:46 +02:00
if [[ ! -f /config/sigal.conf.py ]] ; then
sed -E 's@#? *source = .*$@source = "/pictures"@' \
"$(find /usr -name sigal.conf.py)" | \
sed -E 's@#? *destination = .*$@destination = "/usr/share/nginx/html"@'| \
sed -E 's@#? *keep_orig = .*$@keep_orig = True@' | \
sed -E 's@#? *zip_gallery = .*$@zip_gallery = "archive.zip"@' | \
sed -E 's@#? *orig_link = .*$@orig_link = True@' | \
sed -E 's@quality: *[0-9]+ *,$@quality: '$JPEG_QUALITY',@' \
> /config/sigal.conf.py
fi
build_sigal
if [[ -n "$CRONJOB" ]]
then
( echo "${CRONJOB} root /usr/local/bin/build_sigal 2>&1 > /dev/null" > /etc/cron.d/sigal \
&& echo "Create sigal build crontab" ) 2>&1 | /usr/bin/ts '%Y/%m/%d %H:%M:%S [cronjob]:'
service cron start 2>&1 | /usr/bin/ts '%Y/%m/%d %H:%M:%S [cronjob]:'
fi
2020-09-23 13:19:36 +02:00
exec nginx -g "daemon off;"
2016-08-29 15:51:09 +02:00