You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by GitBox <gi...@apache.org> on 2021/03/07 08:10:44 UTC

[GitHub] [airflow] BasPH commented on a change in pull request #14641: Remove the default config from the Configuration View, show only running configuration

BasPH commented on a change in pull request #14641:
URL: https://github.com/apache/airflow/pull/14641#discussion_r588991403



##########
File path: airflow/www/views.py
##########
@@ -2653,42 +2653,39 @@ class ConfigurationView(AirflowBaseView):
     )
     def conf(self):
         """Shows configuration."""
-        raw = request.args.get('raw') == "true"
         title = "Airflow Configuration"
-        subtitle = AIRFLOW_CONFIG
-        # Don't show config when expose_config variable is False in airflow config
+
         if conf.getboolean("webserver", "expose_config"):
-            with open(AIRFLOW_CONFIG) as file:
-                config = file.read()
             table = [
                 (section, key, value, source)
                 for section, parameters in conf.as_dict(True, True).items()
                 for key, (value, source) in parameters.items()
             ]
-        else:
-            config = (
-                "# Your Airflow administrator chose not to expose the "
-                "configuration, most likely for security reasons."
+
+            if request.args.get('raw') == "true":
+                return Response(response=json.dumps(table), status=200, mimetype="application/json")
+
+            return self.render_template(
+                'airflow/config.html',
+                title=title,
+                pre_subtitle=settings.HEADER + "  v" + airflow.__version__,

Review comment:
       IMO it doesn't add anything relevant, so I'd remove it. Shall I add that to this PR?




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org