Jakob Borg
6f743f3138
Revert "lib/model: Emit LocalDiskUpdated events on detecting local changes"
...
This reverts commit 5a7fad0bcdc3e3ae18e0ecdd3f4d9e92c6f38920.
2016-05-14 10:55:24 +02:00
Nate Morrison
5a7fad0bcd
lib/model: Emit LocalDiskUpdated events on detecting local changes
...
GitHub-Pull-Request: https://github.com/syncthing/syncthing/pull/3055
2016-05-14 08:37:07 +00:00
Jakob Borg
0761d804a4
cmd/syncthing: Use random folder ID for default folder, limit random charset
...
This uses the same charset as the Javascript code, excluding confusing
characters like 0, O, I, 1, l etc.
GitHub-Pull-Request: https://github.com/syncthing/syncthing/pull/3064
2016-05-09 09:43:40 +00:00
klemens
bd41e21c26
all: Correct spelling in comments
...
Skip-check: authors pr-build-mac
GitHub-Pull-Request: https://github.com/syncthing/syncthing/pull/3056
2016-05-08 10:54:22 +00:00
Jakob Borg
39899e40bf
cmd/syncthing: Use ReadAll + json.Unmarshal in places were we care about consuming the reader
...
Because json.NewDecoder(r).Decode(&v) doesn't necessarily consume all
data on the reader, that means an HTTP connection can't be reused. We
don't do a lot of HTTP traffic where we read JSON responses, but the
discovery is one such place. The other two are for POSTs from the GUI,
where it's not exactly critical but still nice if the connection still
can be keep-alive'd after the request as well.
Also ensure that we call req.Body.Close() for clarity, even though this
should by all accounts not really be necessary.
GitHub-Pull-Request: https://github.com/syncthing/syncthing/pull/3050
2016-05-06 22:01:56 +00:00
Audrius Butkevicius
674fc566bb
lib/connections: Refactor
...
1. Removes separate relay lists and relay clients/services, just makes it a listen address
2. Easier plugging-in of other transports
3. Allows "hot" disabling and enabling NAT services
4. Allows "hot" listen address changes
5. Changes listen address list with a preferable "default" value just like for discovery
6. Debounces global discovery announcements as external addresses change (which it might alot upon starting)
7. Stops this whole "pick other peers relay by latency". This information is no longer available,
but I don't think it matters as most of the time other peer only has one relay.
8. Rename ListenAddress to ListenAddresses, as well as in javascript land.
9. Stop serializing deprecated values to JSON
GitHub-Pull-Request: https://github.com/syncthing/syncthing/pull/2982
2016-05-04 19:38:12 +00:00
Jakob Borg
09832abe50
lib/config: Change folder type attribute to a FolderType type
...
GitHub-Pull-Request: https://github.com/syncthing/syncthing/pull/3032
2016-05-04 11:26:36 +00:00
Audrius Butkevicius
eabd2fc936
lib/model: Use factories for creating folders
...
GitHub-Pull-Request: https://github.com/syncthing/syncthing/pull/3029
2016-05-04 10:47:33 +00:00
Jakob Borg
ccfcdf7f48
cmd/syncthing: Don't compact database at startup
...
This happens automatically in the background anyway, and it can take a
long time on low powered devices at an inconvenient time. We just want
to get up and running as quickly as possible.
GitHub-Pull-Request: https://github.com/syncthing/syncthing/pull/3000
2016-04-22 07:34:11 +00:00
Jakob Borg
893cc025f9
cmd/syncthing: Accept ISO-8859-1 and UTF-8 in HTTP BasicAuth header ( fixes #2779 )
...
GitHub-Pull-Request: https://github.com/syncthing/syncthing/pull/2989
2016-04-18 20:24:38 +00:00
AudriusButkevicius
1a5f524ae4
lib/model, lib/protocol: Implement temporary indexes ( fixes #950 )
...
GitHub-Pull-Request: https://github.com/syncthing/syncthing/pull/2252
2016-04-15 10:59:41 +00:00
Audrius Butkevicius
c49453c519
lib/pmp: Add NAT-PMP support (ref #698 )
...
GitHub-Pull-Request: https://github.com/syncthing/syncthing/pull/2968
2016-04-13 18:50:40 +00:00
Jakob Borg
52c7804f32
lib/connections: Silence vet and lint warnings
...
GitHub-Pull-Request: https://github.com/syncthing/syncthing/pull/2971
2016-04-13 11:50:51 +00:00
Audrius Butkevicius
19b4f3bfb4
lib/nat: Add a nat package and service to track mappings on multiple IGDs
2016-04-10 19:36:38 +00:00
Audrius Butkevicius
2eb8a9ef56
all: Dead code cleanup
2016-04-09 01:10:31 +00:00
Audrius Butkevicius
393798098c
cmd/syncthing: Listening on a 0 port is not valid ( fixes #2926 )
2016-04-09 01:06:55 +00:00
Audrius Butkevicius
b678b4e048
cmd/syncthing: Skip a calculation if timediff is zero ( fixes #2854 )
2016-04-05 07:12:17 +02:00
Laurent Etiemble
7b4e1e9055
cmd/syncthing: Fix handler ordering so CORS middleware wraps all the others but the debug one
2016-04-03 13:24:55 +02:00
Jakob Borg
4c3cd4c9e3
lib/ignore: Replace lib/fnmatch with github.com/gobwas/glob
...
Because it's literally ten times faster:
benchmark old ns/op new ns/op delta
BenchmarkMatch-8 13842 1200 -91.33%
BenchmarkMatchCached-8 139 147 +5.76%
benchmark old allocs new allocs delta
BenchmarkMatch-8 0 0 +0.00%
BenchmarkMatchCached-8 0 0 +0.00%
benchmark old bytes new bytes delta
BenchmarkMatch-8 12 0 -100.00%
BenchmarkMatchCached-8 0 0 +0.00%
2016-04-02 20:03:24 +01:00
Audrius Butkevicius
29913dd1e4
lib/connections: Refactor address listing into connection service
2016-03-25 07:35:18 +00:00
Jakob Borg
95247f7740
cmd/syncthing: Basic smoke test of all API endpoints
...
... except /rest/system/upgrade that requires a correct response from
Github, which we shouldn't depend on.
2016-03-24 10:17:04 +00:00
Jakob Borg
e5731229c7
cmd/syncthing: Add test for starting API service and requesting some URLs
2016-03-24 08:55:33 +00:00
Jakob Borg
52c74ad866
cmd/syncthing: Add mock types for API service testing
2016-03-24 08:09:13 +00:00
Jakob Borg
a492cfba13
cmd/syncthing: Extract interfaces for things the API depends on
...
Enables testing of the API service, in the long run.
2016-03-21 19:36:08 +00:00
Jakob Borg
9dec6f1324
cmd/syncthing: Return 500 with an error object instead of empty 200 on marshalling failure in REST response
2016-03-20 11:54:53 +01:00
Jakob Borg
e9c5261a49
Mend GUI tests
2016-03-13 17:24:49 +01:00
Jakob Borg
ba5231dc89
apiService should not reference global variable 'locations' (hinders testing)
2016-03-13 11:03:00 +01:00
Jakob Borg
032365d57c
Fix STGUIASSETS search paths & order ( fixes #2827 )
2016-03-12 12:17:25 +00:00
Jakob Borg
fd962c5e99
Also update allowed version tests
2016-03-10 13:24:36 +01:00
Jakob Borg
07f944bf48
More lenient expression for allowed version tags
2016-03-10 13:19:00 +01:00
Audrius Butkevicius
3b146eda0d
Clarify GUI stuff ( fixes #2819 )
2016-03-06 22:07:15 +00:00
Jakob Borg
e11302172e
Report versioning usage in usage report
...
I consider it a bug that we didn't already and that this is covered
already under the agreement that we report which features are in use.
2016-02-13 08:19:30 +01:00
Audrius Butkevicius
bf353a42cd
Merge pull request #2780 from letiemble/CORS_Support2
...
Move CORS middleware to process un-authenticated OPTIONS requests
2016-02-12 21:29:45 +00:00
Laurent Etiemble
d8e19b776e
Swap the corsMiddleware and the csrfMiddleware to the unauthenticated OPTIONS requests are first processed.
2016-02-12 22:10:08 +01:00
Jakob Borg
3c7164846d
Return "No such object in the index" when /rest/db/file gets called on something that doesn't exist
...
Better than the confusing result of getting a blank fileinfo that looks
valid apart from being all crap.
2016-02-12 14:55:16 +01:00
Jakob Borg
a7a9d7d85c
Return correct content type for /rest/events
2016-02-02 12:40:42 +01:00
Jakob Borg
e93c766c42
Rename RawAPIKey -> APIKey in GUIConfiguration
2016-02-02 11:12:25 +01:00
Jakob Borg
39c16d1cc4
Add -paths option to print config, key, database paths
2016-02-02 10:41:49 +01:00
Antony Male
5971c00a4f
Support multiple API keys (command-line and config) ( fixes #2747 )
2016-01-30 15:18:09 +00:00
Jakob Borg
fae68a5396
Return status code 307 instead of 302 when redirecting from HTTP to HTTPS
2016-01-29 11:07:51 +01:00
Laurent Etiemble
fed374fcb6
Add a CORS handler to deal with preflight OPTIONS requests
2016-01-26 21:55:51 +01:00
Jakob Borg
11d4986517
Humanize serialization of version vectors (again)
2016-01-20 11:14:08 -08:00
Jakob Borg
2919b76947
The "OK" log level is silly and should not exist
2016-01-16 23:04:41 +01:00
Jakob Borg
97b1c66d4a
Improve API/GUI shutdown handling ( fixes #2694 )
...
This fixes both a race condition where we could assign s.stop from one
goroutine and then read it from another without locking, and handles the
fact that listener may be nil at shutdown if we've had a bad
CommitConfiguration call in the meantime.
2016-01-14 11:06:36 +01:00
Jakob Borg
f741066466
Always run relaying when enabled ( fixes #2665 )
2016-01-12 14:15:47 +01:00
Jakob Borg
01c70caa8f
Merge pull request #2682 from AudriusButkevicius/themes
...
Add theme support
2016-01-10 19:04:57 +01:00
Audrius Butkevicius
cd54186113
Add support for themes ( fixes #1925 )
2016-01-10 17:57:27 +00:00
Jakob Borg
353689857e
Fix version string check to allow properly tagged betas
2016-01-10 18:41:15 +01:00
Jakob Borg
d74377350b
v0.13.0 is the Copper Cockroach
2016-01-10 10:12:29 +01:00
Audrius Butkevicius
6c0a973ac3
Merge pull request #2480 from calmh/shortdblabels
...
Change database folder label format
2016-01-10 01:33:56 +00:00