Skip to content

Commit

Permalink
feat: make user session timeout configurable by flags (#2845)
Browse files Browse the repository at this point in the history
  • Loading branch information
fritx committed Dec 6, 2023
1 parent fc2ee37 commit 391a078
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions cmd/root.go
Expand Up @@ -64,6 +64,7 @@ func addServerFlags(flags *pflag.FlagSet) {
flags.Uint32("socket-perm", 0666, "unix socket file permissions") //nolint:gomnd
flags.StringP("baseurl", "b", "", "base url")
flags.String("cache-dir", "", "file cache directory (disabled if empty)")
flags.String("token-expiration-time", "2h", "user session timeout")
flags.Int("img-processors", 4, "image processors count") //nolint:gomnd
flags.Bool("disable-thumbnails", false, "disable image thumbnails")
flags.Bool("disable-preview-resize", false, "disable resize of image previews")
Expand Down Expand Up @@ -261,6 +262,10 @@ func getRunParams(flags *pflag.FlagSet, st *storage.Storage) *settings.Server {
_, disableExec := getParamB(flags, "disable-exec")
server.EnableExec = !disableExec

if val, set := getParamB(flags, "token-expiration-time"); set {
server.TokenExpirationTime = val
}

return server
}

Expand Down

0 comments on commit 391a078

Please sign in to comment.