I don’t think so. I was looking at using it to control a remote host but it seems syncthing-gtk wants to start the daemon itself and attach to it. There are no obvious configurations to point GTK to an already running instance.
I’ve never used it myself so I might be talking shit, but I imagine that if worst came to worst you could point it to the right config directory (so it picks up the api url), and somehow give it a “syncthing” binary that launches but does nothing. Say, a copy of cat or so. It’s a bit hacky though. And it could run into trouble if it expects to be able to decide the api key from the outside. Or file a feature request.
def _read_config(self):
# Read syncthing config to get connection url
configxml = os.path.join(get_config_dir(), "syncthing", "config.xml")
get_config_dir() seems to just look in standard user specific config directories for the xml so you could probably get away with a hardlink to the dedicated user’s xml.
Syncthing-GTK may even have a command line flag to handle this similar to Syncthing’s -home flag.
Are you hoping for full control of the daemon or just monitoring? You would have to manage the config file permissions if you want Syncthing-GTK to edit them.
I would also look at making a script similar to gksu -u syncthing 'syncthing' to use to execute the service if you need to.
P.S. I don’t pretend to know anything about the workings of Syncthing-GTK. I have just been poking around in some free time while on a locked down windows machine so I could be miles off.
A link from my ~/.config/syncthing/config.xml might common up the config.
A link from my ~/.config/syncthing might common up just about everything.
Permissions should be simple as I already have a common group for syncthing and me.
What worries me is having 2 instances of syncthing running on the same data. How do I get GTK running under me to recognise the instance running under syncthing-user as the real one and not start a second instance?
`david@monocerus:~$ cd .config/syncthing-gtk
david@monocerus:~/.config/syncthing-gtk$ ls -lai
total 20
4587521 drwxr-xr-x 2 david david 4096 Jan 12 15:11 .
3407875 drwx------ 23 david david 4096 Jan 18 11:45 ..
*5505058 -rw-rw-r-- 2 st std 622 Jan 11 14:40 config.json
*5505040 -rwxrwxr-x 2 st std 199 Jan 12 17:23 run_syncthing
*5505089 -rwxrwxr-x 2 st std 158 Jan 12 17:23 run_syncthing_part2
david@monocerus:~/.config/syncthing-gtk$ ls -lai /home/st/.config/syncthing-gtk
total 20
5505057 drwxrwx--- 2 st std 4096 Jan 11 14:43 .
5505026 drwxr-x--- 4 st std 4096 Jan 7 11:54 ..
5505058 -rw-rw-r-- 2 st std 622 Jan 11 14:40 config.json
5505040 -rwxrwxr-x 2 st std 199 Jan 12 17:23 run_syncthing
5505089 -rwxrwxr-x 2 st std 158 Jan 12 17:23 run_syncthing_part2
david@monocerus:~/.config/syncthing-gtk$ ls -lai ../syncthing
total 32
3408906 drwxr-xr-x 2 david david 4096 Jan 10 20:00 .
3407875 drwx------ 23 david david 4096 Jan 18 11:45 ..
*5505034 -rw-r--r-- 2 st std 615 Jan 6 14:45 cert.pem
*5505063 -rw-rw---- 1 st std 3197 Jan 7 09:24 config.xml
*5505044 -rw------- 1 st std 165 Jan 7 14:23 csrftokens.txt
*5505037 -rw-r--r-- 2 st std 1070 Jan 6 14:45 https-cert.pem
*5505038 -rw------- 2 st std 1675 Jan 6 14:45 https-key.pem
*5505039 -rw------- 2 st std 288 Jan 6 14:45 key.pem
david@monocerus:~/.config/syncthing-gtk$ ls -lai /home/st/.config/syncthing
total 52
5505029 drwxr-x--- 3 st std 4096 Jan 12 23:46 .
5505026 drwxr-x--- 4 st std 4096 Jan 7 11:54 ..
5505034 -rw-r--r-- 2 st std 615 Jan 6 14:45 cert.pem
5505041 -rw------- 1 st st 3190 Jan 12 23:46 config.xml
5505199 -rw------- 1 st st 264 Jan 12 15:54 csrftokens.txt
5505037 -rw-r--r-- 2 st std 1070 Jan 6 14:45 https-cert.pem
5505038 -rw------- 2 st std 1675 Jan 6 14:45 https-key.pem
5505030 drwxr-xr-x 2 st std 20480 Jan 18 11:00 index-v0.11.0.db
5505039 -rw------- 2 st std 288 Jan 6 14:45 key.pem
david@monocerus:~/.config/syncthing-gtk$
I’ve starred the hardlinks. st and david are members of std.
Obviously I needed to config.xml and config.json. I got a permissions error on a certificate file (I forget which one) trying to run gtk, so I just did hardlinks for all files in the syncthing directory.
By the way, I haven’t got it all working properly yet. Gtk points to the correct syncthing instance, but I need to sort out gtk starting syncthing properly. Will post when I get round to trying this.
`