Skip to content

Commit

Permalink
users: New default config/data locations
Browse files Browse the repository at this point in the history
  • Loading branch information
calmh committed Oct 22, 2023
1 parent dfbdd5f commit d87c9e3
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 22 deletions.
2 changes: 1 addition & 1 deletion users/autostart.rst
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,7 @@ Go to ``/etc/supervisor/conf.d/`` and create a new file named ``syncthing.conf``
autorestart = True
directory = /home/<USERNAME>/
user = <USERNAME>
command = /usr/bin/syncthing --no-browser --home="/home/<USERNAME>/.config/syncthing"
command = /usr/bin/syncthing --no-browser
environment = STNORESTART="1", HOME="/home/<USERNAME>"

Reload Supervisord::
Expand Down
36 changes: 21 additions & 15 deletions users/config.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Synopsis

::

$HOME/.config/syncthing
$HOME/.local/state/syncthing
$HOME/Library/Application Support/Syncthing
%LOCALAPPDATA%\Syncthing

Expand All @@ -25,11 +25,12 @@ Description

Syncthing uses a single directory to store configuration and crypto keys.
Syncthing also has a database, which is often stored in this directory too.
The config location defaults to ``$HOME/.config/syncthing``
(Unix-like), ``$HOME/Library/Application Support/Syncthing`` (Mac),
or ``%LOCALAPPDATA%\Syncthing`` (Windows). It can be changed at runtime
using the ``--config`` flag. In this directory the following files are
located:
The config location defaults to ``$XDG_STATE_HOME/syncthing`` or
``$HOME/.local/state/syncthing`` (Unix-like), ``$HOME/Library/Application
Support/Syncthing`` (Mac), or ``%LOCALAPPDATA%\Syncthing`` (Windows). It can
be changed at runtime using the ``--config`` or ``--home`` flags or the
corresponding environment varibles (``$STCONFDIR`` or ``STHOMEDIR``). The
following files are located in this directory:

:file:`config.xml`
The configuration file, in XML format.
Expand All @@ -48,22 +49,27 @@ located:

The database is stored either in the same directory as the config (usually the
default), but may also be located in one of the following directories (Unix-like
platforms only):
platforms only) for legacy reasons:

* If a database exists in the old default location, that location is
still used.
* If ``$XDG_DATA_HOME`` is set, use ``$XDG_DATA_HOME/syncthing``.
* If ``~/.local/share/syncthing`` exists, use that location.
* Use the old default location (same as config).
* ``$XDG_DATA_HOME/syncthing``
* ``~/.local/share/syncthing``
* Any location specified by the ``--data`` or ``--home`` flags or the
corresponding environment varibles (``$STDATADIR`` or ``STHOMEDIR``).

The location of the database can be changed using the ``--data`` flag. The
``--home`` flag sets both config and database locations at the same time.
The database contains the following files:
The database directory contains the following files, among others:

:file:`index-{*}.db`
A directory holding the database with metadata and hashes of the files
currently on disk and available from peers.

:file:`syncthing.log`
Log output, on some systems.

:file:`audit-{*}.log`
Audit log data, when enabled.

:file:`panic-{*}.log`
Crash log data, when required.

Config File Format
------------------
Expand Down
10 changes: 5 additions & 5 deletions users/faq-parts/troubleshooting.rst
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ The web GUI contains a ``Recent Changes`` button under the device list which
displays changes since the last (re)start of Syncthing. With the ``--audit``
option you can enable a persistent, detailed log of changes and most
activities, which contains a ``JSON`` formatted sequence of events in the
``~/.config/syncthing/audit-_date_-_time_.log`` file.
``~/.local/state/syncthing/audit-_date_-_time_.log`` file.

Does the audit log contain every change?
----------------------------------------
Expand Down Expand Up @@ -168,18 +168,18 @@ or unmount a filesystem, then syncthing must know whether you have really delete
your files. Therefore, syncthing always checks that the ``.stfolder`` is present.

When this error appears, syncthing assumes that the folder has encountered some type of error
and will stop syncing it until the ``.stfolder`` reappears. Once that happens, all changes made
and will stop syncing it until the ``.stfolder`` reappears. Once that happens, all changes made
to the folder locally will be synced (i.e. missing files will be considered deletions).

- If you get this error message, check the folder in question on your storage. If you have
- If you get this error message, check the folder in question on your storage. If you have
unmounted the folder (or a parent of it), you must remount it for syncthing to resume syncing
this folder.
this folder.

- If you have moved the folder, you must either move it back to its original location, or remove the
folder from within the syncthing UI and re-add it at its new location.

- If the folder is present on disk, with all of its children files and directories, but the ``.stfolder``
is still missing:
is still missing:

It is possible that a file cleaning software has removed the ``.stfolder``. Some software
removes empty folders, and the ``.stfolder`` is often empty. This happens particularly often on Android.
Expand Down
3 changes: 2 additions & 1 deletion users/syncthing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,8 @@ Options
.. cmdoption:: --home=<dir>

Set common configuration and data directory. The default configuration
directory is ``$HOME/.config/syncthing`` (Unix-like),
directory is ``$XDG_STATE_HOME/syncthing`` or
``$HOME/.local/state/syncthing`` (Unix-like),
``$HOME/Library/Application Support/Syncthing`` (Mac) and
``%LOCALAPPDATA%\Syncthing`` (Windows).

Expand Down

0 comments on commit d87c9e3

Please sign in to comment.