mirror of
				https://github.com/paperless-ngx/paperless-ngx.git
				synced 2025-11-03 19:17:13 -05:00 
			
		
		
		
	changed a few things
This commit is contained in:
		
							parent
							
								
									653edc1fdc
								
							
						
					
					
						commit
						c26962f17f
					
				@ -21,44 +21,22 @@
 | 
				
			|||||||
# This where your documents should go to be consumed.  Make sure that it exists
 | 
					# This where your documents should go to be consumed.  Make sure that it exists
 | 
				
			||||||
# and that the user running the paperless service can read/write its contents
 | 
					# and that the user running the paperless service can read/write its contents
 | 
				
			||||||
# before you start Paperless.
 | 
					# before you start Paperless.
 | 
				
			||||||
PAPERLESS_CONSUMPTION_DIR=""
 | 
					#PAPERLESS_CONSUMPTION_DIR=""
 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
# You can specify where you want the SQLite database to be stored instead of
 | 
					 | 
				
			||||||
# the default location of /data/ within the install directory.
 | 
					 | 
				
			||||||
#PAPERLESS_DBDIR=/path/to/database/file
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
# Override the default MEDIA_ROOT here.  This is where all files are stored.
 | 
					 | 
				
			||||||
# The default location is /media/documents/ within the install folder.
 | 
					 | 
				
			||||||
#PAPERLESS_MEDIADIR=/path/to/media
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					# This is where paperless stores all its data (documents, thumbnails, search
 | 
				
			||||||
 | 
					# index, sqlite database, etc).
 | 
				
			||||||
 | 
					#PAPERLESS_DATA_DIR="../data"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# 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=""
 | 
					#PAPERLESS_STATICDIR=""
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# This is where the whoosh document index is stored
 | 
					 | 
				
			||||||
#PAPERLESS_INDEX_DIR="/path/to/index"
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
# Override the MEDIA_URL here.  Unless you're hosting Paperless off a subdomain
 | 
					 | 
				
			||||||
# like /paperless/, you probably don't need to change this.
 | 
					 | 
				
			||||||
#PAPERLESS_MEDIA_URL="/media/"
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
# Override the STATIC_URL here.  Unless you're hosting Paperless off a
 | 
					# Override the STATIC_URL here.  Unless you're hosting Paperless off a
 | 
				
			||||||
# subdomain like /paperless/, you probably don't need to change this.
 | 
					# subdomain like /paperless/, you probably don't need to change this.
 | 
				
			||||||
#PAPERLESS_STATIC_URL="/static/"
 | 
					#PAPERLESS_STATIC_URL="/static/"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# You can specify where the document classification model file should be
 | 
					 | 
				
			||||||
# stored. Make sure that this file is writeable by the user executing the
 | 
					 | 
				
			||||||
# management command "document_create_classifier" and that the path exists.
 | 
					 | 
				
			||||||
# The default location is /models/model.pickle wwithin the install folder.
 | 
					 | 
				
			||||||
#PAPERLESS_MODEL_FILE=/path/to/model/file
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
# These values are required if you want paperless to check a particular email
 | 
					# These values are required if you want paperless to check a particular email
 | 
				
			||||||
# box every 10 minutes and attempt to consume documents from there.  If you
 | 
					# box every 10 minutes and attempt to consume documents from there.  If you
 | 
				
			||||||
# don't define a HOST, mail checking will just be disabled.
 | 
					# don't define a HOST, mail checking will just be disabled.
 | 
				
			||||||
@ -75,25 +53,13 @@ PAPERLESS_CONSUME_MAIL_PASS=""
 | 
				
			|||||||
# ignored.
 | 
					# ignored.
 | 
				
			||||||
PAPERLESS_EMAIL_SECRET=""
 | 
					PAPERLESS_EMAIL_SECRET=""
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# Specify a filename format for the document (directories are supported)
 | 
					 | 
				
			||||||
# Use the following placeholders:
 | 
					 | 
				
			||||||
# * {correspondent}
 | 
					 | 
				
			||||||
# * {title}
 | 
					 | 
				
			||||||
# * {created}
 | 
					 | 
				
			||||||
# * {added}
 | 
					 | 
				
			||||||
# * {tags[KEY]} If your tags conform to key_value or key-value
 | 
					 | 
				
			||||||
# * {tags[INDEX]} If your tags are strings, select the tag by index
 | 
					 | 
				
			||||||
# Uniqueness of filenames is ensured, as an incrementing counter is attached
 | 
					 | 
				
			||||||
# to each filename.
 | 
					 | 
				
			||||||
#PAPERLESS_FILENAME_FORMAT=""
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
###############################################################################
 | 
					###############################################################################
 | 
				
			||||||
####                              Security                                 ####
 | 
					####                              Security                                 ####
 | 
				
			||||||
###############################################################################
 | 
					###############################################################################
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# Controls whether django's debug mode is enabled. Disable this on production
 | 
					# Controls whether django's debug mode is enabled. Disable this on production
 | 
				
			||||||
# systems. Debug mode is enabled by default.
 | 
					# systems. Debug mode is enabled by default.
 | 
				
			||||||
#PAPERLESS_DEBUG="true"
 | 
					#PAPERLESS_DEBUG="false"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# Paperless can be instructed to attempt to encrypt your PDF files with GPG
 | 
					# Paperless can be instructed to attempt to encrypt your PDF files with GPG
 | 
				
			||||||
 | 
				
			|||||||
@ -8,16 +8,20 @@ from documents.models import Document
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
class Command(Renderable, BaseCommand):
 | 
					class Command(Renderable, BaseCommand):
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    help = "Recreates the document index"
 | 
					    help = "Manages the document index."
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    def __init__(self, *args, **kwargs):
 | 
					    def __init__(self, *args, **kwargs):
 | 
				
			||||||
        self.verbosity = 0
 | 
					        self.verbosity = 0
 | 
				
			||||||
        BaseCommand.__init__(self, *args, **kwargs)
 | 
					        BaseCommand.__init__(self, *args, **kwargs)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    def add_arguments(self, parser):
 | 
				
			||||||
 | 
					        parser.add_argument("command", choices=['reindex', 'optimize'])
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    def handle(self, *args, **options):
 | 
					    def handle(self, *args, **options):
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        self.verbosity = options["verbosity"]
 | 
					        self.verbosity = options["verbosity"]
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        if options['command'] == 'reindex':
 | 
				
			||||||
            documents = Document.objects.all()
 | 
					            documents = Document.objects.all()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            ix = index.open_index(recreate=True)
 | 
					            ix = index.open_index(recreate=True)
 | 
				
			||||||
@ -25,3 +29,6 @@ class Command(Renderable, BaseCommand):
 | 
				
			|||||||
            with AsyncWriter(ix) as writer:
 | 
					            with AsyncWriter(ix) as writer:
 | 
				
			||||||
                for document in documents:
 | 
					                for document in documents:
 | 
				
			||||||
                    index.update_document(writer, document)
 | 
					                    index.update_document(writer, document)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        elif options['command'] == 'optimize':
 | 
				
			||||||
 | 
					            index.open_index().optimize()
 | 
				
			||||||
 | 
				
			|||||||
@ -39,7 +39,7 @@ 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.getenv('PAPERLESS_DATA_DIR', os.path.join(DATA_DIR, "media"))
 | 
					MEDIA_ROOT = os.path.join(DATA_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")
 | 
				
			||||||
@ -59,15 +59,15 @@ SECRET_KEY = os.getenv(
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# SECURITY WARNING: don't run with debug turned on in production!
 | 
					# SECURITY WARNING: don't run with debug turned on in production!
 | 
				
			||||||
DEBUG = __get_boolean("PAPERLESS_DEBUG", "YES")
 | 
					DEBUG = __get_boolean("PAPERLESS_DEBUG", "NO")
 | 
				
			||||||
 | 
					
 | 
				
			||||||
LOGIN_URL = "admin:login"
 | 
					LOGIN_URL = "admin:login"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
ALLOWED_HOSTS = ["*"]
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
_allowed_hosts = os.getenv("PAPERLESS_ALLOWED_HOSTS")
 | 
					_allowed_hosts = os.getenv("PAPERLESS_ALLOWED_HOSTS")
 | 
				
			||||||
if _allowed_hosts:
 | 
					if _allowed_hosts:
 | 
				
			||||||
    ALLOWED_HOSTS = _allowed_hosts.split(",")
 | 
					    ALLOWED_HOSTS = _allowed_hosts.split(",")
 | 
				
			||||||
 | 
					else:
 | 
				
			||||||
 | 
					    ALLOWED_HOSTS = ["*"]
 | 
				
			||||||
 | 
					
 | 
				
			||||||
FORCE_SCRIPT_NAME = os.getenv("PAPERLESS_FORCE_SCRIPT_NAME")
 | 
					FORCE_SCRIPT_NAME = os.getenv("PAPERLESS_FORCE_SCRIPT_NAME")
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user