mirror of
https://github.com/octoleo/syncthing.git
synced 2024-12-22 10:58:57 +00:00
Allow fractional free space percentages (fixes #2233)
This commit is contained in:
parent
66df2e57ae
commit
41c131d840
@ -40,8 +40,8 @@
|
||||
</p>
|
||||
</div>
|
||||
<div class="form-group" ng-class="{'has-error': folderEditor.minDiskFreePct.$invalid && folderEditor.minDiskFreePct.$dirty}">
|
||||
<label for="minDiskFreePct"><span translate>Minimum Free Disk Space</span> (0-100%)</label>
|
||||
<input name="minDiskFreePct" id="minDiskFreePct" class="form-control" type="number" ng-model="currentFolder.minDiskFreePct" required min="0" max="100"></input>
|
||||
<label for="minDiskFreePct"><span translate>Minimum Free Disk Space</span> (0.0 - 100.0%)</label>
|
||||
<input name="minDiskFreePct" id="minDiskFreePct" class="form-control" type="number" ng-model="currentFolder.minDiskFreePct" required min="0.0" max="100.0"></input>
|
||||
<p class="help-block">
|
||||
<span translate ng-if="!folderEditor.minDiskFreePct.$valid && folderEditor.minDiskFreePct.$dirty">The minimum free disk space percentage must be a non-negative number between 0 and 100 (inclusive).</span>
|
||||
</p>
|
||||
|
@ -5,7 +5,7 @@ import (
|
||||
)
|
||||
|
||||
const (
|
||||
AssetsBuildDate = "Sun, 30 Aug 2015 11:36:51 GMT"
|
||||
AssetsBuildDate = "Sun, 06 Sep 2015 06:47:10 GMT"
|
||||
)
|
||||
|
||||
func Assets() map[string][]byte {
|
||||
@ -89,7 +89,7 @@ func Assets() map[string][]byte {
|
||||
assets["syncthing/device/idqrModalView.html"], _ = base64.StdEncoding.DecodeString("H4sIAAAJbogA/zSQPXLCMBCFe59iZxug0PgCttPQ0OQOQlqbnegnSAsJo+jukQ00Gj3pvW/e7uCj1Q7Yjsj2mhCyaLnlpsIcEdjEMOI1mWgJQVgcjVjK7kh3NgQnS0F4ZqOFY9jBH0jSITstVCsoKMVuxk/taS8Xzs/c/nCoFcHptDTcgzKCcTG/7lMHMFi+tzedW5Mfcg7WQ2UPQr+ifAwxf+tWYJOmlaCEUyn+cTrWOvQtvVHYLxAWxfOI6xe+kc+EOrtovqCZlFxu/hw0O1z9OZl16P5jxY9vLPZTN/TbvqbuHwAA//8BAAD//2Nevvg4AQAA")
|
||||
assets["syncthing/device/module.js"], _ = base64.StdEncoding.DecodeString("H4sIAAAJbogA/0rMSy/NSSzSy81PKc1J1VAvrsxLLsnIzEvXS0kty0xOVddRiI7VtOYCAAAA//8BAAD//23b1z0oAAAA")
|
||||
assets["syncthing/folder/editFolderModalDirective.js"], _ = base64.StdEncoding.DecodeString("H4sIAAAJbogA/1yOMQ+CMBCFd35Ft4OElF0mFzdH3Rt6wCVHa46rxhj+uxUSor7xfe/uPReGxE7sFH1iLGF+hk5HCoPtI3sUqAqTZT0Jdkr3HEFPelrhOXrHUJs+5SOKwZSVea35jwQ1SfgyNnNWoU4PBo5Q/yDF6cZO8SKc6T6k2YY0f7VXwocddWLYnyxtsVRt8QYAAP//AQAA//+34Oi50wAAAA==")
|
||||
assets["syncthing/folder/editFolderModalView.html"], _ = base64.StdEncoding.DecodeString("H4sIAAAJbogA/9RbbW/bOPJ///8UrLD/1gYiO70rClwvMZBrWlxwzbZoelfcLvYKWqItIpKoJekkvmzus98MKcp6tOWHGnsv2ljUcDgczvxmhqTOQn5HeHjusZDr9yIOmfRIEFOlzr1EhDQmMxoyj2g65WnIHs49/6U3+T9CTMcyoR9yGos5sQ/x3FC10QUi1SzV+fs2iohRlMMRAEn0qkqhuY5ZiQBIVEZTks59FYn7c+8Zzoen83cPXOFfb2IJci4zCvPyZ3a+k7MxvssptKSpiqlmk4swJFYljsD+6R61z6AZSwMedw76DlisH/VsHL0qdDcG5XUrcirCZVmNMyETIkXMQBj46ZGUJuY3DocjC1lVaomjFPeVd9W3gYj9JPRf/qFGU6XCQf25FIvMQ6XlrY8vIqp8JqWQL96QsjAj+3B1OfqBp3c05iF5/ryLIuRSL58a44MEMZ0yMGQh3VSvLr2G4q3OydVloXbTrYUdT7OFrqgO+OF8JNitSONl0xCMi61oy+pAd4AlARdbZsBQ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X2O6GM9wbGLP5TZYVfcuJuRzNTQyvkeMU8MJJrrJNEmM1pjZI/DYW6lAi31OJiQ/JFnHsx3gzrrkqdlMlX5f6B0zDImFs2P36mYLNL5QfcBngp39rJ/zZpGIHXqTmjN13k/aOkvpL3n+liNLLwc7zZkvmw7RUtGHS7qaU/UKncU2qPvuSpxY/8x/5n/8CAAD//wEAAP//Kaui7hw6AAA=")
|
||||
assets["syncthing/folder/editFolderModalView.html"], _ = base64.StdEncoding.DecodeString("H4sIAAAJbogA/9Rb+2/cuPH//ftX8IT7JmvA0jptcEBTewE3TlCjySWI0wa9wzXgStwVYUnUkVzbW5/7t3eGFLV67mofWVx/SLyihsPhPD4zfOg84neERxcei7h+K5KISY+ECVXqwktFRBMyoxHziKZTnkXs4cLzX3iT/yPEdKwS+hGniZgT+5DMDVUXXSgyzTJdvO+iiBlFORwBkMQv6xSa64RVCIBE5TQj2dxXsbi/8L7D+fBs/uaBK/zrTSxBwWVGYV7+zM53cj7GdwWFljRTCdVschlFxKrEEdg//aMOGTRnWciT3kHfAIv1o56P45el7sagvH5FTkW0rKpxJmRKpEgYCAM/PZLR1PzG4XBkIetKrXCU4r72rv42FImfRv6LPzRo6lQ4qD+XYpF7qLSi9fF5TJXPpBTy+StSFSawD9dXwfc8u6MJj8izZ30UEZd6+dQaHyRI6JSBIwvppnp95bUUb3VOrq9KtZtuHex4li90TXXAD+cjwW9FlizbjmBCbEVbVQeGA5gEQmyZA0PNHrRhBhZkCSh2ISVEi5Uu4JFHJPt1wSWLyCLjvy5Y4cXYJadaM5ldeON//Uz9f1/6P535f/K/Br88vjj94eXT92P0OiN9x6xyJ1XMktyfJiK87dClc/lSbzgun9V9qGIUa7TffuszWi6NhiCWb2IhNegJJstnHCYE2iE6ZkXPgLxfKE2mzLQpUD4RGaFJAmLDC6CP2B0PmQraUbqb6MYhA6vkAhknn0t5wFFIWkhkaQ48cGnmDR7fFCqkWSaMWNOEZrcHlqpwsW2FcpqiRDXNPPoBsD2mkobAW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"], _ = base64.StdEncoding.DecodeString("H4sIAAAJbogA/1yOsc7CMAyE9z5FtrRSle5/p39kYIQ9atzWkusgxwEh1HcnUKkCbrzz+T7PUyYvbokhE9Q23XnQGXlyY6QAYpvKFLmAAoPitZxAQD1MHAXSMQZPtjVjLi2MbOrGPN6FlwQ0C38Ym5lUcNA/Y/9t+xUpLBfyCiehku4k3UbS/e6eEW5u1oXs/mXtq7XpqycAAAD//wEAAP//eXHskdUAAAA=")
|
||||
assets["syncthing/folder/editIgnoresModalView.html"], _ = base64.StdEncoding.DecodeString("H4sIAAAJbogA/5xVz27bPgy+9yn48+GHdGhiFOguneNL0QE9DNjQBxgYi7aFypIg0WmzIO8+2nFcB02XbofApkzx+/jxTzKl16DVMiGl+aGyLlBMoDAY4zJpnEIDJSpKgHGlraKXZTK/TvILgP7m1HGuNBpXwd4wVe91yq9wlsny8P2UR02CGUYHcalvjj1Ys+lYBbTRIFO+5w7fkZmCjVla34zxUwF4H2zl1GYK5SdR74VpAL2P7YfYV+CsWPLBaEuLLPWT20wvjIHwgFG60PQZB2cSCO5Zzq4/J3mWHjzzi0maIZ2a/hAlNmiMXIoe7YTej1YXT1C1WhGwg9h67wKTGqlmaXcjh1mGUAcql0nN7G/TVLkiLuLGFlxrWy0scdpGCjHtc+2Oam5MV/ZQES+TnyuD9mkqeNkaAxKmbaSWyNrZLMX88vZYDmUOKSgpq0T+JVJIU4llMYgcMKQ2XukucZ4VTlH+X5b2T6kg53Ku3ijwYNfCWsDBlcA1QaXXZEEEl37ujmd6QQvhCdYx0EthWkWXgywSVp0G/nQW+FE0MgSG1mTgWRtVYFAwa5CLmqKcdMICgtKBCnZhI01jNh9APg/9rTWs30Vuuq9eqL0i967xPHaansW+c01X7yt4rkVmaRkFyL3wUVqFuypgPxYnwcQyH5zK0jk+XgETFy+9NzdU8tuRuO/qbqtD4+8T226LNgTh/dUZWSwLGY96t9tu4yYyNb35SB4Dily73SLyfuJf1XhlKkRWLbN0Fm88LZO9Ma7MFVuQ39wH3aBI373HJgFbzQsjwyqjjGsaFu3sMgGFjLI5Y6PH3I+Hoc/vsExQtvFcylw8dRukT/F/u4r+y5v2FJTBYaL+nuxfpqKoROmpMZV/YMy6kb+VPzO+My6epTwpxfg6vAyP3wAAAP//AQAA//8ktcnt0QYAAA==")
|
||||
assets["syncthing/folder/module.js"], _ = base64.StdEncoding.DecodeString("H4sIAAAJbogA/0rMSy/NSSzSy81PKc1J1VAvrsxLLsnIzEvXS8vPSUktUtdRiI7VtOYCAAAA//8BAAD//4Nu4g4oAAAA")
|
||||
|
@ -74,7 +74,7 @@ type FolderConfiguration struct {
|
||||
RescanIntervalS int `xml:"rescanIntervalS,attr" json:"rescanIntervalS"`
|
||||
IgnorePerms bool `xml:"ignorePerms,attr" json:"ignorePerms"`
|
||||
AutoNormalize bool `xml:"autoNormalize,attr" json:"autoNormalize"`
|
||||
MinDiskFreePct int `xml:"minDiskFreePct" json:"minDiskFreePct"`
|
||||
MinDiskFreePct float64 `xml:"minDiskFreePct" json:"minDiskFreePct"`
|
||||
Versioning VersioningConfiguration `xml:"versioning" json:"versioning"`
|
||||
Copiers int `xml:"copiers" json:"copiers"` // This defines how many files are handled concurrently.
|
||||
Pullers int `xml:"pullers" json:"pullers"` // Defines how many blocks are fetched at the same time, possibly between separate copier routines.
|
||||
@ -238,7 +238,7 @@ type OptionsConfiguration struct {
|
||||
DatabaseBlockCacheMiB int `xml:"databaseBlockCacheMiB" json:"databaseBlockCacheMiB" default:"0"`
|
||||
PingTimeoutS int `xml:"pingTimeoutS" json:"pingTimeoutS" default:"30"`
|
||||
PingIdleTimeS int `xml:"pingIdleTimeS" json:"pingIdleTimeS" default:"60"`
|
||||
MinHomeDiskFreePct int `xml:"minHomeDiskFreePct" json:"minHomeDiskFreePct" default:"1"`
|
||||
MinHomeDiskFreePct float64 `xml:"minHomeDiskFreePct" json:"minHomeDiskFreePct" default:"1"`
|
||||
}
|
||||
|
||||
func (orig OptionsConfiguration) Copy() OptionsConfiguration {
|
||||
@ -534,6 +534,13 @@ func setDefaults(data interface{}) error {
|
||||
}
|
||||
f.SetInt(i)
|
||||
|
||||
case float64:
|
||||
i, err := strconv.ParseFloat(v, 64)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
f.SetFloat(i)
|
||||
|
||||
case bool:
|
||||
f.SetBool(v == "true")
|
||||
|
||||
|
@ -166,7 +166,7 @@ func TestOverriddenValues(t *testing.T) {
|
||||
DatabaseBlockCacheMiB: 42,
|
||||
PingTimeoutS: 60,
|
||||
PingIdleTimeS: 120,
|
||||
MinHomeDiskFreePct: 5,
|
||||
MinHomeDiskFreePct: 5.2,
|
||||
}
|
||||
|
||||
cfg, err := Load("testdata/overridenvalues.xml", device1)
|
||||
|
2
lib/config/testdata/overridenvalues.xml
vendored
2
lib/config/testdata/overridenvalues.xml
vendored
@ -26,6 +26,6 @@
|
||||
<databaseBlockCacheMiB>42</databaseBlockCacheMiB>
|
||||
<pingTimeoutS>60</pingTimeoutS>
|
||||
<pingIdleTimeS>120</pingIdleTimeS>
|
||||
<minHomeDiskFreePct>5</minHomeDiskFreePct>
|
||||
<minHomeDiskFreePct>5.2</minHomeDiskFreePct>
|
||||
</options>
|
||||
</configuration>
|
||||
|
@ -1670,7 +1670,7 @@ func (m *Model) BringToFront(folder, file string) {
|
||||
// CheckFolderHealth checks the folder for common errors and returns the
|
||||
// current folder error, or nil if the folder is healthy.
|
||||
func (m *Model) CheckFolderHealth(id string) error {
|
||||
if minFree := float64(m.cfg.Options().MinHomeDiskFreePct); minFree > 0 {
|
||||
if minFree := m.cfg.Options().MinHomeDiskFreePct; minFree > 0 {
|
||||
if free, err := osutil.DiskFreePercentage(m.cfg.ConfigPath()); err == nil && free < minFree {
|
||||
return errors.New("home disk is out of space")
|
||||
}
|
||||
@ -1691,7 +1691,7 @@ func (m *Model) CheckFolderHealth(id string) error {
|
||||
err = errors.New("folder path missing")
|
||||
} else if !folder.HasMarker() {
|
||||
err = errors.New("folder marker missing")
|
||||
} else if free, errDfp := osutil.DiskFreePercentage(folder.Path()); errDfp == nil && free < float64(folder.MinDiskFreePct) {
|
||||
} else if free, errDfp := osutil.DiskFreePercentage(folder.Path()); errDfp == nil && free < folder.MinDiskFreePct {
|
||||
err = errors.New("out of disk space")
|
||||
}
|
||||
} else if os.IsNotExist(err) {
|
||||
|
@ -508,14 +508,13 @@ func (p *rwFolder) pullerIteration(ignores *ignore.Matcher) int {
|
||||
return true
|
||||
})
|
||||
|
||||
// Check if we are able to store all files on disk
|
||||
if pullFileSize > 0 {
|
||||
folder, ok := p.model.cfg.Folders()[p.folder]
|
||||
if ok {
|
||||
if free, err := osutil.DiskFreeBytes(folder.Path()); err == nil && free < pullFileSize {
|
||||
l.Infof("Puller (folder %q): insufficient disk space available to pull %d files (%.2fMB)", p.folder, changed, float64(pullFileSize)/1024/1024)
|
||||
return 0
|
||||
}
|
||||
// Check if we are able to store all files on disk. Only perform this
|
||||
// check if there is a minimum free space threshold set on the folder.
|
||||
folderCfg := p.model.cfg.Folders()[p.folder]
|
||||
if folderCfg.MinDiskFreePct > 0 || pullFileSize > 0 {
|
||||
if free, err := osutil.DiskFreeBytes(folderCfg.Path()); err == nil && free < pullFileSize {
|
||||
l.Warnf(`Folder "%s": insufficient disk space available to pull %d files (%.2f MiB)`, p.folder, changed, float64(pullFileSize)/1024/1024)
|
||||
return 0
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user