Merge pull request #1285 from coreos-inc/configmaildefaults
Fix mail and signing defaults
This commit is contained in:
commit
b9f47f6761
3 changed files with 20 additions and 4 deletions
|
@ -297,8 +297,8 @@
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="co-checkbox">
|
<div class="co-checkbox">
|
||||||
<input id="ftmail" type="checkbox" ng-model="config.FEATURE_ACI_CONVERSION">
|
<input id="ftaci" type="checkbox" ng-model="config.FEATURE_ACI_CONVERSION">
|
||||||
<label for="ftmail">Enable ACI Conversion</label>
|
<label for="ftaci">Enable ACI Conversion</label>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="co-alert co-alert-info" ng-if="config.FEATURE_ACI_CONVERSION" style="margin-top: 20px;">
|
<div class="co-alert co-alert-info" ng-if="config.FEATURE_ACI_CONVERSION" style="margin-top: 20px;">
|
||||||
|
|
|
@ -21,7 +21,7 @@ def add_enterprise_config_defaults(config_obj, current_secret_key, hostname):
|
||||||
# Default features that are off.
|
# Default features that are off.
|
||||||
config_obj['FEATURE_MAILING'] = config_obj.get('FEATURE_MAILING', False)
|
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_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.
|
# Default the signer config.
|
||||||
config_obj['GPG2_PRIVATE_KEY_FILENAME'] = config_obj.get('GPG2_PRIVATE_KEY_FILENAME',
|
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')
|
'signing-public.gpg')
|
||||||
config_obj['SIGNING_ENGINE'] = config_obj.get('SIGNING_ENGINE', 'gpg2')
|
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.
|
# Default auth type.
|
||||||
if not 'AUTHENTICATION_TYPE' in config_obj:
|
if not 'AUTHENTICATION_TYPE' in config_obj:
|
||||||
config_obj['AUTHENTICATION_TYPE'] = 'Database'
|
config_obj['AUTHENTICATION_TYPE'] = 'Database'
|
||||||
|
|
|
@ -1,5 +1,10 @@
|
||||||
import gpgme
|
import gpgme
|
||||||
import os
|
import os
|
||||||
|
import features
|
||||||
|
import logging
|
||||||
|
|
||||||
|
logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
from StringIO import StringIO
|
from StringIO import StringIO
|
||||||
|
|
||||||
class GPG2Signer(object):
|
class GPG2Signer(object):
|
||||||
|
@ -61,7 +66,13 @@ class Signer(object):
|
||||||
if preference is None:
|
if preference is None:
|
||||||
return None
|
return None
|
||||||
|
|
||||||
|
if not features.ACI_CONVERSION:
|
||||||
|
return None
|
||||||
|
|
||||||
|
try:
|
||||||
return SIGNING_ENGINES[preference](app.config, key_directory)
|
return SIGNING_ENGINES[preference](app.config, key_directory)
|
||||||
|
except Exception:
|
||||||
|
logger.exception('Could not initialize signing engine')
|
||||||
|
|
||||||
def __getattr__(self, name):
|
def __getattr__(self, name):
|
||||||
return getattr(self.state, name, None)
|
return getattr(self.state, name, None)
|
||||||
|
|
Reference in a new issue