Repository navigation
Extension installation for docker instance #318
Description
I am having a hard time figuring out how to add third-party extension to a docker instance.
I am using Fedora Workstation 42.
So, I have the following docker-compose.yml file as follow:
volumes:
data:
extensions:
services:
freshrss:
image: freshrss/freshrss:latest
# # Optional build section if you want to build the image locally:
# build:
# # Pick #latest (slow releases) or #edge (rolling release) or a specific release like #1.21.0
# context: https://github.com/FreshRSS/FreshRSS.git#latest
# dockerfile: Docker/Dockerfile-Alpine
container_name: freshrss
hostname: freshrss
restart: unless-stopped
logging:
options:
max-size: 10m
volumes:
- data:/var/www/FreshRSS/data
- ./extensions:/var/www/FreshRSS/extensions
ports:
- 8080:80
environment:
TZ: America/New_York
CRON_MIN: '3,33'
TRUSTED_PROXY: 172.16.0.1/12 192.168.0.1/16
Then i created /home/dir/.config/freshrss/extensions/ directory. I cd to /home/dir/.config/freshrss and invoke docker-compose up -d.
I finished the initial completion at localhost:8080 on firefox, where all checks were marked green and finished with no error.
Then, I downloaded the Extensions-master.zip and extracted them. I copied the xExtension-Youtube dir to /home/dir/.config/freshrss/extensions/ . I invoke docker restart freshrss, but on firefox, I don't see the button at all to use the extension when I go to the extensions setting.
What problem am i having? Is it to do with permission rights or something on the dir?
Here, I include some info from the docker inspect freshrss command
...
"HostConfig": {
"Binds": [
"/home/dir/.config/freshrss/extensions:/var/www/FreshRSS/extensions:rw"
],
...
"Mounts": [
{
"Type": "bind",
"Source": "/home/dir/.config/freshrss/extensions",
"Destination": "/var/www/FreshRSS/extensions",
"Mode": "rw",
"RW": true,
"Propagation": "rprivate"
},
{
"Type": "volume",
"Name": "freshrss_data",
"Source": "/var/lib/docker/volumes/freshrss_data/_data",
"Destination": "/var/www/FreshRSS/data",
"Driver": "local",
"Mode": "z",
"RW": true,
"Propagation": ""
}
Appreciate any help here.
Activity
Inverle commentedon May 4, 2025
Make sure you aren't seeing a cached version of the extensions page, by adding
&123to the end of the URL e.g. http://localhost:8080/i/?c=extension&123lnguyen4 commentedon May 4, 2025
Thanks, I tried with the &123 appended to the end of url. Still, extension is not available
Inverle commentedon May 5, 2025
What is the output of:
tree -paugh /home/dir/.config/freshrss/extensionsand
docker logs freshrss 2>&1 | egrep '^(FreshRSS|\[|PHP)'lnguyen4 commentedon May 5, 2025
the
treecommand gives me:and the
docker logscommand gives:Thanks
Inverle commentedon May 5, 2025
Can you try running
sudo chgrp -R 33 /home/user/.config/freshrss/extensionsand then check http://localhost:8080/i/?c=extension&12345?
Edit: make sure to run
sudo chmod 755 /home/user/.config/freshrss/extensionstoolnguyen4 commentedon May 5, 2025
Followed. But the extension still doesn't show up.
Here are the outputs from the earlier command
I think there is still something wrong with the permission setting :(
Inverle commentedon May 5, 2025
Yes, it's a permission error, but I'm not exactly sure what's wrong.
edit: I meant
sudo chmod -R 755 /home/user/.config/freshrss/extensionsinstead ofsudo chmod 755 /home/user/.config/freshrss/extensions, so maybe that's why (forgot the -R flag)check http://localhost:8080/i/?c=extension&534543 after running the new chmod command
if that won't fix it then:
what are the outputs of:
sudo ps -Ao pid,user,command | egrep '(docker|container)'sudo docker exec freshrss ps -Ao pid,user,commandsudo docker exec freshrss cat /etc/passwd | grep www-datalnguyen4 commentedon May 5, 2025
Thanks a lot for helping so far. I
sudo chmodwith-Rflag for theextensionsdir but still it doesn't help. I restarted the docker daemon , restarted the freshrss container, but extension is not available to use.Here is output of
sudo ps -Ao pid,user,command | egrep '(docker|container)':sudo docker exec freshrss ps -Ao pid,user,command:sudo docker exec freshrss cat /etc/passwd | grep www-data:Inverle commentedon May 5, 2025
What about
docker exec -u www-data freshrss ls -la extensions extensions/*?Can you run
docker exec -it www-data freshrss bashand cd intoextensions?Maybe you can edit this line in your
docker-compose.ymlto
stop the container:
docker stop freshrssand start it again(without the ./)
and instead use
docker cpto get your extensions into the container e.g.docker cp /opt/Extensions/xExtension-YouTube/ freshrss:/var/www/FreshRSS/extensions/This may have a better chance of working
lnguyen4 commentedon May 5, 2025
I got
I ran
docker exec -it -u www-data freshrss bashand gotFor
- extensions:/var/www/FreshRSS/extensionsindocker-compose.yml, I have done this way in another laptop and understood that this will create the volumefreshrss_extensions, and whenever I want to install extension, i need todocker execinto the container and do the installation. Hence, when I try to set up this docker instance for my new laptop, I want to set up for extensions to work on host's but I know if not setting permissions correctly, it would be a headache.One thing I want to ask: say, the extensions is set up as default
- extensions: ...indocker-compose.yml, and most of the time, the extensions zip files are downloaded on the host, how can I do the installation (moving the dir) right on the host terminal without having todocker execinto the container shell?Inverle commentedon May 5, 2025
@lnguyen4
As I wrote earlier, by using
docker cp;) (or you can also cd into/var/lib/docker/volumes/*_extensions/_dataand copy it into there)Regarding the earlier approach though:
Since you use Fedora, which has SELinux enabled by default, according to https://stackoverflow.com/questions/24288616/permission-denied-on-accessing-host-directory-in-docker the best solution is to use
chcon -Rt svirt_sandbox_file_t /home/user/.config/freshrss/extensions, of course I have no idea if this will work so you can also trysu -c "setenforce 0"if it doesn't.Or alternatively, you can add a
privileged: trueline into yourdocker-compose.ymlfile, but this is a bad idea security wise.Let me know if you are able to get extensions working with
./extensionsAlkarex commentedon May 6, 2025
As @Inverle wrote, this is an issue due to a wrong SELinux configuration and permissions.
See (but may not apply to you directly, so just for inspiration) https://freshrss.github.io/FreshRSS/en/users/07_Frequently_Asked_Questions.html#permissions-under-selinux
and additional documentation welcome
lnguyen4 commentedon May 6, 2025
@Inverle @Alkarex , Thank you for providing help so far and giving some relevant info.
I am just a novice user for Fedora and know nothing about SELinux. I look up some to read , especially about docker and find this info about docker label for SELinux-enabled host: https://docs.docker.com/engine/storage/bind-mounts/#configure-the-selinux-label
Then, I decided to re-do the whole installation for this docker instance. From the link above, I use the
:zoption at the end of bind mount- ./extensions:/var/www/FreshRSS/extensions:zindocker-compose.ymlfile. Now, my docker instance is set up, and I can cp the extension dir into ./extensions so that the extension is available to use. I wonder if there is any side effect of using that:zoption on bind mount. The link above warns against the:Zoption for certain cases.Thanks again,