fix: add tokenExpirationTime to `config init` and troubleshoot docs (#5546)

Co-authored-by: Henrique Dias <mail@hacdias.com>
master
Brian Fromm 2025-11-17 00:57:02 -07:00 committed by GitHub
parent 0a0cb8046f
commit 8c5dc7641e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 17 additions and 1 deletions

View File

@ -222,6 +222,7 @@ func printSettings(ser *settings.Server, set *settings.Settings, auther auth.Aut
fmt.Fprintf(w, "\tAddress:\t%s\n", ser.Address)
fmt.Fprintf(w, "\tTLS Cert:\t%s\n", ser.TLSCert)
fmt.Fprintf(w, "\tTLS Key:\t%s\n", ser.TLSKey)
fmt.Fprintf(w, "\tToken Expiration Time:\t%s\n", ser.TokenExpirationTime)
fmt.Fprintf(w, "\tExec Enabled:\t%t\n", ser.EnableExec)
fmt.Fprintf(w, "\tThumbnails Enabled:\t%t\n", ser.EnableThumbnails)
fmt.Fprintf(w, "\tResize Preview:\t%t\n", ser.ResizePreview)

View File

@ -155,6 +155,11 @@ override the options.`,
return err
}
ser.TokenExpirationTime, err = flags.GetString("tokenExpirationTime")
if err != nil {
return err
}
err = d.store.Settings.Save(s)
if err != nil {
return err

View File

@ -5,4 +5,4 @@
"log": "stdout",
"database": "/database/filebrowser.db",
"root": "/srv"
}
}

View File

@ -0,0 +1,9 @@
# Troubleshooting
## Session Timeout
By default, user sessions expire after **2 hours**. If you're uploading large files over slower connections, you may need to increase this timeout to prevent sessions from expiring mid-upload. You can configure the session timeout using the `tokenExpirationTime` setting.
You can either set this option during runtime by using the flag `--tokenExpirationTime`, the environment variable `FB_TOKEN_EXPIRATION_TIME`, or in your configuration file. If you want to persist this to the configuration, please use [`filebrowser config set`](cli/filebrowser-config-set.md).
Valid duration formats include `"2h"`, `"30m"`, `"24h"`, or combinations like `"2h30m"`.

View File

@ -100,6 +100,7 @@ nav:
- customization.md
- authentication.md
- command-execution.md
- Troubleshooting: troubleshooting.md
- Deployment: deployment.md
- Command Line Usage:
- cli/filebrowser.md