From a3c4e4c6b65086f9c1af9569b9a771ef8320d917 Mon Sep 17 00:00:00 2001 From: jonaswinkler <17569239+jonaswinkler@users.noreply.github.com> Date: Tue, 6 Apr 2021 21:31:42 +0200 Subject: [PATCH] install script: configure time zone --- install-paperless-ng.sh | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/install-paperless-ng.sh b/install-paperless-ng.sh index c550d253c..39541dcc3 100755 --- a/install-paperless-ng.sh +++ b/install-paperless-ng.sh @@ -62,7 +62,7 @@ if [[ -z $(which docker-compose) ]] ; then exit 1 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. docker stats --no-stream 2>/dev/null 1>&2 if [ $? -ne 0 ] ; then @@ -73,6 +73,8 @@ if [ $? -ne 0 ] ; then sleep 3 fi +default_time_zone=$(timedatectl show -p Timezone --value) + set -e echo "" @@ -145,6 +147,15 @@ echo "" ask "Port" "8000" 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 "Database backend: PostgreSQL and SQLite are available. Use PostgreSQL" 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 echo "USERMAP_GID=$USERMAP_GID" fi + echo "PAPERLESS_ZIME_ZONE=$TIME_ZONE" echo "PAPERLESS_OCR_LANGUAGE=$OCR_LANGUAGE" echo "PAPERLESS_SECRET_KEY=$SECRET_KEY" if [[ ! " ${DEFAULT_LANGUAGES[@]} " =~ " ${OCR_LANGUAGE} " ]] ; then