repochecker: Enforce archive types
This commit is contained in:
parent
038abe450d
commit
724b00b825
@ -127,6 +127,11 @@ func SyncExerciceFiles(i Importer, exercice fic.Exercice) (errs []string) {
|
||||
|
||||
// Import standard files
|
||||
for _, fname := range files {
|
||||
// Enforce file format
|
||||
if path.Ext(fname) == "rar" || path.Ext(fname) == "7z" {
|
||||
errs = append(errs, fmt.Sprintf("%q: WARNING %q use a forbidden archive type.", path.Base(exercice.Path), fname))
|
||||
}
|
||||
|
||||
if f, err := i.importFile(path.Join(exercice.Path, "files", fname),
|
||||
func(filePath string, origin string) (interface{}, error) {
|
||||
return exercice.ImportFile(filePath, origin, digests[fname])
|
||||
|
@ -1,3 +1,4 @@
|
||||
//go:build checkupdate
|
||||
// +build checkupdate
|
||||
|
||||
package main
|
||||
@ -9,7 +10,7 @@ import (
|
||||
"net/http"
|
||||
)
|
||||
|
||||
const version = 10
|
||||
const version = 11
|
||||
|
||||
func init() {
|
||||
go checkUpdate()
|
||||
|
Loading…
Reference in New Issue
Block a user