syncthing / syncthing/syncthing-macos
API key is not saved when using a new one
Nobody has claimed this yet.
- Dominant language
- Objective-C
- Stars
- 3.9k
- Forks
- 203
- Avg merge
- 3d 14h
- Merged PRs (30d)
- 2
Description
I am using Syncthing 1.19.2 on Mac OSX High Sierra
(Note I've tried 1.20 on High Sierra without any success.
After I installed Syncthing 1.19.2 and set it to start at login, it worked perfectly syncing to two other Macs.
At some point I generated a new API Key (in the Web Gui Settings) and expected Syncthing to start at login and go Online with the green dot however Syncthing would not go online and showed the yellow Offine Indicator and the menu bar showed an exclamation mark on the Syncthing icon. After generating the new API Key, every time I started Syncthing it showed the old API key in the Preferences, even though the Web Gui Settings showed the new API Key, and stayed Offline. This mismatch between the preferences API key and the Web Gui settings API key is the issue stopping Syncthing going online.
The workaround for this issue I found was as follows
- When Syncthing is initially installed and enabled to start at login, Mac OSX puts the APIKey in a file called 'com.github.xor-gate.syncthing-macosx.plist' in ~/Library/Preferences. For some reason this plist NEVER GETS UPDATED when a new API Key is generated
- I edited the APIKey in 'com.github.xor-gate.syncthing-macosx.plist' to reflect the same API key that is in the Web Interface settings, restarted OSX and Syncthing went online correctly.
So I there is a bug that when the API is re-generated the new API key does not get updated into the com.github.xor-gate.syncthing-macosx.plist in ~/Library/Preferences.
Hope this helps other Mac Syncthing users.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by tracing how the macOS app reads and writes ~/Library/Preferences/com.github.xor-gate.syncthing-macosx.plist when Syncthing starts at login. Reproduce the API key regeneration and restart flow described in the issue. Done means the startup preferences use the newly generated Web GUI API key and Syncthing goes online.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- objective-c
- Domain
- desktop
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100