improved allowed hosts docs, default config and added a system warning

This commit is contained in:
vabene1111
2024-06-27 13:48:11 +02:00
parent 965f7c04d8
commit 17d34c5ca7
4 changed files with 27 additions and 12 deletions

View File

@@ -82,6 +82,17 @@
{% else %}
{% trans 'Everything is fine!' %}
{% endif %}
<h4 class="mt-3">{% trans 'Allowed Hosts' %} <span
class="badge badge-{% if '*' in allowed_hosts %}warning{% else %}success{% endif %}">{% if '*' in allowed_hosts %}
{% trans 'Warning' %}{% else %}{% trans 'Ok' %}{% endif %}</span></h4>
{% if debug %}
{% blocktrans %}
Your allowed hosts are configured to allow every host. This might be ok in some setups but should be avoided. Please see the docs about this.
{% endblocktrans %}
{% else %}
{% trans 'Everything is fine!' %}
{% endif %}
<h4 class="mt-3">{% trans 'Database' %}
<span class="badge badge-{{ postgres_status }}">

View File

@@ -348,7 +348,7 @@ def system(request):
request, 'system.html', {
'gunicorn_media': settings.GUNICORN_MEDIA, 'debug': settings.DEBUG, 'postgres': postgres, 'postgres_version': postgres_ver, 'postgres_status': database_status,
'postgres_message': database_message, 'version_info': VERSION_INFO, 'plugins': PLUGINS, 'secret_key': secret_key, 'orphans': orphans, 'migration_info': migration_info,
'missing_migration': missing_migration,
'missing_migration': missing_migration, 'allowed_hosts': settings.ALLOWED_HOSTS,
})