diff --git a/mayan/apps/django_gpg/runtime.py b/mayan/apps/django_gpg/runtime.py index 58977b0f7e..2a471b09e9 100644 --- a/mayan/apps/django_gpg/runtime.py +++ b/mayan/apps/django_gpg/runtime.py @@ -1,14 +1,4 @@ -from __future__ import absolute_import - -import sys - from .api import GPG -from .settings import KEYSERVERS, GPG_HOME +from .settings import GPG_HOME, GPG_PATH, KEYSERVERS -try: - gpg = GPG(home=GPG_HOME, keyservers=KEYSERVERS) -except Exception as exception: - gpg = GPG(keyservers=KEYSERVERS) - # TODO: Maybe raise a standard exception to signify configuration error - sys.stderr.write(u'ERROR: GPG initialization error: %s\n' % exception) - sys.stderr.write(u'INFO: Initializating GPG with system default home\n') +gpg = GPG(binary_path=GPG_PATH, home=GPG_HOME, keyservers=KEYSERVERS) diff --git a/mayan/apps/django_gpg/settings.py b/mayan/apps/django_gpg/settings.py index b377e2a9a2..c33ce25ed3 100644 --- a/mayan/apps/django_gpg/settings.py +++ b/mayan/apps/django_gpg/settings.py @@ -14,5 +14,6 @@ register_settings( settings=[ {'name': u'KEYSERVERS', 'global_name': u'SIGNATURES_KEYSERVERS', 'default': ['pool.sks-keyservers.net'], 'description': _(u'List of keyservers to be queried for unknown keys.')}, {'name': u'GPG_HOME', 'global_name': u'SIGNATURES_GPG_HOME', 'default': os.path.join(settings.MEDIA_ROOT, u'gpg_home'), 'description': _(u'Home directory used to store keys as well as configuration files.')}, + {'name': u'GPG_PATH', 'global_name': u'SIGNATURES_GPG_PATH', 'default': u'/usr/bin/gpgs', 'description': _(u'Path to the GPG binary.')}, ] )