Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cmd: Move stdiscosrv and strelaysrv in as subcommands to Syncthing #8953

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

calmh
Copy link
Member

@calmh calmh commented Jun 27, 2023

This adds syncthing discosrv and syncthing relaysrv as subcommands to Syncthing. This has several advantages:

  • If you have Syncthing, you also have these functions.
  • It's fewer things for us to build and distribute, both for binaries, Debian archives and Docker images.
  • We can take advantage of common functinality like auto upgrades (though that doesn't happen as part of this PR).

The main disadvantage is that it means we're carrying around more code in the syncthing binary that might not be required for all users; the increase on my system (darwin-arm64) is from 24.0 MB to 25.3 MB so I think this is acceptable.

There is a slight change in the CLI handling for the commands: the Go flag parser accepts long arguments with single dash, while kong does not. I changed a few timeout values from integer to duration for consistency, since it's anyway a breaking change. Given that nobody is going to get hit by this by mistake (there are no auto upgrades from the old binaries, and they need to run a different command) I think this is fine, too.

To do:

  • systemd stuff
  • ufw stuff
  • exposing the relevant ports in the Docker container?
  • documentation updates!

This adds `syncthing discosrv` and `syncthing relaysrv` as subcommands
to Syncthing. This has several advantages:

- If you have Syncthing, you also have these functions.
- It's fewer things for us to build and distribute, both for binaries,
  Debian archives and Docker images.
- We can take advantage of common functinality like auto upgrades
  (though that doesn't happen as part of this PR).

The main disadvantage is that it means we're carrying around more code
in the syncthing binary that might not be required for all users; the
increase on my system (darwin-arm64) is from 24.0 MB to 25.3 MB so I
think this is acceptable.

There is a slight change in the CLI handling for the commands: the Go
flag parser accepts long arguments with single dash, while kong does
not. I changed a few timeout values from integer to duration for
consistency, since it's anyway a breaking change. Given that nobody is
going to get hit by this by mistake (there are no auto upgrades from the
old binaries, and they need to run a different command) I think this is
fine, too.
@calmh calmh marked this pull request as draft June 27, 2023 09:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant