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

Load a config file from environment variable #3842

Closed
wants to merge 1 commit into from

Conversation

Mynacol
Copy link
Contributor

@Mynacol Mynacol commented Dec 16, 2023

The environment variable RSSBRIDGE_CONFIG, if set, is used as file path instead of the default config.ini.php in the document root. This allows having a read-only document root and still setting custom configuration options. In particular, this helps NixOS which patched the code previously (ref https://github.com/NixOS/nixpkgs/blob/23.11/pkgs/servers/web-apps/rss-bridge/paths.patch ).

An alternative would be setting the config options as environment variables. But coercing arrays in comma-separated lists and escaping special symbols can easily lead to errors. Using an ini file is easier for NixOS (see NixOS/nixpkgs#223148 if you're interested).

The environment variable RSSBRIDGE_CONFIG, if set, is used as file path
instead of the default config.ini.php in the document root. This allows
having a read-only document root and still setting custom configuration
options. In particular, this helps NixOS which patched the code
previously.

https://github.com/NixOS/nixpkgs/blob/23.11/pkgs/servers/web-apps/rss-bridge/paths.patch
@dvikan
Copy link
Contributor

dvikan commented Dec 17, 2023

i dont like this because the config logic is already very complex.

this issue is related to prior efforts to split out a public document root.

#3432

@Mynacol
Copy link
Contributor Author

Mynacol commented Dec 18, 2023 via email

@dvikan
Copy link
Contributor

dvikan commented Jan 9, 2024

What is the purpose of this?

Can this problem be solved with a symlink?

Example: /var/www/rss-bridge/config.ini.php => /etc/rss-bridge/config.ini.php

@Mynacol
Copy link
Contributor Author

Mynacol commented Feb 6, 2024

The environment variable method is working quite nicely, so this is not needed anymore :)

Edit: reference to the other PR: NixOS/nixpkgs#223148

@Mynacol Mynacol closed this Feb 6, 2024
SuperSandro2000 added a commit to NixOS/nixpkgs that referenced this pull request Apr 3, 2024
This allows managing rss-bridge's config with nix.
It leverages the environment variable way of setting the config options,
introduced quite [some time ago](RSS-Bridge/rss-bridge#2100)
It is the only existing way to set config options independent of the
document root, and upstream is [hesitant](RSS-Bridge/rss-bridge#3842)
to change the config loading methods.

Co-authored-by: Sandro <sandro.jaeckel@gmail.com>
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 this pull request may close these issues.

2 participants