Added random-token-length, Encode() refactored

This commit is contained in:
Andrea Spacca
2021-05-20 08:26:07 +02:00
parent b5ffdb5095
commit fdfd453222
6 changed files with 58 additions and 13 deletions

View File

@ -274,6 +274,12 @@ var globalFlags = []cli.Flag{
Value: "",
EnvVar: "CORS_DOMAINS",
},
cli.Int64Flag{
Name: "random-token-length",
Usage: "",
Value: 6,
EnvVar: "RANDOM_TOKEN_LENGTH",
},
}
type Cmd struct {
@ -377,6 +383,9 @@ func New() *Cmd {
options = append(options, server.RateLimit(v))
}
v := c.Int64("random-token-length")
options = append(options, server.RandomTokenLength(v))
purgeDays := c.Int("purge-days")
purgeInterval := c.Int("purge-interval")
if purgeDays > 0 && purgeInterval > 0 {