Compare commits

...

13 Commits
0.7.0 ... 0.8.0

Author SHA1 Message Date
Daniel Quinn
4d2b71454d Ignore .virtualenv 2017-09-09 12:22:03 +03:00
Daniel Quinn
5cbb33b02b Add documentation for the new FORCE_SCRIPT_NAME feature 2017-09-09 12:21:31 +03:00
Daniel Quinn
2c55aad6c0 Merge pull request #255 from maphy-psd/master
add FORCE_SCRIPT_NAME to host paperless on a subpath url
2017-09-06 15:56:44 +01:00
Daniel Quinn
1e039dcb32 Bump gunicorn 2017-08-30 00:44:13 +03:00
Daniel Quinn
6ca8da4858 Patch requirements to keep up with Django versions 2017-08-30 00:27:54 +03:00
maphy-psd
82f05e27c3 fix travis ci E510
E501 line too long (85 > 79 characters)
2017-08-20 16:18:39 +02:00
maphy-psd
7a627e4ad8 white spacing and remove var's prefix 2017-08-20 14:29:51 +02:00
maphy-psd
73af9552ec getenv has "None" as default
@MasterofJOKers in PR#255
2017-08-20 14:13:23 +02:00
maphy-psd
e4854f2144 def thumbnail uses FORCE_SCRIPT_NAME
with this edit the tumbnails are show up..
2017-08-19 18:37:17 +02:00
maphy-psd
6f5c1ac4e1 add FORCE_SCRIPT_NAME setting 2017-08-19 12:39:25 +02:00
maphy-psd
22acc51284 add PAPERLESS_FORCE_SCRIPT_NAME 2017-08-19 12:38:45 +02:00
Daniel Quinn
a05644fc31 Merge pull request #250 from brightdroid/master
create documents subfolder folder if they do not exist
2017-08-12 14:39:22 +01:00
Christoph Roeder
d1aa54caa9 create documents subfolder folder if they do not exist 2017-07-31 21:35:41 +02:00
7 changed files with 44 additions and 4 deletions

1
.gitignore vendored
View File

@@ -68,6 +68,7 @@ db.sqlite3
.idea
# Other stuff that doesn't belong
.virtualenv
virtualenv
.vagrant
docker-compose.yml

View File

@@ -575,3 +575,28 @@ If you're using Docker, you can set a restart-policy_ in the
Docker daemon.
.. _restart-policy: https://docs.docker.com/engine/reference/commandline/run/#restart-policies-restart
.. _setup-subdirectory
Hosting Paperless in a Subdirectory
-----------------------------------
Paperless was designed to run off the root of the hosting domain,
(ie: ``https://example.com/``) but with a few changes, you can configure
it to run in a subdirectory on your server
(ie: ``https://example.com/paperless/``).
Thanks to the efforts of `maphy-psd`_ on `Github`_, running Paperless in a
subdirectory is now as easy as setting a config variable. Simply set
``PAPERLESS_FORCE_SCRIPT_NAME`` in your environment or
``/etc/paperless.conf`` to the path you want Paperless hosted at, configure
Nginx/Apache for your needs and you're done. So, if you want Paperless to live
at ``https://example.com/arbitrary/path/to/paperless`` then you just set
``PAPERLESS_FORCE_SCRIPT_NAME`` to ``/arbitrary/path/to/paperless``. Note the
leading ``/`` there.
As to how to configure Nginx or Apache for this, that's on you :-)
.. _maphy-psd: https://github.com/maphy-psd
.. _Github: https://github.com/danielquinn/paperless/pull/255

View File

@@ -80,6 +80,11 @@ PAPERLESS_PASSPHRASE="secret"
# as is "example.com,www.example.com", but NOT " example.com" or "example.com,"
#PAPERLESS_ALLOWED_HOSTS="example.com,www.example.com"
# To host paperless under a subpath url like example.com/paperless you set
# this value to /paperless. No trailing slash!
#
# https://docs.djangoproject.com/en/1.11/ref/settings/#force-script-name
#PAPERLESS_FORCE_SCRIPT_NAME=""
###############################################################################
#### Software Tweaks ####

View File

@@ -1,4 +1,4 @@
Django==1.10.5
Django>=1.10,<1.11
Pillow>=3.1.1
django-crispy-forms>=1.6.1
django-extensions>=1.7.6
@@ -13,7 +13,7 @@ python-dateutil>=2.6.0
python-dotenv>=0.6.2
python-gnupg>=0.3.9
pytz>=2016.10
gunicorn==19.6.0
gunicorn==19.7.1
# For the tests
factory-boy

View File

@@ -70,9 +70,14 @@ class DocumentAdmin(CommonAdmin):
created_.short_description = "Created"
def thumbnail(self, obj):
if settings.FORCE_SCRIPT_NAME:
src_link = "{}/fetch/thumb/{}".format(
settings.FORCE_SCRIPT_NAME, obj.id)
else:
src_link = "/fetch/thumb/{}".format(obj.id)
png_img = self._html_tag(
"img",
src="/fetch/thumb/{}".format(obj.id),
src=src_link,
width=180,
alt="Thumbnail of {}".format(obj.file_name),
title=obj.file_name

View File

@@ -38,6 +38,9 @@ class GnuPG(object):
def move_documents_and_create_thumbnails(apps, schema_editor):
os.makedirs(os.path.join(settings.MEDIA_ROOT, "documents", "originals"), exist_ok=True)
os.makedirs(os.path.join(settings.MEDIA_ROOT, "documents", "thumbnails"), exist_ok=True)
documents = os.listdir(os.path.join(settings.MEDIA_ROOT, "documents"))
if set(documents) == {"originals", "thumbnails"}:

View File

@@ -47,7 +47,8 @@ _allowed_hosts = os.getenv("PAPERLESS_ALLOWED_HOSTS")
if _allowed_hosts:
ALLOWED_HOSTS = _allowed_hosts.split(",")
FORCE_SCRIPT_NAME = os.getenv("PAPERLESS_FORCE_SCRIPT_NAME")
# Application definition
INSTALLED_APPS = [