fix(qryptinvite): validate quota and TTL env values (#93)
Some checks failed
CI / build (push) Has been cancelled
deploy / deploy (push) Has been cancelled
test / test (push) Has been cancelled

Co-authored-by: rissrice2105-agent <rissrice2105-agent@users.noreply.github.com>
This commit is contained in:
RissRIce 2026-07-16 20:01:41 -06:00 committed by GitHub
parent db641c79bb
commit 7cb2aba24e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 50 additions and 2 deletions

View file

@ -45,12 +45,12 @@ func ConfigFromEnv() Config {
c.RedeemURL = v
}
if v := os.Getenv("AGENTBBS_QRYPT_INVITE_TTL"); v != "" {
if d, err := time.ParseDuration(v); err == nil {
if d, err := time.ParseDuration(v); err == nil && d > 0 {
c.TTL = d
}
}
if v := os.Getenv("AGENTBBS_QRYPT_INVITE_QUOTA"); v != "" {
if n, err := strconv.Atoi(v); err == nil {
if n, err := strconv.Atoi(v); err == nil && n >= 0 {
c.Quota = n
}
}