Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Installation process step 3 not possible when already integrated in traefik and authelia #5357

Closed
CDaxi opened this issue Apr 29, 2023 · 3 comments · Fixed by #5358
Closed
Labels
Bug (confirmed) 🐞 issues that are reproducable Docker Everything related to Docker Security 🛡️
Milestone

Comments

@CDaxi
Copy link

CDaxi commented Apr 29, 2023

Describe the bug
If you use the Docker image from linux servers (lscr.io/linuxserver/freshrss), there will be a fatal error thrown when calling httpAuthUser() in step 3 of the installation.

<br />
--
  | <b>Fatal error</b>:  Uncaught FreshRSS_Context_Exception: System configuration not initialised! in /app/www/lib/lib_rss.php:670
  | Stack trace:
  | #0 /app/www/lib/lib_rss.php(685): checkTrustedIP()
  | #1 /app/www/app/install.php(571): httpAuthUser()
  | #2 /app/www/app/install.php(738): printStep3()
  | #3 /app/www/p/i/index.php(30): require('...')
  | #4 {main}
  | thrown in <b>/app/www/lib/lib_rss.php</b> on line <b>670</b><br />

httpAuthUser will call checkTrustedIP but the configuration about the trusted IP is not done at this point.
This means $_SERVER['HTTP_REMOTE_USER'] is present, checkTrustedIP is executed but not configured now and there is no check if you are at the installation process.

To Reproduce

  • Docker installation with traefik reverse proxy and authelia SSO
  • Should also be reproduceble when http header "Remote-User" is present and step 3 is shown in browser.

Expected behavior
At least a installation process which can be completed.
To have a full working authetication with trusted http headers will need the trusted ip configuration too which is not shown in the installation.

My personal expectation will be to have at least the checkTrustedIP function written in a way that it detects a FreshRSS installation process and accept any IP at this point.

Screenshots
n/a

Environment information (please complete the following information):

  • Device: any
  • OS: any
  • Browser: any
  • FreshRSS version: 1.21.0
  • Database version: sqlite
  • PHP version: 8.1
  • Installation type: Docker

Additional context

  • Docker configured
  • Traefik working as reverse proxy
  • Authelia configured as SSO container
  • New FreshRSS docker container already configured with needed docker labels for traefik and authelia
@Alkarex Alkarex added the Docker Everything related to Docker label Apr 29, 2023
@Alkarex Alkarex added this to the 1.22.0 milestone Apr 29, 2023
@Alkarex Alkarex added Security 🛡️ Bug (unconfirmed) issues thar could not reproduced yeat Bug (confirmed) 🐞 issues that are reproducable and removed Bug (unconfirmed) issues thar could not reproduced yeat labels Apr 29, 2023
Alkarex added a commit to Alkarex/FreshRSS that referenced this issue Apr 29, 2023
@Alkarex
Copy link
Member

Alkarex commented Apr 29, 2023

Thanks for the bug report. Should be fixed by #5358 (not much tested yet)
Would you be able to test? Let me know.

To test, you can for instance instruct your Docker or docker-compose to build from git:

    build:
      context: https://github.com/Alkarex/FreshRSS.git#trusted_sources-install
      dockerfile: Docker/Dockerfile-Alpine

@CDaxi
Copy link
Author

CDaxi commented Apr 30, 2023

OK:
The installation form issue is fixed.

Still an issue:
At the config.php:

  • auth_type is still set to "form"
  • trusted_sources will not contain the ip

There should be at least an information that these data has to manually changed by the admin.
The better way would be to add the input for trusted_sources at the installation process and display it only if the http_auth is selected.

Thanks for the quick response to my issue.

Alkarex added a commit that referenced this issue May 2, 2023
* Automatic trusted_sources during install
Fix #5357

* Fix install for http_auth

* Update lib/lib_rss.php

Co-authored-by: Luc SANCHEZ <4697568+ColonelMoutarde@users.noreply.github.com>

* Fill null exception e-mail

* Revert some syntax

* Minor parentheses
@Alkarex
Copy link
Member

Alkarex commented Jul 26, 2023

Related change: #5549
Tests and feedback welcome

Alkarex added a commit to Alkarex/FreshRSS that referenced this issue Jul 26, 2023
Alkarex added a commit that referenced this issue Jul 30, 2023
* Rework trusted proxies
Fix #5502
Follow-up of #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 #5358
#5357

* Minor readme
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug (confirmed) 🐞 issues that are reproducable Docker Everything related to Docker Security 🛡️
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants