enforce 16 characters for companion.secret_key
All checks were successful
CI / build (push) Successful in 59s

ref: 23ff6135bb
This commit is contained in:
Fijxu 2025-03-27 22:11:51 -03:00
parent e13b2e02a7
commit 356e523bc8
Signed by: Fijxu
GPG key ID: 32C1DDF333EDA6A4

View file

@ -92,4 +92,11 @@ func LoadConfig() {
Secret_key: getEnvString("SECRET_KEY", "", false),
},
}
checkConfig()
}
func checkConfig() {
if len(Cfg.Companion.Secret_key) > 16 {
log.Fatalln("The value of 'companion.secret_key' (YTPROXY_SECRET_KEY) needs to be a size of 16 characters.")
}
}