Add support for crash reporting via sentry and change the send_crash_reports key
This commit is contained in:
@@ -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
@@ -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
|
||||
|
||||
Vendored
+3
-3
@@ -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
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user