mirror of
				https://github.com/paperless-ngx/paperless-ngx.git
				synced 2025-10-30 03:56:23 -05:00 
			
		
		
		
	Corrections to pass pre-commit hooks
This commit is contained in:
		
							
								
								
									
										2
									
								
								.env
									
									
									
									
									
								
							
							
						
						
									
										2
									
								
								.env
									
									
									
									
									
								
							| @@ -1,2 +1,2 @@ | |||||||
| COMPOSE_PROJECT_NAME=paperless | COMPOSE_PROJECT_NAME=paperless | ||||||
| export PROMPT="(pipenv-projectname)$P$G" | export PROMPT="(pipenv-projectname)$P$G" | ||||||
|   | |||||||
							
								
								
									
										10
									
								
								Dockerfile
									
									
									
									
									
								
							
							
						
						
									
										10
									
								
								Dockerfile
									
									
									
									
									
								
							| @@ -11,7 +11,15 @@ FROM ubuntu:20.04 AS jbig2enc | |||||||
|  |  | ||||||
| WORKDIR /usr/src/jbig2enc | WORKDIR /usr/src/jbig2enc | ||||||
|  |  | ||||||
| RUN apt-get update && apt-get install -y --no-install-recommends build-essential automake libtool libleptonica-dev zlib1g-dev git ca-certificates | RUN apt-get update \ | ||||||
|  |   && apt-get install -y --no-install-recommends build-essential \ | ||||||
|  |     automake \ | ||||||
|  | 	libtool \ | ||||||
|  | 	libleptonica-dev \ | ||||||
|  | 	zlib1g-dev \ | ||||||
|  | 	git \ | ||||||
|  | 	ca-certificates \ | ||||||
|  | && rm -rf /var/lib/apt/lists/* | ||||||
|  |  | ||||||
| RUN git clone https://github.com/agl/jbig2enc . | RUN git clone https://github.com/agl/jbig2enc . | ||||||
| RUN ./autogen.sh | RUN ./autogen.sh | ||||||
|   | |||||||
| @@ -56,12 +56,12 @@ install_languages() { | |||||||
| 		#    continue | 		#    continue | ||||||
| 		#fi | 		#fi | ||||||
|  |  | ||||||
| 		if dpkg -s $pkg &>/dev/null; then | 		if dpkg -s "$pkg" &>/dev/null; then | ||||||
| 			echo "Package $pkg already installed!" | 			echo "Package $pkg already installed!" | ||||||
| 			continue | 			continue | ||||||
| 		fi | 		fi | ||||||
|  |  | ||||||
| 		if ! apt-cache show $pkg &>/dev/null; then | 		if ! apt-cache show "$pkg" &>/dev/null; then | ||||||
| 			echo "Package $pkg not found! :(" | 			echo "Package $pkg not found! :(" | ||||||
| 			continue | 			continue | ||||||
| 		fi | 		fi | ||||||
| @@ -77,7 +77,7 @@ install_languages() { | |||||||
| echo "Paperless-ngx docker container starting..." | echo "Paperless-ngx docker container starting..." | ||||||
|  |  | ||||||
| # Install additional languages if specified | # Install additional languages if specified | ||||||
| if [[ ! -z "$PAPERLESS_OCR_LANGUAGES" ]]; then | if [[ -n "$PAPERLESS_OCR_LANGUAGES" ]]; then | ||||||
| 	install_languages "$PAPERLESS_OCR_LANGUAGES" | 	install_languages "$PAPERLESS_OCR_LANGUAGES" | ||||||
| fi | fi | ||||||
|  |  | ||||||
|   | |||||||
| @@ -6,14 +6,11 @@ wait_for_postgres() { | |||||||
|  |  | ||||||
| 	echo "Waiting for PostgreSQL to start..." | 	echo "Waiting for PostgreSQL to start..." | ||||||
|  |  | ||||||
| 	host="${PAPERLESS_DBHOST}" | 	host="${PAPERLESS_DBHOST:=localhost}" | ||||||
| 	port="${PAPERLESS_DBPORT}" | 	port="${PAPERLESS_DBPORT:=5342}" | ||||||
|  |  | ||||||
| 	if [[ -z $port ]]; then |  | ||||||
| 		port="5432" |  | ||||||
| 	fi |  | ||||||
|  |  | ||||||
| 	while ! </dev/tcp/$host/$port; do | 	while [ ! "$(pg_isready -h "$host" -p "$port")" ]; do | ||||||
|  |  | ||||||
| 		if [ $attempt_num -eq $max_attempts ]; then | 		if [ $attempt_num -eq $max_attempts ]; then | ||||||
| 			echo "Unable to connect to database." | 			echo "Unable to connect to database." | ||||||
| @@ -23,7 +20,7 @@ wait_for_postgres() { | |||||||
|  |  | ||||||
| 		fi | 		fi | ||||||
|  |  | ||||||
| 		attempt_num=$(expr "$attempt_num" + 1) | 		attempt_num=$(("$attempt_num" + 1)) | ||||||
| 		sleep 5 | 		sleep 5 | ||||||
| 	done | 	done | ||||||
| } | } | ||||||
|   | |||||||
| @@ -1,3 +1,5 @@ | |||||||
|  | #!/usr/bin/env bash | ||||||
|  |  | ||||||
| for command in document_archiver document_exporter document_importer mail_fetcher document_create_classifier document_index document_renamer document_retagger document_thumbnails document_sanity_checker manage_superuser; | for command in document_archiver document_exporter document_importer mail_fetcher document_create_classifier document_index document_renamer document_retagger document_thumbnails document_sanity_checker manage_superuser; | ||||||
| do | do | ||||||
| 	echo "installing $command..." | 	echo "installing $command..." | ||||||
|   | |||||||
| @@ -6,10 +6,10 @@ cd /usr/src/paperless/src/ | |||||||
|  |  | ||||||
| if [[ $(id -u) == 0 ]] ; | if [[ $(id -u) == 0 ]] ; | ||||||
| then | then | ||||||
|   gosu paperless python3 manage.py management_command "$@" | 	gosu paperless python3 manage.py management_command "$@" | ||||||
| elif [[ $(id -un) == "paperless" ]] ; | elif [[ $(id -un) == "paperless" ]] ; | ||||||
| then | then | ||||||
|   python3 manage.py management_command "$@" | 	python3 manage.py management_command "$@" | ||||||
| else | else | ||||||
|   echo "Unknown user." | 	echo "Unknown user." | ||||||
| fi | fi | ||||||
|   | |||||||
| @@ -1,5 +1,4 @@ | |||||||
| FROM python:3.5.1 | FROM python:3.5.1 | ||||||
| MAINTAINER Pit Kleyersburg <pitkley@googlemail.com> |  | ||||||
|  |  | ||||||
| # Install Sphinx and Pygments | # Install Sphinx and Pygments | ||||||
| RUN pip install Sphinx Pygments | RUN pip install Sphinx Pygments | ||||||
|   | |||||||
| @@ -1685,4 +1685,4 @@ bulk of the work on this big change. | |||||||
| .. _a new home on Docker Hub: https://hub.docker.com/r/danielquinn/paperless/ | .. _a new home on Docker Hub: https://hub.docker.com/r/danielquinn/paperless/ | ||||||
| .. _optipng: http://optipng.sourceforge.net/ | .. _optipng: http://optipng.sourceforge.net/ | ||||||
| .. _DjangoQL: https://github.com/ivelum/djangoql | .. _DjangoQL: https://github.com/ivelum/djangoql | ||||||
| .. _ansible repo: https://github.com/paperless-ngx/paperless-ngx-ansible | .. _ansible repo: https://github.com/paperless-ngx/paperless-ngx-ansible | ||||||
|   | |||||||
| @@ -5,11 +5,11 @@ Frequently asked questions | |||||||
|  |  | ||||||
| **Q:** *What's the general plan for Paperless-ngx?* | **Q:** *What's the general plan for Paperless-ngx?* | ||||||
|  |  | ||||||
| **A:** While Paperless-ngx is already considered largely "feature-complete" it is a community-driven  | **A:** While Paperless-ngx is already considered largely "feature-complete" it is a community-driven | ||||||
| project and development will be guided in this way. New features can be submitted via | project and development will be guided in this way. New features can be submitted via | ||||||
| GitHub discussions and "up-voted" by the community but this is not a garauntee the feature | GitHub discussions and "up-voted" by the community but this is not a garauntee the feature | ||||||
| will be implemented. This project will always be open to collaboration in the form of PRs, | will be implemented. This project will always be open to collaboration in the form of PRs, | ||||||
| ideas etc.  | ideas etc. | ||||||
|  |  | ||||||
| **Q:** *I'm using docker. Where are my documents?* | **Q:** *I'm using docker. Where are my documents?* | ||||||
|  |  | ||||||
| @@ -83,7 +83,7 @@ a long time. | |||||||
|  |  | ||||||
| **Q:** *How do I run this on Unraid?* | **Q:** *How do I run this on Unraid?* | ||||||
|  |  | ||||||
| **A:** Paperless-ngx is available as `community app <https://unraid.net/community/apps?q=paperless-ngx>`_  | **A:** Paperless-ngx is available as `community app <https://unraid.net/community/apps?q=paperless-ngx>`_ | ||||||
| in Unraid. `Uli Fahrer <https://github.com/Tooa>`_ created a container template for that. | in Unraid. `Uli Fahrer <https://github.com/Tooa>`_ created a container template for that. | ||||||
|  |  | ||||||
| **Q:** *How do I run this on my toaster?* | **Q:** *How do I run this on my toaster?* | ||||||
|   | |||||||
| @@ -42,4 +42,3 @@ Mobile support in the future? This kinda works, however some layouts are still | |||||||
| too wide. | too wide. | ||||||
|  |  | ||||||
| .. image:: _static/screenshots/mobile.png | .. image:: _static/screenshots/mobile.png | ||||||
|  |  | ||||||
|   | |||||||
| @@ -477,7 +477,7 @@ Migrating from Paperless-ng | |||||||
| =========================== | =========================== | ||||||
|  |  | ||||||
| Paperless-ngx is meant to be a drop-in replacement for Paperless-ng and thus upgrading should be | Paperless-ngx is meant to be a drop-in replacement for Paperless-ng and thus upgrading should be | ||||||
| trivial for most users, especially when using docker. However, as with any major change, it is  | trivial for most users, especially when using docker. However, as with any major change, it is | ||||||
| recommended to take a full backup first. Once you are ready, simply change the docker image to | recommended to take a full backup first. Once you are ready, simply change the docker image to | ||||||
| point to the new source. E.g. if using Docker Compose, edit ``docker-compose.yml`` and change: | point to the new source. E.g. if using Docker Compose, edit ``docker-compose.yml`` and change: | ||||||
|  |  | ||||||
| @@ -490,12 +490,12 @@ to | |||||||
| .. code:: | .. code:: | ||||||
|  |  | ||||||
|   image: ghcr.io/paperless-ngx/paperless-ngx:latest |   image: ghcr.io/paperless-ngx/paperless-ngx:latest | ||||||
|      |  | ||||||
| and then run ``docker-compose up -d`` which will pull the new image recreate the container. | and then run ``docker-compose up -d`` which will pull the new image recreate the container. | ||||||
| That's it! | That's it! | ||||||
|  |  | ||||||
| Users who installed with the bare-metal route should also update their Git clone to point to  | Users who installed with the bare-metal route should also update their Git clone to point to | ||||||
| ``https://github.com/paperless-ngx/paperless-ngx``, e.g. using the command  | ``https://github.com/paperless-ngx/paperless-ngx``, e.g. using the command | ||||||
| ``git remote set-url origin https://github.com/paperless-ngx/paperless-ngx`` and then pull the | ``git remote set-url origin https://github.com/paperless-ngx/paperless-ngx`` and then pull the | ||||||
| lastest version. | lastest version. | ||||||
|  |  | ||||||
|   | |||||||
| @@ -3,16 +3,16 @@ | |||||||
| ask() { | ask() { | ||||||
| 	while true ; do | 	while true ; do | ||||||
| 		if [[ -z $3 ]] ; then | 		if [[ -z $3 ]] ; then | ||||||
| 			read -p "$1 [$2]: " result | 			read -r -p "$1 [$2]: " result | ||||||
| 		else | 		else | ||||||
| 			read -p "$1 ($3) [$2]: " result | 			read -r -p "$1 ($3) [$2]: " result | ||||||
| 		fi | 		fi | ||||||
| 		if [[ -z $result ]]; then | 		if [[ -z $result ]]; then | ||||||
| 			ask_result=$2 | 			ask_result=$2 | ||||||
| 			return | 			return | ||||||
| 		fi | 		fi | ||||||
| 		array=$3 | 		array=$3 | ||||||
| 		if [[ -z $3 || " ${array[@]} " =~ " ${result} " ]]; then | 		if [[ -z $3 || " ${array[*]} " =~ ${result} ]]; then | ||||||
| 			ask_result=$result | 			ask_result=$result | ||||||
| 			return | 			return | ||||||
| 		else | 		else | ||||||
| @@ -24,7 +24,7 @@ ask() { | |||||||
| ask_docker_folder() { | ask_docker_folder() { | ||||||
| 	while true ; do | 	while true ; do | ||||||
|  |  | ||||||
| 		read -p "$1 [$2]: " result | 		read -r -p "$1 [$2]: " result | ||||||
|  |  | ||||||
| 		if [[ -z $result ]]; then | 		if [[ -z $result ]]; then | ||||||
| 			ask_result=$2 | 			ask_result=$2 | ||||||
| @@ -64,8 +64,7 @@ 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 | if [ ! "$(docker stats --no-stream 2>/dev/null 1>&2)" ] ; then | ||||||
| if [ $? -ne 0 ] ; then |  | ||||||
| 	echo "" | 	echo "" | ||||||
| 	echo "WARN: It look like the current user does not have Docker permissions." | 	echo "WARN: It look like the current user does not have Docker permissions." | ||||||
| 	echo "WARN: Use 'sudo usermod -aG docker $USER' to assign Docker permissions to the user." | 	echo "WARN: Use 'sudo usermod -aG docker $USER' to assign Docker permissions to the user." | ||||||
| @@ -228,7 +227,7 @@ ask "Paperless username" "$(whoami)" | |||||||
| USERNAME=$ask_result | USERNAME=$ask_result | ||||||
|  |  | ||||||
| while true; do | while true; do | ||||||
| 	read -sp "Paperless password: " PASSWORD | 	read -r -sp "Paperless password: " PASSWORD | ||||||
| 	echo "" | 	echo "" | ||||||
|  |  | ||||||
| 	if [[ -z $PASSWORD ]] ; then | 	if [[ -z $PASSWORD ]] ; then | ||||||
| @@ -236,7 +235,7 @@ while true; do | |||||||
| 		continue | 		continue | ||||||
| 	fi | 	fi | ||||||
|  |  | ||||||
| 	read -sp "Paperless password (again): " PASSWORD_REPEAT | 	read -r -sp "Paperless password (again): " PASSWORD_REPEAT | ||||||
| 	echo "" | 	echo "" | ||||||
|  |  | ||||||
| 	if [[ ! "$PASSWORD" == "$PASSWORD_REPEAT" ]] ; then | 	if [[ ! "$PASSWORD" == "$PASSWORD_REPEAT" ]] ; then | ||||||
| @@ -285,7 +284,7 @@ echo "Paperless username: $USERNAME" | |||||||
| echo "Paperless email: $EMAIL" | echo "Paperless email: $EMAIL" | ||||||
|  |  | ||||||
| echo "" | echo "" | ||||||
| read -p "Press any key to install." | read -r -p "Press any key to install." | ||||||
|  |  | ||||||
| echo "" | echo "" | ||||||
| echo "Installing paperless..." | echo "Installing paperless..." | ||||||
| @@ -304,7 +303,7 @@ fi | |||||||
| wget "https://raw.githubusercontent.com/paperless-ngx/paperless-ngx/main/docker/compose/docker-compose.$DOCKER_COMPOSE_VERSION.yml" -O docker-compose.yml | wget "https://raw.githubusercontent.com/paperless-ngx/paperless-ngx/main/docker/compose/docker-compose.$DOCKER_COMPOSE_VERSION.yml" -O docker-compose.yml | ||||||
| wget "https://raw.githubusercontent.com/paperless-ngx/paperless-ngx/main/docker/compose/.env" -O .env | wget "https://raw.githubusercontent.com/paperless-ngx/paperless-ngx/main/docker/compose/.env" -O .env | ||||||
|  |  | ||||||
| SECRET_KEY=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 64 | head -n 1) | SECRET_KEY=$(tr -dc 'a-zA-Z0-9' < /dev/urandom | fold -w 64 | head -n 1) | ||||||
|  |  | ||||||
| DEFAULT_LANGUAGES="deu eng fra ita spa" | DEFAULT_LANGUAGES="deu eng fra ita spa" | ||||||
|  |  | ||||||
| @@ -318,7 +317,7 @@ DEFAULT_LANGUAGES="deu eng fra ita spa" | |||||||
| 	echo "PAPERLESS_TIME_ZONE=$TIME_ZONE" | 	echo "PAPERLESS_TIME_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 | ||||||
| 		echo "PAPERLESS_OCR_LANGUAGES=$OCR_LANGUAGE" | 		echo "PAPERLESS_OCR_LANGUAGES=$OCR_LANGUAGE" | ||||||
| 	fi | 	fi | ||||||
| } > docker-compose.env | } > docker-compose.env | ||||||
| @@ -334,12 +333,12 @@ fi | |||||||
|  |  | ||||||
| if [[ -n $DATA_FOLDER ]] ; then | if [[ -n $DATA_FOLDER ]] ; then | ||||||
| 	sed -i "s#- data:/usr/src/paperless/data#- $DATA_FOLDER:/usr/src/paperless/data#g" docker-compose.yml | 	sed -i "s#- data:/usr/src/paperless/data#- $DATA_FOLDER:/usr/src/paperless/data#g" docker-compose.yml | ||||||
|     sed -i "/^\s*data:/d" docker-compose.yml | 	sed -i "/^\s*data:/d" docker-compose.yml | ||||||
| fi | fi | ||||||
|  |  | ||||||
| if [[ -n $POSTGRES_FOLDER ]] ; then | if [[ -n $POSTGRES_FOLDER ]] ; then | ||||||
| 	sed -i "s#- pgdata:/var/lib/postgresql/data#- $POSTGRES_FOLDER:/var/lib/postgresql/data#g" docker-compose.yml | 	sed -i "s#- pgdata:/var/lib/postgresql/data#- $POSTGRES_FOLDER:/var/lib/postgresql/data#g" docker-compose.yml | ||||||
|     sed -i "/^\s*pgdata:/d" docker-compose.yml | 	sed -i "/^\s*pgdata:/d" docker-compose.yml | ||||||
| fi | fi | ||||||
|  |  | ||||||
| # remove trailing blank lines from end of file | # remove trailing blank lines from end of file | ||||||
| @@ -348,7 +347,7 @@ sed -i -e :a -e '/^\n*$/{$d;N;};/\n$/ba' docker-compose.yml | |||||||
| l1=$(grep -n '^volumes:' docker-compose.yml | cut -d : -f 1)  # get line number containing volume: at begin of line | l1=$(grep -n '^volumes:' docker-compose.yml | cut -d : -f 1)  # get line number containing volume: at begin of line | ||||||
| l2=$(wc -l < docker-compose.yml)  # get total number of lines | l2=$(wc -l < docker-compose.yml)  # get total number of lines | ||||||
| if [ "$l1" -eq "$l2" ] ; then | if [ "$l1" -eq "$l2" ] ; then | ||||||
|     sed -i "/^volumes:/d" docker-compose.yml | 	sed -i "/^volumes:/d" docker-compose.yml | ||||||
| fi | fi | ||||||
|  |  | ||||||
|  |  | ||||||
|   | |||||||
| @@ -1,3 +1,5 @@ | |||||||
|  | #!/usr/bin/env bash | ||||||
|  |  | ||||||
| docker run -p 5432:5432 -e POSTGRES_PASSWORD=password -v paperless_pgdata:/var/lib/postgresql/data -d postgres:13 | docker run -p 5432:5432 -e POSTGRES_PASSWORD=password -v paperless_pgdata:/var/lib/postgresql/data -d postgres:13 | ||||||
| docker run -d -p 6379:6379 redis:latest | docker run -d -p 6379:6379 redis:latest | ||||||
| docker run -p 3000:3000 -d gotenberg/gotenberg:7 | docker run -p 3000:3000 -d gotenberg/gotenberg:7 | ||||||
|   | |||||||
| @@ -60,4 +60,4 @@ small > svg { | |||||||
|  |  | ||||||
| .show .btn-outline-primary { | .show .btn-outline-primary { | ||||||
|   color: #fff; |   color: #fff; | ||||||
| } | } | ||||||
|   | |||||||
| @@ -36,11 +36,11 @@ $border-color-dark-mode: #47494f; | |||||||
|     --bs-primary: hsl(var(--pngx-primary),var(--pngx-primary-lightness)); |     --bs-primary: hsl(var(--pngx-primary),var(--pngx-primary-lightness)); | ||||||
|     --bs-primary-rgb: var(--bs-primary); |     --bs-primary-rgb: var(--bs-primary); | ||||||
|   } |   } | ||||||
|    |  | ||||||
|   .navbar-brand { |   .navbar-brand { | ||||||
|     color: var(--bs-body-color); |     color: var(--bs-body-color); | ||||||
|   } |   } | ||||||
|    |  | ||||||
|   .border { |   .border { | ||||||
|     border-color: var(--bs-border-color) !important; |     border-color: var(--bs-border-color) !important; | ||||||
|   } |   } | ||||||
| @@ -156,7 +156,7 @@ $border-color-dark-mode: #47494f; | |||||||
|   .toast { |   .toast { | ||||||
|     background-color: hsla(var(--pngx-primary), calc(var(--pngx-primary-lightness) - 18%), 0.9); |     background-color: hsla(var(--pngx-primary), calc(var(--pngx-primary-lightness) - 18%), 0.9); | ||||||
|   } |   } | ||||||
|    |  | ||||||
|   .toast-header { |   .toast-header { | ||||||
|     background-color: hsla(var(--pngx-primary), calc(var(--pngx-primary-lightness) - 10%), 0.9); |     background-color: hsla(var(--pngx-primary), calc(var(--pngx-primary-lightness) - 10%), 0.9); | ||||||
|   } |   } | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 Schnuffle
					Schnuffle