Albirew/nyaa-pantsu
Archivé
1
0
Bifurcation 0

Disable uploading of torrents by default

Cette révision appartient à :
Eliot Whalan 2017-05-08 08:16:20 +10:00
Parent 36db332b16
révision d1bb68f8f2
2 fichiers modifiés avec 7 ajouts et 0 suppressions

Voir le fichier

@ -3,4 +3,6 @@ package config
const (
// TorrentFileStorage = "/var/tmp/torrent_outgoing"
TorrentFileStorage = ""
//disable uploads by default
UploadsDisabled = 1
)

Voir le fichier

@ -7,6 +7,7 @@ import (
"strconv"
"time"
"github.com/ewhal/nyaa/config"
"github.com/ewhal/nyaa/db"
"github.com/ewhal/nyaa/model"
"github.com/ewhal/nyaa/service/captcha"
@ -14,6 +15,10 @@ import (
)
func UploadHandler(w http.ResponseWriter, r *http.Request) {
if config.UploadsDisabled == 1 {
http.Error(w, "Error uploads are disabled", http.StatusInternalServerError)
return
}
var err error
var uploadForm UploadForm
if r.Method == "POST" {