Add support for crash reporting via sentry and change the send_crash_reports key

This commit is contained in:
Arturo Filastò
2018-06-29 15:29:05 +02:00
parent b8dff783e1
commit d88764aa34
7 changed files with 72 additions and 19 deletions
+6
View File
@@ -5,6 +5,8 @@ import (
"io/ioutil"
"sync"
"github.com/apex/log"
"github.com/ooni/probe-cli/internal/crashreport"
"github.com/ooni/probe-cli/utils"
"github.com/pkg/errors"
)
@@ -39,6 +41,10 @@ func ParseConfig(b []byte) (*Config, error) {
if err := c.Validate(); err != nil {
return nil, errors.Wrap(err, "validating")
}
if c.Advanced.SendCrashReports == false {
log.Info("Disabling crash reporting.")
crashreport.Disabled = true
}
return &c, nil
}
+5 -5
View File
@@ -110,17 +110,17 @@ type Notifications struct {
// Sharing settings
type Sharing struct {
IncludeIP bool `json:"include_ip"`
IncludeASN bool `json:"include_asn"`
IncludeGPS bool `json:"include_gps"`
UploadResults bool `json:"upload_results"`
SendCrashReports bool `json:"send_crash_reports"`
IncludeIP bool `json:"include_ip"`
IncludeASN bool `json:"include_asn"`
IncludeGPS bool `json:"include_gps"`
UploadResults bool `json:"upload_results"`
}
// Advanced settings
type Advanced struct {
IncludeCountry bool `json:"include_country"`
UseDomainFronting bool `json:"use_domain_fronting"`
SendCrashReports bool `json:"send_crash_reports"`
}
// AutomatedTesting settings
+3 -3
View File
@@ -7,8 +7,7 @@
"include_ip": false,
"include_asn": true,
"include_gps": true,
"upload_results": true,
"send_crash_reports": true
"upload_results": true
},
"notifications": {
"enabled": true,
@@ -58,6 +57,7 @@
},
"advanced": {
"include_country": true,
"use_domain_fronting": false
"use_domain_fronting": false,
"send_crash_reports": true
}
}