admin: New route to reset settings to sane default values
This commit is contained in:
parent
a8f25471f1
commit
1436d9ca81
4 changed files with 35 additions and 30 deletions
|
|
@ -168,26 +168,7 @@ func main() {
|
|||
|
||||
// Initialize settings and load them
|
||||
if !settings.ExistsSettings(path.Join(settings.SettingsDir, settings.SettingsFile)) {
|
||||
if err = settings.SaveSettings(path.Join(settings.SettingsDir, settings.SettingsFile), settings.FICSettings{
|
||||
Title: "Challenge FIC",
|
||||
Authors: "Laboratoire SRS, ÉPITA",
|
||||
FirstBlood: fic.FirstBlood,
|
||||
SubmissionCostBase: fic.SubmissionCostBase,
|
||||
ExerciceCurCoefficient: 1,
|
||||
HintCurCoefficient: 1,
|
||||
WChoiceCurCoefficient: 1,
|
||||
AllowRegistration: false,
|
||||
CanJoinTeam: false,
|
||||
DenyTeamCreation: false,
|
||||
DenyNameChange: false,
|
||||
AcceptNewIssue: true,
|
||||
EnableResolutionRoute: false,
|
||||
PartialValidation: true,
|
||||
UnlockedChallengeDepth: 0,
|
||||
SubmissionUniqueness: false,
|
||||
DisplayAllFlags: false,
|
||||
EventKindness: false,
|
||||
}); err != nil {
|
||||
if err = api.ResetSettings(); err != nil {
|
||||
log.Fatal("Unable to initialize settings.json:", err)
|
||||
}
|
||||
} else {
|
||||
|
|
|
|||
Reference in a new issue