FreshRSS / Extensions

A repository containing all the official FreshRSS extensions
GNU Affero General Public License v3.0
322 stars 52 forks source link

Adding extensions to FreshRSS in a Docker container? #37

Closed ghost closed 4 years ago

ghost commented 5 years ago

This is probably a stupid question, but this is my first time playing with Docker and I can't get this to work. I installed FreshRSS into a Docker container on a Raspberry Pi, and it all works fine. Then I follow the Docker guide to access the container:

$ docker run -it freshrss/freshrss sh

Which gives me a shell in /var/www/FreshRSS/ in the container.

I add the extension to the /extensions directory:

/var/www/FreshRSS # cd extensions/
/var/www/FreshRSS/extensions # wget https://github.com/kevinpapst/freshrss-youtube/archive/master.zip
Connecting to github.com (192.30.255.113:443)
Connecting to codeload.github.com (192.30.255.120:443)
master.zip           100% |*****************************************************************************************| 18800   0:00:00 ETA
/var/www/FreshRSS/extensions # unzip master.zip
Archive:  master.zip
   creating: freshrss-youtube-master/
  inflating: freshrss-youtube-master/.gitignore
  inflating: freshrss-youtube-master/README.md
   creating: freshrss-youtube-master/xExtension-YouTube/
  inflating: freshrss-youtube-master/xExtension-YouTube/LICENSE
  inflating: freshrss-youtube-master/xExtension-YouTube/configure.phtml
  inflating: freshrss-youtube-master/xExtension-YouTube/extension.php
   creating: freshrss-youtube-master/xExtension-YouTube/i18n/
   creating: freshrss-youtube-master/xExtension-YouTube/i18n/de/
  inflating: freshrss-youtube-master/xExtension-YouTube/i18n/de/ext.php
   creating: freshrss-youtube-master/xExtension-YouTube/i18n/en/
  inflating: freshrss-youtube-master/xExtension-YouTube/i18n/en/ext.php
   creating: freshrss-youtube-master/xExtension-YouTube/i18n/fr/
  inflating: freshrss-youtube-master/xExtension-YouTube/i18n/fr/ext.php
  inflating: freshrss-youtube-master/xExtension-YouTube/metadata.json
/var/www/FreshRSS/extensions # mv freshrss-youtube-master/xExtension-YouTube .
/var/www/FreshRSS/extensions # rm -rf freshrss-youtube-master/
/var/www/FreshRSS/extensions # ls
README.md           Tumblr-GDPR         master.zip          xExtension-YouTube

Then visit http://192.168.x.x:8080/i/?c=extension and the new extension doesn't show up?

I tried docker restart freshrss (aka turning it off and on again ;)) but still no luck.

Thanks in advance.

Frenzie commented 5 years ago

It's probably the permissions. Did you check what they are?

Alkarex commented 5 years ago

@obsoletenerd : I believe it is simply that your Docker command is wrong. Please try with:

sudo docker exec -it freshrss sh

It works for me in Docker, even with the default user.

Alkarex commented 5 years ago

With the command you have run, you now probably have several FreshRSS instances running...

Try:

sudo docker ps -a
sudo docker rm -f ...

P.S.: What you were doing is spinning a new FreshRSS instance, make the changes in that new one, and stop it (without removing it) on exit. Therefore you could not see your changes in your true instance.

alfureu commented 4 years ago

I must second this issue. Everything is loaded correctly, in the correct place and with correct permissions. The extension does not show up in FreshRSS. Using linuxserver/freshrss:latest

Alkarex commented 4 years ago

@DOFfactory What docker run command are you using? Are you using a Docker volume for the extensions?

alfureu commented 4 years ago

Hi @Alkarex, nothing extra, the standard command from linuxserver.io:

docker create --name=freshrss -e PUID=1000 -e PGID=100 -e TZ=Europe/London p 8088:80 -v /home/docker/freshrss:/config --restart unless-stopped linuxserver/freshrss
kabili207 commented 4 years ago

The current docker image looks for extentions in /config/www/freshrss/extensions

marienfressinaud commented 4 years ago

You should probably install the extensions in a volume on the host, then mount it in your container. You should not add them in a running container or they risk to be dropped when you stop it. Quick example:

$ mkdir /path/to/extensions
$ # install your extensions in /path/to/extensions as you do usually
$ docker run \
    --rm \
    --volume /path/to/data:/var/www/FreshRSS/data:z \
    --volume /path/to/extensions:/var/www/FreshRSS/extensions:z \
    --publish 127.0.0.1:80:80 \
    --name freshrss \
    freshrss/freshrss

(to adapt for the linuxserver/freshrss image with /config/www/freshrss/extensions)

The main drawback of this technique is that you have to reinstall the default extensions in the host volume (at the moment, only Tumblr-GDPR)

Alkarex commented 4 years ago

We should improve this process. I will try to find time to make a proposition

alfureu commented 4 years ago

Hi, I can confirm this works. One comment: the folder must be outside on the host of the docker (naturally), but in case somebody is wondering why is it not working. I agree with @Alkarex that this has to be done nicer, the best would be some clickable "upload" function of extensions through the frontend. It would be lovely to add also url there to download/upload an extension.

Alkarex commented 4 years ago

There is now a distinction between core extensions shipped with FreshRSS, and third-party extensions installed by the user. This makes it easier to mount a Docker volume. Implemented in the /master branch with https://github.com/FreshRSS/FreshRSS/pull/2837 Feedback welcome

nickelswitte commented 1 year ago

I am not able to get extension to run inside a docker container, therefore I reopen this issue.

The theoretical steps are kinda straight forward, so here is what I did:

  1. Put the folder of an extension, e.g. xExtension-ReadingTime into ./extensions
  2. Check if the volumes are correct
volumes:
      # Optional volume for storing third-party extensions
      - ./extensions:/var/www/FreshRSS/extensions
  1. Check if the extension shows up correctly in the container, they do

    # ls
    xExtension-ReadingTime  xExtension-ShareByEmail  xExtension-TitleWrap
  2. Restart container

But nothing shows up grafik

Is there something that I do wrong?

Alkarex commented 1 year ago

Can you try the following command?

docker exec freshrss ls -alh /var/www/FreshRSS/extensions
nickelswitte commented 1 year ago
total 24K
drwxr----- 5 1000 www-data 4.0K Dec 22 23:53 .
drwxr-xr-x 1 root www-data 4.0K Dec 22 23:53 ..
drwxr----- 3 1000 www-data 4.0K Dec 22 23:26 xExtension-ReadingTime
drwxr----- 7 1000 www-data 4.0K Dec 22 23:44 xExtension-ShareByEmail
drwxr----- 3 1000 www-data 4.0K Dec 22 23:43 xExtension-TitleWrap
Alkarex commented 1 year ago

Right, then:

docker exec freshrss chown www-data:www-data -R /var/www/FreshRSS/extensions
docker exec freshrss chmod g+rx /var/www/FreshRSS/extensions
nickelswitte commented 1 year ago

Thank you, that has worked. I went into the UI and activated the extensions (all three of them), but they show no effect (no reading time nor email sharing). Am I still missing some detail?

alfureu commented 1 year ago

@nickelswitte you need to bind a folder to the docker (if you use it that way) and install the extensions in that subfolder afaik

Alkarex commented 1 year ago

@nickelswitte Please try with the CustomCSS extension, just for debugging, using the following custom CSS, and when activated, you are supposed to see texts on that page in red:

body {
  color:red;
}

image

mrcozzens commented 1 year ago

The current docker image looks for extentions in /config/www/freshrss/extensions

thank you for this.. I changed my volume to this and that did the trick ! - ./extensions:/config/www/freshrss/extensions