From 02dd7ec615e914009468282a219e44880514308d Mon Sep 17 00:00:00 2001 From: Starbeamrainbowlabs Date: Wed, 7 Apr 2021 23:19:06 +0100 Subject: [PATCH 1/7] docker: mark scripts as executable --- docker/docker-entrypoint.sh | 0 docker/management_script.sh | 0 2 files changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 docker/docker-entrypoint.sh mode change 100644 => 100755 docker/management_script.sh diff --git a/docker/docker-entrypoint.sh b/docker/docker-entrypoint.sh old mode 100644 new mode 100755 diff --git a/docker/management_script.sh b/docker/management_script.sh old mode 100644 new mode 100755 From dd7c5da256594a22534611df1b7042f1ec2b916f Mon Sep 17 00:00:00 2001 From: Starbeamrainbowlabs Date: Thu, 8 Apr 2021 00:03:55 +0100 Subject: [PATCH 2/7] docker-entrypoint.sh: split non-root tasks into docker-prepare.sh --- Dockerfile | 1 + docker/docker-entrypoint.sh | 75 +++---------------------------------- docker/docker-prepare.sh | 68 +++++++++++++++++++++++++++++++++ 3 files changed, 74 insertions(+), 70 deletions(-) create mode 100755 docker/docker-prepare.sh diff --git a/Dockerfile b/Dockerfile index e41aeb7ac..332a56aba 100644 --- a/Dockerfile +++ b/Dockerfile @@ -78,6 +78,7 @@ RUN cd docker \ && mkdir /var/log/supervisord /var/run/supervisord \ && cp supervisord.conf /etc/supervisord.conf \ && cp docker-entrypoint.sh /sbin/docker-entrypoint.sh \ + && cp docker-prepare.sh /sbin/docker-prepare.sh \ && chmod 755 /sbin/docker-entrypoint.sh \ && chmod +x install_management_commands.sh \ && ./install_management_commands.sh \ diff --git a/docker/docker-entrypoint.sh b/docker/docker-entrypoint.sh index cf6129438..5b0389b96 100755 --- a/docker/docker-entrypoint.sh +++ b/docker/docker-entrypoint.sh @@ -15,70 +15,6 @@ map_uidgid() { fi } - -wait_for_postgres() { - attempt_num=1 - max_attempts=5 - - echo "Waiting for PostgreSQL to start..." - - host="${PAPERLESS_DBHOST}" - port="${PAPERLESS_DBPORT}" - - if [[ -z $port ]] ; - then - port="5432" - fi - - while !/usr/src/paperless/data/migration_lock - -} - -search_index() { - index_version=1 - index_version_file=/usr/src/paperless/data/.index_version - - if [[ (! -f "$index_version_file") || $(< $index_version_file) != "$index_version" ]]; then - echo "Search index out of date. Updating..." - sudo -HEu paperless python3 manage.py document_index reindex - echo $index_version | sudo -HEu paperless tee $index_version_file >/dev/null - fi -} - initialize() { map_uidgid @@ -92,13 +28,13 @@ initialize() { echo "creating directory /tmp/paperless" mkdir -p /tmp/paperless - + + set +e chown -R paperless:paperless ../ chown -R paperless:paperless /tmp/paperless - - migrations - - search_index + set -e + + sudo -HEu paperless /sbin/docker-prepare.sh } install_languages() { @@ -154,4 +90,3 @@ else echo Executing "$@" exec "$@" fi - diff --git a/docker/docker-prepare.sh b/docker/docker-prepare.sh new file mode 100755 index 000000000..fd32d0a7e --- /dev/null +++ b/docker/docker-prepare.sh @@ -0,0 +1,68 @@ +#!/usr/bin/env bash + +wait_for_postgres() { + attempt_num=1 + max_attempts=5 + + echo "Waiting for PostgreSQL to start..." + + host="${PAPERLESS_DBHOST}" + port="${PAPERLESS_DBPORT}" + + if [[ -z $port ]] ; + then + port="5432" + fi + + while !/usr/src/paperless/data/migration_lock +} + +search_index() { + index_version=1 + index_version_file=/usr/src/paperless/data/.index_version + + if [[ (! -f "$index_version_file") || $(< $index_version_file) != "$index_version" ]]; then + echo "Search index out of date. Updating..." + python3 manage.py document_index reindex + echo $index_version | sudo -HEu paperless tee $index_version_file >/dev/null + fi +} + +do_work() { + migrations; + + search_index; +} + +do_work; From b761a549c010689b3f2e361314237595a79116fe Mon Sep 17 00:00:00 2001 From: Starbeamrainbowlabs Date: Thu, 8 Apr 2021 03:06:01 +0100 Subject: [PATCH 3/7] docker-prepare.sh: remove rogue instances of sudo This is being done by calling the script as the correct user in the first place. --- docker/docker-prepare.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docker/docker-prepare.sh b/docker/docker-prepare.sh index fd32d0a7e..53f5201e4 100755 --- a/docker/docker-prepare.sh +++ b/docker/docker-prepare.sh @@ -44,7 +44,7 @@ migrations() { # of the current container starts. flock 200 echo "Apply database migrations..." - sudo -HEu paperless python3 manage.py migrate + python3 manage.py migrate ) 200>/usr/src/paperless/data/migration_lock } @@ -55,7 +55,7 @@ search_index() { if [[ (! -f "$index_version_file") || $(< $index_version_file) != "$index_version" ]]; then echo "Search index out of date. Updating..." python3 manage.py document_index reindex - echo $index_version | sudo -HEu paperless tee $index_version_file >/dev/null + echo $index_version | tee $index_version_file >/dev/null fi } From 6f0c14cc07ed834a5096c6f3e35036eded46e447 Mon Sep 17 00:00:00 2001 From: Michael Shamoon <4887959+shamoon@users.noreply.github.com> Date: Wed, 14 Apr 2021 09:00:30 -0700 Subject: [PATCH 4/7] Make filter editor / bulk editor 'sticky' on scroll --- .../document-list/document-list.component.html | 8 ++++---- .../document-list/document-list.component.scss | 9 +++++++++ src-ui/src/theme.scss | 6 +++++- src-ui/src/theme_dark.scss | 4 ++++ 4 files changed, 22 insertions(+), 5 deletions(-) diff --git a/src-ui/src/app/components/document-list/document-list.component.html b/src-ui/src/app/components/document-list/document-list.component.html index 45b6fad37..8b91949a8 100644 --- a/src-ui/src/app/components/document-list/document-list.component.html +++ b/src-ui/src/app/components/document-list/document-list.component.html @@ -75,7 +75,7 @@ -
+
@@ -99,7 +99,7 @@
- + @@ -174,10 +174,10 @@
- +
- + diff --git a/src-ui/src/app/components/document-list/document-list.component.scss b/src-ui/src/app/components/document-list/document-list.component.scss index 28f765e29..ab67d9572 100644 --- a/src-ui/src/app/components/document-list/document-list.component.scss +++ b/src-ui/src/app/components/document-list/document-list.component.scss @@ -34,3 +34,12 @@ $paperless-card-breakpoints: ( right: 0 !important; left: auto !important; } + +.sticky-top { + z-index: 1000; // below main navbar + top: calc(7rem - 2px); // height of navbar (mobile) + + @media (min-width: 768px) { + top: 3.5rem; // height of navbar + } +} diff --git a/src-ui/src/theme.scss b/src-ui/src/theme.scss index df2aea003..113968a9f 100644 --- a/src-ui/src/theme.scss +++ b/src-ui/src/theme.scss @@ -4,4 +4,8 @@ $primaryFaded: #d1ddd2; $theme-colors: ( "primary": $primary -); \ No newline at end of file +); + +.bg-body { + background-color: #fff; +} diff --git a/src-ui/src/theme_dark.scss b/src-ui/src/theme_dark.scss index 996f9da3d..25abac773 100644 --- a/src-ui/src/theme_dark.scss +++ b/src-ui/src/theme_dark.scss @@ -37,6 +37,10 @@ $border-color-dark-mode: #47494f; } } + .bg-body { + background-color: $bg-dark-mode !important; + } + .text-light { color: $text-color-dark-mode !important; } From 43d05b2e6de157b680fd48c7d04f5a9a00361f76 Mon Sep 17 00:00:00 2001 From: Michael Shamoon <4887959+shamoon@users.noreply.github.com> Date: Wed, 14 Apr 2021 09:00:57 -0700 Subject: [PATCH 5/7] Hide visible underlying shadows on filter / bulk editor --- .../app/components/document-list/document-list.component.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src-ui/src/app/components/document-list/document-list.component.html b/src-ui/src/app/components/document-list/document-list.component.html index 8b91949a8..d11eb7f90 100644 --- a/src-ui/src/app/components/document-list/document-list.component.html +++ b/src-ui/src/app/components/document-list/document-list.component.html @@ -75,7 +75,7 @@ -
+
From c266cd6aaece00434deb4b47f74d1e93e5b641ed Mon Sep 17 00:00:00 2001 From: Michael Shamoon <4887959+shamoon@users.noreply.github.com> Date: Wed, 14 Apr 2021 09:34:39 -0700 Subject: [PATCH 6/7] Spacing tweaks, mobile breakpoint --- .../app/components/document-list/document-list.component.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src-ui/src/app/components/document-list/document-list.component.html b/src-ui/src/app/components/document-list/document-list.component.html index d11eb7f90..1b805bb2e 100644 --- a/src-ui/src/app/components/document-list/document-list.component.html +++ b/src-ui/src/app/components/document-list/document-list.component.html @@ -75,7 +75,7 @@ -
+
From a4fef056edd778d6c116641b3d4f3b32d3d933c9 Mon Sep 17 00:00:00 2001 From: Michael Shamoon <4887959+shamoon@users.noreply.github.com> Date: Wed, 14 Apr 2021 13:24:03 -0700 Subject: [PATCH 7/7] Fix breakpoint File missing from last commit --- .../app/components/document-list/document-list.component.scss | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src-ui/src/app/components/document-list/document-list.component.scss b/src-ui/src/app/components/document-list/document-list.component.scss index ab67d9572..ee50852f0 100644 --- a/src-ui/src/app/components/document-list/document-list.component.scss +++ b/src-ui/src/app/components/document-list/document-list.component.scss @@ -39,7 +39,7 @@ $paperless-card-breakpoints: ( z-index: 1000; // below main navbar top: calc(7rem - 2px); // height of navbar (mobile) - @media (min-width: 768px) { + @media (min-width: 580px) { top: 3.5rem; // height of navbar } }