100 Commits
Author SHA1 Message Date
Jakob Borg 9af3c75f37 chore: set User-Agent on all outgoing HTTP requests (#10867)
It's only polite, and it enables better troubleshooting in situations
like weird-ass requests to the upgrades download service.

---------

Signed-off-by: Jakob Borg <jakob@kastelo.net>
2026-08-24 18:26:23 +00:00
Jakob Borg 38ac58c82e build(deps): update dependencies (#10865)
Signed-off-by: Jakob Borg <jakob@kastelo.net>
2026-08-20 11:09:34 +02:00
Jakob Borg 82f3e86424 build: use Go 1.27, minimum version is Go 1.26 (#10864)
### Purpose

🎉

Signed-off-by: Jakob Borg <jakob@kastelo.net>
2026-08-19 20:23:21 +02:00
Jakob Borg 305162e0af Merge branch 'infrastructure'
* infrastructure:
  fix(stdiscosrv): slightly increase reannounce times and smoothing
  fix(stdiscosrv): 500 errors should be accompanied by log entry
  fix(ursrv): data problems are the clients fault
  build: sign docker images
2026-08-18 11:32:52 +02:00
Jakob Borg a907594914 fix(stdiscosrv): slightly increase reannounce times and smoothing
Signed-off-by: Jakob Borg <jakob@kastelo.net>
2026-08-18 11:30:52 +02:00
Jakob Borg db2b02c44d fix(stdiscosrv): 500 errors should be accompanied by log entry
Signed-off-by: Jakob Borg <jakob@kastelo.net>
2026-08-18 11:30:52 +02:00
Jakob Borg 34b3603052 fix(ursrv): data problems are the clients fault
Signed-off-by: Jakob Borg <jakob@kastelo.net>
2026-08-18 11:30:52 +02:00
Jakob Borg bb9dac4f75 build: sign docker images
Signed-off-by: Jakob Borg <jakob@kastelo.net>
2026-08-18 11:28:52 +02:00
Jakob Borg 058bcd7334 fix: open GUI when relaunched instead of printing error (fixes #10727) (#10852)
This is primarily to improve the experience in environments that start
Syncthing from a graphical environment, e.g., Windows.

When already running, instead of printing an error we open the GUI. If
the GUI is not available (but the lockfile indicates we are running),
print an error and exit.

If --no-browser is given or STNOBROWSER is set, act like before.

Closes #10736. Marking as `fix` because this does not deserve to trigger
a minor release on its own.

---------

Signed-off-by: Jakob Borg <jakob@kastelo.net>
2026-08-11 11:17:09 +00:00
Jakob Borg 328d910aee fix(api): correctly return metrics, support bundle (fixes #10847) (#10849)
Our faked request wasn't good enough; improve it, adding a test.

Signed-off-by: Jakob Borg <jakob@kastelo.net>
2026-08-05 18:35:17 +00:00
Jakob Borg d7df27a367 fix(model): correctly handle receive-only changed directories (fixes #8004) (#10843)
When adding a folder in receive-only mode where the contents were
already identical to a remote device, directories would remain as
locally changed when everything else had consolidated. The reason this
happened is that we only did the matching between locally changed files
and their global equivalent for changed items, but directories are
typically not "changed" much as we don't track their mtime, so they
wouldn't pass through this stage when scanning.

Now, instead, do the check when we're anyway walking all the files in
phase two of scanning. This catches all cases of identical items, files
or directories, regardless of how they came to be in the index.

Signed-off-by: Jakob Borg <jakob@kastelo.net>
2026-08-05 20:23:53 +02:00
Jakob Borg 8ea09c0094 chore: style fixes from go fix (#10846)
Just `go fix ./...`

Signed-off-by: Jakob Borg <jakob@kastelo.net>
2026-08-05 20:23:22 +02:00
Jakob Borg 946e2b83a1 fix(db, model): better handle db connections, puller concurrency, avoid deadlock (fixes #10841) (#10842)
There is a danger of deadlock wherever we have database operations
inside a database iterator. The iterator itself pins a connection, so
the nested operations need another connection; if we've reached
maxOpenConns then it blocks until a connection is released. If all
connections are consumed by such iterators then none can make progress.

Luckily, we have limited concurrency for most such iterator loops. They
are part of scanning, pulling, reverting, etc where there is only ever
one such routine per folder. The exception is block reuse in the copier
routine, which is limited by the `Copiers` setting per folder. This
could in practice deadlock since you could set copiers to eight and end
up with six `AllLocalBlocksWithHash` iterators when `maxDBConns=6`, all
of which need to make additional database calls inside the loop.

This PR fixes the problem twice;

- The problematic loop does not need to be reentrant. The set of blocks
that may be returned by the iterator is finite so we can easily just
collect them to a slice before we start processing them. This avoids the
problem entirely.
- We do not need to limit database connections as strictly as we
currently do. Increase the maximum allowed, while reducing the number of
held-open idle connections slightly. This is not an exact science, but
ideally we want "most" operations to be able to use the pinned
connections to avoid cache churn. Most operations are short lived
queries, or single-goroutine iterators with short lived queries inside,
so four connections seems like it should usually be enough. 🤷
- Additionally, set a cap on Copiers. Currently you could set it to an
arbitrarily large number, which is not advantageous. Limit it to
2*NumCPU which scales somewhat with system performance.

Signed-off-by: Jakob Borg <jakob@kastelo.net>
2026-08-03 23:36:05 +02:00
Jakob Borg bcef5c5bc6 chore(syncthing): include local db entries in perfstats (#10839)
As used by the latest few PRs with graphs in them

Signed-off-by: Jakob Borg <jakob@kastelo.net>
2026-07-27 10:23:18 +00:00
Jakob Borg 952da4224b chore(model): optimise fsync calls (#10831)
This improves performance when running with fsync enabled. The key
observation is that the OS may coalesce multiple concurrent fsyncs, so
we gain some performance by issuing them in parallell. Since they run
from the finisher routine, a simple fix is to run multiple finisher
routines. That's the `after` line in the graph below. The other step is
to do the same for the directory fsyncs, issuing them concurrently with
a limiter. In both cases I used the Copiers value as the concurrency
factor. Additionally, add some buffering to the channels between
routines to minimise stalls where a routine needs to wait for another.
This is the `after2` line.

All in all, this speeds up syncing 25k tiny files from 190s to 130s, a
30% improvement.

<img width="821" height="540" alt="Screenshot 2026-07-25 at 22 58 34"
src="https://github.com/user-attachments/assets/18272c89-a99e-4ee4-9b5e-b278967ea7c6"
/>

---------

Signed-off-by: Jakob Borg <jakob@kastelo.net>
2026-07-27 12:13:05 +02:00
Jakob Borg b2092b188f chore(fs): optimise casefs caching performance (#10830)
This tweaks the casefs cache to do in-place updates for modifications we
perform, instead of dropping the entire cache. That is, we add, remove
and rename things in the cache after having done the corresponding
operation.

We still drop the cache entirely on larger operations like MkdirAll, and
before Walk, and the 1s expiry is unchanged.

The result is performance much closer to the original. I set up a device
with 150 000 tiny files and measured the time it took for a blank device
to come online and sync all the files, with default settings apart from
`fsync` being disabled, as it otherwise dominated the benchmark...

There are three runs, all are identical in the first 40 seconds which is
the index transmission & reception, then we can see the `sensitive` run
(casefs disabled) finishes at 137 seconds (137-40 = 97s spent syncing);
the `before` run finishes at 238s (198s spent syncing); the `after` run
finishes at 142 seconds (102s spent syncing). So, effectively the sync
time is cut in half, and is now very close to having case sensitive
enabled.

<img width="812" height="476" alt="Screenshot 2026-07-25 at 23 22 22"
src="https://github.com/user-attachments/assets/0aa39712-9fd7-46cf-969e-b6a20f150a3c"
/>

---------

Signed-off-by: Jakob Borg <jakob@kastelo.net>
2026-07-27 12:05:20 +02:00
Jakob Borg 2f55d28b5c fix(api): handle empty path in static request (#10837)
The panic would be recovered by the HTTP server, but this is cleaner.

Signed-off-by: Jakob Borg <jakob@kastelo.net>
2026-07-26 18:54:45 +00:00
Jakob Borg 733f63592f fix(versioner): handle invalid empty command (#10836)
Same same

Signed-off-by: Jakob Borg <jakob@kastelo.net>
2026-07-26 18:51:53 +00:00
Jakob Borg b8a255cc96 fix(ignore): handle pattern resulting in empty string (#10835)
Minor fix to avoid a panic in ignore matching.

Signed-off-by: Jakob Borg <jakob@kastelo.net>
2026-07-26 20:50:14 +02:00
Jakob Borg 703b185982 fix(upnp): guard against out of index string access (#10834)
Broken responses may have empty path component.

Signed-off-by: Jakob Borg <jakob@kastelo.net>
2026-07-26 18:37:28 +00:00
Jakob Borg 119d5e72ef chore: deflake TestRecvOnlyRevertNeeds (#10827)
There was a rare, tricky race condition in the setup, where a pull could
get started, find the blocks from the file we injected in
updateLocalsFromScanning, copy them into a temp file, then fail the pull
because the file was already in place. Then later, after the revert,
another pull would start, find the temp file and reuse it, making it so
needed=0 instead of the expected needed>0 the test checks for.

This avoids all that by setting the local index data prior to getting it
from the "remote" device, thus avoiding the initial pull and temp file
creation etc.

Signed-off-by: Jakob Borg <jakob@kastelo.net>
2026-07-25 08:47:42 +00:00
Jakob Borg ec35a95318 chore: slightly optimise rename detection (ref #10777) (#10819)
Only run rename detection for new files. This skips an expensive check
for all updates to existing files. The tradeoff is that we no longer
immediately detect renames on top of another file as a rename -- this
may instead become a copy+delete operation on the destination.

---------

Signed-off-by: Jakob Borg <jakob@kastelo.net>
2026-07-25 07:46:56 +00:00
Jakob Borg b15ff42d52 chore: remove ignore file caching entirely (#10813)
Effectively nobody uses it, it cost more than it was worth, the code
doesn't carry its weight. Remove it and let any similar mechanism in the
future be an internal implementation detail.

Closes #10812

Signed-off-by: Jakob Borg <jakob@kastelo.net>
2026-07-25 09:43:22 +02:00
Jakob Borg 2f81bf5d34 chore(fs): casefs keep first instead of last mapping
Closes #10823, closes #10825.

Signed-off-by: Jakob Borg <jakob@kastelo.net>
2026-07-25 09:36:39 +02:00
Jakob Borg 39b0bd20d0 chore: new code contribution guidelines (#10821)
Reflecting current challenges.

Signed-off-by: Jakob Borg <jakob@kastelo.net>
2026-07-25 09:33:38 +02:00
Jakob Borg 977f790143 build(deps): update dependencies (#10824)
Signed-off-by: Jakob Borg <jakob@kastelo.net>
2026-07-24 08:09:47 +02:00
Jakob Borg 9f7b4d4104 fix(model): properly health-check up-to-date folders (fixes #10546) (#10773)
Previously we'd skip the health check for an up-to-date folder, so it
would continue looking up-to-date even when the folder path missing.

---------

Signed-off-by: Jakob Borg <jakob@kastelo.net>
2026-07-20 22:54:31 +02:00
Jakob Borg d710874903 chore: fix a couple of unclosed http connections (#10806)
Signed-off-by: Jakob Borg <jakob@kastelo.net>
2026-07-20 20:22:40 +00:00
Jakob Borg 1722f0a7b2 fix(strelaypoolsrv): locking correctness (#10801)
Fixes a couple of races on relay handling in the pool server.

Fixes #10799.
Closes #10800.

Signed-off-by: Jakob Borg <jakob@kastelo.net>
2026-07-16 16:01:47 +00:00
Jakob Borg c904140b3c fix: avoid warning on does-not-exist scan error (fixes #10465) (#10791)
We never need to treat these as warnings from a scan.

Signed-off-by: Jakob Borg <jakob@kastelo.net>
2026-07-16 09:20:33 +08:00
Jakob Borg c1d8045d86 fix(ignore, fs): allow loading ignore patterns behind symlink (fixes #10785) (#10786)
The recent change to disallow following symlinks by default conflicts
with the expected behavior of .stignore. This adds a new flag which may
be passed to OpenFile to skip default symlink-forbidding open flag.

---------

Signed-off-by: Jakob Borg <jakob@kastelo.net>
2026-07-16 09:19:13 +08:00
Jakob Borg ef4629ea56 chore(model): simplify FileInfoBatch size computation (#10776)
We used a size computation to generate reasonably sized batches, but the
ProtoSize call is fairly expensive as it requires a conversion to a wire
type etc. We don't need that much precision. Instead, just limit to 1000
files or 5000 blocks, which is likely approximately that much data
anyway.

Closes #10707

Signed-off-by: Jakob Borg <jakob@kastelo.net>
2026-07-01 16:01:46 +00:00
Jakob Borg 35576881ff chore(stcrashreceiver): the "internal" directory exists
Closes #10729

Signed-off-by: Jakob Borg <jakob@kastelo.net>
2026-07-01 17:43:26 +02:00
Jakob Borg 44cbfcad56 fix(sqlite): update last migration to set schema version, counts (#10768)
The counts needs to be modified manually since we're not running
triggers during migrations. The schema version needed to be bumped.

Signed-off-by: Jakob Borg <jakob@kastelo.net>
2026-06-26 07:22:40 +02:00
Jakob Borg e4d08b336e fix(config): remove extraneous defaults setting while unmarshalling folder options (fixes #10746, fixes #10389) (#10763)
This broke PATCH on folders. Any place that needs the defaults should
set them prior to unmarshal.

Signed-off-by: Jakob Borg <jakob@kastelo.net>
2026-06-23 07:57:36 +02:00
Jakob Borg 97cb72a608 chore(versioner): attempt to prevent blatantly unsafe external versioner commands (fixes #10721) (#10722)
While preparing the command, attempt to verify that the template
expansion happens in a way that will result in a non-shell-injection
command. I don't presume to say that this is a 100% prevention, and the
script itself can always do dumb shit with the file path later.
Nonetheless, we should make a best-effort attempt.

Equally, this could generate false positives for commands that are
strangely written but in fact safe. I think this is acceptable; external
versioning is currently used by approximately 0.02% of users, and
presumably most of them have a setup that is sane.

---------

Signed-off-by: Jakob Borg <jakob@kastelo.net>
2026-06-23 07:48:53 +02:00
Jakob Borg 5313c75eba chore(model): increase default value for num hashers (#10761) 2026-06-22 12:53:03 +02:00
Jakob Borg 92ff9ac078 chore(osutil): fixup test for symlinked folder root (#10758)
This test was incorrectly rewritten to use fakefs, which doesn't really
test what it's supposed to test.

Signed-off-by: Jakob Borg <jakob@kastelo.net>
2026-06-21 19:48:15 +02:00
Jakob Borg 8cc4c4ffb3 build: use Go 1.26 for Windows as well (#10744)
Signed-off-by: Jakob Borg <jakob@kastelo.net>
2026-06-13 14:01:46 +02:00
Jakob Borg f1d631d66e fix(protocol): loosen restriction on size of directory entries (#10743)
The synthetic directory size must be permitted.

Ref #10737.

---------

Signed-off-by: Jakob Borg <jakob@kastelo.net>
2026-06-13 06:31:26 +00:00
Jakob Borg ee275fee65 build(deps): update dependencies (#10740)
Signed-off-by: Jakob Borg <jakob@kastelo.net>
2026-06-12 08:59:50 +02:00
Jakob Borg 6606e6b4d3 fix(protocol): be more stringent about blocks in non-file entries (#10737)
Directories, but also symlinks, should not have blocks or a size.

Signed-off-by: Jakob Borg <jakob@kastelo.net>
2026-06-11 18:52:24 +02:00
Jakob Borg f6428af4c8 fix(protocol): always expect & validate block hash in requests (#10738)
Verify that block requests have a hash and that it's correct. This helps
prevent certain races and ensure that only expected data is ever
returned in response to a request.

(In Syncthing prior to 1.28.1 the block hash was omitted for encrypted
requests from trusted devices. This breaks compatibility with that
specific config on those versions.)

---------

Signed-off-by: Jakob Borg <jakob@kastelo.net>
2026-06-11 18:51:25 +02:00
Jakob Borg a5cbeeafea fix(fs, model): improve symlink resilience in file shortcut (#10739)
Ensure file was a file before the shortcut as well as after... (This was
implied when talking to a correct implementation, but not enforced.)

Make our file opening operations safe by default by ensuring the last
path component is not a symlink.

---------

Signed-off-by: Jakob Borg <jakob@kastelo.net>
2026-06-11 18:50:11 +02:00
Jakob Borg 6df85dc95c fix: let umask do the thing (#10723)
We had a few places where we had perhaps too much of an opinion on the
permissions on created files and directories, sometimes fuled by a
misconception about how permissions work in both Unix and Windows. Recap
on the ground rules:

- On all unixes, all file & directory creation (`Mkdir`, `MkdirAll`,
`Create`, `WriteFile`, `Open`) has the given permission bits filtered
via the user's umask. The proper permissions for us to use are in almost
all cases 0o666 for files and 0o777 for directories, strange as that may
look at the call site.
- On Windows, there is no umask but in turn all of the permission bits
except the user write bit are ignored. The absence of user write bit is
converted into the read only attribute. This means that what is proper
for Unix above is also proper for Windows.
- We make an exception when creating files for certificate keys and the
config / database directories, as those contain secrets we think should remain closed
even if the user generally collaborates with other users on the system.

(Also removal of a bugfixed copy of MkdirAll for Windows that hasn't
been necessary for a few years.)

---------

Signed-off-by: Jakob Borg <jakob@kastelo.net>
2026-06-03 10:54:04 +02:00
Jakob Borg f93306c819 fix(gui): properly escape filenames in fancytree
Signed-off-by: Jakob Borg <jakob@kastelo.net>
2026-06-02 16:54:21 +02:00
Jakob Borg 9cdff04877 fix(connections): do not report connection metrics for self (ref #10509) (#10724)
Makes the metrics easier to interpret.

Signed-off-by: Jakob Borg <jakob@kastelo.net>
2026-06-02 14:01:03 +02:00
Jakob Borg 6be1ff8480 fix(protocol): handle zero-size requests (fixes #10709) (#10710)
- Allow zero-sized requests since they are sent by all current versions
of Syncthing.
- Stop sending zero-sized requests since that's stupid.

---------

Signed-off-by: Jakob Borg <jakob@kastelo.net>
2026-05-25 15:22:07 +02:00
Jakob Borg deb1e5b38a Revert "build: temporarily disable illumos for release"
This reverts commit c0c401efeb.
2026-05-23 12:00:07 +02:00
Jakob Borg 49a2688caa Merge branch 'infrastructure'
* infrastructure:
  build: let infra containers builds fail individually
  chore(ur): move structs to reduce dependency chain
  chore(stcrashreceiver): add profiler on metrics port
  chore(stcrashreceiver): compact diskstore in-memory representation
  chore(stcrashreceiver): better source cache & metrics
  chore(stcrashreceiver): metrics on ignore matches
2026-05-23 09:36:25 +02:00
Jakob Borg 05b4f6abda build: let infra containers builds fail individually
Signed-off-by: Jakob Borg <jakob@kastelo.net>
2026-05-23 09:18:15 +02:00
Jakob Borg 9152d7fb2f chore(ur): move structs to reduce dependency chain
lib/ur brings in a lot of dependencies we don't need in e.g.
stcrashreceiver, who only needs the small failure reporting structs.
Make those part of the lean `contract` package instead.

Signed-off-by: Jakob Borg <jakob@kastelo.net>
2026-05-23 09:13:47 +02:00
Jakob Borg 4404b4dfb4 chore(stcrashreceiver): add profiler on metrics port
Signed-off-by: Jakob Borg <jakob@kastelo.net>
2026-05-23 08:51:34 +02:00
Jakob Borg b537090d91 chore(stcrashreceiver): compact diskstore in-memory representation
Signed-off-by: Jakob Borg <jakob@kastelo.net>
2026-05-23 08:51:34 +02:00
Jakob Borg 79423edbdf chore(stcrashreceiver): better source cache & metrics
Signed-off-by: Jakob Borg <jakob@kastelo.net>
2026-05-23 08:51:34 +02:00
Jakob Borg 33075974cb chore(stcrashreceiver): metrics on ignore matches
Signed-off-by: Jakob Borg <jakob@kastelo.net>
2026-05-23 08:51:32 +02:00
Jakob Borg 8a3a06f7ca build(deps): x/net for govulncheck (#10703)
Signed-off-by: Jakob Borg <jakob@kastelo.net>
2026-05-23 06:48:21 +00:00
Jakob Borg d0b35021c6 chore(syncthing): include runtime context in GC crashes (#10702)
The runtime prints a lot of context for crashes due to bad pointers etc,
which is required to understand the crash, but this context comes before
the `fatal error: ...` line. Currently those lines get filtered out and
not included in the crash report. This change modifies the criteria so
that we start collecting crash data also at a line that begins with
`runtime:`, and tweaks the parsing later to look for the specific
`panic:` or `fatal error:` which may come later as the subject.

---------

Signed-off-by: Jakob Borg <jakob@kastelo.net>
2026-05-23 08:40:43 +02:00
Jakob Borg 6322091462 fix(discover): only announce wildcard for TCP punching when listening on wildcard address (fixes #10503) (#10691)
If we aren't announcing e.g. tcp://0.0.0.0:22000 then also do not
announce tcp://0.0.0.0:0.

Signed-off-by: Jakob Borg <jakob@kastelo.net>
2026-05-23 06:37:48 +00:00
Jakob Borg 5464970c5d fix(versioner): ensure user read/write/execute on archived dirs (fixes #10532) (#10696)
This makes sure the user running Syncthing, and hence Synchting itself,
has read/write/execute on directories in .stversions. The other
permission bits remain copied from the source directory, ensuring
whatever group and other permissions were set remain in effect.

Closes #10695.

---------

Signed-off-by: Jakob Borg <jakob@kastelo.net>
2026-05-23 06:21:04 +00:00
Jakob Borg 3962a23723 fix(syncthing): properly upgrade via REST when Syncthing is running (fixes #10697) (#10699)
The locking logic for upgrades got inverted in the lockfile changes. If
we got the lock it means Syncthing wasn't already running, so we can do
a direct upgrade. If we failed to get the lock it means Syncthing was
running and we should tell the REST interface to do the upgrade.

Signed-off-by: Jakob Borg <jakob@kastelo.net>
2026-05-21 10:15:18 +02:00
Jakob Borg feaa90408e Merge branch 'infrastructure'
* infrastructure:
  fix(stcrashreceiver): allow extra pre/post data in version line
  chore(stcrashreceiver): improve logging
  chore(stdiscosrv): prewarm counters at startup
2026-05-21 09:57:46 +02:00
Jakob Borg a8ed6e4855 fix(stcrashreceiver): allow extra pre/post data in version line
Signed-off-by: Jakob Borg <jakob@kastelo.net>
2026-05-19 08:46:22 +02:00
Jakob Borg 5b1e1c0520 chore(stcrashreceiver): improve logging
Signed-off-by: Jakob Borg <jakob@kastelo.net>
2026-05-19 08:46:21 +02:00
Jakob Borg c17be06192 chore(stdiscosrv): prewarm counters at startup
Signed-off-by: Jakob Borg <jakob@kastelo.net>
2026-05-18 23:40:38 +02:00
Jakob Borg 14c4ad3af2 build: remove environment annotations
Signed-off-by: Jakob Borg <jakob@kastelo.net>
2026-05-12 15:44:51 +02:00
Jakob Borg 08036b1d87 build: be explicit about workflow permissions (#10690)
Signed-off-by: Jakob Borg <jakob@kastelo.net>
2026-05-12 15:36:20 +02:00
Jakob Borg c0c401efeb build: temporarily disable illumos for release
They let the domain/DNSSEC expire, I need the build to pass.

Signed-off-by: Jakob Borg <jakob@kastelo.net>
2026-05-12 07:59:47 +02:00
Jakob Borg 658ea62052 build: fix draft/published status for new releases
Signed-off-by: Jakob Borg <jakob@kastelo.net>
2026-05-12 07:34:50 +02:00
Jakob Borg f6c551fe87 chore(fs): remove unused SymlinksSupported() method (#10684)
💀

Signed-off-by: Jakob Borg <jakob@kastelo.net>
2026-05-09 10:48:53 +00:00
Jakob Borg f538b47070 chore(model): slightly improve handling of pulling empty blocks (#10679)
In the common case (sparse files enabled, not reusing old data) we'd
optimise away pulling & writing zero blocks. However in the corner cases
we'd go through the whole processing of pulling the block over the
network which is of course entirely unnecessary.

Now, instead, always take an optimised path for all-zeroes blocks. In
the clean case we do nothing, otherwise we materialise a block of zeroes
and write it directly.

---------

Signed-off-by: Jakob Borg <jakob@kastelo.net>
2026-05-09 12:15:18 +02:00
Jakob Borg 3709174a86 build(deps): update dependencies (#10683)
Signed-off-by: Jakob Borg <jakob@kastelo.net>
2026-05-09 06:49:34 +00:00
Jakob Borg 5dd22cfd85 Merge branch 'infrastructure'
* infrastructure:
  fix(stdiscosrv): do graceful shutdown on SIGTERM
2026-05-04 09:54:04 +02:00
Jakob Borg 6c51a59c52 fix(stdiscosrv): do graceful shutdown on SIGTERM
Signed-off-by: Jakob Borg <jakob@kastelo.net>
2026-05-02 17:26:37 +02:00
Jakob Borg 1919c89de4 build: only run the periodic build jobs in the syncthing org (#10675) 2026-05-01 05:09:14 +00:00
Jakob Borg 774aa11795 fix(stdiscosrv): only read certificate proxy headers with --http (#10674)
These headers should not be inspected when running with a TLS listener.

Additionally, we should really enable them individually instead of
trusting the proxy to filter out the unused variants, but baby steps.

Reported by multiple AI vuln scanners.

Signed-off-by: Jakob Borg <jakob@kastelo.net>
2026-04-30 18:44:28 +00:00
Jakob Borg 44abd15162 chore(api): use ldap package escape functions (#10672)
Instead of our own variants, which were mostly but not 100% identical.

---------

Signed-off-by: Jakob Borg <jakob@kastelo.net>
2026-04-29 12:06:12 +02:00
Jakob Borg 531d7f1a9a build: create GH release as draft, then publish
Signed-off-by: Jakob Borg <jakob@kastelo.net>
2026-04-26 12:43:45 +02:00
Jakob Borg 6bff89a618 docs: release notes for 2.1
Signed-off-by: Jakob Borg <jakob@kastelo.net>
2026-04-26 12:23:35 +02:00
Jakob Borg 86ac4e5017 feat: make block indexing configurable (#10608)
This adds a new folder-level configuration `FullBlockIndex`. It controls
whether we maintain the block index for a given folder -- currently
that's always true, now it becomes possible to turn off. The block index
is used for lookup of blocks across files and folders. Effectively, when
syncing a change, for each block, we check:

1. Is the block already present in the old version of the file? If so,
we can reuse (copy) it without network transfer. **This check is always
possible.**
2. Is the block already present in any other file in this folder or
other folders? If so we can copy it. **This check is only possible with
the full block index.**
3. We must transfer the block over the network.

Maintaining the full block index is costly in time, I/O and database
size. With this PR, maintaining the full block index becomes the default
for send-receive and receive-only folders only, with it disabled for
send-only and receive-encrypted folders. The block index is never useful
for encrypted folders, as blocks are encrypted separate for each file.
It is also not useful for send-only folders by themselves, though the
data in the send-only folder could be reused by other receive-type
folders if it were enabled.

For very large folders it may make sense to disable the full block index
regardless of folder type and just accept the resulting decrease in data
reuse.

Disabling or enabling the option in the GUI causes the index to be
destroyed or rebuilt accordingly.

https://github.com/syncthing/docs/pull/1005

---------

Signed-off-by: Jakob Borg <jakob@kastelo.net>
2026-04-26 11:58:09 +02:00
Jakob Borg 1f57187461 fix(strelaypoolsrv): retry "not found" errors in registration check
We presumably always intended to retry these, but we didn't.

Relates to #10658.

Signed-off-by: Jakob Borg <jakob@kastelo.net>
2026-04-24 15:19:48 +02:00
Jakob Borg a7f47d381e fix(strelaypoolsrv): correct remote address logging
Signed-off-by: Jakob Borg <jakob@kastelo.net>
2026-04-24 15:19:48 +02:00
Jakob Borg 1a7825c7ec fix(strelaysrv): properly use bind address for outgoing requests (fixes #10658) (#10659)
This was lost in #7217 a while back.

---------

Signed-off-by: Jakob Borg <jakob@kastelo.net>
2026-04-24 15:18:18 +02:00
Jakob Borg 97fb677887 chore(api): deflake TestHTTPLogin on Windows (#10667)
Hopefully deflakes TestHTTPLogin on Windows, where it currently often
times out, presumably in the config saving stage after already having
started a shutdown of the API and being CPU constrained due to password
hashing.

---------

Signed-off-by: Jakob Borg <jakob@kastelo.net>
2026-04-24 15:07:16 +02:00
Jakob Borg 124f6979a4 build: parallelise linux builds slightly (#10666)
They currently take like 25 minutes. This reduces that to approximately
a third, wall-clock wise.

Signed-off-by: Jakob Borg <jakob@kastelo.net>
2026-04-24 13:16:12 +02:00
Jakob Borg bcaabedc8e chore(scanner): deflake TestStopWalk (#10664)
The test expected the stopped scanner to produce at most numHashers
additional results, but there's also the case where a directory is
encountered (which doesn't require hashing) and sent directly.

Signed-off-by: Jakob Borg <jakob@kastelo.net>
2026-04-24 09:52:50 +02:00
Jakob Borg 46fb888ea3 chore(model): deflake TestCompletionEmptyGlobal (#10663)
There was a race condition where using IndexUpdate would trigger a pull,
which would sync the delete we are looking for, making the completion
100%. By doing the insert directly into the database we are not
triggering these things and get the expected completion percentage
always.

Signed-off-by: Jakob Borg <jakob@kastelo.net>
2026-04-24 09:52:27 +02:00
Jakob Borg 36c3331696 chore(model): deflake cluster config tests (#10662)
These have been flaky for a long time, seemingly because the multiple
connection code slightly changed the timing of cluster config sending by
moving them to the connection promotion loop. This adds some resiliency
to that, instead of assuming that the CC:s will be immediately available
after adding the connection.

---------

Signed-off-by: Jakob Borg <jakob@kastelo.net>
2026-04-24 07:41:17 +00:00
Jakob Borg 2721b7b522 chore(model): more efficient tracking of renames during scan (#10653) 2026-04-23 07:20:52 +02:00
Jakob Borg b1ccf3f3fd chore: trivial fixes (#10650)
... which keep getting filed by AI agents.

Closes #10649, closes #10486, closes #10648, closes #10499, closes
#10647, closes #10635, closes #10636, closes #10607.

---------

Signed-off-by: Jakob Borg <jakob@kastelo.net>
2026-04-22 06:38:05 +00:00
Jakob Borg a211fafdc4 policy: pushing invalidates PR approval
Signed-off-by: Jakob Borg <jakob@kastelo.net>
2026-04-08 17:48:27 +02:00
Jakob Borg e4e9402cd9 docs: add release notes for 2.1
Signed-off-by: Jakob Borg <jakob@kastelo.net>
2026-04-07 17:25:53 +02:00
Jakob Borg f806967958 Merge branch 'infrastructure'
* infrastructure:
  chore(stdiscosrv): smooth retry-after delays over a slightly larger normal distribution
  chore(stdiscosrv): optionally delay shutdown
  chore(stdiscosrv): adjust desired seen and unseen rate separately
2026-04-07 17:22:35 +02:00
Jakob Borg 5d877f65f5 build: have dependabot group PRs and use cooldown (#10630)
Signed-off-by: Jakob Borg <jakob@kastelo.net>
2026-04-07 16:57:42 +02:00
Jakob Borg 5febc056a8 fix(protocol): limit size of incoming request messages (#10629)
Signed-off-by: Jakob Borg <jakob@kastelo.net>
2026-04-07 16:28:18 +02:00
Jakob Borg 3ac9b83f40 chore(stdiscosrv): smooth retry-after delays over a slightly larger normal distribution
Signed-off-by: Jakob Borg <jakob@kastelo.net>
2026-04-06 14:49:13 +02:00
Jakob Borg 1d4df9c1f4 chore(stdiscosrv): optionally delay shutdown
Signed-off-by: Jakob Borg <jakob@kastelo.net>
2026-04-06 11:06:25 +02:00
Jakob Borg a80b53d113 chore(stdiscosrv): adjust desired seen and unseen rate separately
Signed-off-by: Jakob Borg <jakob@kastelo.net>
2026-04-06 10:42:24 +02:00
Jakob Borg b594b7491f chore: systematic syncthing_build_info metric
Signed-off-by: Jakob Borg <jakob@kastelo.net>
2026-04-06 09:44:49 +02:00
Jakob Borg b39c56f82d chore: remove tracking inode change time (#10579)
Signed-off-by: Jakob Borg <jakob@kastelo.net>
2026-03-22 20:24:03 -07:00