mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2026-07-27 03:31:35 +00:00
Mention in docs and messages, that the env in docker-compose must not be quoted
Fixed issue #1453
This commit is contained in:
parent
9d438d7d97
commit
3de2c91d93
8 changed files with 61 additions and 14 deletions
|
|
@ -23,12 +23,16 @@
|
|||
<p>Try following things:</p>
|
||||
<ul>
|
||||
<li>Ensure that you are using the correct URL to access Part-DB.</li>
|
||||
<li>Set the <code>TRUSTED_HOSTS</code> environment variable in your <code>.env.local</code> file (or your docker-compose environment) to a regular expression matching all host names Part-DB should be reachable under, e.g.
|
||||
{% if seen_host %}
|
||||
<code>TRUSTED_HOSTS='^({{ seen_host|replace({'.': '\\.'}) }})$'</code> (if <code>{{ seen_host }}</code> is a host name you trust)
|
||||
{% else %}
|
||||
<code>TRUSTED_HOSTS='^(localhost|example\.com)$'</code>
|
||||
{% endif %}
|
||||
<li>Set the <code>TRUSTED_HOSTS</code> environment variable to a regular expression matching all host names Part-DB should be reachable under. Note that the required quoting differs depending on where you set it:
|
||||
<ul>
|
||||
{% if seen_host %}
|
||||
<li>In your <code>.env.local</code> file, the value must be wrapped in single quotes: <code>TRUSTED_HOSTS='^({{ seen_host|replace({'.': '\\.'}) }})$'</code> (if <code>{{ seen_host }}</code> is a host name you trust)</li>
|
||||
<li>In <code>docker-compose.yaml</code>, the value must NOT be quoted: <code>TRUSTED_HOSTS=^({{ seen_host|replace({'.': '\\.'}) }})$</code> (if <code>{{ seen_host }}</code> is a host name you trust)</li>
|
||||
{% else %}
|
||||
<li>In your <code>.env.local</code> file, the value must be wrapped in single quotes: <code>TRUSTED_HOSTS='^(localhost|example\.com)$'</code></li>
|
||||
<li>In <code>docker-compose.yaml</code>, the value must NOT be quoted: <code>TRUSTED_HOSTS=^(localhost|example\.com)$</code></li>
|
||||
{% endif %}
|
||||
</ul>
|
||||
</li>
|
||||
<li>If Part-DB is running behind a reverse proxy, also make sure that <code>TRUSTED_PROXIES</code> is configured correctly, so the original host name is forwarded properly.</li>
|
||||
<li>Run <kbd>php bin/console cache:clear</kbd> after changing the configuration.</li>
|
||||
|
|
|
|||
|
|
@ -98,9 +98,12 @@
|
|||
{% if trusted_hosts_unconfigured and is_granted('@system.server_infos') %}
|
||||
<div class="alert alert-warning" role="alert">
|
||||
<h5><i class="fa-solid fa-triangle-exclamation fa-fw"></i> {% trans %}system.trusted_hosts.unconfigured.title{% endtrans %}</h5>
|
||||
<p class="mb-1">{% trans %}system.trusted_hosts.unconfigured.message{% endtrans %}</p>
|
||||
<p class="mb-0">{% trans %}system.trusted_hosts.unconfigured.suggestion{% endtrans %}
|
||||
<br><code>TRUSTED_HOSTS='^({{ app.request.host|replace({'.': '\\.'}) }})$'</code></p>
|
||||
<p class="mb-1">{% trans %}system.trusted_hosts.unconfigured.message{% endtrans %}
|
||||
{% trans %}system.trusted_hosts.unconfigured.suggestion{% endtrans %}</p>
|
||||
<p class="mb-0">{% trans %}system.trusted_hosts.unconfigured.env_example{% endtrans %}
|
||||
<code>TRUSTED_HOSTS='^({{ app.request.host|replace({'.': '\\.'}) }})$'</code></p>
|
||||
<p class="mb-0">{% trans %}system.trusted_hosts.unconfigured.docker_example{% endtrans %}
|
||||
<code>TRUSTED_HOSTS=^({{ app.request.host|replace({'.': '\\.'}) }})$</code></p>
|
||||
<small>{% trans %}update_manager.new_version_available.only_administrators_can_see{% endtrans %}</small>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue