Skip to content

Commit 2e1f9a7

Browse files
ralf401mgruner
andauthored
Fixes #665 - Extended variable RAILS_TRUSTED_PROXIES
--------- Co-authored-by: Martin Gruner <[email protected]>
1 parent c7007e4 commit 2e1f9a7

File tree

2 files changed

+33
-29
lines changed

2 files changed

+33
-29
lines changed

appendix/configure-env-vars.rst

Lines changed: 21 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,19 @@
11
Configuration via Environment Variables
22
=======================================
33

4-
Use these environment variables to configure Zammad's behavior at runtime.
4+
Use environment variables to configure Zammad's settings and configuration.
5+
If you installed Zammad via docker, there is an additional page describing
6+
:doc:`/install/docker-compose/environment`.
57

6-
.. note:: 🙋 **What's an environment variable, and how do I “use” it?**
8+
.. note:: **How to set an environment variable?**
79

8-
Unfortunately, that question has a very long answer
9-
that goes beyond the scope of this article.
10-
How you set environment variables will depend on how you installed Zammad
11-
(*e.g.,* source, package, or Docker).
10+
It depends on how you installed Zammad (source, package, docker).
11+
Either set it via ``zammad config`` command as you can see below, use your
12+
system's way of setting variables via command line
13+
(e.g. ``export VARIABLE=value)``, place an ``.env`` file in the directory or
14+
even use a GUI like Portainer to define them for a docker installation.
1215

13-
But for package installations, here's a short answer:
16+
Example for package installations:
1417

1518
.. code-block:: sh
1619
@@ -25,9 +28,6 @@ Use these environment variables to configure Zammad's behavior at runtime.
2528
$ zammad config:unset OPTION
2629
$ systemctl restart zammad
2730
28-
To learn more, do some googling on environment variables
29-
and the shell environment (or execution environment) in Unix.
30-
3131
.. important::
3232

3333
While below options and remarks affect all installation types of Zammad,
@@ -112,6 +112,17 @@ ZAMMAD_WEBSOCKET_PORT
112112

113113
Default: ``6042``
114114

115+
RAILS_TRUSTED_PROXIES
116+
This setting is important for the correct detection of client IP addresses
117+
and features based on it, like rate limiting.
118+
119+
By default, Zammad trusts localhost proxies only. Any additional proxy servers
120+
will have to be added here, by IP address (if static) or by host name.
121+
Host names are resolved during the start of Zammad, so that a restart is required
122+
whenever the IP address of a proxy server changes.
123+
124+
Default: ``127.0.0.1,::1``
125+
115126
.. _performance_tuning:
116127

117128
Performance Tuning
@@ -167,14 +178,6 @@ ZAMMAD_PROCESS_SCHEDULED_JOBS_WORKERS
167178
| Default: **unset**
168179
| Maximum number of workers: ``1``
169180
170-
.. danger::
171-
172-
Disable processing of scheduled jobs by setting
173-
``ZAMMAD_PROCESS_SCHEDULED_JOBS_DISABLE``.
174-
175-
Doing so on productive instances will draw important parts of your
176-
instance not working. **WE STRONGLY** encourage against using this flag.
177-
178181
ZAMMAD_PROCESS_DELAYED_JOBS_WORKERS
179182
How many processes should work on delayed jobs?
180183

@@ -187,14 +190,6 @@ ZAMMAD_PROCESS_DELAYED_JOBS_WORKERS
187190
188191
.. warning:: 🥵 **This option can be very CPU-intensive.**
189192

190-
.. danger::
191-
192-
Disable processing of delayed jobs by setting
193-
``ZAMMAD_PROCESS_DELAYED_JOBS_DISABLE``.
194-
195-
Doing so on productive instances will draw important parts of your
196-
instance not working. **WE STRONGLY** encourage against using this flag.
197-
198193

199194
ZAMMAD_PROCESS_DELAYED_AI_JOBS_WORKERS
200195
How many instances of AI workers should run simultaneously. AI workers handle

install/docker-compose/environment.rst

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,18 @@ Zammad
3838
* - ZAMMAD_FQDN
3939
- ``(unset)``
4040
- Set the :admin-docs:`FQDN </settings/system/base.html>` for your instance.
41+
* - RAILS_TRUSTED_PROXIES
42+
- ``127.0.0.1,::1``
43+
- This setting is important for the correct detection of client IP addresses
44+
and features based on it, like rate limiting.
45+
46+
By default, Zammad trusts localhost proxies only. Any additional proxy servers
47+
will have to be added here, by IP address (if static) or by host name.
48+
Host names are resolved during the start of Zammad, so that a restart is required
49+
whenever the IP address of a proxy server changes.
50+
51+
Note that in docker context, Zammad may see the network gateway IP address instead of the
52+
actual proxy server IP address, if it is placed in another network.
4153
* - ZAMMAD_WEB_CONCURRENCY
4254
- ``(unset)``
4355
- Allows spawning ``n`` workers to allow more simultaneous connections for
@@ -72,9 +84,6 @@ Zammad
7284

7385
In case you applied :doc:`docker hardware resource limits </install/docker-compose/docker-compose-scenarios>`,
7486
the zammad-scheduler CPU setting should match the sum of all worker settings variables.
75-
* - RAILS_TRUSTED_PROXIES
76-
- ``['127.0.0.1', '::1']``
77-
- By default Zammad trusts localhost proxies only.
7887
* - MEMCACHE_SERVERS
7988
- ``zammad-memcached:11211``
8089
- Provide your own Memcached instance to Zammad if you already have one.

0 commit comments

Comments
 (0)