gnome-shell-extension-syncthing-indicator
gnome-shell-extension-syncthing-indicator copied to clipboard
Cannot find Syncthing config
I'm trying to run Syncthing Indicator on the immutable Linux distro Bluefin (which is based on Universal Blue which in turn is based on Fedora Silverblue). Syncthing is installed via brew install syncthing
.
I understand that Syncthing Indicator ships its own systemd service unit, so I did not enable the one shipped with Homebrew (would be enabled via brew services start syncthing
). Instead, I adapted the one that Syncthing Indicator installed (~/.config/systemd/user/syncthing.service
) to
- point to the right binary path:
-
ExecStart=/home/linuxbrew/.linuxbrew/bin/syncthing serve --no-browser --no-restart --logflags=0
-
- use the correct config and state dirs:
-
Environment="STCONFDIR=/var/home/salim/.config/syncthing"
-
Environment="STDATADIR=/var/home/salim/.local/state/syncthing"
-
The above env vars are also set in my ~/.bashrc
:
export STCONFDIR='/var/home/salim/.config/syncthing'
export STDATADIR='/var/home/salim/.local/state/syncthing'
After running systemctl --user daemon-reload; systemctl --user restart syncthing.service
, Syncthing appears to be running fine (systemctl --user status syncthing.service
looks good) and the Syncthing web interface is accessible under the default http://127.0.0.1:8384/
address. syncthing --paths
on a terminal gives the expected output, i.e. is using the correct config/state directories:
Configuration file:
/var/home/salim/.config/syncthing/config.xml
Device private key & certificate files:
/var/home/salim/.config/syncthing/key.pem
/var/home/salim/.config/syncthing/cert.pem
GUI / API HTTPS private key & certificate files:
/var/home/salim/.config/syncthing/https-key.pem
/var/home/salim/.config/syncthing/https-cert.pem
Database location:
/var/home/salim/.local/state/syncthing/index-v0.14.0.db
Log file:
-
GUI override directory:
/var/home/salim/.config/syncthing/gui
Default sync folder directory:
/var/home/salim/Sync
But Syncthing Indicator fails to find the Syncthing config. Logs:
137743: Aug 11 19:23:41 salim-laptop gnome-shell[16036]: syncthing-indicator-manager: can't find config file
137744: Aug 11 19:23:41 salim-laptop gnome-shell[16036]: syncthing-indicator-manager: Config not found
137745: Aug 11 19:23:41 salim-laptop gnome-shell[16036]: syncthing-indicator: config-error {
137748: Aug 11 19:23:41 salim-laptop gnome-shell[16036]: error: Syncthing Indicator: Cannot find Syncthing config, syncthing might not be installed, check log for more details
137749: Aug 11 19:23:41 salim-laptop gnome-shell[16036]: syncthing-indicator-manager: can't find config file
137750: Aug 11 19:23:41 salim-laptop gnome-shell[16036]: syncthing-indicator-manager: can't find config file
137751: Aug 11 19:23:41 salim-laptop gnome-shell[16036]: syncthing-indicator-manager: can't find config file
(last line is repeated a few more times)
The following code seems responsible to detect Syncthing's config:
https://github.com/2nv2u/gnome-shell-extension-syncthing-indicator/blob/fe58a1a3ea9a9c278c83b31c22f8bcead16e6e95/src/syncthing.js#L359-L401
I guess the reason why it fails in my case is that the STCONFDIR
and STDATADIR
env vars are not set during GLib.spawn_sync(null, ['syncthing', '--paths'], null, GLib.SpawnFlags.SEARCH_PATH, null)
? If so, how could I fix that?