install script: configure time zone

This commit is contained in:
jonaswinkler 2021-04-06 21:31:42 +02:00
parent 645297d68c
commit a3c4e4c6b6

View File

@ -62,7 +62,7 @@ if [[ -z $(which docker-compose) ]] ; then
exit 1 exit 1
fi fi
# Check if user has permissions to run Docker by trying to get the status of Docker (docker status). # Check if user has permissions to run Docker by trying to get the status of Docker (docker status).
# If this fails, the user probably does not have permissions for Docker. # If this fails, the user probably does not have permissions for Docker.
docker stats --no-stream 2>/dev/null 1>&2 docker stats --no-stream 2>/dev/null 1>&2
if [ $? -ne 0 ] ; then if [ $? -ne 0 ] ; then
@ -73,6 +73,8 @@ if [ $? -ne 0 ] ; then
sleep 3 sleep 3
fi fi
default_time_zone=$(timedatectl show -p Timezone --value)
set -e set -e
echo "" echo ""
@ -145,6 +147,15 @@ echo ""
ask "Port" "8000" ask "Port" "8000"
PORT=$ask_result PORT=$ask_result
echo ""
echo "Paperless requires you to configure the current time zone correctly."
echo "Otherwise, the dates of your documents may appear off by one day,"
echo "depending on where you are on earth."
echo ""
ask "Current time zone" "$default_time_zone"
TIME_ZONE=$ask_result
echo "" echo ""
echo "Database backend: PostgreSQL and SQLite are available. Use PostgreSQL" echo "Database backend: PostgreSQL and SQLite are available. Use PostgreSQL"
echo "if unsure. If you're running on a low-power device such as Raspberry" echo "if unsure. If you're running on a low-power device such as Raspberry"
@ -280,6 +291,7 @@ DEFAULT_LANGUAGES="deu eng fra ita spa"
if [[ ! $USERMAP_GID == "1000" ]] ; then if [[ ! $USERMAP_GID == "1000" ]] ; then
echo "USERMAP_GID=$USERMAP_GID" echo "USERMAP_GID=$USERMAP_GID"
fi fi
echo "PAPERLESS_ZIME_ZONE=$TIME_ZONE"
echo "PAPERLESS_OCR_LANGUAGE=$OCR_LANGUAGE" echo "PAPERLESS_OCR_LANGUAGE=$OCR_LANGUAGE"
echo "PAPERLESS_SECRET_KEY=$SECRET_KEY" echo "PAPERLESS_SECRET_KEY=$SECRET_KEY"
if [[ ! " ${DEFAULT_LANGUAGES[@]} " =~ " ${OCR_LANGUAGE} " ]] ; then if [[ ! " ${DEFAULT_LANGUAGES[@]} " =~ " ${OCR_LANGUAGE} " ]] ; then