Expect full downloadable file pathname (allow CDN)
This commit is contained in:
parent
da84a90b4f
commit
ee67788d59
@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
BASEURL="http://localhost:8081"
|
BASEURL="http://localhost:8081"
|
||||||
BASEURI="https://srs.epita.fr/owncloud/remote.php/webdav/FIC 2016"
|
BASEURI="https://srs.epita.fr/owncloud/remote.php/webdav/FIC 2016"
|
||||||
|
BASEFILE="/files"
|
||||||
CLOUDPASS=fic:'f>t\nV33R|(+?$i*'
|
CLOUDPASS=fic:'f>t\nV33R|(+?$i*'
|
||||||
|
|
||||||
new_theme() {
|
new_theme() {
|
||||||
@ -29,7 +30,7 @@ new_file() {
|
|||||||
EXERCICE="$2"
|
EXERCICE="$2"
|
||||||
URI="$3"
|
URI="$3"
|
||||||
|
|
||||||
curl -f -s -d "{\"URI\": \"$URI\"}" "${BASEURL}/api/themes/$THEME/$EXERCICE/files" |
|
curl -f -s -d "{\"URI\": \"${BASEFILE}${URI}\"}" "${BASEURL}/api/themes/$THEME/$EXERCICE/files" |
|
||||||
grep -Eo '"id":[0-9]+,' | grep -Eo "[0-9]+"
|
grep -Eo '"id":[0-9]+,' | grep -Eo "[0-9]+"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -17,7 +17,6 @@ import (
|
|||||||
|
|
||||||
var TeamsDir string
|
var TeamsDir string
|
||||||
var SubmissionDir string
|
var SubmissionDir string
|
||||||
var BaseURL string
|
|
||||||
|
|
||||||
func watchsubdir(watcher *inotify.Watcher, pathname string) error {
|
func watchsubdir(watcher *inotify.Watcher, pathname string) error {
|
||||||
log.Println("Watch new directory:", pathname)
|
log.Println("Watch new directory:", pathname)
|
||||||
@ -44,7 +43,6 @@ func watchsubdir(watcher *inotify.Watcher, pathname string) error {
|
|||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
var dsn = flag.String("dsn", "fic:fic@/fic", "DSN to connect to the MySQL server")
|
var dsn = flag.String("dsn", "fic:fic@/fic", "DSN to connect to the MySQL server")
|
||||||
flag.StringVar(&BaseURL, "baseurl", "http://fic.srs.epita.fr/", "URL prepended to each URL")
|
|
||||||
flag.StringVar(&SubmissionDir, "submission", "./submissions", "Base directory where save submissions")
|
flag.StringVar(&SubmissionDir, "submission", "./submissions", "Base directory where save submissions")
|
||||||
flag.StringVar(&TeamsDir, "teams", "../TEAMS", "Base directory where save teams JSON files")
|
flag.StringVar(&TeamsDir, "teams", "../TEAMS", "Base directory where save teams JSON files")
|
||||||
flag.Parse()
|
flag.Parse()
|
||||||
|
@ -3,7 +3,6 @@ package fic
|
|||||||
import (
|
import (
|
||||||
"encoding/hex"
|
"encoding/hex"
|
||||||
"fmt"
|
"fmt"
|
||||||
"path"
|
|
||||||
"time"
|
"time"
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -87,7 +86,7 @@ func MyJSONTeam(t *Team, started bool) (interface{}, error) {
|
|||||||
return nil, err
|
return nil, err
|
||||||
} else {
|
} else {
|
||||||
for _, f := range files {
|
for _, f := range files {
|
||||||
exercice.Files = append(exercice.Files, myTeamFile{path.Join("/files", f.Path), f.Name, hex.EncodeToString(f.Checksum), f.Size})
|
exercice.Files = append(exercice.Files, myTeamFile{f.Path, f.Name, hex.EncodeToString(f.Checksum), f.Size})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user