Hi,
long story short: I’d like to use the config file to set more of the default behaviour and I don’t know if that is even possible. A short answer would be NO.
My insight into these things: I stopped every attempt at actually learning to do something like this at the hello world stage and I only started because some sort of edumacational facility forced me to. I’m just not the right starting material.
Anyways: Obviously there are some flags (or options?) that can be attached when starting Syncthing (I can use the command line, I’m not stupid)
$ syncthing -h
Usage:
syncthing [options]
Options:
-audit Write events to audit file
-generate="" Generate key and config in specified dir, then exit
-gui-address="" Override GUI address
-gui-apikey="" Override GUI API key
-gui-authentication="" Override GUI authentication; username:password
-home="" Set configuration directory
-logfile="-" Log file name (use "-" for stdout)
-logflags="2" Select information in log line prefix
-no-browser Do not start browser
-no-restart Do not restart; just exit
-reset Reset the database
-upgrade Perform upgrade
-upgrade-check Check for available upgrade
-upgrade-to="" Force upgrade directly from specified URL
-verbose Print verbose log output
-version Show version
As usual these options are used to overwrite default behaviour that is either set or inherited somewhere. Some of these defaults are set in the in the options (dictionary?) of the config.xml or that is at least what I assume.
e.g.
<startBrowser>true</startBrowser>
is overwritten by
syncthing -no-browser
I tried to trace the code on github. The flags are translated into to the vars
in the main.go
file thing. Ok, then some other listing in there looks like it sets the pecking order of these different ways of adjusting the the behaviour. That makes sense.
What I did not find is something that looked like I could somehow pass an integer for logFlags
, “logflags
”, logFlags
and a strings for logFile
, “logfile
”, “”, via the config.xml.
Is this not defined? Am I looking in the wrong place? simply not possible?
(obviously you can’t set the home folder in a file that needs to read from the home folder without a handstand. I understand that there might be other probably completely different caveats)
No! It is not strictly necessary but I want the process to behave as I choose in the config file and not to be dependend on the way I start it. Because this can vary from LaunchAgent over loginItem to a droplet.
Ideally would already exist. It is definitely not working with all the terms I tried, but that could also be because the default is set to 2 by something that outranks the config.xml I simply don’t know.
cheers for reading