First working certificate generation code, related to #35

This commit is contained in:
Pierre Jaury
2016-11-09 16:18:16 +01:00
parent 0bde4fe05a
commit 4246179b88
5 changed files with 87 additions and 2 deletions

View File

@@ -28,7 +28,9 @@ default_config = {
'DKIM_PATH': '/dkim/{domain}.{selector}.key',
'DKIM_SELECTOR': 'dkim',
'BABEL_DEFAULT_LOCALE': 'en',
'BABEL_DEFAULT_TIMEZONE': 'UTC'
'BABEL_DEFAULT_TIMEZONE': 'UTC',
'ENABLE_CERTBOT': False,
'CERTS_PATH': '/certs'
}
# Load configuration from the environment if available
@@ -61,6 +63,10 @@ if not app.debug or os.environ.get('WERKZEUG_RUN_MAIN') == 'true':
def get_locale():
return flask.request.accept_languages.best_match(translations)
# Certbot configuration
if app.config['ENABLE_CERTBOT']:
from mailu import certbot
# Finally setup the blueprint and redirect /
from mailu import admin
app.register_blueprint(admin.app, url_prefix='/admin')