Skip to content

Instantly share code, notes, and snippets.

@Paraphraser
Created July 4, 2025 05:44
Show Gist options
  • Save Paraphraser/f3ab039e28de839503459371f461a853 to your computer and use it in GitHub Desktop.
Save Paraphraser/f3ab039e28de839503459371f461a853 to your computer and use it in GitHub Desktop.
Syncthing "Running (Offline)"

Syncthing "Running (Offline)"

If you are running Syncthing on macOS, you may see a menu-bar pattern line this:

See also Syncthing forum issue 24351 which was closed without an answer. Same problem.

I don't claim to understand Syncthing's internals but this condition appears to mean that there is a mismatch between the API keys in these two locations:

  • Web UI: Actions » Settings » General » API Key
  • Menu-bar UI: Syncthing » Preferences » API key

I encountered this problem on an M2 MacBook Pro running Sequoia 15.5. Once I realised what was going on, I tried the obvious approach of copying and pasting from one to the other:

  • It is possible to copy the keys from both places;
  • It isn't possible to paste a key into the Web UI;
  • It is possible to paste a key into the Menu-bar UI but it doesn't seem to persist.

I decided to try some brute force. The steps below worked for me but YMMV:

  1. In the Syncthing Web UI:

    • Click Actions and choose Settings.
    • Make sure the General tab is selected.
    • Right-click on the "API Key" field and choose "copy". This places the value of the API Key on your clipboard.
    • Close the browser window.
  2. In the Syncthing Menu-bar item:

    • Choose "Preferences..."
    • Select the contents of the "API key" field.
    • Right-click and choose "Paste". This replaces the key with the value copied in step 1.
    • Click Test and confirm that the indicator changes from red to green.
    • Click Quit Syncthing.
  3. Launch Terminal and type (do not copy and paste) the following command without pressing return after you type the =:

    APIKEY=

    Either press +v or choose "Paste" from the "Edit" menu. The result should be something like this:

    APIKEY=jmn2mXzxxUnZyYzWqYubiLkFfvVVmgQJ

    where the string after the = is your API Key from the Syncthing Web UI that you copied to the clipboard in step 1.

    Press return. This sets the APIKEY variable to the value of your API Key.

  4. Still in Terminal, run the following commands. You can either select all the commands as a group, copy them to the clipboard, paste into the Terminal window, then press return, or you can copy and paste one line at a time, pressing return after each command:

    cd ~/Library/Preferences
    PLIST=com.github.xor-gate.syncthing-macosx.plist
    cp "$PLIST" "$PLIST.bak"
    plutil -extract "ApiKey" raw "$PLIST"
    plutil -replace "ApiKey" -string "$APIKEY" "$PLIST"
    plutil -extract "ApiKey" raw "$PLIST"

    In words:

    • Be in the right directory.
    • Define a variable pointing to Syncthing's preferences file.
    • Make a backup copy of the preferences file.
    • Display the value of the API Key before the change.
    • Edit the preferences file to update the API Key.
    • Display the value of the API Key before the change.

    If all goes well, you will see the change of value in the output from the two plutil -extract commands.

  5. Restart your Mac. When Syncthing launches after the restart, it should pick up the new API Key and the "Running (Offline)" should have gone away.

Reverting

If you make a mess and need to undo the change, launch Terminal and run the following commands:

cd ~/Library/Preferences
PLIST=com.github.xor-gate.syncthing-macosx.plist
mv "$PLIST.bak" "$PLIST"

Restarting your Mac is advisable.

Cleaning up

Once you are satisfied that everything is working, you can remove the backup file:

rm ~/Library/Preferences/com.github.xor-gate.syncthing-macosx.plist.bak
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment