Compare commits
2 Commits
082ab9a7ea
...
d23311f5b0
Author | SHA1 | Date |
---|---|---|
aardouin | d23311f5b0 | |
aardouin | fad9b38b7e |
|
@ -83,7 +83,7 @@ func (s *Server) submitHandler(w http.ResponseWriter, r *http.Request) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
if !verified && !s.config.DisableValidation {
|
if !verified {
|
||||||
slog.Debug("Invalid solution")
|
slog.Debug("Invalid solution")
|
||||||
http.Error(w, "Invalid solution", http.StatusBadRequest)
|
http.Error(w, "Invalid solution", http.StatusBadRequest)
|
||||||
return
|
return
|
||||||
|
|
|
@ -1,14 +1,13 @@
|
||||||
package config
|
package config
|
||||||
|
|
||||||
type Config struct {
|
type Config struct {
|
||||||
BaseUrl string `env:"ALTCHA_BASE_URL" envDefault:""`
|
BaseUrl string `env:"ALTCHA_BASE_URL" envDefault:""`
|
||||||
Port string `env:"ALTCHA_PORT" envDefault:"3333"`
|
Port string `env:"ALTCHA_PORT" envDefault:"3333"`
|
||||||
HmacKey string `env:"ALTCHA_HMAC_KEY"`
|
HmacKey string `env:"ALTCHA_HMAC_KEY"`
|
||||||
MaxNumber int64 `env:"ALTCHA_MAX_NUMBER" envDefault:"1000000"`
|
MaxNumber int64 `env:"ALTCHA_MAX_NUMBER" envDefault:"1000000"`
|
||||||
Algorithm string `env:"ALTCHA_ALGORITHM" envDefault:"SHA-256"`
|
Algorithm string `env:"ALTCHA_ALGORITHM" envDefault:"SHA-256"`
|
||||||
Salt string `env:"ALTCHA_SALT"`
|
Salt string `env:"ALTCHA_SALT"`
|
||||||
Expire string `env:"ALTCHA_EXPIRE" envDefault:"600"`
|
Expire string `env:"ALTCHA_EXPIRE" envDefault:"600"`
|
||||||
CheckExpire bool `env:"ALTCHA_CHECK_EXPIRE" envDefault:"1"`
|
CheckExpire bool `env:"ALTCHA_CHECK_EXPIRE" envDefault:"1"`
|
||||||
Debug bool `env:"ALTCHA_DEBUG" envDefault:"false"`
|
Debug bool `env:"ALTCHA_DEBUG" envDefault:"false"`
|
||||||
DisableValidation bool `env:"ATLCHA_DISABLE_VALIDATION" envDefault:"false"`
|
|
||||||
}
|
}
|
Loading…
Reference in New Issue