Subject: [bug#75959] [PATCH v10] services: syncthing: Add support for config file generation.

From: Rodion Goritskov <[email-masked]>
Date: Sun, 23 Feb 2025 00:29:25 +0100

Zacchaeus Scheffer <[email-masked]> writes:

> Hi,
>
> Gabriel Santos <[email-masked]> writes:
>
>> Greetings,
>>
>> I appreciate your efforts on this, but this completly broke
>> home-syncthing-service-type for me, as it's resetting my configuration,
>> giving my device another ID.
>>
>> --
>> Gabriel Santos
>
> I think I know why this is.  At some point Syncthing changed the default
> config directory from ~/.config/syncthing to ~/.local/state/syncthing.
> If you move your syncthing .pem files from ~/.local/state/syncthing to
> ~/.config/syncthing, it will work.  Since it seems Syncthing has changed
> the default, this service should really do so as well.  I'll update it
> on the other patch that I'm submitting.
>
> -Zacchae

Hi!

I also have a problem (cannot say if it the same as Gabriel's) - after upgrade my Syncthing
instances stopped working with the odd error "remote device missing in
cluster config".

Moving config didn't work - and, as far as I understand, Syncthing still
read the config in .config if it is present.

However, it looks like it is not because the service itself, but because
of the syncthing upgrade to 1.29.2 in commit
06d37f38606fabbace21e55ec7f2546b3ae5214f.

I checked it by inheriting the Syncthing with the older version:

> (define-public syncthing-old
>  (package
>    (inherit syncthing)
>    (name "syncthing-old")
>    (version "1.28.1")
>    (source (origin
>              (method url-fetch)
>              (uri (string-append "https://github.com/syncthing/syncthing"
>                                  "/releases/download/v" version
>                                  "/syncthing-source-v" version ".tar.gz"))
>              (sha256
>               (base32
>                "16j5w6hdr1x2231hw0zsxm53sw34wxcs4ijjjcnzcg1vz9drjrg9"))))))

And passing it to the server:

> (service syncthing-with-vpn-service-type
> 		 (syncthing-configuration
> 		  (syncthing syncthing-old)
> 		  (user "rodion")))

After that everything started working as before.
Will try to investigate the issue further - couldn't find anything
related neither in Syncthing form nor in the Github issues.