aboutsummaryrefslogtreecommitdiff
path: root/Docker/entrypoint.sh
diff options
context:
space:
mode:
Diffstat (limited to 'Docker/entrypoint.sh')
-rwxr-xr-xDocker/entrypoint.sh10
1 files changed, 10 insertions, 0 deletions
diff --git a/Docker/entrypoint.sh b/Docker/entrypoint.sh
index 1b25026b5..6cb5a49b4 100755
--- a/Docker/entrypoint.sh
+++ b/Docker/entrypoint.sh
@@ -11,6 +11,16 @@ if [ -n "$LISTEN" ]; then
find /etc/apache2/ -type f -name FreshRSS.Apache.conf -exec sed -r -i "\\#^Listen#s#^.*#Listen $LISTEN#" {} \;
fi
+if [ -n "$TRUSTED_PROXY" ]; then
+ if [ "$TRUSTED_PROXY" -eq 0 ]; then
+ # Disable RemoteIPHeader and RemoteIPTrustedProxy
+ find /etc/apache2/ -type f -name FreshRSS.Apache.conf -exec sed -r -i "/^\s*RemoteIP.*$/s/^/#/" {} \;
+ else
+ # Custom list for RemoteIPTrustedProxy
+ find /etc/apache2/ -type f -name FreshRSS.Apache.conf -exec sed -r -i "\\#^\s*RemoteIPTrustedProxy#s#^.*#\tRemoteIPTrustedProxy $TRUSTED_PROXY#" {} \;
+ fi
+fi
+
if [ -n "$OIDC_ENABLED" ] && [ "$OIDC_ENABLED" -ne 0 ]; then
a2enmod -q auth_openidc
fi