Albirew/nyaa-pantsu
Albirew
/
nyaa-pantsu
Archivé
1
0
Bifurcation 0

Forgot to move Token config

Tokens config are now in config/tokens.go
Cette révision appartient à :
akuma06 2017-05-29 17:39:13 +02:00
Parent 3ec367a759
révision bd59f3afd1
3 fichiers modifiés avec 10 ajouts et 6 suppressions

Voir le fichier

@ -22,7 +22,4 @@ const (
EmailPort = 465
// EmailTimeout : Timeout for waiting server response
EmailTimeout = 10 * time.Second
)
// EmailTokenHashKey : /!\ Email hash for generating email activation token /!\
var EmailTokenHashKey = []byte("CHANGE_THIS_BEFORE_DEPLOYING_YOU_GIT")
)

7
config/tokens.go Fichier normal
Voir le fichier

@ -0,0 +1,7 @@
package config
// EmailTokenHashKey : /!\ Email hash for generating email activation token /!\
var EmailTokenHashKey = []byte("CHANGE_THIS_BEFORE_DEPLOYING_YOU_GIT")
// CSRFTokenHashKey : /!\ CSRF hash for generating CSRF tokens /!\
var CSRFTokenHashKey = []byte("CHANGE_THIS_BEFORE_DEPLOYING_YOU_GIT")

Voir le fichier

@ -33,9 +33,9 @@ func RunServer(conf *config.Config) {
// Please make EnableSecureCSRF to false when testing locally
if config.EnableSecureCSRF {
http.Handle("/", csrf.Protect([]byte("q8satbudwexfzh2j3m5n6p8r9satcvsd"))(router.Router))
http.Handle("/", csrf.Protect(config.CSRFTokenHashKey)(router.Router))
} else {
http.Handle("/", csrf.Protect([]byte("q8satbudwexfzh2j3m5n6p8r9satcvsd"), csrf.Secure(false))(router.Router))
http.Handle("/", csrf.Protect(config.CSRFTokenHashKey, csrf.Secure(false))(router.Router))
}
// Set up server,
srv := &http.Server{