|:.:.:.:.:.:.:.:.:/.:.:.:.:.:./.:.:.:.:.:.:.:.:.:.:.:.:.:./|   '. :.:.:.:.:.:.:.:.:.:.l.ヽ:.:.:.:.l:.:.:.:.:.:.:.:.:.:∧\:.:.:.',
          |:.:.:.:.:.:.:./.:.:.:.:.:./.:.:.:.:.:.:.:.:.:.:.:.: , ′   l :.:.:.:.:.:.:.:.:.:| ∨.:.:.l:.:.:.:.:.:.:.:.:.:.∧ \:.'.
          |:.:.:.:.:.:/.:.:.:.:.: /.:.:.:.:.:.:.:.:. ヽ/ /    |:.:.:.:.:.:.:./:.:.|   y'.:.:|:.:.:.:.|:.:.:.:.:.:.∧   ヘ.
          |:.:.:.:./.:.:.:.//.:.:.:.:.:.:.:.:.:.:/ \,′   !:.:.:.:.:.:/|:.:./,/ '.:.:| :.:.:.|:.:.:.:.:.:.:.:.|
          |:.:.:/.:.:./.:./.:.:.:.:.:.:.:.:./   /` ‐-‐'|:.:.:./ |ァ'´    |:.:| :.:.:.|:.:.:.:.:.:.:.:.|
          |:.:.i.:.:./.:.:.: '.:.:.:.:.:.:.:/   ,/       |:.:.:/   ′    }.:.| :.:.:.|:.:.:.| :.:.:.:|
          |:.:.|:./.: rヘ|:.:.:.:.:.:/:.| 三三三三三  |:./   三三三 ハ|:.:.:.:.|:.:.:.| :.:.:.:|
          |:.:.l〃.:{  |:.:.:.:./.:.:.|             l.'         .i.:.:.i.:.:.:∧ :.:|ヽ :.:|
          |:.:./.:.:.:.\|:.:.:/.:.:.:.:|                '       |:.:.||:.:/  :.:.| '.:.:l
          |:./.:.:.:.:.:.:. !:./.:.:.:.:.:.'、            ,.ー--、    }.:.:|レ′ ∨  V
          |/.:.:.:.:.:.:.:.:V '´  ̄`ヽ.、            ´`¨¨{. |_.  '.:.:.:.|
         /.:.:.:.:.:.:.:./         ヘ `    . __. -r1 |:.:.:.:.:.:.:.:.|
         :.:.:.:.:.:.:, '         '. \    | _.   -┴ー──┴┐
         :.:.:.:.:./           |  \  r' |   -──────i'
    

< KONAKONA.MOE >

Fixing Syncthing's Favicon with Caddy

Last Mod.: 2024-06-04 | Created On: 2024-02-11


The Syncthing’s WebUI favicon doesn’t appear in bookmarks on Firefox or Firefox-based browsers. I don’t know about other browsers, but this really pisses me off. I think the reason it does that is because it’s not charged when the page first loads, no, after viewing the HTML I saw that there’s a script embedded into the favicon’s tag in the <head> that loads it dynamically, so that it can change depending on the current status of Syncthing. It works on the tabs but unfortunately not in bookmarks which is very annoying because I like bookmarking a lot of thigs with only the icon showing.

Here is what the favicon path looks like, and is what I believe what’s causing the issue:

1<link
2	rel="shortcut icon"
3	href="assets/img/favicon-{{syncthingStatus()}}.png"
4	type="image/x-icon"
5/>

Fixing this problem with the Caddy webserver is actually very very easy:

1yourdomain.tld {
2	reverse_proxy localhost:8384
3	rewrite /assets/img/favicon-*.png /assets/img/favicon-default.png
4}

As you can see the only thing you need to add is rewrite /assets/img/favicon-*.png /assets/img/favicon-default.png which redirects all the status favicons that the WebUI loads dynamically to the default one with a wildcard. Will the status favicons work (on the tab)? Apparently not (apart from the default of course) but I don’t care, the favicon is there. Maybe you could comment it out after you get the favicon working in the bookmark and reload Caddy, who knows, but this is all cosmetics anyway.


Prev:
Dynamic DNS with a Single Bash Script using …
Next:
How to Disable Routing for Wireguard Interfaces