100 Commits
Author SHA1 Message Date
Jakob Borg f2ed52347e refactor(discover): simplify cache handling by moving to the cachedFinder (#10956)
Where it should have been to begin with

---------

Signed-off-by: Jakob Borg <[email protected]>
2026-11-19 11:51:57 +01:00
Jakob Borg ed38528d7f fix: invalid files on remote devices are not "available" (fixes #10943) (#10944)
Properly exclude them from the corresponding query.

Signed-off-by: Jakob Borg <[email protected]>
2026-10-27 12:25:15 +01:00
Jakob Borg d6d0181f7d fix(model): properly compare blocks when reconciling receive-only (fixes #10928) (#10929)
Signed-off-by: Jakob Borg <[email protected]>
2026-10-20 19:54:38 +00:00
Jakob Borg 2d2ffc160e fix: cap body sizes for incoming requests to public services
Signed-off-by: Jakob Borg <[email protected]>
2026-10-18 11:31:39 +02:00
Jakob Borg ab91974876 fix(model): ensure parent ownership is copied properly (fixes #8399) (#10926)
When creating multiple directories, inherit ownership all the way up
(down).

Signed-off-by: Jakob Borg <[email protected]>
2026-10-18 11:30:45 +02:00
Jakob Borg f07853b517 fix(model): verify local change before applying metadata shortcut (fixes #10924) (#10925)
Signed-off-by: Jakob Borg <[email protected]>
2026-10-18 11:24:47 +02:00
Jakob Borg 7eee65afc6 chore(protocol): add protovalidate validation of incoming messages, reasonable limits (#10838)
This adds pre-validation directly at the unmarshal step, of annotations
added to the protobuf definitions. This seeks to weed out unreasonable
situations early, by ensuring offsets are positive, string lengths are
limited, etc. Some of the limits are a bit subjective, but I think I've
put them above what is expected and reasonable...

---------

Signed-off-by: Jakob Borg <[email protected]>
2026-10-18 11:09:03 +02:00
Jakob Borg ab8dcf844e fix(protocol): convert panics on bad data to protocol errors (#10923)
A couple of "panic: bug: foo" type things, where the bug could be
controlled by the supposedly untrusted side.

Signed-off-by: Jakob Borg <[email protected]>
2026-10-18 10:45:48 +02:00
Jakob Borg a0fd63763f fix(discover): skip unnecessary identical global announce updates; obey retry-after (#10918)
We might send unnecessary updates because something changed by the
actual announcement remains identical; skip those.

---------

Signed-off-by: Jakob Borg <[email protected]>
2026-10-09 12:11:30 +02:00
Jakob Borg aff2db883e build(deps): update dependencies (#10917)
Signed-off-by: Jakob Borg <[email protected]>
2026-10-09 10:36:49 +02:00
Jakob Borg 5fb192176d fix(sqlite): do not generate unbounded prepared statements (ref #10913) (#10915)
The API can use arbitrary paging parameters, causing arbitrary numbers
of prepared statements, which becomes a memory leak.

Signed-off-by: Jakob Borg <[email protected]>
2026-10-07 19:08:43 +02:00
Jakob Borg 84329b277f fix(sqlite): avoid early garbage collection of deleted recv-enc files (#10916)
Signed-off-by: Jakob Borg <[email protected]>
2026-10-07 19:07:32 +02:00
Jakob Borg 529ced6c6b fix: handle missing max-sequence file entries (#10912)
This could happen when a folder has deleted files as the latest entries,
and nothing else happened for 180 days (the default tombstone cleanup
time).

Signed-off-by: Jakob Borg <[email protected]>
2026-10-07 18:32:44 +02:00
Jakob Borg 6868119860 build: skip defunct loki sending
Signed-off-by: Jakob Borg <[email protected]>
2026-10-06 10:02:02 +02:00
Jakob Borg 7ad73b408a fix: remove unnecessary delay in index transmission (#10908)
Prior to refactoring, this delay kicked in once all batches were sent.
Now, it came between each batch. Fix that.

---------

Signed-off-by: Jakob Borg <[email protected]>
2026-10-04 06:16:09 +00:00
Jakob Borg 05b6704ef5 fix: use global short lived HTTP client with proper HTTP/2 support (#10901)
In e7b8efb41 I disabled keepalives in several HTTP clients, which
inadvertently also disabled HTTP/2. However, the TLS setup announced h2
as a supported protocol, which caused confusion. This fixes that, and
makes sure to use the same client in all relevant places.

The old option to do usage reporting posts with InsecureSkipVerify goes
away -- nobody should have ever used it.

---------

Signed-off-by: Jakob Borg <[email protected]>
2026-09-30 07:05:59 +00:00
Jakob Borg 9bb4747df2 fix(watchaggregator): properly convert floating-point time duration (fixes #10899) (#10900)
Signed-off-by: Jakob Borg <[email protected]>
2026-09-30 05:53:20 +00:00
Jakob Borg e7b8efb410 fix: disable keepalive on most outgoing HTTP connections (#10891)
Where we don't expect connection reuse for further requests this reduces
the number of open connection server-side.

Signed-off-by: Jakob Borg <[email protected]>
2026-09-22 14:32:44 +02:00
Jakob Borg bb19c017ae fix(model): properly error out when a temp file can't be created (#10883)
Such as when the base filename contains a character disallowed on the
current filesystem...

Signed-off-by: Jakob Borg <[email protected]>
2026-09-14 14:46:03 +02:00
Jakob Borg 813863cdf4 doc: simplify security reporting note
Signed-off-by: Jakob Borg <[email protected]>
2026-09-12 11:11:28 +02:00
Jakob Borg 466857ae7a fix(model): introducers should not be able to add themselves to folders (#10880)
As documented and intended, introducers should be able to vouch for
folders shared with them, but not other folders.

Signed-off-by: Jakob Borg <[email protected]>
2026-09-12 09:09:59 +00:00
Jakob Borg 2ca95cf149 build: give macos security set-key-partition-list the correct password
Signed-off-by: Jakob Borg <[email protected]>
2026-09-08 08:57:55 +02:00
Jakob Borg 62f6060ceb Merge branch 'infrastructure'
* infrastructure:
  chore(discosrv): add debug headers to ping response
  chore(stupgrades): allow templating the asset URL
2026-09-08 08:07:35 +02:00
Jakob Borg c10408263e chore(discosrv): add debug headers to ping response
Signed-off-by: Jakob Borg <[email protected]>
2026-09-08 08:06:31 +02:00
Jakob Borg 6c25cdebf6 chore(stupgrades): allow templating the asset URL
Signed-off-by: Jakob Borg <[email protected]>
2026-09-08 08:06:31 +02:00
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 <[email protected]>
2026-08-24 18:26:23 +00:00
Jakob Borg 38ac58c82e build(deps): update dependencies (#10865)
Signed-off-by: Jakob Borg <[email protected]>
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 <[email protected]>
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 <[email protected]>
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 <[email protected]>
2026-08-18 11:30:52 +02:00
Jakob Borg 34b3603052 fix(ursrv): data problems are the clients fault
Signed-off-by: Jakob Borg <[email protected]>
2026-08-18 11:30:52 +02:00
Jakob Borg bb9dac4f75 build: sign docker images
Signed-off-by: Jakob Borg <[email protected]>
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 <[email protected]>
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 <[email protected]>
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 <[email protected]>
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 <[email protected]>
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 <[email protected]>
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 <[email protected]>
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 <[email protected]>
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 <[email protected]>
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 <[email protected]>
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 <[email protected]>
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 <[email protected]>
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 <[email protected]>
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 <[email protected]>
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 <[email protected]>
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 <[email protected]>
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 <[email protected]>
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 <[email protected]>
2026-07-25 09:33:38 +02:00
Jakob Borg 977f790143 build(deps): update dependencies (#10824)
Signed-off-by: Jakob Borg <[email protected]>
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 <[email protected]>
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 <[email protected]>
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 <[email protected]>
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 <[email protected]>
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 <[email protected]>
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 <[email protected]>
2026-07-01 16:01:46 +00:00
Jakob Borg 35576881ff chore(stcrashreceiver): the "internal" directory exists
Closes #10729

Signed-off-by: Jakob Borg <[email protected]>
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 <[email protected]>
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 <[email protected]>
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 <[email protected]>
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 <[email protected]>
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 <[email protected]>
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 <[email protected]>
2026-06-13 06:31:26 +00:00
Jakob Borg ee275fee65 build(deps): update dependencies (#10740)
Signed-off-by: Jakob Borg <[email protected]>
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 <[email protected]>
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 <[email protected]>
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 <[email protected]>
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 <[email protected]>
2026-06-03 10:54:04 +02:00
Jakob Borg f93306c819 fix(gui): properly escape filenames in fancytree
Signed-off-by: Jakob Borg <[email protected]>
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 <[email protected]>
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 <[email protected]>
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 <[email protected]>
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 <[email protected]>
2026-05-23 09:13:47 +02:00
Jakob Borg 4404b4dfb4 chore(stcrashreceiver): add profiler on metrics port
Signed-off-by: Jakob Borg <[email protected]>
2026-05-23 08:51:34 +02:00
Jakob Borg b537090d91 chore(stcrashreceiver): compact diskstore in-memory representation
Signed-off-by: Jakob Borg <[email protected]>
2026-05-23 08:51:34 +02:00
Jakob Borg 79423edbdf chore(stcrashreceiver): better source cache & metrics
Signed-off-by: Jakob Borg <[email protected]>
2026-05-23 08:51:34 +02:00
Jakob Borg 33075974cb chore(stcrashreceiver): metrics on ignore matches
Signed-off-by: Jakob Borg <[email protected]>
2026-05-23 08:51:32 +02:00
Jakob Borg 8a3a06f7ca build(deps): x/net for govulncheck (#10703)
Signed-off-by: Jakob Borg <[email protected]>
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 <[email protected]>
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 <[email protected]>
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 <[email protected]>
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 <[email protected]>
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 <[email protected]>
2026-05-19 08:46:22 +02:00
Jakob Borg 5b1e1c0520 chore(stcrashreceiver): improve logging
Signed-off-by: Jakob Borg <[email protected]>
2026-05-19 08:46:21 +02:00
Jakob Borg c17be06192 chore(stdiscosrv): prewarm counters at startup
Signed-off-by: Jakob Borg <[email protected]>
2026-05-18 23:40:38 +02:00
Jakob Borg 14c4ad3af2 build: remove environment annotations
Signed-off-by: Jakob Borg <[email protected]>
2026-05-12 15:44:51 +02:00
Jakob Borg 08036b1d87 build: be explicit about workflow permissions (#10690)
Signed-off-by: Jakob Borg <[email protected]>
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 <[email protected]>
2026-05-12 07:59:47 +02:00
Jakob Borg 658ea62052 build: fix draft/published status for new releases
Signed-off-by: Jakob Borg <[email protected]>
2026-05-12 07:34:50 +02:00
Jakob Borg f6c551fe87 chore(fs): remove unused SymlinksSupported() method (#10684)
💀

Signed-off-by: Jakob Borg <[email protected]>
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 <[email protected]>
2026-05-09 12:15:18 +02:00
Jakob Borg 3709174a86 build(deps): update dependencies (#10683)
Signed-off-by: Jakob Borg <[email protected]>
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 <[email protected]>
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