syncthing-gtk icon indicating copy to clipboard operation
syncthing-gtk copied to clipboard

Make Syncthing-GTK able to run/shutdown Syncthing snap package

Open bungabunga opened this issue 6 years ago • 9 comments

I run syncthing as a snap on my Ubuntu 17.10 laptop and it's working fine with Syncthing-GTK, except for starting Syncthing daemon from your app. So I must start the daemon independently, which I do, but I thing it would be better if that would be possible from your within application. (maybe it is but I just couldn't wind out the proper way to do it?)

bungabunga avatar Nov 08 '17 10:11 bungabunga

How are you starting Syncthing daemon installed in snap?

kozec avatar Nov 08 '17 10:11 kozec

snap run syncthing

(without sudo)

bungabunga avatar Nov 08 '17 10:11 bungabunga

And do you happen to know where does syncthing stores its configuration when started like that? :D

kozec avatar Nov 09 '17 15:11 kozec

all the files that are usually located in /home/USER/.config/syncthing are in snap version located in /home/USER/snap/syncthing/common/syncthing

bungabunga avatar Nov 09 '17 15:11 bungabunga

So, with this, ST-GTK will not start with 1st run wizard if there is snap config present, but it will popup dialog about /usr/bin/syncthing not being found and you'll have to set executable to snap run syncthing manually, as there doesn't seem to be any way how to tell that there is one installed.

kozec avatar Nov 29 '17 17:11 kozec

The snap installation adds /snap/bin/syncthing (which should be added to the users path if snapd is installed). Can not this simply be added as a secondary binary search location?

hackel avatar Mar 07 '18 00:03 hackel

Frankly, I don't really know enough about snaps to tell if that should or will work and I don't have any machine capable of testing it right now. But if someone feels like testing it and creating PR, it is welcomed :)

Search paths are generated here.

kozec avatar Mar 07 '18 06:03 kozec

I looked a bit into it. ST-GTK finds the syncthing snap binary just fine.

The problem left is, that ST-GTK tries to write the syncthing configuration files to ~/.config/syncthing but the snap does not have write access to this directory.

The correct configuration dir for syncthing as a snap would be ~/snap/syncthing/common/syncthing. Unfortunately ST-GTK uses the get_config_dir() function from the tools.py to also find it's own configuration directory (which is still under ~/.config). So no easy fix that way.

@kozec can you estimate what changes would be necessary to fix the issue?

Thanks a lot for your work!

timski avatar Apr 18 '18 20:04 timski

#449 made a pull request

timski avatar Apr 21 '18 11:04 timski