mirror of
				https://github.com/paperless-ngx/paperless-ngx.git
				synced 2025-10-25 15:52:35 -04:00 
			
		
		
		
	Merge branch 'master' of github.com:danielquinn/paperless
This commit is contained in:
		
						commit
						524d64c694
					
				| @ -3,6 +3,11 @@ Changelog | ||||
| 
 | ||||
| * 0.2.0 | ||||
| 
 | ||||
|   * `#150`_: The media root is now a variable you can set in | ||||
|     ``paperless.conf``. | ||||
|   * `#148`_: The database location (sqlite) is now a variable you can set in | ||||
|     ``paperless.conf``. | ||||
|   * `#146`_: Fixed a bug that allowed unauthorised access to the `/fetch` URL. | ||||
|   * `#131`_: Document files are now automatically removed from disk when | ||||
|     they're deleted in Paperless. | ||||
|   * `#121`_: Fixed a bug where Paperless wasn't setting document creation time | ||||
| @ -130,3 +135,6 @@ Changelog | ||||
| .. _#98: https://github.com/danielquinn/paperless/issues/98 | ||||
| .. _#121: https://github.com/danielquinn/paperless/issues/121 | ||||
| .. _#131: https://github.com/danielquinn/paperless/issues/131 | ||||
| .. _#146: https://github.com/danielquinn/paperless/issues/146 | ||||
| .. _#148: https://github.com/danielquinn/paperless/pull/148 | ||||
| .. _#150: https://github.com/danielquinn/paperless/pull/150 | ||||
|  | ||||
| @ -550,8 +550,7 @@ your gunicorn instance.  This should do the trick: | ||||
| Vagrant | ||||
| ....... | ||||
| 
 | ||||
| You're currently on your own, but the Ubuntu explanation above may be enough. | ||||
| 
 | ||||
| You may use the Ubuntu explanation above. Replace ``(local-filesystems and net-device-up IFACE=eth0)`` with ``vagrant-mounted``. | ||||
| 
 | ||||
| .. _setup-permanent-docker: | ||||
| 
 | ||||
|  | ||||
| @ -80,3 +80,10 @@ PAPERLESS_SHARED_SECRET="" | ||||
| # For more information on how to use this value, you should probably search | ||||
| # the web for "MAGICK_TMPDIR". | ||||
| #PAPERLESS_CONVERT_TMPDIR=/var/tmp/paperless | ||||
| 
 | ||||
| # You can specify where you want the SQLite database to be stored instead of  | ||||
| # the default location | ||||
| #PAPERLESS_DBDIR=/path/to/database/file | ||||
| 
 | ||||
| # Override the default MEDIA_ROOT here.  This is where all files are stored. | ||||
| #PAPERLESS_MEDIADIR=/path/to/media | ||||
|  | ||||
| @ -5,7 +5,7 @@ from subprocess import Popen | ||||
| 
 | ||||
| from django.conf import settings | ||||
| 
 | ||||
| from ..models import Correspondent, Tag | ||||
| from ..models import Correspondent, Document, Tag | ||||
| 
 | ||||
| 
 | ||||
| def logger(message, group): | ||||
| @ -85,6 +85,10 @@ def run_post_consume_script(sender, document, **kwargs): | ||||
| 
 | ||||
| 
 | ||||
| def cleanup_document_deletion(sender, instance, using, **kwargs): | ||||
| 
 | ||||
|     if not isinstance(instance, Document): | ||||
|         return | ||||
| 
 | ||||
|     for f in (instance.source_path, instance.thumbnail_path): | ||||
|         try: | ||||
|             os.unlink(f) | ||||
|  | ||||
| @ -31,7 +31,7 @@ class IndexView(TemplateView): | ||||
|         return TemplateView.get_context_data(self, **kwargs) | ||||
| 
 | ||||
| 
 | ||||
| class FetchView(DetailView): | ||||
| class FetchView(LoginRequiredMixin, DetailView): | ||||
| 
 | ||||
|     model = Document | ||||
| 
 | ||||
|  | ||||
| @ -27,8 +27,15 @@ SECRET_KEY = 'e11fl1oa-*ytql8p)(06fbj4ukrlo+n7k&q5+$1md7i+mge=ee' | ||||
| # SECURITY WARNING: don't run with debug turned on in production! | ||||
| DEBUG = True | ||||
| 
 | ||||
| LOGIN_URL = '/admin/login' | ||||
| 
 | ||||
| ALLOWED_HOSTS = [] | ||||
| 
 | ||||
| # Tap paperless.conf if it's available | ||||
| if os.path.exists("/etc/paperless.conf"): | ||||
|     load_dotenv("/etc/paperless.conf") | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| # Application definition | ||||
| 
 | ||||
| @ -88,9 +95,16 @@ WSGI_APPLICATION = 'paperless.wsgi.application' | ||||
| DATABASES = { | ||||
|     "default": { | ||||
|         "ENGINE": "django.db.backends.sqlite3", | ||||
|         "NAME": os.path.join(BASE_DIR, "..", "data", "db.sqlite3"), | ||||
|         "NAME": os.path.join( | ||||
|                     os.getenv( | ||||
|                         "PAPERLESS_DBDIR", | ||||
|                         os.path.join(BASE_DIR, "..", "data") | ||||
|                     ), | ||||
|                     "db.sqlite3" | ||||
|                 ) | ||||
|     } | ||||
| } | ||||
| 
 | ||||
| if os.getenv("PAPERLESS_DBUSER") and os.getenv("PAPERLESS_DBPASS"): | ||||
|     DATABASES["default"] = { | ||||
|         "ENGINE": "django.db.backends.postgresql_psycopg2", | ||||
| @ -137,7 +151,10 @@ USE_TZ = True | ||||
| # https://docs.djangoproject.com/en/1.9/howto/static-files/ | ||||
| 
 | ||||
| STATIC_ROOT = os.path.join(BASE_DIR, "..", "static") | ||||
| MEDIA_ROOT = os.path.join(BASE_DIR, "..", "media") | ||||
| MEDIA_ROOT = os.getenv( | ||||
|                 "PAPERLESS_MEDIADIR", | ||||
|                 os.path.join(BASE_DIR, "..", "media") | ||||
|              ) | ||||
| 
 | ||||
| STATIC_URL = '/static/' | ||||
| MEDIA_URL = "/media/" | ||||
| @ -148,11 +165,6 @@ MEDIA_URL = "/media/" | ||||
| # values in /etc/paperless.conf instead. | ||||
| # ---------------------------------------------------------------------------- | ||||
| 
 | ||||
| # Tap paperless.conf if it's available | ||||
| if os.path.exists("/etc/paperless.conf"): | ||||
|     load_dotenv("/etc/paperless.conf") | ||||
| 
 | ||||
| 
 | ||||
| # Logging | ||||
| 
 | ||||
| LOGGING = { | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user