How to change the favicon?

Shinyproxy by default loads with the spring boot logo as the favicon image. How do you change this? It would be nice to have the ability to change the favicon in the application.yaml file so the favicon could be changed in the same manner the navbar image is changed.

4 Likes

@Luke_Singham Have you managed to change the spring boot logo?

I have created a static folder and placed my favicon.ico in there. When I start shinyproxy as

java -cp static:shinyproxy-1.0.2.jar org.springframework.boot.loader.JarLauncher

this favicon is used.

@rstub Where did you place you static folder? I’ve tried /opt/shinyproxy/static and /etc/shinyproxy/static and chmod -R 777 on both folders, but it still doesn’t show.

@fifthace I placed the static folder in the same directory as the jar file. You could also use absolute paths like

java -cp </path/to/static>:</path/to/shinyproxy.jar>  org.springframework.boot.loader.JarLauncher

I am still struggling with this. I use the Ubuntu .deb package in Ubuntu 16.04. The package creates a systemd service that launches Shinyproxy at boot. There are two files of interest (I think):

/opt/shinyproxy/shinyproxy.server
/etc/systemd/system/shinyproxy.server

Both are identical.

In both files, I have attempted to change the ExecStart line from this:
ExecStart=/usr/bin/java -jar /opt/shinyproxy/shinyproxy.jar
to this:
ExecStart=/usr/bin/java -cp /opt/shinyproxy/static:/opt/shinyproxy/shinyproxy.jar org.springframework.boot.loader.JarLauncher

where /opt/shinyproxy/static contains the favicon and is owned by the user shinyproxy with 644 permissions.

I then do:
sudo systemctl daemon-reload
sudo systemctl restart shinyproxy.service

But the new favicon isn’t loaded. I have also tried to reboot my machine without any joy. Any idea what I’m missing?

is there any solution for this issue/question ? the logo-url is not a valid option for this?

@Dylan_Cissou @fifthace @rstub @gbisschoff @Luke_Singham ShinyProxy 2.0.5 has a new setting favicon-path; see https://www.shinyproxy.io/downloads/

Best,
Tobias

1 Like

@tverbeke Many thanks for this. This little branding exercise really makes the service we are providing appear more professional :slight_smile: .

However, I still can’t get it to work after upgrading to ShinyProxy 2.0.5 running in Ubuntu 16.04 (I also tried 18.04). Here is the top of my application.yml:

proxy:
  title: My app
  logo-url: file:///var/www/html/logo_white.png
  favicon-path: file:///var/www/html/favicon_64_64.png

The logo_white shows up as expected, in the navbar. The favicon, which is a 64x64 pixel .png, does not show up, even when I restart shinyproxy and clear the browser cache.

I have tested that the png works as a favicon in a simple html page on the same server, pointing to the same file, in three different browsers. I have also tested with a 16x16 pixel .ico file in ShinyProxy, without success. How can I debug this?

Hi @fifthace,

For the logo-url a file URI scheme can be used (file://), but for favicon-path only absolute and relative paths are supported i.e. /var/www/html/favicon_64_64.png in your case.

Does that help?

Best,
Tobias

2 Likes

Hi @tverbeke,
I’ve tried this now, restarted the server, but it still doesn’t show. I have tried both png and ico files and /var/www/html/favicon_64_64.png and placing favicon_64_64.png/ico in both the /etc/shinyproxy/ and /opt/shinyproxy/ folders and then used it as a relative path. I’ve chmod 777 the file. I’m a bit stuck… Did anyone else have success with this?

With shinyproxy 1.1.1 we were able to simplify the set-up described above, since static/favicon.ico is used even when shinyproxy is started as java -jar shinyproxy.jar.

With shinyproxy 2 we are still fighting with other problems, c.f. https://github.com/openanalytics/shinyproxy/issues/106.

Ok, in the end this worked:

  favicon-path: favicon.ico

It didn’t work when I first did this, but after a few days (?!) with cache being cleared out, it suddenly appeared.

@fifthace, @rstub, @Dylan_Cissou, @gbisschoff, @Luke_Singham

ShinyProxy 2.1.0 now also supports .png files as favicon, see https://www.shinyproxy.io/downloads/

Hope it’s useful!

Best,
Tobias

2 Likes