From 8c5dc7641e6f8aadd9e5d5d3b25a2ad9f1ec9a1e Mon Sep 17 00:00:00 2001 From: Brian Fromm <69060375+brianfromm@users.noreply.github.com> Date: Mon, 17 Nov 2025 00:57:02 -0700 Subject: [PATCH] fix: add tokenExpirationTime to `config init` and troubleshoot docs (#5546) Co-authored-by: Henrique Dias --- cmd/config.go | 1 + cmd/config_init.go | 5 +++++ docker/common/defaults/settings.json | 2 +- www/docs/troubleshooting.md | 9 +++++++++ www/mkdocs.yml | 1 + 5 files changed, 17 insertions(+), 1 deletion(-) create mode 100644 www/docs/troubleshooting.md diff --git a/cmd/config.go b/cmd/config.go index 73d4faa9..8dc8baa7 100644 --- a/cmd/config.go +++ b/cmd/config.go @@ -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) diff --git a/cmd/config_init.go b/cmd/config_init.go index 21cacb33..4c9aab63 100644 --- a/cmd/config_init.go +++ b/cmd/config_init.go @@ -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 diff --git a/docker/common/defaults/settings.json b/docker/common/defaults/settings.json index e787ef87..cf7fb4ee 100644 --- a/docker/common/defaults/settings.json +++ b/docker/common/defaults/settings.json @@ -5,4 +5,4 @@ "log": "stdout", "database": "/database/filebrowser.db", "root": "/srv" -} \ No newline at end of file +} diff --git a/www/docs/troubleshooting.md b/www/docs/troubleshooting.md new file mode 100644 index 00000000..a994957e --- /dev/null +++ b/www/docs/troubleshooting.md @@ -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"`. diff --git a/www/mkdocs.yml b/www/mkdocs.yml index 7558c534..c71c6798 100644 --- a/www/mkdocs.yml +++ b/www/mkdocs.yml @@ -100,6 +100,7 @@ nav: - customization.md - authentication.md - command-execution.md + - Troubleshooting: troubleshooting.md - Deployment: deployment.md - Command Line Usage: - cli/filebrowser.md