You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
cli subcommand does not use STHOMEDIR env var #9041
bugA problem with current functionality, as opposed to missing functionality (enhancement)frozen-due-to-ageIssues closed and untouched for a long time, together with being locked for discussion
In the docker container, it seems that the syncthing cli subcommand does not use the STHOMEDIR environment variable added in 1.23.7 (#8957). On the other hand, the serve subcommand works as expected with the new environment variable.
In the session below, I would expect the syncthing cli command without the explicit --home parameter to output the same as the one with the parameter set, instead it uses the default value:
# podman run --name bug --rm -d docker.io/syncthing/syncthing:1.23.7
# podman exec bug sh -c 'export | grep STHOMEDIR'
export STHOMEDIR='/var/syncthing/config'
# podman exec bug sh -c 'syncthing cli show version'
reading device ID: open /var/syncthing/.config/syncthing/cert.pem: no such file or directory
# podman exec bug sh -c 'syncthing cli --home="$STHOMEDIR" show version'
{
"arch": "amd64",
"codename": "Fermium Flea",
"container": true,
"date": "2023-07-31T03:45:37Z",
"extra": "",
"isBeta": false,
"isCandidate": false,
"isRelease": true,
"longVersion": "syncthing v1.23.7 \"Fermium Flea\" (go1.20.7 linux-amd64) [email protected] 2023-07-31 03:45:37 UTC [noupgrade]",
"os": "linux",
"stamp": "1690775137",
"tags": [
"noupgrade"
],
"user": "docker",
"version": "v1.23.7"
}
It seems that syncthing cli has the same behavior with the environment variables STGUIADDRESS and STGUIAPIKEY, i.e. it doesn't use them when available, and instead --gui-address and --gui-apikey must be provided explicitly.
As far as I know, those two have been available for some time already to syncthing serve, so maybe the fact that those environment variables don't work for syncthing cli is not a bug proper?
The fact that #8957 (linked in the release notes) mentions:
Since these pertain to the environment Syncthign runs in, and also affect multiple subcommands, it would be nice if they could be set in the environment once and for all.
I just assumed that the env vars were meant to be available for all subcommands that have those arguments.
bugA problem with current functionality, as opposed to missing functionality (enhancement)frozen-due-to-ageIssues closed and untouched for a long time, together with being locked for discussion
Activity
Upgrade syncthing to 1.23.7
crazygolem commentedon Aug 19, 2023
It seems that
syncthing clihas the same behavior with the environment variablesSTGUIADDRESSandSTGUIAPIKEY, i.e. it doesn't use them when available, and instead--gui-addressand--gui-apikeymust be provided explicitly.As far as I know, those two have been available for some time already to
syncthing serve, so maybe the fact that those environment variables don't work forsyncthing cliis not a bug proper?The fact that #8957 (linked in the release notes) mentions:
I just assumed that the env vars were meant to be available for all subcommands that have those arguments.
calmh commentedon Aug 19, 2023
I agree they should, it's just a historic bug/oversight that they are not.
cjc7373 commentedon Oct 8, 2023
I see syncthing uses two cli frameworks: kong and urfave/cli. Should one be migrated to another?
calmh commentedon Oct 8, 2023
Ideally, yes. It's the
clisubcommand that does different magic for historical reasons.cmd/syncthing: Mostly replace urfave/cli command line parser with ale…