Allow configuration of usage reporting URL
This commit is contained in:
@@ -234,6 +234,9 @@ type OptionsConfiguration struct {
|
||||
UPnPTimeoutS int `xml:"upnpTimeoutSeconds" json:"upnpTimeoutSeconds" default:"10"`
|
||||
URAccepted int `xml:"urAccepted" json:"urAccepted"` // Accepted usage reporting version; 0 for off (undecided), -1 for off (permanently)
|
||||
URUniqueID string `xml:"urUniqueID" json:"urUniqueId"` // Unique ID for reporting purposes, regenerated when UR is turned on.
|
||||
URURL string `xml:"urURL" json:"urURL" default:"https://data.syncthing.net/newdata"`
|
||||
URPostInsecurely bool `xml:"urPostInsecurely" json:"urPostInsecurely" default:"false"` // For testing
|
||||
URInitialDelayS int `xml:"urInitialDelayS" json:"urInitialDelayS" default:"1800"`
|
||||
RestartOnWakeup bool `xml:"restartOnWakeup" json:"restartOnWakeup" default:"true"`
|
||||
AutoUpgradeIntervalH int `xml:"autoUpgradeIntervalH" json:"autoUpgradeIntervalH" default:"12"` // 0 for off
|
||||
KeepTemporariesH int `xml:"keepTemporariesH" json:"keepTemporariesH" default:"24"` // 0 for off
|
||||
|
||||
@@ -60,6 +60,9 @@ func TestDefaultValues(t *testing.T) {
|
||||
PingTimeoutS: 30,
|
||||
PingIdleTimeS: 60,
|
||||
MinHomeDiskFreePct: 1,
|
||||
URURL: "https://data.syncthing.net/newdata",
|
||||
URInitialDelayS: 1800,
|
||||
URPostInsecurely: false,
|
||||
}
|
||||
|
||||
cfg := New(device1)
|
||||
@@ -175,6 +178,9 @@ func TestOverriddenValues(t *testing.T) {
|
||||
PingTimeoutS: 60,
|
||||
PingIdleTimeS: 120,
|
||||
MinHomeDiskFreePct: 5.2,
|
||||
URURL: "https://localhost/newdata",
|
||||
URInitialDelayS: 800,
|
||||
URPostInsecurely: true,
|
||||
}
|
||||
|
||||
cfg, err := Load("testdata/overridenvalues.xml", device1)
|
||||
|
||||
3
lib/config/testdata/overridenvalues.xml
vendored
3
lib/config/testdata/overridenvalues.xml
vendored
@@ -32,5 +32,8 @@
|
||||
<pingTimeoutS>60</pingTimeoutS>
|
||||
<pingIdleTimeS>120</pingIdleTimeS>
|
||||
<minHomeDiskFreePct>5.2</minHomeDiskFreePct>
|
||||
<urURL>https://localhost/newdata</urURL>
|
||||
<urInitialDelayS>800</urInitialDelayS>
|
||||
<urPostInsecurely>true</urPostInsecurely>
|
||||
</options>
|
||||
</configuration>
|
||||
|
||||
Reference in New Issue
Block a user