From 15814cfd35b8ac704a761530e14bd9efe6500ddc Mon Sep 17 00:00:00 2001 From: Alexandre Alapetite Date: Sat, 3 Jan 2026 17:48:33 +0100 Subject: 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() --- p/api/.htaccess | 3 +++ 1 file changed, 3 insertions(+) (limited to 'p/api') diff --git a/p/api/.htaccess b/p/api/.htaccess index dd3df0b4f..3597751f6 100644 --- a/p/api/.htaccess +++ b/p/api/.htaccess @@ -1,9 +1,12 @@ SetEnvIfNoCase "Authorization" "(.*)" HTTP_AUTHORIZATION=$1 + SetEnvIfNoCase "Authorization" "^GoogleLogin auth=([^/]+)" REMOTE_USER=$1 LOG_REMOTE_USER=$1 RewriteEngine on RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}] + RewriteCond %{HTTP:Authorization} "^GoogleLogin auth=([^/]+)" [NC] + RewriteRule .* - [E=REMOTE_USER:%1,E=LOG_REMOTE_USER:%1] -- cgit v1.2.3