admin: Add a new option -4real to avoid mass progression deletion
This commit is contained in:
parent
49664c3dfe
commit
995740e275
2 changed files with 6 additions and 0 deletions
|
@ -12,6 +12,8 @@ import (
|
|||
"github.com/julienschmidt/httprouter"
|
||||
)
|
||||
|
||||
var IsProductionEnv = false
|
||||
|
||||
func init() {
|
||||
router.GET("/api/settings-ro.json", apiHandler(getROSettings))
|
||||
router.GET("/api/settings.json", apiHandler(getSettings))
|
||||
|
|
|
@ -93,6 +93,9 @@ func main() {
|
|||
if v, exists := os.LookupEnv("FIC_BASEURL"); exists {
|
||||
baseURL = v
|
||||
}
|
||||
if v, exists := os.LookupEnv("FIC_4REAL"); exists {
|
||||
api.IsProductionEnv = v == "true" || v == "on" || v == "TRUE" || v == "ON" || v == "1"
|
||||
}
|
||||
|
||||
// Read parameters from command line
|
||||
var bind = flag.String("bind", "127.0.0.1:8081", "Bind port/socket")
|
||||
|
@ -117,6 +120,7 @@ func main() {
|
|||
flag.StringVar(&cloudPassword, "cloudpass", cloudPassword, "Password used to sync")
|
||||
flag.BoolVar(&fic.OptionalDigest, "optionaldigest", fic.OptionalDigest, "Is the digest required when importing files?")
|
||||
flag.BoolVar(&fic.StrongDigest, "strongdigest", fic.StrongDigest, "Are BLAKE2b digests required or is SHA-1 good enough?")
|
||||
flag.BoolVar(&api.IsProductionEnv, "4real", api.IsProductionEnv, "Set this flag when running for a real challenge (it disallows or avoid most of mass user progression deletion)")
|
||||
flag.Parse()
|
||||
|
||||
log.SetPrefix("[admin] ")
|
||||
|
|
Reference in a new issue