Skip to content

Conversation

cre4ture
Copy link
Owner

@cre4ture cre4ture commented Jul 5, 2025

No description provided.

calmh and others added 21 commits May 29, 2025 14:56
Previously all were ignored except noupgrade which was hard coded...
…yncthing#10145)

In practice we already always call SetPassword and ClusterConfig
together. However it's not just "sensible" to do that, it's required: If
the passwords change, the remote device needs to know about that to
check that the enc. setup is valid/consistent (e.g. tokens match,
folder-type is appropriate, ...).
And with the passwords set later, there's no point in adding them as
part of creating a new connection.

This is a "followup" (if one can call it that 4 years later :) ) to
resp. fix for the following commit:
924b968

Co-authored-by: Jakob Borg <jakob@kastelo.net>
It shouldn't have touched non-PR issues, but it did
…ng#9519) (syncthing#10148)

Tihs makes it easier to use metrics based on device and folder labels,
names, and other attributes. Other metrics which are based on folder or
device ID can be joined with these info metrics to enrich their label
sets.

```
# HELP syncthing_config_device_info Provides additional information labels on devices
# TYPE syncthing_config_device_info gauge
syncthing_config_device_info{device="I6KAH76-66SLLLB-5PFXSOA-UFJCDZC-YAOMLEK-CP2GB32-BV5RQST-3PSROAU",introducer="false",name="s1",paused="false",untrusted="false"} 1

# HELP syncthing_config_folder_info Provides additional information labels on folders
# TYPE syncthing_config_folder_info gauge
syncthing_config_folder_info{folder="default",label="The default folder",path="s2",paused="false",type="sendreceive"} 1
```

With this you can e.g. query for

```
syncthing_connections_active * on(device) group_left syncthing_config_device_info
```

Fixes syncthing#9519 
Closes syncthing#10074 
Closes syncthing#10147
We use a slightly different handling of features between prereleases.
### Purpose

This change fixes a logical bug in the panic log writing where we could
end up writing to a uninitialized file descriptor.

On the very first iteration, `panicFd` is nil. We enter the if `panicFd
== nil { … }` block, check for “panic:” or “fatal error:”, and if
neither matches, we skip instantiating `panicFd` altogether. However,
immediately after, still within `if panicFd == nil { … }`, we call
`panicFd.WriteString("Panic at ...")`. But `panicFd` would in this case
be `nil`, which will cause a run‐time panic.

It's not clear to me why panicFd is only initialized if the lines start
with "panic:" or "fatal error:" so I've left that logic untouched. With
this change we at least avoid the risk of writing to a nil
filedescriptor.
## Authorship

Your name and email will be added automatically to the AUTHORS file
based on the commit metadata.

---------

Co-authored-by: Jakob Borg <jakob@kastelo.net>
syncthing#9927) (syncthing#10179)

I'll let Audrius words from the ticket explain this :)

> I'm a bit lost, time.Duration is an int64, yet watcher delay is float,
> anything sub 1s gets rounded down to 0, so you just end up going into
an
> infinite loop.


syncthing#9927 (comment)
…ixes syncthing#9879) (syncthing#10176)

Only Require either matching UID & GID OR matching Names.

If the 2 devices have a different Name => UID mapping, they can never be
totaly equal. Therefore when syncing we try matching the Name and fall
back to the UID. However when scanning for changes we currently require
both the Name & UID to match. This leads to forever having out of sync
files back and forth, or local additions when receive only.

This patch does not change the sending behavoir. It only change what we
decide is equal for exisiting files with mismapped Name => UID,

The added testcases show the change: Test 1,5,6 are the same as current.
Test 2,3 Are what change with this patch (from false to true). Test 4 is
a subset of test 2 they is currently special cased as true, which does
not chnage.

Co-authored-by: Jakob Borg <jakob@kastelo.net>
Syncthing version 1.x will soon be replaced by Syncthing version 2.x.
Version 2 brings a new database format and various cleanups, but remains
protocol compatible with Syncthing 1.

More detailed information about Syncthing 2 can be found in the release
notes at https://github.com/syncthing/syncthing/releases.

This release is also available as:

* APT repository: https://apt.syncthing.net/

* Docker image: `docker.io/syncthing/syncthing:1.30.0` or `ghcr.io/syncthing/syncthing:1.30.0`
  (`{docker,ghcr}.io/syncthing/syncthing:1` to follow just the major version)
* fix(protocol): avoid deadlock with concurrent connection start and close by @calmh in syncthing#10140
* fix(syncthing): avoid writing panic log to nil fd by @ardevd in syncthing#10154
* feat(config): expose folder and device info as metrics (fixes syncthing#9519) by @calmh in syncthing#10148
* build: properly propagate build tags to Debian build by @calmh in syncthing#10144
* chore(protocol): don't start connection routines a second time by @imsodin in syncthing#10146
* chore(protocol): only allow enc. password changes on cluster config by @imsodin in syncthing#10145

**Full Changelog**: syncthing/syncthing@v1.29.7...v1.30.0
@cre4ture cre4ture merged commit e968c74 into main Jul 5, 2025
44 of 45 checks passed
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.

6 participants