Disable uploading of torrents by default
Cette révision appartient à :
Parent
36db332b16
révision
d1bb68f8f2
2 fichiers modifiés avec 7 ajouts et 0 suppressions
|
@ -3,4 +3,6 @@ package config
|
|||
const (
|
||||
// TorrentFileStorage = "/var/tmp/torrent_outgoing"
|
||||
TorrentFileStorage = ""
|
||||
//disable uploads by default
|
||||
UploadsDisabled = 1
|
||||
)
|
||||
|
|
|
@ -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" {
|
||||
|
|
Référencer dans un nouveau ticket