69dc9a4731
Added new email html template. It is sent when user tries to reset password with unknown or unverified account. Made a couple of minor config changes. Issue: https://github.com/storj/storj/issues/4913 Change-Id: I730f48b3478e302d1e38e1f8a27c75f66a8ba6fd
46 lines
989 B
Go
46 lines
989 B
Go
// Copyright (C) 2022 Storj Labs, Inc.
|
|
// See LICENSE for copying information.
|
|
|
|
package console
|
|
|
|
import (
|
|
"encoding/json"
|
|
)
|
|
|
|
// Satellites is a configuration value that contains a list of satellite names and addresses.
|
|
// Format should be [{"name": "","address": ""],{"name": "","address": ""},...] in valid JSON format.
|
|
//
|
|
// Can be used as a flag.
|
|
type Satellites []satellite
|
|
|
|
type satellite struct {
|
|
Name string `json:"name"`
|
|
Address string `json:"address"`
|
|
}
|
|
|
|
// Type implements pflag.Value.
|
|
func (Satellites) Type() string { return "console.Satellites" }
|
|
|
|
// String is required for pflag.Value.
|
|
func (sl *Satellites) String() string {
|
|
satellites, err := json.Marshal(*sl)
|
|
if err != nil {
|
|
return ""
|
|
}
|
|
|
|
return string(satellites)
|
|
}
|
|
|
|
// Set does validation on the configured JSON.
|
|
func (sl *Satellites) Set(s string) (err error) {
|
|
satellites := make([]satellite, 3)
|
|
|
|
err = json.Unmarshal([]byte(s), &satellites)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
*sl = satellites
|
|
return
|
|
}
|