aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVosjedev <vosje@vosjedev.net>2025-11-02 19:05:32 +0100
committerVosjedev <vosje@vosjedev.net>2025-11-02 19:05:32 +0100
commitf4d79e811aa2995bbdaf171b69dd024200d321e2 (patch)
tree1e951025a63a46d3fb41fbcd0d6f55dd480a34d4
parent69b679357b785410eecf6b0021b022bac35a8e0c (diff)
downloadacit-f4d79e811aa2995bbdaf171b69dd024200d321e2.tar.gz
acit-f4d79e811aa2995bbdaf171b69dd024200d321e2.tar.bz2
acit-f4d79e811aa2995bbdaf171b69dd024200d321e2.tar.xz
Add ACIT_BEHIND_PROXY for reverse proxy configs
-rw-r--r--README.md1
-rw-r--r--compose.yml1
-rw-r--r--src/acit/__init__.py5
3 files changed, 6 insertions, 1 deletions
diff --git a/README.md b/README.md
index 1cae78b..7a96fd0 100644
--- a/README.md
+++ b/README.md
@@ -75,6 +75,7 @@ MYSQL_HOST=localhost # the hostname/ip of the server. to define a port, use host
# Settings
# --------
ACIT_HOME_REDIRECT=about:blank # where to redirect to when someone queries the webroot
+ACIT_BEHIND_PROXY= # when set, acit displays the 'real ip' when behind a proxy
# the following option should be the full path to an executable.
# said executable should return a table of trackers and urls.
diff --git a/compose.yml b/compose.yml
index 95fa6d0..c00c167 100644
--- a/compose.yml
+++ b/compose.yml
@@ -29,6 +29,7 @@ services:
- ACIT_MAIL_DOMAIN=example.com
#- ACIT_MAIL_USES_ALIASES=true # uncomment to enable
- ACIT_HOME_REDIRECT=about:blank
+ - ACIT_BEHIND_PROXY=true
volumes:
- ./acit-list-trackers:/usr/lib/acit-list-trackers
diff --git a/src/acit/__init__.py b/src/acit/__init__.py
index 63d667e..ac96935 100644
--- a/src/acit/__init__.py
+++ b/src/acit/__init__.py
@@ -1,4 +1,6 @@
+from os import getenv
+
import cherrypy
from .web import Server
@@ -25,7 +27,8 @@ def run():
server=Server(dbpool=db,site=site,imap=imap)
cherrypy.quickstart(server,'/',{
'global':{
- 'server.socket_host':'0.0.0.0'
+ 'server.socket_host':'0.0.0.0',
+ 'tools.proxy.on':True if getenv("ACIT_BEHIND_PROXY") else False
}
})