Merge pull request #1285 from coreos-inc/configmaildefaults

Fix mail and signing defaults
This commit is contained in:
josephschorr 2016-03-31 12:31:26 -04:00
commit b9f47f6761
3 changed files with 20 additions and 4 deletions

View file

@ -297,8 +297,8 @@
</div>
<div class="co-checkbox">
<input id="ftmail" type="checkbox" ng-model="config.FEATURE_ACI_CONVERSION">
<label for="ftmail">Enable ACI Conversion</label>
<input id="ftaci" type="checkbox" ng-model="config.FEATURE_ACI_CONVERSION">
<label for="ftaci">Enable ACI Conversion</label>
</div>
<div class="co-alert co-alert-info" ng-if="config.FEATURE_ACI_CONVERSION" style="margin-top: 20px;">

View file

@ -21,7 +21,7 @@ def add_enterprise_config_defaults(config_obj, current_secret_key, hostname):
# Default features that are off.
config_obj['FEATURE_MAILING'] = config_obj.get('FEATURE_MAILING', False)
config_obj['FEATURE_BUILD_SUPPORT'] = config_obj.get('FEATURE_BUILD_SUPPORT', False)
config_obj['FEATURE_ACI_CONVERSION'] = config_obj.get('FEATURE_ACI_CONVERSION', True)
config_obj['FEATURE_ACI_CONVERSION'] = config_obj.get('FEATURE_ACI_CONVERSION', False)
# Default the signer config.
config_obj['GPG2_PRIVATE_KEY_FILENAME'] = config_obj.get('GPG2_PRIVATE_KEY_FILENAME',
@ -30,6 +30,11 @@ def add_enterprise_config_defaults(config_obj, current_secret_key, hostname):
'signing-public.gpg')
config_obj['SIGNING_ENGINE'] = config_obj.get('SIGNING_ENGINE', 'gpg2')
# Default mail setings.
config_obj['MAIL_USE_TLS'] = True
config_obj['MAIL_PORT'] = 587
config_obj['MAIL_DEFAULT_SENDER'] = 'support@quay.io'
# Default auth type.
if not 'AUTHENTICATION_TYPE' in config_obj:
config_obj['AUTHENTICATION_TYPE'] = 'Database'

View file

@ -1,5 +1,10 @@
import gpgme
import os
import features
import logging
logger = logging.getLogger(__name__)
from StringIO import StringIO
class GPG2Signer(object):
@ -61,7 +66,13 @@ class Signer(object):
if preference is None:
return None
return SIGNING_ENGINES[preference](app.config, key_directory)
if not features.ACI_CONVERSION:
return None
try:
return SIGNING_ENGINES[preference](app.config, key_directory)
except Exception:
logger.exception('Could not initialize signing engine')
def __getattr__(self, name):
return getattr(self.state, name, None)