mirror of
				https://github.com/paperless-ngx/paperless-ngx.git
				synced 2025-11-03 03:16:10 -06:00 
			
		
		
		
	fixed folders, compatible with previous paperless version
This commit is contained in:
		
							
								
								
									
										5
									
								
								.gitignore
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										5
									
								
								.gitignore
									
									
									
									
										vendored
									
									
								
							@@ -76,8 +76,9 @@ scripts/nuke
 | 
				
			|||||||
/static/
 | 
					/static/
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# Stored PDFs
 | 
					# Stored PDFs
 | 
				
			||||||
/data/media/documents/*
 | 
					/media/documents/originals/*
 | 
				
			||||||
/data/media/thumbnails/*
 | 
					/media/documents/thumbnails/*
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/data/classification_model.pickle
 | 
					/data/classification_model.pickle
 | 
				
			||||||
/data/db.sqlite3
 | 
					/data/db.sqlite3
 | 
				
			||||||
/data/index
 | 
					/data/index
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -45,6 +45,7 @@ RUN apt-get update \
 | 
				
			|||||||
		unpaper \
 | 
							unpaper \
 | 
				
			||||||
	&& pip install --upgrade pipenv \
 | 
						&& pip install --upgrade pipenv \
 | 
				
			||||||
	&& pipenv install --system --deploy \
 | 
						&& pipenv install --system --deploy \
 | 
				
			||||||
 | 
						&& pipenv --clear \
 | 
				
			||||||
	&& apt-get -y purge build-essential \
 | 
						&& apt-get -y purge build-essential \
 | 
				
			||||||
	&& apt-get -y autoremove --purge \
 | 
						&& apt-get -y autoremove --purge \
 | 
				
			||||||
	&& rm -rf /var/lib/apt/lists/*
 | 
						&& rm -rf /var/lib/apt/lists/*
 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										0
									
								
								media/documents/thumbnails/.keep
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										0
									
								
								media/documents/thumbnails/.keep
									
									
									
									
									
										Normal file
									
								
							@@ -25,10 +25,13 @@
 | 
				
			|||||||
# before you start Paperless.
 | 
					# before you start Paperless.
 | 
				
			||||||
#PAPERLESS_CONSUMPTION_DIR=""
 | 
					#PAPERLESS_CONSUMPTION_DIR=""
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# This is where paperless stores all its data (documents, thumbnails, search
 | 
					# This is where paperless stores all its data (search index, sqlite database,
 | 
				
			||||||
# index, sqlite database, etc).
 | 
					# classification model, etc).
 | 
				
			||||||
#PAPERLESS_DATA_DIR="../data"
 | 
					#PAPERLESS_DATA_DIR="../data"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					# This is where your documents and thumbnails are stored.
 | 
				
			||||||
 | 
					#PAPERLESS_MEDIA_ROOT="../media"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# Override the default STATIC_ROOT here.  This is where all static files
 | 
					# Override the default STATIC_ROOT here.  This is where all static files
 | 
				
			||||||
# created using "collectstatic" manager command are stored.
 | 
					# created using "collectstatic" manager command are stored.
 | 
				
			||||||
#PAPERLESS_STATICDIR="../static"
 | 
					#PAPERLESS_STATICDIR="../static"
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -16,26 +16,25 @@ map_uidgid() {
 | 
				
			|||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
migrations() {
 | 
					migrations() {
 | 
				
			||||||
    # A simple lock file in case other containers use this startup
 | 
					 | 
				
			||||||
    LOCKFILE="/usr/src/paperless/data/db.sqlite3.migration"
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
    # check for and create lock file in one command
 | 
						(
 | 
				
			||||||
    if (set -o noclobber; echo "$$" > "${LOCKFILE}") 2> /dev/null
 | 
							# flock is in place to prevent multiple containers from doing migrations
 | 
				
			||||||
    then
 | 
							# simultaneously. This also ensures that the db is ready when the command
 | 
				
			||||||
        trap 'rm -f "${LOCKFILE}"; exit $?' INT TERM EXIT
 | 
							# of the current container starts.
 | 
				
			||||||
 | 
							flock 200
 | 
				
			||||||
		sudo -HEu paperless python3 manage.py migrate
 | 
							sudo -HEu paperless python3 manage.py migrate
 | 
				
			||||||
        rm ${LOCKFILE}
 | 
						)  200>/usr/src/paperless/data/migration_lock
 | 
				
			||||||
    fi
 | 
					
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
initialize() {
 | 
					initialize() {
 | 
				
			||||||
	map_uidgid
 | 
						map_uidgid
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	for data_dir in index media media/documents media/thumbnails; do
 | 
						for dir in export data data/index media media/documents media/documents/originals media/documents/thumbnails; do
 | 
				
			||||||
		if [[ ! -d "../data/$data_dir" ]]
 | 
							if [[ ! -d "../$dir" ]]
 | 
				
			||||||
		then
 | 
							then
 | 
				
			||||||
			echo "creating directory ../data/$data_dir"
 | 
								echo "creating directory ../$dir"
 | 
				
			||||||
			mkdir ../data/$data_dir
 | 
								mkdir ../$dir
 | 
				
			||||||
		fi
 | 
							fi
 | 
				
			||||||
	done
 | 
						done
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -46,7 +45,6 @@ initialize() {
 | 
				
			|||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
install_languages() {
 | 
					install_languages() {
 | 
				
			||||||
	echo "TEST"
 | 
					 | 
				
			||||||
	local langs="$1"
 | 
						local langs="$1"
 | 
				
			||||||
	read -ra langs <<<"$langs"
 | 
						read -ra langs <<<"$langs"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -95,7 +95,6 @@ class DocumentViewSet(RetrieveModelMixin,
 | 
				
			|||||||
    ordering_fields = (
 | 
					    ordering_fields = (
 | 
				
			||||||
        "id", "title", "correspondent__name", "created", "modified", "added", "archive_serial_number")
 | 
					        "id", "title", "correspondent__name", "created", "modified", "added", "archive_serial_number")
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					 | 
				
			||||||
    def file_response(self, pk, disposition):
 | 
					    def file_response(self, pk, disposition):
 | 
				
			||||||
        #TODO: this should not be necessary here.
 | 
					        #TODO: this should not be necessary here.
 | 
				
			||||||
        content_types = {
 | 
					        content_types = {
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -33,7 +33,9 @@ def paths_check(app_configs, **kwargs):
 | 
				
			|||||||
    Check the various paths for existence, readability and writeability
 | 
					    Check the various paths for existence, readability and writeability
 | 
				
			||||||
    """
 | 
					    """
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    check_messages = path_check("PAPERLESS_DATA_DIR") +\
 | 
					    check_messages = path_check("PAPERLESS_DATA_DIR") + \
 | 
				
			||||||
 | 
					                     path_check("PAPERLESS_MEDIA_ROOT") + \
 | 
				
			||||||
 | 
					                     path_check("PAPERLESS_CONSUMPTION_DIR") + \
 | 
				
			||||||
                     path_check("PAPERLESS_STATICDIR")
 | 
					                     path_check("PAPERLESS_STATICDIR")
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    return check_messages
 | 
					    return check_messages
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -39,11 +39,11 @@ BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
DATA_DIR = os.getenv('PAPERLESS_DATA_DIR', os.path.join(BASE_DIR, "..", "data"))
 | 
					DATA_DIR = os.getenv('PAPERLESS_DATA_DIR', os.path.join(BASE_DIR, "..", "data"))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
MEDIA_ROOT = os.path.join(DATA_DIR, "media")
 | 
					MEDIA_ROOT = os.getenv('PAPERLESS_MEDIA_ROOT', os.path.join(BASE_DIR, "..", "media"))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
INDEX_DIR = os.path.join(DATA_DIR, "index")
 | 
					INDEX_DIR = os.path.join(DATA_DIR, "index")
 | 
				
			||||||
ORIGINALS_DIR = os.path.join(MEDIA_ROOT, "documents")
 | 
					ORIGINALS_DIR = os.path.join(MEDIA_ROOT, "documents", "originals")
 | 
				
			||||||
THUMBNAIL_DIR = os.path.join(MEDIA_ROOT, "thumbnails")
 | 
					THUMBNAIL_DIR = os.path.join(MEDIA_ROOT, "documents", "thumbnails")
 | 
				
			||||||
MODEL_FILE = os.path.join(DATA_DIR, "classification_model.pickle")
 | 
					MODEL_FILE = os.path.join(DATA_DIR, "classification_model.pickle")
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# Quick-start development settings - unsuitable for production
 | 
					# Quick-start development settings - unsuitable for production
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user