diff options
| author | 2026-01-03 17:48:33 +0100 | |
|---|---|---|
| committer | 2026-01-03 17:48:33 +0100 | |
| commit | 15814cfd35b8ac704a761530e14bd9efe6500ddc (patch) | |
| tree | 8484110f75cf1de09f285bffb9305cd1aa32d71d /Docker | |
| parent | 252703305758e2ed0e6257ae94fdb3b4b90f7184 (diff) | |
Add remote user in Apache logs, also for API (#8392)
* API: add remote user in Apache logs
fix https://github.com/FreshRSS/FreshRSS/discussions/8385
Example:
```
2026-01-01T18:38:28.645486326Z 0.0.0.0 - alex [01/Jan/2026:19:38:28 +0100] "GET /api/greader.php/reader/api/0/subscription/list?output=json HTTP/1.1" 200 9798 "-" "curl/8.14.1"
```
* Fallback mod_rewrite
* Log remote user with same priority as FreshRSS_http_Util::httpAuthUser()
Diffstat (limited to 'Docker')
| -rw-r--r-- | Docker/FreshRSS.Apache.conf | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/Docker/FreshRSS.Apache.conf b/Docker/FreshRSS.Apache.conf index 5868fae40..5db17e91a 100644 --- a/Docker/FreshRSS.Apache.conf +++ b/Docker/FreshRSS.Apache.conf @@ -14,7 +14,11 @@ ErrorLog /dev/stderr RemoteIPInternalProxy 10.0.0.1/8 172.16.0.1/12 192.168.0.1/16 </IfModule> -LogFormat "%a %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined_proxy +# Default, will be overridden by p/.htaccess and p/api/.htaccess +SetEnvIfExpr "reqenv('LOG_REMOTE_USER') == ''" LOG_REMOTE_USER=- +SetEnvIfExpr "reqenv('LOG_REMOTE_USER') == '-' && reqenv('REMOTE_USER') =~ /(.+)/" LOG_REMOTE_USER=$1 + +LogFormat "%a %l %{LOG_REMOTE_USER}e %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined_proxy CustomLog "|/var/www/FreshRSS/cli/sensitive-log.sh" combined_proxy <IfDefine OIDC_ENABLED> |
