Skip to content

Commit a86f6a1

Browse files
committed
chore: updates for v2 changes (#901)
Initial collection of docs changes for v2
1 parent 9b61f62 commit a86f6a1

File tree

10 files changed

+164
-278
lines changed

10 files changed

+164
-278
lines changed

advanced/option-database-tuning.rst

Lines changed: 0 additions & 29 deletions
This file was deleted.

dev/building.rst

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,10 @@ Prerequisites
3232
- The latest stable version of Go. The previous stable version should also
3333
work; older versions will likely not work. This largely follows Go's
3434
`Release Policy <https://go.dev/doc/devel/release#policy>`__.
35-
- Git
35+
- Usually, a C compiler. Syncthing uses SQLite for storing data and the
36+
most common implementation is written in C.
37+
- Git, unless you're building from a downloaded source tarball that includes
38+
a ``RELEASE`` marker with the version information.
3639
- If you want to build Debian packages FPM is required. See FPM's
3740
`installation information <https://fpm.readthedocs.io/en/latest/installation.html>`__.
3841
- To build Windows executables, installing `goversioninfo
@@ -44,11 +47,6 @@ If you're not already a Go developer, the easiest way to get going
4447
is to download the latest version of Go as instructed in
4548
https://go.dev/doc/install.
4649

47-
.. note::
48-
Because Syncthing uses Go modules you do not need to set or care about "GOPATH".
49-
However, the GOPATH still defaults to ``~/go`` and you'd be best to *not*
50-
put your Syncthing source in there, for now.
51-
5250
Building (Unix)
5351
---------------
5452

@@ -109,7 +107,13 @@ The following ``build.go`` subcommands and options exist.
109107
``go run build.go build``
110108
Builds just the named target, or ``syncthing`` by default, to the current
111109
directory. Use this when cross compiling, with parameters for what to cross
112-
compile to: ``go run build.go --goos linux --goarch 386 build``.
110+
compile to: ``go run build.go --goos linux --goarch 386 build``. When
111+
cross compiling you need to have a C compiler for the target platform, and
112+
you need to let Go know how to invoke it. The ``--cc`` flag to build.go
113+
controls this, together with the environment variable ``CGO_ENABLED=1``.
114+
For example, to cross build from Linux to Windows using Zig as the C
115+
compiler, ``go run build.go -goos windows -goarch amd64 -cc "zig cc
116+
-target x86_64-windows" build``.
113117

114118
``go run build.go test``
115119
Runs the tests.
@@ -120,11 +124,13 @@ The following ``build.go`` subcommands and options exist.
120124

121125
``go run build.go tar``
122126
Creates a Syncthing tar.gz dist file in the current directory. Assumes a
123-
Unixy build.
127+
Unixy build. Otherwise same considerations and parameters as for the
128+
``build`` subcommand.
124129

125130
``go run build.go zip``
126131
Creates a Syncthing zip dist file in the current directory. Assumes a
127-
Windows build.
132+
Windows build. Otherwise same considerations and parameters as for the
133+
``build`` subcommand.
128134

129135
The options ``--no-upgrade``, ``--goos`` and ``--goarch`` can be given to
130136
influence ``build``, ``tar`` and ``zip``. Examples:

includes/env-vars.rst

Lines changed: 6 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@ STTRACE
88
Main and operational facilities:
99
config
1010
Configuration loading and saving.
11-
db
12-
The database layer.
1311
main
1412
Main package.
1513
model
@@ -51,6 +49,8 @@ STTRACE
5149
REST API.
5250
sha256
5351
SHA256 hashing package (this facility currently unused).
52+
sqlite
53+
The SQLite database
5454
stats
5555
Persistent device and folder statistics.
5656
sync
@@ -63,65 +63,14 @@ STTRACE
6363
all
6464
All of the above.
6565

66-
STBLOCKPROFILE
67-
Write block profiles to ``block-$pid-$timestamp.pprof`` every 20 seconds.
68-
69-
STCPUPROFILE
70-
Write a CPU profile to ``cpu-$pid.pprof`` on exit.
71-
72-
STDEADLOCKTIMEOUT
73-
Used for debugging internal deadlocks; sets debug sensitivity. Use only
74-
under direction of a developer.
75-
7666
STLOCKTHRESHOLD
7767
Used for debugging internal deadlocks; sets debug sensitivity. Use only
7868
under direction of a developer.
7969

80-
STGUIADDRESS
81-
Override GUI listen address. Equivalent to passing :option:`--gui-address`.
82-
83-
STGUIAPIKEY
84-
Override the API key needed to access the GUI / REST API. Equivalent to
85-
passing :option:`--gui-apikey`.
86-
87-
STGUIASSETS
88-
Directory to load GUI assets from. Overrides compiled in assets. Useful for
89-
developing webgui, commonly use ``STGUIASSETS=gui bin/syncthing``.
90-
91-
STHEAPPROFILE
92-
Write heap profiles to ``heap-$pid-$timestamp.pprof`` each time heap usage
93-
increases.
94-
95-
STNODEFAULTFOLDER
96-
Don't create a default folder when starting for the first time. This
97-
variable will be ignored anytime after the first run. Equivalent to the
98-
:option:`--no-default-folder` flag.
99-
100-
STNORESTART
101-
Equivalent to the :option:`--no-restart` flag.
102-
103-
STNOUPGRADE
104-
Disable automatic upgrades. Equivalent to the :option:`--no-upgrade` flag.
105-
106-
STPROFILER
107-
Set to a listen address such as "127.0.0.1:9090" to start the profiler with
108-
HTTP access, which then can be reached at
109-
http://localhost:9090/debug/pprof. See ``go tool pprof`` for more
110-
information.
111-
112-
STPERFSTATS
113-
Write running performance statistics to ``perf-$pid.csv``. Not supported on
114-
Windows.
115-
116-
STRECHECKDBEVERY
117-
Time before folder statistics (file, dir, ... counts) are recalculated from
118-
scratch. The given duration must be parseable by Go's ``time.ParseDuration``. If
119-
missing or not parseable, the default value of 1 month is used. To force
120-
recalculation on every startup, set it to ``1s``.
121-
122-
STGCINDIRECTEVERY
123-
Sets the time interval in between database garbage collection runs. The
124-
given duration must be parseable by Go's ``time.ParseDuration``.
70+
STVERSIONEXTRA
71+
Add extra information to the version string in logs and the version line
72+
in the GUI. Can be set to the name of a wrapper or tool controlling
73+
syncthing to communicate this to the end user.
12574

12675
GOMAXPROCS
12776
Set the maximum number of CPU cores to use. Defaults to all available CPU

rest/system-config-get.rst

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,7 @@ Returns the current configuration.
5050
"pullerPauseS": 0,
5151
"maxConflicts": -1,
5252
"disableSparseFiles": false,
53-
"disableTempIndexes": false,
5453
"paused": false,
55-
"weakHashThresholdPct": 25,
5654
"markerName": ".stfolder",
5755
"copyOwnershipFromParent": false,
5856
"modTimeWindowS": 0,
@@ -171,7 +169,6 @@ Returns the current configuration.
171169
"stunServers": [
172170
"default"
173171
],
174-
"databaseTuning": "auto",
175172
"maxConcurrentIncomingRequestKiB": 0,
176173
"announceLANAddresses": true,
177174
"sendFullIndexOnUpgrade": false,
@@ -226,9 +223,7 @@ Returns the current configuration.
226223
"pullerPauseS": 0,
227224
"maxConflicts": 10,
228225
"disableSparseFiles": false,
229-
"disableTempIndexes": false,
230226
"paused": false,
231-
"weakHashThresholdPct": 25,
232227
"markerName": ".stfolder",
233228
"copyOwnershipFromParent": false,
234229
"modTimeWindowS": 0,

rest/system-paths-get.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ and others.
1616
"certFile": "/home/user/.config/syncthing/cert.pem",
1717
"config": "/home/user/.config/syncthing/config.xml",
1818
"csrfTokens": "/home/user/.config/syncthing/csrftokens.txt",
19-
"database": "/home/user/.local/share/syncthing/index-v0.14.0.db",
19+
"database": "/home/user/.local/share/syncthing/index-v2",
2020
"defFolder": "/home/user/Sync",
2121
"guiAssets": "/home/user/src/syncthing/gui",
2222
"httpsCertFile": "/home/user/.config/syncthing/https-cert.pem",

specs/bep-v1.rst

Lines changed: 28 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -235,13 +235,11 @@ Protocol Buffer Schema
235235
}
236236
237237
message Folder {
238-
string id = 1;
239-
string label = 2;
240-
bool read_only = 3;
241-
bool ignore_permissions = 4;
242-
bool ignore_delete = 5;
243-
bool disable_temp_indexes = 6;
244-
bool paused = 7;
238+
string id = 1;
239+
string label = 2;
240+
FolderType type = 3;
241+
FolderStopReason stop_reason = 7;
242+
reserved 4 to 6;
245243
246244
repeated Device devices = 16;
247245
}
@@ -265,6 +263,18 @@ Protocol Buffer Schema
265263
ALWAYS = 2;
266264
}
267265
266+
enum FolderType {
267+
FOLDER_TYPE_SEND_RECEIVE = 0;
268+
FOLDER_TYPE_SEND_ONLY = 1;
269+
FOLDER_TYPE_RECEIVE_ONLY = 2;
270+
FOLDER_TYPE_RECEIVE_ENCRYPTED = 3;
271+
}
272+
273+
enum FolderStopReason {
274+
FOLDER_STOP_REASON_RUNNING = 0;
275+
FOLDER_STOP_REASON_PAUSED = 1;
276+
}
277+
268278
Fields (Cluster Config Message)
269279
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
270280

@@ -284,20 +294,12 @@ the folder.
284294
The **label** field contains the folder label, the human readable name of
285295
the folder.
286296

287-
The **read_only** field is set for folders that the device will accept no
288-
updates from the network for.
289-
290-
The **ignore_permissions** field is set for folders that the device will not
291-
accept or announce file permissions for.
292-
293-
The **ignore_delete** field is set for folders that the device will ignore
294-
deletes for.
295-
296-
The **disable_temp_indexes** field is set for folders that will not dispatch
297-
and do not wish to receive progress updates about partially downloaded files
298-
via Download Progress messages.
297+
The **folder_type** field contains the type of the folder as defined by the
298+
FolderType enumeration.
299299

300-
The **paused** field is set for folders that are currently paused.
300+
The **stop_reason** field is set for folders that are currently stopped for
301+
any reason. The zero means that the folder is not stopped; further reasons
302+
are defined by the FolderStopReason enumeration.
301303

302304
The **devices** field is a list of devices participating in sharing this
303305
folder.
@@ -401,10 +403,10 @@ Protocol Buffer Schema
401403
}
402404
403405
message BlockInfo {
404-
int64 offset = 1;
405-
int32 size = 2;
406-
bytes hash = 3;
407-
uint32 weak_hash = 4;
406+
int64 offset = 1;
407+
int32 size = 2;
408+
bytes hash = 3;
409+
reserved 4;
408410
}
409411
410412
message Vector {
@@ -511,6 +513,8 @@ Protocol Buffer Schema
511513
int32 size = 5;
512514
bytes hash = 6;
513515
bool from_temporary = 7;
516+
int32 block_no = 9;
517+
reserved 8;
514518
}
515519
516520
Fields

0 commit comments

Comments
 (0)