aboutsummaryrefslogtreecommitdiff
path: root/p/api
diff options
context:
space:
mode:
authorGravatar Alexandre Alapetite <alexandre@alapetite.fr> 2026-01-03 17:48:33 +0100
committerGravatar GitHub <noreply@github.com> 2026-01-03 17:48:33 +0100
commit15814cfd35b8ac704a761530e14bd9efe6500ddc (patch)
tree8484110f75cf1de09f285bffb9305cd1aa32d71d /p/api
parent252703305758e2ed0e6257ae94fdb3b4b90f7184 (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 'p/api')
-rw-r--r--p/api/.htaccess3
1 files changed, 3 insertions, 0 deletions
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 @@
<IfModule mod_setenvif.c>
SetEnvIfNoCase "Authorization" "(.*)" HTTP_AUTHORIZATION=$1
+ SetEnvIfNoCase "Authorization" "^GoogleLogin auth=([^/]+)" REMOTE_USER=$1 LOG_REMOTE_USER=$1
</IfModule>
<IfModule !mod_setenvif.c>
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
+ RewriteCond %{HTTP:Authorization} "^GoogleLogin auth=([^/]+)" [NC]
+ RewriteRule .* - [E=REMOTE_USER:%1,E=LOG_REMOTE_USER:%1]
</IfModule>
</IfModule>