Allow setting the GPG binary path
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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.')},
|
||||
]
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user