Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a configuration to mask some of the information that is shown in the config tab of the worker view #1347

Open
ercpereda opened this issue Jan 4, 2024 · 0 comments

Comments

@ercpereda
Copy link

Is your feature request related to a problem? Please describe.
The Config tab of the worker view can show the value of the celery config that contains secrets.

Describe the solution you'd like
Add a configuration to Flower to list the variables that should be masked before being shown in the config tab.

Modifying this template a little could be enough.

<div class="tab-pane fade" id="tab-config" role="tabpanel" aria-labelledby="tab-config">
<div class="col-lg-8">
<table class="table table-bordered table-striped caption-top">
<caption>Configuration options</caption>
<tbody>
{% for name,value in sorted(worker.get('conf', {}).items()) %}
{% if value is not None %}
<tr>
<td><a
href="https://docs.celeryq.dev/en/latest/userguide/configuration.html#{{ name.lower().replace('_', '-') }}"
target="_blank">{{ name }}</a></td>
<td>{{ value }}</td>
</tr>
{% end %}
{% end %}
</tbody>
</table>
</div>
</div> <!-- end config tab -->

          <div class="tab-pane fade" id="tab-config" role="tabpanel" aria-labelledby="tab-config">
            <div class="col-lg-8">
              <table class="table table-bordered table-striped caption-top">
                <caption>Configuration options</caption>
                <tbody>
                  {% for name,value in sorted(worker.get('conf', {}).items()) %}
                  {% if value is not None %}
                  <tr>
                    <td><a
                        href="https://docs.celeryq.dev/en/latest/userguide/configuration.html#{{ name.lower().replace('_', '-') }}"
                        target="_blank">{{ name }}</a></td>
                    - <td>{{ value }}</td>
                    + <td>{{ value if name not in LIST_OF_SECRETS_DEFINED_IN_THE_CONFIG  else '********' }}
                  </tr>
                  {% end %}
                  {% end %}
                </tbody>
              </table>
            </div>
          </div> <!-- end config tab -->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant