frontend: new option to deny team name change

This commit is contained in:
nemunaire 2016-01-24 14:31:21 +01:00
parent 136b436af5
commit 3f10eeef64
2 changed files with 17 additions and 3 deletions

View file

@ -31,6 +31,7 @@ func main() {
var prefix = flag.String("prefix", "", "Request path prefix to strip (from proxy)")
var start = flag.Int64("start", 0, fmt.Sprintf("Challenge start timestamp (in 2 minutes: %d)", time.Now().Unix()/60*60+120))
var duration = flag.Duration("duration", 180*time.Minute, "Challenge duration")
var denyChName = flag.Bool("denyChName", false, "Deny team to change their name")
flag.StringVar(&TeamsDir, "teams", "../TEAMS", "Base directory where save teams JSON files")
flag.StringVar(&SubmissionDir, "submission", "./submissions/", "Base directory where save submissions")
flag.Parse()
@ -65,7 +66,7 @@ func main() {
log.Println("Registering handlers...")
http.Handle(fmt.Sprintf("%s/time.json", *prefix), http.StripPrefix(*prefix, TimeHandler{startTime, *duration}))
http.Handle(fmt.Sprintf("%s/", *prefix), http.StripPrefix(*prefix, SubmissionHandler{end}))
http.Handle(fmt.Sprintf("%s/", *prefix), http.StripPrefix(*prefix, SubmissionHandler{end, *denyChName}))
log.Println(fmt.Sprintf("Ready, listening on %s", *bind))
if err := http.ListenAndServe(*bind, nil); err != nil {