Commit Graph

20 Commits

Author SHA1 Message Date
Alexandre Alapetite
15814cfd35 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()
2026-01-03 17:48:33 +01:00
Alexandre Alapetite
128c375fc9 Debian 13 with OIDC fix (#8032)
Follow-up of https://github.com/FreshRSS/FreshRSS/pull/7772
fix https://github.com/FreshRSS/FreshRSS/issues/7860
fix https://github.com/FreshRSS/FreshRSS/issues/7798
Follow-up of https://github.com/FreshRSS/FreshRSS/pull/7805

PHP 8.4.11, Apache 2.4.65
* https://wiki.debian.org/DebianTrixie
* https://www.debian.org/releases/testing/release-notes/whats-new.en.html
* https://downloads.apache.org/httpd/CHANGES_2.4

And thanks to @CrazyWolf13 for [the debugging](https://github.com/OpenIDC/mod_auth_openidc/discussions/1349#discussioncomment-14542930)!

Co-authored-by: Tobias <96661824+CrazyWolf13@users.noreply.github.com>
2025-10-02 21:15:51 +02:00
Alexandre Alapetite
8ca70040b9 OIDC changelog + minor whitespace
+fix minor whitespace from https://github.com/FreshRSS/FreshRSS/pull/6730
2024-08-26 09:49:11 +02:00
pando85
82593f5968 Fix OIDC session params definition (#6730)
* Fix OIDC session params definition

- standardize environment variable names
- group all in the same configuration file
- use mod_auth_openidc default values
- fix `OIDCSessionMaxDuration` because it was not set with the previous
  code
- add documentation

* Add double quoting to prevent globbing and word splitting

* Revert line deleted by mistake
2024-08-25 19:57:30 +02:00
нездалисько
b4ceabc248 add OIDCSessionMaxDuration and OIDCSessionInactivityTimeout (#6642)
* add OIDCSessionMaxDuration and OIDCSessionInactivityTimeout

* entrypoint.sh OIDCSessionMaxDuration and Session fix

* fix: entrypoint.sh OIDCSessionMaxDuration and OIDCSessionInactivityTimeout and Alpine support

* Use Apache config file instead

* Spelling

* fixed after restarting the double OIDC lines

* Refactor

---------

Co-authored-by: Alexandre Alapetite <alexandre@alapetite.fr>
2024-08-14 08:55:29 +02:00
Mossroy
5374df384a Use RemoteIPInternalProxy directive of remoteip Apache module (#5740)
* Use RemoteIPInternalProxy directive of remoteip Apache module

instead of RemoteIPTrustedProxy directive

To allow internal IPs to be trusted: for internal clients,
and also for the case of chained internal reverse-proxies

Fixes #5726

* One last reference forgotten

---------

Co-authored-by: Alexandre Alapetite <alexandre@alapetite.fr>
2023-10-25 16:23:03 +02:00
Alexandre Alapetite
e7689459f2 Rework trusted proxies (#5549)
* Rework trusted proxies
Fix https://github.com/FreshRSS/FreshRSS/issues/5502
Follow-up of https://github.com/FreshRSS/FreshRSS/pull/3226

New environment variable `TRUSTED_PROXY`: set to 0 to disable, or to a list of trusted IP ranges compatible with https://httpd.apache.org/docs/current/mod/mod_remoteip.html#remoteiptrustedproxy

New internal environment variable `CONN_REMOTE_ADDR` to remember the true IP address of the connection (e.g. last proxy), even when using mod_remoteip.

Current working setups should not observe any significant change.

* Minor whitespace

* Safer trusted sources during install
Rework of https://github.com/FreshRSS/FreshRSS/pull/5358
https://github.com/FreshRSS/FreshRSS/issues/5357

* Minor readme
2023-07-30 12:59:18 +02:00
otaconix
a066be93b0 Add OIDC_X_FORWARDED_HEADERS environment variable (fixes #5516) (#5523)
* Add OIDC_X_FORWARDED_HEADERS environment variable (fixes #5516)

The mod_auth_oidc needs an additional directive (`OIDCXForwardedHeaders`)
in case FreshRSS is running behind a reverse proxy, so it knows what host,
protocol and port were used to access it. This information is then used
in the `redirect_uri` when directing the user agent (browser) to the identity
provider for authentication.

Please note that, if you are running FreshRSS behind a reverse proxy that
handles TLS, you may need to update your identity provider's configuration so
it accepts `https://...` as a `redirect_uri`.

* Add link to mod_auth_openidc's documentation for the OIDCXForwardedHeaders Apache configuration directive

* Minor spelling

---------

Co-authored-by: Stefan Zwanenburg <stefan@zwanenburg.info>
Co-authored-by: Alexandre Alapetite <alexandre@alapetite.fr>
2023-07-16 14:50:42 +02:00
otaconix
fc579bd2bc Allow choosing the OIDC remote user claim and scopes to request from the identity provider (#5481)
* Allow choosing the OIDC remote user claim and scopes to request from the identity provider

* Added comment to explain how checking whether an environment variable is set is done

* Use apostrophe's instead of single quotes for verb contractions in docs

* Move variables used for checking presence of environment variables inside IfDefine block
2023-06-30 12:58:20 +02:00
Aaron Schif
58b254f9cb Add OpenID Connect (#5351)
* Add OIDC

* Update documentation.

* Update apache conf adding IfModule

* Use IfDefine for OIDC in apache conf

* Fix non-oidc support

* Fix typing

* Use IfDefine to enable OIDC

* Add OIDC support to all dockerfiles

* Re add apache Require option

* Fixes and documentation

* A few more fixes

* A bit more doc

* Change type of environment variable

* Update readme

* Correct apache config for OIDC support.

* Fix README formatting

* Update oidc control path

* Fix oidc endpoint being cached

* A bit more review

* Simplify ExpiresActive

* Add session refresh and improve caching

* Allow more different setups

* A bit more documentation

* A bit more readme

---------

Co-authored-by: Aaron Schif <aschif@netdevgroup.com>
Co-authored-by: Alexandre Alapetite <alexandre@alapetite.fr>
Co-authored-by: maTh <math-home@web.de>
2023-06-12 10:22:46 +02:00
Rufubi
9604856482 [Docker] Listening for IPv6 connections (#5180)
* Listen for IPv6 connections

* Added information about LISTEN6 variable

* Make LISTEN variable a comma-separated list of values

* Removed debug commands

* Revert changes

---------

Co-authored-by: Rufubi <>
2023-03-26 21:50:27 +02:00
Alexandre Alapetite
075cf4c800 API avoid logging passwords (#5001)
* API avoid logging passwords
* Strip passwords and tokens from API logs
* Only log failed requests information when in debug mode

* Remove debug SHA

* Clean also Apache logs

* Better comments

* Redact also token parameters

* shfmt

* Simplify whitespace

* redacted
2023-01-11 23:27:14 +01:00
Alexandre Alapetite
e1b2f6ae13 Apache TraceEnable Off (#4863)
I have just received an e-mail with a security concern.
Although most likely an obsolete concern (old browsers with Java applets), and the Apache team saying that there is no problem, let's disable the TRACE method by default in our Docker images until we hear anybody actually wanting this feature.
https://httpd.apache.org/docs/current/mod/core.html#traceenable
https://owasp.org/www-community/attacks/Cross_Site_Tracing
2022-11-16 23:27:45 +01:00
Alexandre Alapetite
816f4178dc Docker fix missing .htaccess (#4074)
Related to https://github.com/FreshRSS/FreshRSS/issues/4073
In our Docker configuration, `.htaccess` files are included only once at startup. The one for themes was missing.
2021-12-20 20:46:41 +01:00
Alexandre Alapetite
e0b80e82e2 Docker LogFormat Alpine (#3235)
#fix https://github.com/FreshRSS/FreshRSS/issues/3233
In Alpine, we need to enable mod_logio.c to use %O. Revert to more
standard %b
https://httpd.apache.org/docs/2.4/mod/mod_log_config.html#logformat
2020-10-22 00:04:10 +02:00
Alexandre Alapetite
9ab05c7f67 Docker: Use Apache remoteip (#3226)
#fix https://github.com/FreshRSS/FreshRSS/issues/3224
Log the client remote IP instead of the local proxy IP
https://httpd.apache.org/docs/2.4/mod/mod_remoteip.html
2020-10-16 09:25:43 +02:00
Alexandre Alapetite
fc8fb0a7ee Docker image alternative using Ubuntu (#2205)
* Docker image alternative using Ubuntu

Ubuntu seems to be faster, cf. e.g. PHPBench.
It is quite usual for Docker images to offer both a Debian/Ubuntu and an
Alpine version, so we could also do the same if there is any need.
Follow-up of https://github.com/FreshRSS/FreshRSS/pull/2202

* Only explicit use of Apache confs

Fix double-logging issue

* Explicit ServerTokens OS

Default Apache configuration in Ubuntu, which was removed when disabling all confs.
It is also the default Apache configuration in Alpine.

* Take advantage of syslog for actualization

Same than for Alpine
43ab629e27

* COPY_SYSLOG_TO_STDERR

Same as https://github.com/FreshRSS/FreshRSS/pull/2213

* Update to libapache2-mod-php instead of php-fpm

* Default to Ubuntu

Ubuntu mod-php wins, being ~14% faster than Ubuntu php-fpm (which was ~300% faster than Alpine mod-php)
2019-03-02 21:49:20 +01:00
Alexandre Alapetite
a6623b7b2f Apache performance (#2202)
* Apache performance
API: Use SetEnvIf if available and fallback to RewriteRule
Docker: Disable unused modules.
Docker: Hard-include .htaccess to avoid having to scan for changes in
that file.
Docker: Disable security check of symlinks, which we do not use ayway.

* Apache readme

* Docker/Apache tuning
Run cron job with correct www-data user instead of root
Remove PHP GMP module uneeded for 64-bit Docker image
Add option to mount custom .htaccess for HTTP authentication
Re-add Apache module for HTTP authentication
Move Alpine-specific instructions to Docker file (instead of Apache
conf) to make it easier to have other base images than Alpine
2019-01-02 21:36:33 +01:00
Alexandre Alapetite
90998c2437 Apache overrides were not enough (#1873)
It looks like overrides of CustomLog, ErrorLog, Listen did not do the
job fully.
Updated to comment out those lines in httpd.conf.
Fixes the fact that logs were kept in /var/log/apache2/ (instead of
being only given via STDOUT to Docker logs) and the "internal dummy
connection" bug over IPv6 (Docker is typically only IPv4).
2018-04-26 13:52:44 +02:00
Alexandre Alapetite
71918dbc5a New Docker (#1813)
* Draft of new Docker

Based on Alpine Linux. Size ~78MB.
https://github.com/FreshRSS/docker-freshrss/issues/4
https://github.com/FreshRSS/FreshRSS/issues/520
https://github.com/FreshRSS/docker-freshrss
https://github.com/FreshRSS/docker-freshrss-production

* Docker readme

* +x execution rights prepare

* Docker readme links to hub.docker.com

https://hub.docker.com/r/freshrss/freshrss/
2018-03-04 01:02:02 +01:00