Closed luckyankit closed 2 years ago
You could add the whitelist outside the container and add a volume mapping for it. The path inside the container is /app/whitelist.txt
. So you would add: /path/to/your/whitelist.txt:/app/whitelist.txt
as a volume mapping.
Like this? It didn't work.
I also tried the complete path (/var/www/vhosts/whitelist.txt:/app/whitelist.txt) with nothing on the Host and Plesk just removed the path while saving changes.
Also anything for the cache issue?
This is definitely not correct way to map volume. On you previous screenshot - it is correct.
Anyway, have you restarted docker container after mapping volume?
I faced this same issue when I used rss-bridge on my raspberry pi. Docker volumes are supposed to be directories, into which you'll store file that you want to be permanent, NOT files. For this configuration to work, you must stop and remove the container entirely, and create beforehand the "whitelist.txt" file where the volume mapping is expecting to find it. Only then, this mapping will work. So, you have to be able to create stuff, via command line or smth, if you have access to that, otherwise you're out of luck. FWIW, I just tested my theory and if there is no "whitelist.txt" beforehand, docker will simply create a "whitelist.txt" directory, which is useless.
I have SSH access. Can you please share commands/steps to create docker that way, please?
@em92 it doesn't work any way either. Restarted docker as well.
I can give you general ideas on how to do it, mainly because I haven't used plesk and I don't know exactly what sort of permissions it requires.
sudo nano /var/www/vhosts/whitelist.txt
sudo chown www-data:www-data /var/www/vhosts/whitelist.txt
If you want custom cache duration, you'll have to do a similar procedure with config.ini.php (copy the contents from config.default.ini.php: https://github.com/RSS-Bridge/rss-bridge/blob/master/config.default.ini.php) . To enable the corresponding option, follow the documentation. Hopefully that helps!
Little off-topic, but I came to similar conclusions as @maguilara in terms of using Docker volume. Although as a workaround one can build their own image based on rss-bridge
:
FROM rssbridge/rss-bridge:latest
RUN mkdir /config && \
cp /app/whitelist.default.txt /config/whitelist.txt && \
ln -s /config/whitelist.txt /app/whitelist.txt && \
chown -h www-data:www-data /app/whitelist.txt && \
chown -R www-data:www-data /config
It creates /config
directory and symlinks /app/whitelist.txt
into it. Now it's possible to mount /config
as a volume.
Can somebody test if it works for them, so I can create PR? It seems to be backward compatible with current setup.
I thought about this for a while and tested @verahawk s solution but: I'm relatively sure that this is not possible in the current way rss-bridge is setup.
Mounting a folder will mount the host folder into the container. That means, all the jazz that you are doing in the dockerfile will just be overwritten with the empty, new .config folder on the host. There is no way (that I know of) to mount a folder from the host into the container that will mount it the other way.
What would be possible is to do that after the container was started. The /config folder would have been created by the volume mount and then the whitelist.txt is moved/copied into that folder. You would then see it on the host.
The problem is, that requires the file to be generated after the container started. I am not good enough with php to do that, but what would need to happen (and I actually like that idea) would be:
rss-bridge starts. Checks if there is a whitelist.txt where one would be (e.g /config/whitelist). If yes, use that. If not, generate the file by copying the whitelist.default.txt to that location.
I checked the bridgefactory.php and it already does the checking, it just doesnt do the default-copying. I assume @em92 would need to do that (or someone else with vastly more php knowledge than I have ;D )
If you establish the default-copy-to-/config/whitelist.txt, the solution would be to just mount that folder. I personally dont see any downside to this and only upsides. It is very much more userfriendly than the current solution since you have to generate the file on the host side first and if you are using docker on a NAS or so, you might not be linux-knowledgeable enough to do that.
Yep, my idea was rather a stopgap solution.
A better way of solving this, would be a possibility to configure RSS-Bridge using environment variables – it's really easy to inject those into a Docker container and users with current setup would be unaffected. Unfortunately I don't know PHP either.
The problem would still exist for custom bridges, though. To fix it, RSS-Bridge should look for them in some other directory as well, let's say bridges.d
.
@verahawk check my proposed solution PR. it should do exactly what is needed.
@Bockiii Apart from some small issues, it looks good to me. I have added some comments over there.
Hi i had same issue and this worked with me (https://github.com/RSS-Bridge/rss-bridge/issues/1955#issuecomment-766399765)
You could add the whitelist outside the container and add a volume mapping for it. The path inside the container is
/app/whitelist.txt
. So you would add:/path/to/your/whitelist.txt:/app/whitelist.txt
as a volume mapping.
my docker conf is
version: '2'
services:
rss-bridge:
image: rssbridge/rss-bridge:latest
volumes:
- /etc/rss-bridge/config.ini.php:/config
- /etc/rss-bridge/whitelist.txt:/app/whitelist.txt
ports:
- 3300:80
restart: unless-stopped
You can just map the folder to /config in the container and it will pick up your whitelist, php config and additional bridges.
volumes:
- /etc/rss-bridge:/config
@em92 can be closed
docker exec -it rss-bridge /bin/bash
vim /app/whitelist.txt
How can I add whitelist.txt or enable bridges via variables in docker settings?
I installed rss-bridge docker https://hub.docker.com/r/rssbridge/rss-bridge by searching inside plesk control panel and just ran it. It works great but I have no way to enable more bridges nor I have any setting to change the cache period. Is it possible to enable this via variables as shown in the screenshot.