admin: Read challenge.json from imported directory
This commit is contained in:
parent
560110ba5e
commit
8ed9415c68
3 changed files with 21 additions and 13 deletions
|
@ -57,7 +57,14 @@ func getROSettings(c *gin.Context) {
|
|||
}
|
||||
|
||||
func getChallengeInfo(c *gin.Context) {
|
||||
s, err := settings.ReadChallengeInfo(path.Join(settings.SettingsDir, settings.ChallengeFile))
|
||||
challengeinfo, err := sync.GetFileContent(sync.GlobalImporter, "challenge.json")
|
||||
if err != nil {
|
||||
log.Println("Unable to retrieve challenge.json:", err.Error())
|
||||
c.AbortWithStatusJSON(http.StatusInternalServerError, gin.H{"errmsg": fmt.Sprintf("Unable to retrive challenge.json: %s", err.Error())})
|
||||
return
|
||||
}
|
||||
|
||||
s, err := settings.ReadChallengeInfo(challengeinfo)
|
||||
if err != nil {
|
||||
log.Println("Unable to ReadChallengeInfo:", err.Error())
|
||||
c.AbortWithStatusJSON(http.StatusInternalServerError, gin.H{"errmsg": fmt.Sprintf("Unable to read challenge info: %s", err.Error())})
|
||||
|
|
Reference in a new issue