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

FreshRSS module hard dependent on Nginx #346219

Closed
jacekpoz opened this issue Oct 3, 2024 · 15 comments · Fixed by #347324
Closed

FreshRSS module hard dependent on Nginx #346219

jacekpoz opened this issue Oct 3, 2024 · 15 comments · Fixed by #347324

Comments

@jacekpoz
Copy link
Contributor

jacekpoz commented Oct 3, 2024

Issue description

With services.freshrss.virtualHost set to null, an nginx virtual host isn't created, but a phpfpm pool is still created, expecting an nginx user. If you then set services.freshrss.pool to anything other than "freshrss" (e.g. ""), the freshrss-config service fails with the following log

Oct 03 20:24:01 chmura systemd[1]: Starting Set up the state directory for FreshRSS before use...
Oct 03 20:24:01 chmura freshrss-config-start[1555183]: Warning: scandir(/nix/store/4j0pgzgk1w07fqrgjk4bcn5mx4xgrc6a-freshrss-extensions/share/freshrss//extensions): Failed to open directory: No such file or directory in /nix/store/zq0g5j99rd5a12g9s4afnrn4qxj20kzi-FreshRSS-1.24.3/lib/Minz/ExtensionManager.php on line 127
Oct 03 20:24:01 chmura freshrss-config-start[1555183]: Warning: scandir(): (errno 2): No such file or directory in /nix/store/zq0g5j99rd5a12g9s4afnrn4qxj20kzi-FreshRSS-1.24.3/lib/Minz/ExtensionManager.php on line 127
Oct 03 20:24:01 chmura freshrss-config-start[1555183]: FreshRSS deprecation warning: the CLI option(s): base_url, auth_type are deprecated and will be removed in a future release. Use: base-url, auth-type instead
Oct 03 20:24:01 chmura freshrss-config-start[1555183]: Reconfiguring FreshRSS…
Oct 03 20:24:01 chmura freshrss-config-start[1555202]: Warning: scandir(/nix/store/4j0pgzgk1w07fqrgjk4bcn5mx4xgrc6a-freshrss-extensions/share/freshrss//extensions): Failed to open directory: No such file or directory in /nix/store/zq0g5j99rd5a12g9s4afnrn4qxj20kzi-FreshRSS-1.24.3/lib/Minz/ExtensionManager.php on line 127
Oct 03 20:24:01 chmura freshrss-config-start[1555202]: Warning: scandir(): (errno 2): No such file or directory in /nix/store/zq0g5j99rd5a12g9s4afnrn4qxj20kzi-FreshRSS-1.24.3/lib/Minz/ExtensionManager.php on line 127
Oct 03 20:24:01 chmura freshrss-config-start[1555202]: FreshRSS error: user not found: admin
Oct 03 20:24:01 chmura systemd[1]: freshrss-config.service: Main process exited, code=exited, status=1/FAILURE
Oct 03 20:24:01 chmura systemd[1]: freshrss-config.service: Failed with result 'exit-code'.
Oct 03 20:24:01 chmura systemd[1]: Failed to start Set up the state directory for FreshRSS before use.

There's also no port option making it pretty hard to set up any reverse proxy with this service.

Steps to reproduce

services.freshrss = {
  enable = true;
  baseUrl = "http://freshrss.example.com";
  authType = "none";
  virtualHost = null;
  pool = "";
};
@jacekpoz
Copy link
Contributor Author

jacekpoz commented Oct 3, 2024

cc: @etu @Stunkymonkey @mattchrist

@Stunkymonkey
Copy link
Contributor

see #347324 for a possible fix

@jacekpoz
Copy link
Contributor Author

can't test right now but I'm almost certain the following config on your PR will act the same as the one above does currently

services.freshrss = {
  enable = true;
  baseUrl = "http://freshrss.example.com";
  authType = "none";
  virtualHost = null;
  pool = null; # null is default, could be left out
};

@Stunkymonkey
Copy link
Contributor

@jacekpoz please try it. from point of view this should work:

services.freshrss = {
  enable = true;
  baseUrl = "http://freshrss.example.com";
  authType = "none";
  virtualHost = null;
  pool = null;
};

@jacekpoz
Copy link
Contributor Author

I did, that PR changes nothing

Oct 13 22:38:40 chmura systemd[1]: Starting Set up the state directory for FreshRSS before use...
Oct 13 22:38:41 chmura freshrss-config-start[164031]: Warning: scandir(/nix/store/4j0pgzgk1w07fqrgjk4bcn5mx4xgrc6a-freshrss-extensions/share/freshrss//extensions): Failed to open directory: No such file or directory in /nix/store/3h4zxqkknnwd4m83zizixyafw7qhdnws-FreshRSS-1.24.3/lib/Minz/ExtensionManager.php on line 127
Oct 13 22:38:41 chmura freshrss-config-start[164031]: Warning: scandir(): (errno 2): No such file or directory in /nix/store/3h4zxqkknnwd4m83zizixyafw7qhdnws-FreshRSS-1.24.3/lib/Minz/ExtensionManager.php on line 127
Oct 13 22:38:41 chmura freshrss-config-start[164031]: FreshRSS deprecation warning: the CLI option(s): default_user, base_url, auth_type are deprecated and will be removed in a future release. Use: default-user, base-url, auth-type instead
Oct 13 22:38:41 chmura freshrss-config-start[164031]: Reconfiguring FreshRSS…
Oct 13 22:38:42 chmura freshrss-config-start[164128]: Warning: scandir(/nix/store/4j0pgzgk1w07fqrgjk4bcn5mx4xgrc6a-freshrss-extensions/share/freshrss//extensions): Failed to open directory: No such file or directory in /nix/store/3h4zxqkknnwd4m83zizixyafw7qhdnws-FreshRSS-1.24.3/lib/Minz/ExtensionManager.php on line 127
Oct 13 22:38:42 chmura freshrss-config-start[164128]: Warning: scandir(): (errno 2): No such file or directory in /nix/store/3h4zxqkknnwd4m83zizixyafw7qhdnws-FreshRSS-1.24.3/lib/Minz/ExtensionManager.php on line 127
Oct 13 22:38:42 chmura freshrss-config-start[164128]: FreshRSS error: user not found: admin
Oct 13 22:38:42 chmura systemd[1]: freshrss-config.service: Main process exited, code=exited, status=1/FAILURE
Oct 13 22:38:42 chmura systemd[1]: freshrss-config.service: Failed with result 'exit-code'.
Oct 13 22:38:42 chmura systemd[1]: Failed to start Set up the state directory for FreshRSS before use.

@Stunkymonkey
Copy link
Contributor

the only issue now is: FreshRSS error: user not found: admin. please make sure you remove /var/lib/freshrss/config.php to reset the "install" process.

The one deprecation warning is fixed as well.

@jacekpoz
Copy link
Contributor Author

I just did, almost exact same error

Oct 13 23:36:25 chmura systemd[1]: Starting Set up the state directory for FreshRSS before use...
Oct 13 23:36:26 chmura freshrss-config-start[209422]: Warning: scandir(/nix/store/4j0pgzgk1w07fqrgjk4bcn5mx4xgrc6a-freshrss-extensions/share/freshrss//extensions): Failed to open directory: No such file or directory in /nix/store/3h4zxqkknnwd4m83zizixyafw7qhdnws-FreshRSS-1.24.3/lib/Minz/ExtensionManager.php on line 127
Oct 13 23:36:26 chmura freshrss-config-start[209422]: Warning: scandir(): (errno 2): No such file or directory in /nix/store/3h4zxqkknnwd4m83zizixyafw7qhdnws-FreshRSS-1.24.3/lib/Minz/ExtensionManager.php on line 127
Oct 13 23:36:26 chmura freshrss-config-start[209422]: ℹ️ Remember to re-apply the appropriate access rights, such as:        sudo cli/access-permissions.sh
Oct 13 23:36:26 chmura freshrss-config-start[209456]: Warning: scandir(/nix/store/4j0pgzgk1w07fqrgjk4bcn5mx4xgrc6a-freshrss-extensions/share/freshrss//extensions): Failed to open directory: No such file or directory in /nix/store/3h4zxqkknnwd4m83zizixyafw7qhdnws-FreshRSS-1.24.3/lib/Minz/ExtensionManager.php on line 127
Oct 13 23:36:26 chmura freshrss-config-start[209456]: Warning: scandir(): (errno 2): No such file or directory in /nix/store/3h4zxqkknnwd4m83zizixyafw7qhdnws-FreshRSS-1.24.3/lib/Minz/ExtensionManager.php on line 127
Oct 13 23:36:26 chmura freshrss-config-start[209456]: FreshRSS seems to be already installed!
Oct 13 23:36:26 chmura freshrss-config-start[209456]: Please use `./cli/reconfigure.php` instead.
Oct 13 23:36:26 chmura systemd[1]: freshrss-config.service: Main process exited, code=exited, status=3/NOTIMPLEMENTED
Oct 13 23:36:26 chmura systemd[1]: freshrss-config.service: Failed with result 'exit-code'.
Oct 13 23:36:26 chmura systemd[1]: Failed to start Set up the state directory for FreshRSS before use.

@jacekpoz
Copy link
Contributor Author

I removed /var/lib/freshrss, the config service is running now

the issue still stands though, how do I use it without nginx?

@Stunkymonkey
Copy link
Contributor

at least now no nginx related stuff is configured. But since freshrss requires php-fpm no webserver is running... (which is needed)

services.httpd.* might be used as well. But I have never tested this.

I recommend using nginx. It uses the smallest amount of resources. (If come up with the idea to use it without any "additional" software: that is not possible.)

@jacekpoz
Copy link
Contributor Author

yes, that's why I created this issue - php-fpm is hardcoded to expect an nginx user and group and I'd like to use freshrss without nginx

@mattchrist
Copy link
Contributor

@jacekpoz Which HTTP server other than nginx are you wanting to use to host FreshRSS?

@jacekpoz
Copy link
Contributor Author

caddy

@Stunkymonkey
Copy link
Contributor

see: https://nixos.wiki/wiki/Caddy#PHP_FastCGI

you will still need services.phpfpm.pools (with different user?).

@mattchrist
Copy link
Contributor

mattchrist commented Oct 14, 2024

I think that strategy could work to use Caddy instead of nginx. Another approach would be to reverse-proxy the nginx-provided http server with Caddy.

There's also no port option making it pretty hard to set up any reverse proxy with this service.

The port nginx uses can be configured by adjusting the listeners on the created nginx virtual host.

I don't think it makes sense for the freshrss module to provide configurations for more than one web server. That would add additional maintenance overhead and complexity. There are available workarounds if individuals would like to replace or wrap nginx in their particular configurations. I'm in favor of closing this issue.

@Stunkymonkey
Copy link
Contributor

@mattchrist i agree. NOT providing multiple web-server (this is not a bug, but more of a personal preference).

But the PR should be merged as well. There were some smaller issues.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants