-
-
Notifications
You must be signed in to change notification settings - Fork 14k
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
rss-bridge: add config option #223148
rss-bridge: add config option #223148
Conversation
I forgot to ping @dawidsowa |
@dawidsowa Could you have a look at this? The An alternative would be to use environment variables, but the en- and decoding might cause errors. |
aa26590
to
cd4b148
Compare
Another idea: Should I move the symlink somewhere into /etc? Would be cleaner, separates config from data. |
Having the config file in |
cd4b148
to
3a2a8f2
Compare
701a853
to
1a4fe0a
Compare
After communicating with @dvikan about this, I completely re-wrote this PR to support existing upstream methods. Now we use environment variables, injected through the nginx config. I've now tested this change quite thoroughly and it works nicely so far. The whitelist option is properly removed and aliased, the cache directory continues to be set at After some time we might consider dropping the pkg patches altogether (that'd break for people that manually created a config.ini.php file). Maybe @SuperSandro2000 you'd like to look at this as well? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the other parts are a bit to complicated for me right now, maybe I look at this again at a later point
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've mostly added some formatting tips to make this easier to understand for me. Can you squash the review commits into one or two meaningful ones? Then I want to cherry-pick and test this on my instance and if that continues to work, we can merge this.
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>
Preserve the default value for the filecache path, but also allow modifying it, adapting the tmpfiles rule to create the directory with the right permissions. Co-authored-by: Sandro <sandro.jaeckel@gmail.com>
Prefer setting the whitelisted bridges through the generic configuration method. Removes the need for a whitelist.txt file. Preserves backwards compatibility by taking the same values and essentially just renaming the config option.
1dc4db7
to
84f4100
Compare
Thanks @SuperSandro2000! I rebased all the commits to four quite meaningful ones. The filecache path commit could be additionally squashed. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
my config continues to work like before but it is also pretty simple and just consists of a whitelist
The rss-bridge service changes introduced in f220178 resp. NixOS#223148 removes the need for the package patch. This commit removes the patch to ease updating and maintenance. Relevant service functionality was also removed (e.g. the setting of RSSBRIDGE_DATA). The explicit definition of FileCache.path so users can easily see its default value and change it, requires to use a freeformType to let users freely add potentially upcoming config options. This type is restricted to ini types (although we coerce them to environment variables). This however makes the list of enabled_bridges impossible. That was fixed by explicitly introducing this option with a type allowing lists. The default value however should be unset, which is expressed as `null`, which further spurred a change in the environment variable generation to ignore null values (instead of coercing them to an empty string). A breaking change note was added to highlight this change. A check that warns users of the not-application of their existing config file is not easily possible, as people could have only added or changed the config.ini.php file on the file system without changing a nix variable.
The rss-bridge service changes introduced in f220178 resp. NixOS#223148 removes the need for the package patch. This commit removes the patch to ease updating and maintenance. Relevant service functionality was also removed (e.g. the setting of RSSBRIDGE_DATA). The explicit definition of FileCache.path so users can easily see its default value and change it, requires to use a freeformType to let users freely add potentially upcoming config options. This type is restricted to ini types (although we coerce them to environment variables). This however makes the list of enabled_bridges impossible. That was fixed by explicitly introducing this option with a type allowing lists. The default value however should be unset, which is expressed as `null`, which further spurred a change in the environment variable generation to ignore null values (instead of coercing them to an empty string). A breaking change note was added to highlight this change. A check that warns users of the not-application of their existing config file is not easily possible, as people could have only added or changed the config.ini.php file on the file system without changing a nix variable.
Description of changes
This allows managing rss-bridge's config with nix. Config options are listed at
https://rss-bridge.github.io/rss-bridge/For_Hosts/Custom_Configuration.html
This change should be backwards compatible, only setting the
/var/lib/rss-bridge/config.ini.php
symlink if actually using the new config option (similar to the whitelist option).Things done
sandbox = true
set innix.conf
? (See Nix manual)nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD"
. Note: all changes have to be committed, also see nixpkgs-review usage./result/bin/
)(first contribution, open for improvements)