syncthing 2.0.5

This commit is contained in:
Hadrien Dussuel
2025-09-03 10:51:03 +02:00
parent d0418bc437
commit d465dde2aa
16 changed files with 347 additions and 0 deletions

View File

@@ -0,0 +1,3 @@
# Options to pass to discosrv
# see /usr/libexec/syncthing/stdiscosrv --help for more information
SD_OPTS=

View File

@@ -0,0 +1,27 @@
#!/sbin/openrc-run
# Copyright 1999-2021 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
SD_USER=stdiscosrv
SD_GROUP=syncthing
SD_HOMEDIR=/var/lib/syncthing-discosrv
SD_LOGFILE=/var/log/syncthing/discosrv.log
description="Discovery service for syncthing"
command="/usr/libexec/syncthing/stdiscosrv"
command_args="${SD_OPTS}"
pidfile="/run/syncthing-discosrv.pid"
command_background="yes"
command_user="${SD_USER}:${SD_GROUP}"
directory="${SD_HOMEDIR}"
output_log="${SD_LOGFILE}"
error_log="${SD_LOGFILE}"
depend() {
need net
}
start_pre() {
checkpath -q -d -o ${SD_USER}:${SD_GROUP} ${SD_HOMEDIR}
checkpath -q -f -o ${SD_USER}:${SD_GROUP} ${SD_LOGFILE}
}

View File

@@ -0,0 +1,6 @@
/var/log/syncthing/stdiscosrv.log {
missingok
notifempty
sharedscripts
copytruncate
}

View File

@@ -0,0 +1,3 @@
# Options to pass to relaysrv
# see /usr/libexec/syncthing/strelaysrv --help for more information
SR_OPTS=

View File

@@ -0,0 +1,27 @@
#!/sbin/openrc-run
# Copyright 1999-2021 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
SR_USER=strelaysrv
SR_GROUP=syncthing
SR_HOMEDIR=/var/lib/syncthing-relaysrv
SR_LOGFILE=/var/log/syncthing/relaysrv.log
description="Relay service for syncthing"
command="/usr/libexec/syncthing/strelaysrv"
command_args="${SR_OPTS}"
pidfile="/run/syncthing-relaysrv.pid"
command_background="yes"
command_user="${SR_USER}:${SR_GROUP}"
directory="${SR_HOMEDIR}"
output_log="${SR_LOGFILE}"
error_log="${SR_LOGFILE}"
depend() {
need net
}
start_pre() {
checkpath -q -d -o ${SR_USER}:${SR_GROUP} ${SR_HOMEDIR}
checkpath -q -f -o ${SR_USER}:${SR_GROUP} ${SR_LOGFILE}
}

View File

@@ -0,0 +1,6 @@
/var/log/syncthing/strelaysrv.log {
missingok
notifempty
sharedscripts
copytruncate
}

View File

@@ -0,0 +1,25 @@
Let us save ourselves the pain of messing with renamed system accounts
use the old names, for now at least.
--- a/cmd/stdiscosrv/etc/linux-systemd/stdiscosrv.service
+++ b/cmd/stdiscosrv/etc/linux-systemd/stdiscosrv.service
@@ -9,7 +9,7 @@
ExecStart=/usr/bin/stdiscosrv $DISCOSRV_OPTS
# Hardening
-User=syncthing-discosrv
+User=stdiscosrv
Group=syncthing
ProtectSystem=strict
ReadWritePaths=/var/lib/syncthing-discosrv
--- a/cmd/strelaysrv/etc/linux-systemd/strelaysrv.service
+++ b/cmd/strelaysrv/etc/linux-systemd/strelaysrv.service
@@ -9,7 +9,7 @@
ExecStart=/usr/bin/strelaysrv -nat=${NAT} $RELAYSRV_OPTS
# Hardening
-User=syncthing-relaysrv
+User=strelaysrv
Group=syncthing
ProtectSystem=strict
ReadWritePaths=/var/lib/syncthing-relaysrv

View File

@@ -0,0 +1,25 @@
--- a/build.go
+++ b/build.go
@@ -32,8 +32,6 @@
"strings"
"text/template"
"time"
-
- buildpkg "github.com/syncthing/syncthing/lib/build"
)
var (
@@ -409,13 +409,6 @@
}
args = append(args, "-timeout", timeout)
- if runtime.GOARCH == "amd64" {
- switch runtime.GOOS {
- case buildpkg.Darwin, buildpkg.Linux, buildpkg.FreeBSD: // , "windows": # See https://github.com/golang/go/issues/27089
- args = append(args, "-race")
- }
- }
-
if coverage {
args = append(args, "-covermode", "atomic", "-coverprofile", "coverage.txt", "-coverpkg", strings.Join(pkgs, ","))
}

View File

@@ -0,0 +1,15 @@
This patch removes conditional appending of "-race" flag.
It is needed as we build in PIE mode and race is incompatible with that.
https://bugs.gentoo.org/955442
--- a/build.go
+++ b/build.go
@@ -396,7 +396,7 @@
}
args = append(args, "-timeout", timeout)
- if runtime.GOARCH == "amd64" {
+ if false {
switch runtime.GOOS {
case buildpkg.Darwin, buildpkg.Linux, buildpkg.FreeBSD: // , "windows": # See https://github.com/golang/go/issues/27089
args = append(args, "-race")

View File

@@ -0,0 +1,18 @@
As of early April 2020, running the Syncthing test suite on the Gentoo ppc64
buildhost fails due to TestIssue5063 timing out. Increase the time-out
threshold for this test to allow it to pass.
Other arches we currently support (i.e. amd64, arm and x86) shouldn't be
affected by the change because thay have always passed so far anyway.
--- a/lib/model/model_test.go
+++ b/lib/model/model_test.go
@@ -914,7 +914,7 @@
}()
select {
case <-finished:
- case <-time.After(10 * time.Second):
+ case <-time.After(20 * time.Second):
pprof.Lookup("goroutine").WriteTo(os.Stdout, 1)
t.Fatal("Timed out before all devices were added")
}

View File

@@ -0,0 +1,28 @@
# /etc/conf.d/syncthing: config file for /etc/init.d/syncthing
# User and group as which to run
#SYNCTHING_USER="syncthing"
#SYNCTHING_GROUP="syncthing"
# Configuration directory
#SYNCTHING_HOMEDIR="/var/lib/syncthing/.config/syncthing"
# Log file location
#SYNCTHING_LOGFILE="/var/log/syncthing/syncthing.log"
# umask used to create files
# The default allows group access
#SYNCTHING_UMASK=007
# I/O nice level of syncthing
#SYNCTHING_IONICE="0"
# Nice level of syncthing
#SYNCTHING_NICE="0"
# Where the syncthing GUI should listen. Can be a http(s) URI or a Unix domain socket
#SYNCTHING_GUI_ADDRESS="http://127.0.0.1:8384"
#SYNCTHING_GUI_ADDRESS="unix:/run/syncthing.sock"
# Extra options for syncthing
#SYNCTHING_OPTS=""

View File

@@ -0,0 +1,33 @@
#!/sbin/openrc-run
# Copyright 1999-2022 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
SYNCTHING_USER=${SYNCTHING_USER:-syncthing}
SYNCTHING_GROUP=${SYNCTHING_GROUP:-syncthing}
SYNCTHING_HOMEDIR=${SYNCTHING_HOMEDIR:-/var/lib/syncthing/.config/syncthing}
SYNCTHING_LOGFILE=${SYNCTHING_LOGFILE:-/var/log/syncthing/syncthing.log}
SYNCTHING_UMASK=${SYNCTHING_UMASK:-007}
SYNCTHING_IONICE=${SYNCTHING_IONICE:-0}
SYNCTHING_NICE=${SYNCTHING_NICE:-0}
SYNCTHING_GUI_ADDRESS=${SYNCTHING_GUI_ADDRESS:-http://127.0.0.1:8384}
description="Syncthing is an open, trustworthy and decentralized cloud storage system"
command="/usr/bin/syncthing"
command_args="-no-browser -home=${SYNCTHING_HOMEDIR} -gui-address=${SYNCTHING_GUI_ADDRESS} ${SYNCTHING_OPTS}"
pidfile="/run/${RC_SVCNAME}.pid"
command_background="yes"
command_user="${SYNCTHING_USER}:${SYNCTHING_GROUP}"
umask="${SYNCTHING_UMASK}"
start_stop_daemon_args="--ionice ${SYNCTHING_IONICE} \
--nicelevel ${SYNCTHING_NICE}"
output_log="\"${SYNCTHING_LOGFILE}\""
error_log="\"${SYNCTHING_LOGFILE}\""
depend() {
need localmount net
}
start_pre() {
checkpath -q -d -o ${SYNCTHING_USER}:${SYNCTHING_GROUP} ${SYNCTHING_HOMEDIR}
checkpath -q -f -o ${SYNCTHING_USER}:${SYNCTHING_GROUP} ${SYNCTHING_LOGFILE}
}

View File

@@ -0,0 +1,6 @@
/var/log/syncthing/syncthing.log {
missingok
notifempty
sharedscripts
copytruncate
}