Compare commits

..

14 Commits

Author SHA1 Message Date
Jakob Borg
c482cbbe70 Docs & translations 2016-02-14 20:26:33 +01:00
Jakob Borg
4042a3e406 Merge branch 'master' into v0.12
* master:
  Report versioning usage in usage report
  Swap the corsMiddleware and the csrfMiddleware to the unauthenticated OPTIONS requests are first processed.
  Return "No such object in the index" when /rest/db/file gets called on something that doesn't exist
  Revert "Add .arcconfig to project root"
  Add .arcconfig to project root
2016-02-14 19:39:59 +01:00
Jakob Borg
392132dc3b Merge commit '6f2de31' into v0.12 (no changes taken)
* commit '6f2de31':
  Use v2 of XDR package (actual changes)
  Use v2 of XDR package (auto generated)
  Use v2 of XDR package (deps)
2016-02-14 19:39:34 +01: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
Audrius Butkevicius
cf96bb464f Merge pull request #2777 from calmh/dbfile404
Return "No such object in the index" when /rest/db/file gets called on something that doesn't exist
2016-02-12 20:12:34 +00: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
4fa4668ed6 Revert "Add .arcconfig to project root"
This reverts commit 0ce21aea08.
2016-02-11 21:17:01 +01:00
Jakob Borg
0ce21aea08 Add .arcconfig to project root 2016-02-09 16:50:57 +01:00
Audrius Butkevicius
6f2de31146 Merge pull request #2757 from calmh/newxdr
Use v2 of XDR package
2016-02-02 14:44:06 +00:00
Jakob Borg
e1ac740ac4 Use v2 of XDR package (actual changes) 2016-02-02 15:33:46 +01:00
Jakob Borg
4feeaf1641 Use v2 of XDR package (auto generated) 2016-02-02 12:44:33 +01:00
Jakob Borg
a08bbabd4d Use v2 of XDR package (deps) 2016-02-02 12:43:33 +01:00
17 changed files with 51 additions and 26 deletions

View File

@@ -236,12 +236,12 @@ func (s *apiService) Serve() {
guiCfg := s.cfg.GUI()
// Add the CORS handling
handler := corsMiddleware(mux)
// Wrap everything in CSRF protection. The /rest prefix should be
// protected, other requests will grant cookies.
handler := csrfMiddleware(s.id.String()[:5], "/rest", guiCfg, mux)
// Add the CORS handling
handler = corsMiddleware(handler)
handler = csrfMiddleware(s.id.String()[:5], "/rest", guiCfg, handler)
// Add our version and ID as a header to responses
handler = withDetailsMiddleware(s.id, handler)
@@ -382,6 +382,10 @@ func corsMiddleware(next http.Handler) http.Handler {
// Handle CORS headers and CORS OPTIONS request.
// CORS OPTIONS request are typically sent by browser during AJAX preflight
// when the browser initiate a POST request.
//
// As the OPTIONS request is unauthorized, this handler must be the first
// of the chain.
//
// See https://www.w3.org/TR/cors/ for details.
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
// Add a generous access-control-allow-origin header since we may be
@@ -615,8 +619,14 @@ func (s *apiService) getDBFile(w http.ResponseWriter, r *http.Request) {
qs := r.URL.Query()
folder := qs.Get("folder")
file := qs.Get("file")
gf, _ := s.model.CurrentGlobalFile(folder, file)
lf, _ := s.model.CurrentFolderFile(folder, file)
gf, gfOk := s.model.CurrentGlobalFile(folder, file)
lf, lfOk := s.model.CurrentFolderFile(folder, file)
if !(gfOk || lfOk) {
// This file for sure does not exist.
http.Error(w, "No such object in the index", http.StatusNotFound)
return
}
av := s.model.Availability(folder, file)
sendJSON(w, map[string]interface{}{

View File

@@ -121,10 +121,14 @@ func reportData(cfg *config.Wrapper, m *model.Model) map[string]interface{} {
var rescanIntvs []int
folderUses := map[string]int{
"readonly": 0,
"ignorePerms": 0,
"ignoreDelete": 0,
"autoNormalize": 0,
"readonly": 0,
"ignorePerms": 0,
"ignoreDelete": 0,
"autoNormalize": 0,
"simpleVersioning": 0,
"externalVersioning": 0,
"staggeredVersioning": 0,
"trashcanVersioning": 0,
}
for _, cfg := range cfg.Folders() {
rescanIntvs = append(rescanIntvs, cfg.RescanIntervalS)
@@ -141,6 +145,9 @@ func reportData(cfg *config.Wrapper, m *model.Model) map[string]interface{} {
if cfg.AutoNormalize {
folderUses["autoNormalize"]++
}
if cfg.Versioning.Type != "" {
folderUses[cfg.Versioning.Type+"Versioning"]++
}
}
sort.Ints(rescanIntvs)
res["rescanIntvs"] = rescanIntvs

View File

@@ -5,7 +5,7 @@ import (
)
const (
AssetsBuildDate = "Mon, 08 Feb 2016 16:39:33 GMT"
AssetsBuildDate = "Sun, 14 Feb 2016 19:26:12 GMT"
)
func Assets() map[string][]byte {

View File

@@ -1,6 +1,6 @@
.\" Man page generated from reStructuredText.
.
.TH "SYNCTHING-BEP" "7" "February 08, 2016" "v0.12" "Syncthing"
.TH "SYNCTHING-BEP" "7" "February 12, 2016" "v0.12" "Syncthing"
.SH NAME
syncthing-bep \- Block Exchange Protocol v1
.

View File

@@ -1,6 +1,6 @@
.\" Man page generated from reStructuredText.
.
.TH "SYNCTHING-CONFIG" "5" "February 08, 2016" "v0.12" "Syncthing"
.TH "SYNCTHING-CONFIG" "5" "February 12, 2016" "v0.12" "Syncthing"
.SH NAME
syncthing-config \- Syncthing Configuration
.

View File

@@ -1,6 +1,6 @@
.\" Man page generated from reStructuredText.
.
.TH "SYNCTHING-DEVICE-IDS" "7" "February 08, 2016" "v0.12" "Syncthing"
.TH "SYNCTHING-DEVICE-IDS" "7" "February 12, 2016" "v0.12" "Syncthing"
.SH NAME
syncthing-device-ids \- Understanding Device IDs
.

View File

@@ -1,6 +1,6 @@
.\" Man page generated from reStructuredText.
.
.TH "SYNCTHING-EVENT-API" "7" "February 08, 2016" "v0.12" "Syncthing"
.TH "SYNCTHING-EVENT-API" "7" "February 12, 2016" "v0.12" "Syncthing"
.SH NAME
syncthing-event-api \- Event API
.

View File

@@ -1,6 +1,6 @@
.\" Man page generated from reStructuredText.
.
.TH "SYNCTHING-FAQ" "7" "February 08, 2016" "v0.12" "Syncthing"
.TH "SYNCTHING-FAQ" "7" "February 12, 2016" "v0.12" "Syncthing"
.SH NAME
syncthing-faq \- Frequently Asked Questions
.
@@ -156,6 +156,9 @@ causes a conflict on change you\(aqll end up with \fBsync\-conflict\-...sync\-co
.sp
Each user should run their own Syncthing instance. Be aware that you might need
to configure ports such that they do not overlap (see the config.xml).
.SS Does Syncthing support syncing between folders on the same system?
.sp
Syncthing is not designed to sync locally and the overhead involved in doing so will waste resources. There are better programs to achieve this such as rsync or Unison.
.SS Is Syncthing my ideal backup application?
.sp
No, Syncthing is not a backup application because all changes to your files

View File

@@ -1,6 +1,6 @@
.\" Man page generated from reStructuredText.
.
.TH "SYNCTHING-GLOBALDISCO" "7" "February 08, 2016" "v0.12" "Syncthing"
.TH "SYNCTHING-GLOBALDISCO" "7" "February 12, 2016" "v0.12" "Syncthing"
.SH NAME
syncthing-globaldisco \- Global Discovery Protocol v3
.

View File

@@ -1,6 +1,6 @@
.\" Man page generated from reStructuredText.
.
.TH "SYNCTHING-LOCALDISCO" "7" "February 08, 2016" "v0.12" "Syncthing"
.TH "SYNCTHING-LOCALDISCO" "7" "February 12, 2016" "v0.12" "Syncthing"
.SH NAME
syncthing-localdisco \- Local Discovery Protocol v3
.

View File

@@ -1,6 +1,6 @@
.\" Man page generated from reStructuredText.
.
.TH "SYNCTHING-NETWORKING" "7" "February 08, 2016" "v0.12" "Syncthing"
.TH "SYNCTHING-NETWORKING" "7" "February 12, 2016" "v0.12" "Syncthing"
.SH NAME
syncthing-networking \- Firewall Setup
.

View File

@@ -1,6 +1,6 @@
.\" Man page generated from reStructuredText.
.
.TH "SYNCTHING-RELAY" "7" "February 08, 2016" "v0.12" "Syncthing"
.TH "SYNCTHING-RELAY" "7" "February 12, 2016" "v0.12" "Syncthing"
.SH NAME
syncthing-relay \- Relay Protocol v1
.

View File

@@ -1,6 +1,6 @@
.\" Man page generated from reStructuredText.
.
.TH "SYNCTHING-REST-API" "7" "February 08, 2016" "v0.12" "Syncthing"
.TH "SYNCTHING-REST-API" "7" "February 12, 2016" "v0.12" "Syncthing"
.SH NAME
syncthing-rest-api \- REST API
.

View File

@@ -1,6 +1,6 @@
.\" Man page generated from reStructuredText.
.
.TH "SYNCTHING-SECURITY" "7" "February 08, 2016" "v0.12" "Syncthing"
.TH "SYNCTHING-SECURITY" "7" "February 12, 2016" "v0.12" "Syncthing"
.SH NAME
syncthing-security \- Security Principles
.

View File

@@ -1,6 +1,6 @@
.\" Man page generated from reStructuredText.
.
.TH "SYNCTHING-STIGNORE" "5" "February 08, 2016" "v0.12" "Syncthing"
.TH "SYNCTHING-STIGNORE" "5" "February 12, 2016" "v0.12" "Syncthing"
.SH NAME
syncthing-stignore \- Prevent files from being synchronized to other nodes
.

View File

@@ -1,6 +1,6 @@
.\" Man page generated from reStructuredText.
.
.TH "TODO" "7" "February 08, 2016" "v0.12" "Syncthing"
.TH "TODO" "7" "February 12, 2016" "v0.12" "Syncthing"
.SH NAME
Todo \- Keep automatic backups of deleted files by other nodes
.

View File

@@ -1,6 +1,6 @@
.\" Man page generated from reStructuredText.
.
.TH "SYNCTHING" "1" "February 08, 2016" "v0.12" "Syncthing"
.TH "SYNCTHING" "1" "February 12, 2016" "v0.12" "Syncthing"
.SH NAME
syncthing \- Syncthing
.
@@ -38,7 +38,7 @@ level margin: \\n[rst2man-indent\\n[rst2man-indent-level]]
.ft C
syncthing [\-audit] [\-generate=<dir>] [\-gui\-address=<address>] [\-gui\-apikey=<key>]
[\-home=<dir>] [\-logfile=<filename>] [\-logflags=<flags>] [\-no\-browser]
[\-no\-console] [\-no\-restart] [\-reset] [\-upgrade] [\-upgrade\-check]
[\-no\-console] [\-no\-restart] [\-paths] [\-reset] [\-upgrade] [\-upgrade\-check]
[\-upgrade\-to=<url>] [\-verbose] [\-version]
.ft P
.fi
@@ -123,6 +123,11 @@ Do not restart; just exit.
.UNINDENT
.INDENT 0.0
.TP
.B \-paths
Print the paths used for configuration, keys, database, GUI overrides, default sync folder and the log file.
.UNINDENT
.INDENT 0.0
.TP
.B \-reset
Reset the database.
.UNINDENT