|
| 1 | +# |
| 2 | +# Licensed to the Apache Software Foundation (ASF) under one |
| 3 | +# or more contributor license agreements. See the NOTICE file |
| 4 | +# distributed with this work for additional information |
| 5 | +# regarding copyright ownership. The ASF licenses this file |
| 6 | +# to you under the Apache License, Version 2.0 (the |
| 7 | +# "License"); you may not use this file except in compliance |
| 8 | +# with the License. You may obtain a copy of the License at |
| 9 | +# |
| 10 | +# http://www.apache.org/licenses/LICENSE-2.0 |
| 11 | +# |
| 12 | +# Unless required by applicable law or agreed to in writing, |
| 13 | +# software distributed under the License is distributed on an |
| 14 | +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
| 15 | +# KIND, either express or implied. See the License for the |
| 16 | +# specific language governing permissions and limitations |
| 17 | +# under the License. |
| 18 | +"""Default configuration for the Airflow webserver.""" |
| 19 | +from __future__ import annotations |
| 20 | + |
| 21 | +import os |
| 22 | + |
| 23 | +from airflow.www.fab_security.manager import AUTH_DB |
| 24 | + |
| 25 | +# from airflow.www.fab_security.manager import AUTH_LDAP |
| 26 | +# from airflow.www.fab_security.manager import AUTH_OAUTH |
| 27 | +# from airflow.www.fab_security.manager import AUTH_OID |
| 28 | +# from airflow.www.fab_security.manager import AUTH_REMOTE_USER |
| 29 | + |
| 30 | +basedir = os.path.abspath(os.path.dirname(__file__)) |
| 31 | + |
| 32 | +# Flask-WTF flag for CSRF |
| 33 | +WTF_CSRF_ENABLED = True |
| 34 | + |
| 35 | +# ---------------------------------------------------- |
| 36 | +# AUTHENTICATION CONFIG |
| 37 | +# ---------------------------------------------------- |
| 38 | +# For details on how to set up each of the following authentication, see |
| 39 | +# http://flask-appbuilder.readthedocs.io/en/latest/security.html# authentication-methods |
| 40 | +# for details. |
| 41 | + |
| 42 | +# The authentication type |
| 43 | +# AUTH_OID : Is for OpenID |
| 44 | +# AUTH_DB : Is for database |
| 45 | +# AUTH_LDAP : Is for LDAP |
| 46 | +# AUTH_REMOTE_USER : Is for using REMOTE_USER from web server |
| 47 | +# AUTH_OAUTH : Is for OAuth |
| 48 | +AUTH_TYPE = AUTH_DB |
| 49 | + |
| 50 | +# Uncomment to setup Full admin role name |
| 51 | +AUTH_ROLE_ADMIN = "Admin" |
| 52 | + |
| 53 | +# Uncomment and set to desired role to enable access without authentication |
| 54 | +AUTH_ROLE_PUBLIC = "Admin" |
| 55 | + |
| 56 | +# Will allow user self registration |
| 57 | +AUTH_USER_REGISTRATION = False |
| 58 | + |
| 59 | +# The recaptcha it's automatically enabled for user self registration is active and the keys are necessary |
| 60 | +# RECAPTCHA_PRIVATE_KEY = PRIVATE_KEY |
| 61 | +# RECAPTCHA_PUBLIC_KEY = PUBLIC_KEY |
| 62 | + |
| 63 | +# Config for Flask-Mail necessary for user self registration |
| 64 | +# MAIL_SERVER = 'smtp.gmail.com' |
| 65 | +# MAIL_USE_TLS = True |
| 66 | +# MAIL_USERNAME = 'yourappemail@gmail.com' |
| 67 | +# MAIL_PASSWORD = 'passwordformail' |
| 68 | +# MAIL_DEFAULT_SENDER = 'sender@gmail.com' |
| 69 | + |
| 70 | +# The default user self registration role |
| 71 | +# AUTH_USER_REGISTRATION_ROLE = "Public" |
| 72 | + |
| 73 | +# When using OAuth Auth, uncomment to setup provider(s) info |
| 74 | +# Google OAuth example: |
| 75 | +# OAUTH_PROVIDERS = [{ |
| 76 | +# 'name':'google', |
| 77 | +# 'token_key':'access_token', |
| 78 | +# 'icon':'fa-google', |
| 79 | +# 'remote_app': { |
| 80 | +# 'api_base_url':'https://www.googleapis.com/oauth2/v2/', |
| 81 | +# 'client_kwargs':{ |
| 82 | +# 'scope': 'email profile' |
| 83 | +# }, |
| 84 | +# 'access_token_url':'https://accounts.google.com/o/oauth2/token', |
| 85 | +# 'authorize_url':'https://accounts.google.com/o/oauth2/auth', |
| 86 | +# 'request_token_url': None, |
| 87 | +# 'client_id': GOOGLE_KEY, |
| 88 | +# 'client_secret': GOOGLE_SECRET_KEY, |
| 89 | +# } |
| 90 | +# }] |
| 91 | + |
| 92 | +# When using LDAP Auth, setup the ldap server |
| 93 | +# AUTH_LDAP_SERVER = "ldap://ldapserver.new" |
| 94 | + |
| 95 | +# When using OpenID Auth, uncomment to setup OpenID providers. |
| 96 | +# example for OpenID authentication |
| 97 | +# OPENID_PROVIDERS = [ |
| 98 | +# { 'name': 'Yahoo', 'url': 'https://me.yahoo.com' }, |
| 99 | +# { 'name': 'AOL', 'url': 'http://openid.aol.com/<username>' }, |
| 100 | +# { 'name': 'Flickr', 'url': 'http://www.flickr.com/<username>' }, |
| 101 | +# { 'name': 'MyOpenID', 'url': 'https://www.myopenid.com' }] |
| 102 | + |
| 103 | +# ---------------------------------------------------- |
| 104 | +# Theme CONFIG |
| 105 | +# ---------------------------------------------------- |
| 106 | +# Flask App Builder comes up with a number of predefined themes |
| 107 | +# that you can use for Apache Airflow. |
| 108 | +# http://flask-appbuilder.readthedocs.io/en/latest/customizing.html#changing-themes |
| 109 | +# Please make sure to remove "navbar_color" configuration from airflow.cfg |
| 110 | +# in order to fully utilize the theme. (or use that property in conjunction with theme) |
| 111 | +# APP_THEME = "bootstrap-theme.css" # default bootstrap |
| 112 | +# APP_THEME = "amelia.css" |
| 113 | +# APP_THEME = "cerulean.css" |
| 114 | +# APP_THEME = "cosmo.css" |
| 115 | +# APP_THEME = "cyborg.css" |
| 116 | +# APP_THEME = "darkly.css" |
| 117 | +# APP_THEME = "flatly.css" |
| 118 | +# APP_THEME = "journal.css" |
| 119 | +# APP_THEME = "lumen.css" |
| 120 | +# APP_THEME = "paper.css" |
| 121 | +# APP_THEME = "readable.css" |
| 122 | +# APP_THEME = "sandstone.css" |
| 123 | +# APP_THEME = "simplex.css" |
| 124 | +# APP_THEME = "slate.css" |
| 125 | +# APP_THEME = "solar.css" |
| 126 | +# APP_THEME = "spacelab.css" |
| 127 | +# APP_THEME = "superhero.css" |
| 128 | +# APP_THEME = "united.css" |
| 129 | +# APP_THEME = "yeti.css" |
0 commit comments