kinduff / ansible-docker-freshrss

GNU Affero General Public License v3.0
0 stars 2 forks source link

Problem with environment variables handling #2

Closed sidewinder94 closed 6 months ago

sidewinder94 commented 6 months ago

I've setup my freshrss instance to use OIDC with the following environment variables.

freshrss_environment_variables_additional_variables: |
  OIDC_ENABLED=1
  OIDC_PROVIDER_METADATA_URL=<uri>
  OIDC_CLIENT_ID=freshrss
  OIDC_CLIENT_SECRET=<secret>
  OIDC_CLIENT_CRYPTO_KEY=<key>
  OIDC_REMOTE_USER_CLAIM=preferred_username
  OIDC_SCOPES=openid profile
  OIDC_X_FORWARDED_HEADERS=X-Forwarded-Host X-Forwarded-Port X-Forwarded-Proto

My particular issues revolves around OIDC_X_FORWARDED_HEADERS in which you are supposed to be able to define one, several, or all of the options available.

Issue is :

If the value is surrounded with double quotes like : OIDC_X_FORWARDED_HEADERS="X-Forwarded-Host X-Forwarded-Port X-Forwarded-Proto" this makes the apache config crash with the following error :

déc. 20 16:42:48 matrix-server systemd[1]: Starting FreshRSS (mash-freshrss)...
déc. 20 16:42:49 matrix-server mash-freshrss[2838603]: e8820354d66e020d192ed4a403ff1841fb1af7e0ec5d47f2605574ee8f6ba398
déc. 20 16:42:49 matrix-server systemd[1]: Started FreshRSS (mash-freshrss).
déc. 20 16:42:49 matrix-server mash-freshrss[2838625]: Enabling module auth_openidc.
déc. 20 16:42:56 matrix-server mash-freshrss[2838625]: apache2: Syntax error on line 225 of /etc/apache2/apache2.conf: Syntax error on line 51 of /etc/apache2/sites-enabled/FreshRSS.Apache.conf: Define takes 1-2 arguments, Define a variable, optionally to a value.  Same as passing -D to the command line.

If not, as far as I can tell, the apache config is correct but it breaks the CRON jonb used to automatically refresh the feeds.

Below what happens if I manually execute the CRON expression in container in that case :

root@3cf257dc5145:/var/www/FreshRSS# . /var/www/FreshRSS/Docker/env.txt;                su www-data -s /bin/sh -c 'php /var/www/FreshRSS/app/actualize_script.php'              2>> /proc/1/fd/2 > /tmp/FreshRSS.log
bash: export: `X-Forwarded-Port': not a valid identifier
bash: export: `X-Forwarded-Proto': not a valid identifier
sidewinder94 commented 6 months ago

After rereading through the role this has nothing to do with it and all to do with the freshrss docker image. Sorry for the noise, I'll open an issue on their side instead.