Add _is_beta flag to config file

This commit is contained in:
Arturo Filastò 2018-07-30 18:51:44 +02:00
parent f343a2a1bd
commit 247d128b19
4 changed files with 37 additions and 20 deletions

View File

@ -55,6 +55,7 @@ type Config struct {
Comment string `json:"_"`
Version int64 `json:"_version"`
InformedConsent bool `json:"_informed_consent"`
IsBeta bool `json:"_is_beta"` // This is a boolean flag used to indicate this installation of OONI Probe was a beta install. These installations will have their data deleted across releases.
AutoUpdate bool `json:"auto_update"`
Sharing Sharing `json:"sharing"`

View File

@ -2,6 +2,7 @@
"_": "This is your OONI Probe config file. See https://ooni.io/help/probe-cli for help",
"_version": 0,
"_informed_consent": false,
"_is_beta": true,
"auto_update": true,
"sharing": {
"include_ip": false,

View File

@ -80,26 +80,26 @@ func (fi bindataFileInfo) Sys() interface{} {
}
var _bindataDataDefaultconfigjson = []byte(
"\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\x8c\x94\x41\x6f\x1b\x2d\x10\x86\xef\xfe\x15\x88\x73\x36\x8e\xf4\xdd\x7c" +
"\xfc\x6e\x3d\xb4\xa9\xd4\xde\xa2\x08\x61\x98\xdd\x1d\x95\x9d\xa1\x30\x6b\xd7\xaa\xf2\xdf\x2b\x88\xed\x65\x93\x34" +
"\xcd\x91\xf7\x1d\x06\xe6\x99\x81\xdf\x1b\xa5\xb4\xd1\x3b\xa5\xbf\x8f\x98\x15\x66\x75\xe2\x39\xa9\xfb\xfb\x2f\x9f" +
"\xd4\xd7\xc4\x7b\x50\x8e\xa9\xc7\x41\xf5\x18\xe0\x56\x7d\x03\x50\xa3\x48\xcc\xbb\xed\x96\x99\xf0\x16\x79\x3b\x42" +
"\x88\xdb\x58\x62\x3b\x17\x50\xf5\x9c\x54\x91\xf4\x4d\x4d\x7d\x80\x94\x91\x49\xef\xd4\xdd\xb3\x80\xd4\x73\x9a\xc0" +
"\x1b\xc7\x94\x81\x44\xef\x54\x6f\x43\x86\xea\xda\x59\xd8\xcc\xd1\x5b\x01\xbd\x53\x92\xe6\x67\x39\x8f\x36\x21\x0d" +
"\x7a\xa7\xca\x7d\x95\xd2\x48\x2e\xcc\x1e\x0c\xc6\x76\x7b\x63\xd8\x4c\x4d\x82\xc6\x18\x62\x5e\x1b\x73\x0c\x6c\xbd" +
"\x49\x90\xe7\x20\x17\x6f\xa3\xd4\x53\x3d\x99\x58\xb0\x47\x67\x05\x99\xf2\x72\x3e\x90\xdd\x07\xf0\xeb\x4c\x35\xf6" +
"\x64\x98\x8c\x40\x16\xe3\x78\x8a\x01\xe4\xb9\xf8\x37\xc3\x08\x8e\xf9\x72\xff\xeb\x89\x05\xc1\x64\x05\x7c\xcd\xb2" +
"\xaa\x7a\x39\xb5\x2d\xf9\xac\xd6\xf0\x92\xee\xa1\xca\x4a\xe9\x23\xec\x3b\xc7\x44\xe0\x04\x0f\x28\x27\x7d\x73\x71" +
"\x7a\xeb\x60\xcf\xfc\xa3\x9b\x20\x67\xa0\x01\xd2\xe2\x1d\x47\x2b\xd9\xc6\xb8\x28\x02\x01\x86\x64\xa7\x45\xf1\x36" +
"\x8f\xcb\x8a\xbc\x2c\x8b\x32\x1d\x1d\xd2\xc1\x06\xf4\x5d\x82\x9f\x33\x64\xe9\x02\x12\xbc\x08\x19\xc1\x7a\x48\x5d" +
"\x8f\x10\x7c\x37\x59\xc2\x38\x87\x4a\x59\xd7\xb0\xc7\x73\x71\x13\x93\x8c\xe1\x64\x6c\x08\x7c\xb4\xe4\xca\x58\xe8" +
"\xff\xee\xee\x3e\xff\xaf\xaf\xc4\x2a\xed\x0c\x52\x60\x35\x3d\x3a\xc2\x3e\xa3\xc0\xa2\x34\xac\x9c\x15\x18\x38\x61" +
"\x75\x1f\x1e\xab\xfd\x74\x9d\x94\x2c\x96\xc4\x14\x36\x76\x68\x1b\xf0\x0e\xec\xf7\xa1\xbe\x85\xb5\x05\x7b\x96\xd6" +
"\xf7\x88\x90\xca\x4b\x39\x17\xfd\x91\x1b\x94\x46\x5c\x52\xb5\xdd\x31\x19\xd2\x01\x52\x41\x57\xa6\x4b\xbf\xe1\x99" +
"\xc8\x49\x5e\x07\x94\x46\xff\x75\x77\x63\xae\xb7\xaf\xca\x98\xd0\xfb\x00\x7b\xfe\xf5\xc1\x22\xfe\x3d\x40\x1f\x1c" +
"\xa1\x2b\xcf\xe5\x69\xf9\x43\xa1\xe9\x5f\xff\x23\x8e\x67\x92\x74\x7a\xf1\x33\x64\x30\x9e\x27\x8b\x64\xfa\xc4\x74" +
"\x7e\x8b\xed\xd3\xcb\x40\xde\xb8\x54\x38\x24\x28\x08\xda\xff\x63\xf3\xb4\xf9\x13\x00\x00\xff\xff\xe0\xc5\x07\x53" +
"\x5e\x05\x00\x00")
"\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\x8c\x94\x41\x6f\xdb\x3c\x0c\x86\xef\xf9\x15\x82\xce\x75\x53\xe0\xbb\xe5" +
"\xf8\xdd\x76\xd8\x3a\x60\xbb\x15\x85\x20\x5b\xb4\x4d\x4c\x26\x35\x91\x4e\x16\x0c\xfd\xef\x83\xdc\x24\x56\xda\xae" +
"\xeb\xd1\xef\x4b\x53\xe2\x43\x52\xbf\x37\xc6\x58\x67\x77\xc6\x7e\x1f\x51\x0c\x8a\x39\xf2\x9c\xcd\xfd\xfd\x97\x4f" +
"\xe6\x6b\xe6\x16\x4c\xc7\xd4\xe3\x60\x7a\x8c\x70\x6b\xbe\x01\x98\x51\x35\xc9\x6e\xbb\x65\x26\xbc\x45\xde\x8e\x10" +
"\xd3\x36\x95\xd8\xa6\x8b\x68\x7a\xce\xa6\x48\xf6\x66\x49\xbd\x87\x2c\xc8\x64\x77\xe6\xee\x59\x40\xea\x39\x4f\x10" +
"\x5c\xc7\x24\x40\x6a\x77\xa6\xf7\x51\xe0\xe4\x8a\x6b\x41\xbd\xdd\x19\xcd\xf3\xb3\xe6\x67\x65\x37\xa7\xe0\x15\x6a" +
"\x59\x46\x9f\x91\x06\xbb\x33\xa5\x06\x63\x2c\x52\x17\xe7\x00\x0e\x53\x9d\xb2\x32\xbc\x50\x95\xa0\x32\x86\x24\xd7" +
"\xc6\x9c\x22\xfb\xe0\x32\xc8\x1c\xf5\xec\x6d\x8c\x79\x5a\x4e\x26\x56\xec\xb1\xf3\x8a\x4c\xb2\x9e\x0f\xe4\xdb\x08" +
"\xe1\x3a\xd3\x12\x7b\x74\x4c\x4e\x41\xd4\x75\x3c\xa5\x08\xfa\x0c\xe4\xcd\x30\x82\x83\x9c\xef\x7f\x39\xb1\x20\x98" +
"\xbc\x42\x58\xb2\x5c\x55\xbd\x9e\x5a\x97\x7c\x52\x97\xf0\x92\xee\x61\x91\x8d\xb1\x07\x68\x9b\x8e\x89\xa0\x53\xdc" +
"\xa3\x1e\xed\xcd\xd9\xe9\x7d\x07\x2d\xf3\x8f\x66\x02\x11\xa0\x01\xf2\xea\x1d\x46\xaf\xe2\x53\x5a\x15\x85\x08\x43" +
"\xf6\xd3\xaa\x04\x2f\xe3\xfa\x45\x41\xd7\x8f\x32\x31\x0d\xd2\xde\x47\x0c\x4d\x86\x9f\x33\x88\x36\x11\x09\x5e\x84" +
"\x8c\xe0\x03\xe4\xa6\x47\x88\xa1\x99\x3c\x61\x9a\xe3\x42\xd9\x2e\x61\x8f\xa7\xe2\x26\x26\x1d\xe3\xd1\xf9\x18\xf9" +
"\xe0\xa9\x2b\x63\x61\xff\xbb\xbb\xfb\xfc\xbf\xbd\x10\x5b\x68\x0b\x68\x81\x55\xf5\xe8\x00\xad\xa0\xc2\xaa\x54\xac" +
"\x3a\xaf\x30\x70\xc6\xc5\x7d\x78\x5c\xec\xa7\xcb\xa4\x88\x7a\x52\x57\xd8\xf8\xa1\x6e\xc0\x3b\xb0\xdf\x87\xfa\x16" +
"\xd6\x1a\xec\x49\xba\xbe\x47\x82\x5c\xb6\xe7\x54\xf4\x47\x6e\x50\x1a\x71\x4e\x55\x77\xc7\x09\xe4\x3d\xe4\x82\xae" +
"\x4c\x97\x7d\xc3\x73\x89\xb3\xbe\x0e\x28\x8d\xfe\xeb\xdf\x95\x79\xfd\xfb\x55\x19\x13\x86\x10\xa1\xe5\x5f\x1f\x2c" +
"\xe2\xdf\x03\xf4\xc1\x11\xba\xf0\x5c\x57\x2b\xec\x0b\xcd\xf0\xfa\x1d\xe9\x78\x26\xcd\xc7\x17\x2f\x83\x80\x0b\x3c" +
"\x79\x24\xd7\x67\xa6\xd3\x2e\xd6\xab\x27\x40\xc1\x75\xb9\x70\xc8\x50\x10\xd4\xef\xc7\xe6\x69\xf3\x27\x00\x00\xff" +
"\xff\x42\x02\xc0\xed\x72\x05\x00\x00")
func bindataDataDefaultconfigjsonBytes() ([]byte, error) {
return bindataRead(

View File

@ -2,6 +2,7 @@ package onboard
import (
"github.com/alecthomas/kingpin"
"github.com/apex/log"
"github.com/ooni/probe-cli/internal/cli/root"
"github.com/ooni/probe-cli/internal/onboard"
)
@ -9,12 +10,26 @@ import (
func init() {
cmd := root.Command("onboard", "Starts the onboarding process")
yes := cmd.Flag("yes", "Answer yes to all the onboarding questions.").Bool()
cmd.Action(func(_ *kingpin.ParseContext) error {
ctx, err := root.Init()
if err != nil {
return err
}
if *yes == true {
ctx.Config.Lock()
ctx.Config.InformedConsent = true
ctx.Config.Unlock()
if err := ctx.Config.Write(); err != nil {
log.WithError(err).Error("failed to write config file")
return err
}
return nil
}
return onboard.Onboarding(ctx.Config)
})
}