Open Source Continuous File Synchronization; contains branches to build Syncthing as a C library
Go to file
André Colomb e32a516b5f
lib/model: Forget pending folders no longer announced in ClusterConfig (fixes #5187) (#7205)
* lib/db: Add ExpirePendingFolders().

Use-case is to drop any no-longer-pending folders for a specific
device when parsing its ClusterConfig message where previously offered
folders are not mentioned any more.

The timestamp in ObservedFolder is stored with only second precision,
so round to seconds here as well.  This allows calling the function
within the same second of adding or updating entries.

* lib/model: Weed out pending folders when receiving ClusterConfig.

Filter the entries by timestamp, which must be newer than or equal to
the reception time of the ClusterConfig.  For just mentioned ones,
this assumption will hold as AddOrUpdatePendingFolder() updates the
timestamp.

* lib/model, gui: Notify when one or more pending folders expired.

Introduce new event type FolderOfferCancelled and use it to trigger a
complete refreshCluster() cycle.  Listing individual entries would be
much more code and probably just as much work to answer the API
request.

* lib/model: Add comment and rename ExpirePendingFolders().

* lib/events: Rename FolderOfferCancelled to ClusterPendingChanged.

* lib/model: Reuse ClusterPendingChanged event for cleanPending()

Changing the config does not necessarily mean that the
/resut/cluster/pending endpoints need to be refreshed, but only if
something was actually removed.  Detect this and indicate it through
the ClusterPendingChanged event, which is already hooked up to requery
respective endpoints within the GUI.

No more need for a separate refreshCluster() in reaction to
ConfigSaved event or calling refreshConfig().

* lib/model: Gofmt.

* lib/db: Warn instead of info log for failed removal.

* gui: Fix pending notifications not loading on GUI start.

* lib/db: Use short device ID in log message.

* lib/db: Return list of expired folder IDs after deleting them.

* lib/model: Refactor Pending...Changed events.

* lib/model: Adjust format of removed pending folders enumeration.

Use an array of objects with device / folder ID properties, matching
the other places where it's used.

* lib/db: Drop invalid entries in RemovePendingFoldersBeforeTime().

* lib/model: Gofmt.

My local gofmt did not complain here, strangely...

* gui: Handle PendingDevicesChanged event.

Even though it currently only holds one device at a time, wrap the
contents in an array under the "added" property name.

* lib/model: Fix null values in PendingFoldersChanged removed member.

* gui: Handle PendingFoldersChanged event.

* lib/model: Simplify construction of expiredPendingList.

* lib/model: Reduce code duplication in cleanPending().

Use goto and a label for the common parts of calling the DB removal
function and building the event data part.

* lib/events, gui: Mark ...Rejected events deprecated.

Extend comments explaining the conditions when the replacement event
types are emitted.

* lib/model: Wrap removed devices in array of objects as well.

* lib/db: Use iter.Value() instead of needless db.Get(iter.Key())

* lib/db: Add comment explaining RemovePendingFoldersBeforeTime().

* lib/model: Rename fields folderID and deviceID in event data.

* lib/db: Only list actually expired IDs as removed.

Skip entries where Delete() failed as well as invalid entries that got
removed automatically.

* lib/model: Gofmt
2021-01-25 10:58:10 +00:00
.github Update config.yml 2020-09-23 08:30:46 +01:00
assets assets, gui: Losslessly compress all JPG, PNG, and PDF images (#6265) 2020-01-16 13:52:43 +01:00
cmd cmd/syncthing: Provide early startup for config service (ref #7188) (#7285) 2021-01-16 12:58:02 +01:00
etc etc: Add RestartSec=5 to linux-systemd units 2020-05-12 10:02:32 +02:00
gui lib/model: Forget pending folders no longer announced in ClusterConfig (fixes #5187) (#7205) 2021-01-25 10:58:10 +00:00
lib lib/model: Forget pending folders no longer announced in ClusterConfig (fixes #5187) (#7205) 2021-01-25 10:58:10 +00:00
man gui, man, authors: Update docs, translations, and contributors 2021-01-20 07:45:29 +01:00
meta all: Use protobuf to generate config structs (fixes #6734) (#6900) 2020-08-25 08:11:14 +02:00
proto lib/config, lib/connections: Add optional connection limits (fixes #7176) (#7223) 2021-01-11 15:14:44 +01:00
script build: Ignore noscript in translation-script (#7149) 2020-11-24 22:17:52 +01:00
test test, lib/model: Various integration test updates & improvements (#6956) 2020-09-07 09:35:37 +02:00
.codecov.yml build: Add option to get test coverage (#5539) 2019-02-14 22:38:47 +00:00
.gitattributes lib/protocol: Revert protobuf encoder changes in v0.14.17 (fixes #3855) 2017-01-01 17:19:00 +00:00
.gitignore all: Use protobuf to generate config structs (fixes #6734) (#6900) 2020-08-25 08:11:14 +02:00
.golangci.yml golangci: Skip godox 2019-12-18 11:33:36 +01:00
AUTHORS gui, man, authors: Update docs, translations, and contributors 2021-01-20 07:45:29 +01:00
CONDUCT.md conduct: Upgrade to Contributor Covenant 2018-06-20 23:53:06 +02:00
CONTRIBUTING.md all: Update docs.s.n links to use https 2016-10-27 17:02:19 +00:00
Dockerfile docker: Add tzdata for local time log entries 2020-05-16 11:34:46 +02:00
Dockerfile.builder docker: Accept Go version as --build-arg 2020-05-04 12:45:36 +02:00
Dockerfile.buildx build: Dockerfile that expects ready baked binaries 2020-09-15 19:38:23 +02:00
Dockerfile.stdiscosrv docker: Accept Go version as --build-arg 2020-05-04 12:45:36 +02:00
Dockerfile.strelaysrv docker: Accept Go version as --build-arg 2020-05-04 12:45:36 +02:00
GOALS.md goals: Typo 2017-12-12 08:12:30 +00:00
LICENSE all: Update license url to https (ref #3976) 2017-02-09 08:04:16 +01:00
README-Docker.md docker: Make it easy to disable the GUI, document it (#6021) 2019-09-22 11:33:29 +01:00
README.md various: Master is now main 2020-06-16 07:08:09 +02:00
build.go build: Take extra tags in account for tar, zip 2020-11-20 17:45:07 +01:00
build.ps1 build: Clean up build.sh, add build.ps1 (#6689) 2020-05-28 12:42:15 +02:00
build.sh build: Clean up build.sh, add build.ps1 (#6689) 2020-05-28 12:42:15 +02:00
go.mod lib/config, lib/connections: Add optional connection limits (fixes #7176) (#7223) 2021-01-11 15:14:44 +01:00
go.sum build: Switch to gopsutil's v3 module (#7191) 2020-12-10 16:43:15 +01:00

README.md

Syncthing


Latest Linux & Cross Build Latest Windows Build Latest Mac Build MPLv2 License CII Best Practices Go Report Card

Goals

Syncthing is a continuous file synchronization program. It synchronizes files between two or more computers. We strive to fulfill the goals below. The goals are listed in order of importance, the most important one being the first. This is the summary version of the goal list - for more commentary, see the full Goals document.

Syncthing should be:

  1. Safe From Data Loss

    Protecting the user's data is paramount. We take every reasonable precaution to avoid corrupting the user's files.

  2. Secure Against Attackers

    Again, protecting the user's data is paramount. Regardless of our other goals we must never allow the user's data to be susceptible to eavesdropping or modification by unauthorized parties.

  3. Easy to Use

    Syncthing should be approachable, understandable and inclusive.

  4. Automatic

    User interaction should be required only when absolutely necessary.

  5. Universally Available

    Syncthing should run on every common computer. We are mindful that the latest technology is not always available to any given individual.

  6. For Individuals

    Syncthing is primarily about empowering the individual user with safe, secure and easy to use file synchronization.

  7. Everything Else

    There are many things we care about that don't make it on to the list. It is fine to optimize for these values, as long as they are not in conflict with the stated goals above.

Getting Started

Take a look at the getting started guide.

There are a few examples for keeping Syncthing running in the background on your system in the etc directory. There are also several GUI implementations for Windows, Mac and Linux.

Docker

To run Syncthing in Docker, see the Docker README.

Vote on features/bugs

We'd like to encourage you to vote on issues that matter to you. This helps the team understand what are the biggest pain points for our users, and could potentially influence what is being worked on next.

Getting in Touch

The first and best point of contact is the Forum. There is also an IRC channel, #syncthing on freenode (with a web client), for talking directly to developers and users. If you've found something that is clearly a bug, feel free to report it in the GitHub issue tracker.

Building

Building Syncthing from source is easy, and there's a guide that describes it for both Unix and Windows systems.

Signed Releases

As of v0.10.15 and onwards release binaries are GPG signed with the key D26E6ED000654A3E, available from https://syncthing.net/security.html and most key servers.

There is also a built in automatic upgrade mechanism (disabled in some distribution channels) which uses a compiled in ECDSA signature. macOS binaries are also properly code signed.

Documentation

Please see the Syncthing documentation site.

All code is licensed under the MPLv2 License.